Skip to content

Commit a16b126

Browse files
authored
Merge branch 'main' into run_time_max
2 parents 7e5958f + 1d13f5c commit a16b126

4 files changed

Lines changed: 36 additions & 5 deletions

File tree

src/executorlib/executor/flux.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class FluxJobExecutor(BaseExecutor):
5555
allowed to take in seconds.
5656
* priority (int): the queuing system priority assigned to a given Python function to
5757
influence the scheduling.
58-
*`slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
58+
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
5959
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
6060
flux_executor (flux.job.FluxExecutor): Flux Python interface to submit the workers to flux
6161
flux_executor_nesting (bool): Provide hierarchically nested Flux job scheduler inside the submitted function.
@@ -287,7 +287,7 @@ class FluxClusterExecutor(BaseExecutor):
287287
allowed to take in seconds.
288288
* priority (int): the queuing system priority assigned to a given Python function to
289289
influence the scheduling.
290-
*`slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
290+
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
291291
pysqa_config_directory (str, optional): path to the pysqa config directory (only for pysqa based backend).
292292
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
293293
hostname_localhost (boolean): use localhost instead of the hostname to establish the zmq connection. In the
@@ -544,7 +544,7 @@ def create_flux_executor(
544544
allowed to take in seconds.
545545
* priority (int): the queuing system priority assigned to a given Python function to
546546
influence the scheduling.
547-
*`slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
547+
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
548548
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
549549
flux_executor (flux.job.FluxExecutor): Flux Python interface to submit the workers to flux
550550
flux_executor_nesting (bool): Provide hierarchically nested Flux job scheduler inside the submitted function.

src/executorlib/executor/slurm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class SlurmClusterExecutor(BaseExecutor):
5656
allowed to take in seconds.
5757
* priority (int): the queuing system priority assigned to a given Python function to
5858
influence the scheduling.
59-
*`slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
59+
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
6060
pysqa_config_directory (str, optional): path to the pysqa config directory (only for pysqa based backend).
6161
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
6262
hostname_localhost (boolean): use localhost instead of the hostname to establish the zmq connection. In the
@@ -297,7 +297,7 @@ class SlurmJobExecutor(BaseExecutor):
297297
allowed to take in seconds.
298298
* priority (int): the queuing system priority assigned to a given Python function to
299299
influence the scheduling.
300-
*`slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
300+
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
301301
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
302302
hostname_localhost (boolean): use localhost instead of the hostname to establish the zmq connection. In the
303303
context of an HPC cluster this essential to be able to communicate to an

src/executorlib/task_scheduler/interactive/spawner_pysqa.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ def create_pysqa_block_allocation_scheduler(
238238
cores_per_worker = executor_kwargs.get("cores", 1)
239239
if "cwd" in executor_kwargs and executor_kwargs["cwd"] is not None:
240240
executor_kwargs["cwd"] = os.path.abspath(executor_kwargs["cwd"])
241+
elif cache_directory is not None:
242+
executor_kwargs["cwd"] = os.path.abspath(cache_directory)
241243
if cache_directory is not None:
242244
executor_kwargs["cache_directory"] = os.path.abspath(cache_directory)
243245
else:

tests/unit/executor/test_flux_cluster.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ def test_executor(self):
7171
self.assertEqual(len(os.listdir("executorlib_cache")), 4)
7272
self.assertTrue(fs1.done())
7373

74+
def test_executor_no_cwd(self):
75+
with FluxClusterExecutor(
76+
resource_dict={"cores": 2},
77+
block_allocation=False,
78+
cache_directory="executorlib_cache",
79+
pmi_mode=pmi,
80+
) as exe:
81+
cloudpickle_register(ind=1)
82+
fs1 = exe.submit(mpi_funct, 1)
83+
self.assertFalse(fs1.done())
84+
self.assertEqual(fs1.result(), [(1, 2, 0), (1, 2, 1)])
85+
self.assertEqual(len(os.listdir("executorlib_cache")), 4)
86+
self.assertTrue(fs1.done())
87+
7488
def test_executor_blockallocation(self):
7589
with FluxClusterExecutor(
7690
resource_dict={"cores": 2, "cwd": "executorlib_cache"},
@@ -86,6 +100,21 @@ def test_executor_blockallocation(self):
86100
self.assertEqual(len(os.listdir("executorlib_cache")), 2)
87101
self.assertTrue(fs1.done())
88102

103+
def test_executor_blockallocation_no_cwd(self):
104+
with FluxClusterExecutor(
105+
resource_dict={"cores": 2},
106+
block_allocation=True,
107+
cache_directory="executorlib_cache",
108+
pmi_mode=pmi,
109+
max_workers=1,
110+
) as exe:
111+
cloudpickle_register(ind=1)
112+
fs1 = exe.submit(mpi_funct, 1)
113+
self.assertFalse(fs1.done())
114+
self.assertEqual(fs1.result(), [(1, 2, 0), (1, 2, 1)])
115+
self.assertEqual(len(os.listdir("executorlib_cache")), 2)
116+
self.assertTrue(fs1.done())
117+
89118
def test_executor_dependencies(self):
90119
with FluxClusterExecutor(
91120
resource_dict={"cores": 1, "cwd": "executorlib_cache"},

0 commit comments

Comments
 (0)