You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser.addoption('--slurm-options', dest='slurm_options', type=str, help='list of SLURM options e.g. "--time=00:30:00 --qos=my_queue"')
28
31
parser.addoption('--slurm-srun-options', dest='slurm_srun_options', type=str, help='list of SLURM srun options e.g. "--mem-per-cpu=4GB"')
29
-
parser.addoption('--slurm-additional-cmds', dest='slurm_additional_cmds', type=str, help='list of commands to pass to SLURM job e.g. "source my_env.sh"')
32
+
parser.addoption('--slurm-init-cmds', dest='slurm_init_cmds', type=str, help='list of commands to pass to SLURM job e.g. "source my_env.sh"')
30
33
parser.addoption('--slurm-file', dest='slurm_file', type=str, help='Path to file containing header of SLURM job') # TODO DEL
31
-
parser.addoption('--slurm-sub-command', dest='slurm_sub_command', type=str, help='SLURM submission command (defaults to `sbatch`)') # TODO DEL
f'You may want to use --n-workers={MPI.COMM_WORLD.size}.'
124
+
ifMPI.COMM_WORLD.size!=1:
125
+
err_msg='Do not launch `pytest_parallel` on more that one process when `--scheduler=shell` or `--scheduler=slurm`.\n' \
126
+
'`pytest_parallel` will spawn MPI processes itself.\n' \
127
+
f'You may want to use --n-workers={MPI.COMM_WORLD.size}.'
128
+
raisePytestParallelError(err_msg)
120
129
121
130
122
131
123
132
ifscheduler=='slurm'andnotis_worker:
124
-
assertslurm_optionsorslurm_file, 'You need to specify either `--slurm-options` or `--slurm-file` when `--scheduler=slurm`'
133
+
ifslurm_optionsisNoneandslurm_fileisNone:
134
+
raisePytestParallelError('You need to specify either `--slurm-options` or `--slurm-file` when `--scheduler=slurm`')
125
135
ifslurm_options:
126
-
assertnotslurm_file, 'You need to specify either `--slurm-options` or `--slurm-file`, but not both'
136
+
ifslurm_file:
137
+
raisePytestParallelError('You need to specify either `--slurm-options` or `--slurm-file`, but not both')
127
138
ifslurm_file:
128
-
assertnotslurm_options, 'You need to specify either `--slurm-options` or `--slurm-file`, but not both'
129
-
assertnotslurm_additional_cmds, 'You cannot specify `--slurm-additional-cmds` together with `--slurm-file`'
139
+
ifslurm_options:
140
+
raisePytestParallelError('You need to specify either `--slurm-options` or `--slurm-file`, but not both')
141
+
ifslurm_init_cmds:
142
+
raisePytestParallelError('You cannot specify `--slurm-init-cmds` together with `--slurm-file`')
130
143
131
-
assert'-n='notinslurm_optionsand'--ntasks='notinslurm_options, 'Do not specify `-n/--ntasks` in `--slurm-options` (it is deduced from the `--n-worker` value).'
0 commit comments