cluster-tools 3.5.3__tar.gz → 3.5.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/PKG-INFO +1 -1
  2. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/schedulers/slurm.py +28 -1
  3. cluster_tools-3.5.4/cluster_tools/version.py +1 -0
  4. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools.egg-info/PKG-INFO +1 -1
  5. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/pyproject.toml +1 -1
  6. cluster_tools-3.5.3/cluster_tools/version.py +0 -1
  7. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/LICENSE +0 -0
  8. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/README.md +0 -0
  9. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/__init__.py +0 -0
  10. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/call.py +0 -0
  11. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/file_wait_thread.py +0 -0
  12. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/multiprocessing_logging_handler.py +0 -0
  13. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/pickling.py +0 -0
  14. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/reflection.py +0 -0
  15. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/string_.py +0 -0
  16. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/tailf.py +0 -0
  17. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/_utils/warning.py +0 -0
  18. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executor_protocol.py +0 -0
  19. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/batching.py +0 -0
  20. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/dask.py +0 -0
  21. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/multiprocessing_.py +0 -0
  22. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/multiprocessing_pickle.py +0 -0
  23. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/sequential.py +0 -0
  24. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/executors/sequential_pickle.py +0 -0
  25. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/remote.py +0 -0
  26. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/schedulers/__init__.py +0 -0
  27. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/schedulers/cluster_executor.py +0 -0
  28. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/schedulers/kube.py +0 -0
  29. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools/schedulers/pbs.py +0 -0
  30. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools.egg-info/SOURCES.txt +0 -0
  31. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools.egg-info/dependency_links.txt +0 -0
  32. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools.egg-info/requires.txt +0 -0
  33. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/cluster_tools.egg-info/top_level.txt +0 -0
  34. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/setup.cfg +0 -0
  35. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_all.py +0 -0
  36. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_batching.py +0 -0
  37. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_dask.py +0 -0
  38. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_deref_main.py +0 -0
  39. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_kubernetes.py +0 -0
  40. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_multiprocessing.py +0 -0
  41. {cluster_tools-3.5.3 → cluster_tools-3.5.4}/tests/test_slurm.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cluster_tools
3
- Version: 3.5.3
3
+ Version: 3.5.4
4
4
  Summary: Utility library for easily distributing code execution on clusters
5
5
  Author-email: scalable minds <hello@scalableminds.com>
6
6
  License-Expression: MIT
@@ -54,6 +54,27 @@ SLURM_STATES = {
54
54
  "Unclear": ["SUSPENDED", "REVOKED", "SIGNALING", "SPECIAL_EXIT", "STAGE_OUT"],
55
55
  }
56
56
 
57
+ # Since Slurm 22.05, some resource flags are not automatically inherited from the
58
+ # enclosing sbatch job by srun calls within the script anymore and must be restated
59
+ # explicitly, or srun computes its own (potentially conflicting) resource request
60
+ # leading to failures like:
61
+ # "srun: fatal: cpus-per-task set by two different environment variables ..."
62
+ # Other job_resources (e.g. --mem, --gres) should be inherited by srun automatically.
63
+ # Therefore, we currently explicitely restate potentially non-inherited resource for the srun call.
64
+ # This is most relevant for cpus-per-task, but we have added some others to be on the safe side.
65
+ # It is worth noting that this change was quite disruptive, particularly for MPI implementations.
66
+ # Because of this, in Slurm 23.11, this requirement was largely walked back.
67
+ # SRUN_CPUS_PER_TASK war reverted back to SLURM_CPUS_PER_TASK and an --external-launcher option was introduced to srun
68
+ # to prevent task launchers from being bound to a single CPU.
69
+ SLURM_SRUN_NON_INHERITED_RESOURCE_KEYS = {
70
+ "cpus-per-task",
71
+ "ntasks",
72
+ "gpus",
73
+ "gpus-per-node",
74
+ "gpus-per-socket",
75
+ "gpus-per-task",
76
+ }
77
+
57
78
  SLURM_QUEUE_CHECK_INTERVAL = 1 if "pytest" in sys.modules else 60
58
79
 
59
80
  T = TypeVar("T")
@@ -303,9 +324,15 @@ class SlurmExecutor(ClusterExecutor):
303
324
  log_path = self.format_log_file_path(self.cfut_dir, job_id_string)
304
325
 
305
326
  job_resources_lines = []
327
+ srun_resource_args = []
306
328
  if self.job_resources is not None:
307
329
  for resource, value in self.job_resources.items():
308
330
  job_resources_lines += [f"#SBATCH --{resource}={value}"]
331
+ if resource in SLURM_SRUN_NON_INHERITED_RESOURCE_KEYS:
332
+ srun_resource_args += [f"--{resource}={value}"]
333
+ srun_resource_args_str = (
334
+ " " + " ".join(srun_resource_args) if srun_resource_args else ""
335
+ )
309
336
 
310
337
  max_array_size = self.get_max_array_size()
311
338
  max_submit_jobs = self.get_max_submit_jobs()
@@ -340,7 +367,7 @@ class SlurmExecutor(ClusterExecutor):
340
367
  + job_resources_lines
341
368
  + [
342
369
  *additional_setup_lines,
343
- f"srun {cmdline} {job_index_start}",
370
+ f"srun{srun_resource_args_str} {cmdline} {job_index_start}",
344
371
  ]
345
372
  )
346
373
 
@@ -0,0 +1 @@
1
+ __version__ = '3.5.4'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cluster_tools
3
- Version: 3.5.3
3
+ Version: 3.5.4
4
4
  Summary: Utility library for easily distributing code execution on clusters
5
5
  Author-email: scalable minds <hello@scalableminds.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cluster_tools"
3
- version = "3.5.3" # filled by dunamai
3
+ version = "3.5.4" # filled by dunamai
4
4
  description = "Utility library for easily distributing code execution on clusters"
5
5
  authors = [{name= "scalable minds", email="hello@scalableminds.com"}]
6
6
  readme = "README.md"
@@ -1 +0,0 @@
1
- __version__ = '3.5.3'
File without changes
File without changes
File without changes