7272CWL_VERSIONS=(" v1.0" )
7373
7474# How many tests we will run in parallel
75- # N_TESTS_IN_PARALLEL=16
76- N_TESTS_IN_PARALLEL=4
75+ # You may find that 1 is too slow, and 16 is fast. But this number is applied
76+ # to all tests; login, Slurm, batch. If you use 16 on Slurm or batch, you will
77+ # very likely be penalised by the Slurm algorithm. 4 or 8 may work better.
78+ N_TESTS_IN_PARALLEL=8
7779
7880# CWL repo URLs
7981declare -A CWL_REPO
@@ -101,11 +103,6 @@ declare -A TOOL_BIN
101103TOOL_BIN[cwltool]=" cwltool"
102104TOOL_BIN[toil]=" toil-cwl-runner"
103105
104- # Extra args passed to the binaries
105- declare -A TOOL_ARGS
106- TOOL_ARGS[cwltool]=" --singularity --enable-dev --tmpdir-prefix=$HPC_SCRATCH_DIR "
107- TOOL_ARGS[toil]=" --singularity --disableCaching --disableProgress --defaultMemory=2G --maxMemory=2G --cwl-min-ram=2G --enable-dev --clean=always"
108-
109106# Base working directory
110107BASE_DIR=$( pwd) /runs
111108mkdir -p " $BASE_DIR "
@@ -140,7 +137,7 @@ setup_python_env() {
140137 " $ENV_DIR /bin/pip" install cwltool==3.2.20260413085819
141138 ;;
142139 toil)
143- " $ENV_DIR /bin/pip" install toil[cwl]==9.5.0
140+ " $ENV_DIR /bin/pip" install toil[cwl]==9.4.1
144141 ;;
145142 esac
146143}
@@ -224,30 +221,46 @@ run_tests() {
224221 # shellcheck disable=SC1090
225222 source " $BASE_DIR /venv-$TOOL /bin/activate"
226223
224+ # ------------ DIRS
225+
226+ RUN_ROOT_DIR=" $HPC_SCRATCH_DIR /$( uuidgen) "
227+ mkdir -p " $RUN_ROOT_DIR "
228+
229+ # Directories used by Toil
230+ declare -A RUN_DIRS=(
231+ [outdir]=" $RUN_ROOT_DIR /outdir"
232+ [logdir]=" $RUN_ROOT_DIR /logdir"
233+ [tmpdir]=" $RUN_ROOT_DIR /tmpdir"
234+ [tmpoutdir]=" $RUN_ROOT_DIR /tmpoutdir"
235+ [workdir]=" $RUN_ROOT_DIR /workdir"
236+ [coordination]=" $RUN_ROOT_DIR /coordination"
237+ )
238+
239+ # Extra args passed to the binaries
240+ declare -A TOOL_ARGS
241+ TOOL_ARGS[cwltool]=" --singularity --enable-dev --tmpdir-prefix=${RUN_DIRS[tmpdir]} "
242+
243+ # JOB_STORE="${RUN_ROOT_DIR}/$(uuidgen)"
244+
245+ TOOL_ARGS[toil]=" --singularity \
246+ --disableCaching \
247+ --disableProgress \
248+ --defaultMemory=2G \
249+ --maxMemory=2G \
250+ --cwl-min-ram=2G \
251+ --enable-dev \
252+ --clean=always \
253+ --outdir=${RUN_DIRS[outdir]} \
254+ --log-dir=${RUN_DIRS[logdir]} \
255+ --tmpdir-prefix=${RUN_DIRS[tmpdir]} \
256+ --tmp-outdir-prefix=${RUN_DIRS[tmpoutdir]} \
257+ --workDir=${RUN_DIRS[workdir]} \
258+ --coordinationDir=${RUN_DIRS[coordination]} "
259+ # --jobStore=${JOB_STORE}"
260+
227261 RUNNER=" ${TOOL_BIN[$TOOL]} "
228262 EXTRA=" ${TOOL_ARGS[$TOOL]} "
229263
230- RUN_ROOT_DIR=" "
231- JOB_STORE=" "
232-
233- if [ " $TOOL " = " toil" ]; then
234- # One dedicated root directory for this complete tool/version/mode run.
235- RUN_ROOT_DIR=" ${HPC_SCRATCH_DIR} /$( uuidgen) "
236- mkdir -p " $RUN_ROOT_DIR "
237-
238- # Toil job stores cannot be reused, so create a fresh one for each run.
239- JOB_STORE=" ${RUN_ROOT_DIR} /$( uuidgen) "
240-
241- # Keep all Toil working directories under the same dedicated root.
242- EXTRA=" ${EXTRA} --outdir=${RUN_ROOT_DIR} "
243- EXTRA=" ${EXTRA} --log-dir=${RUN_ROOT_DIR} "
244- EXTRA=" ${EXTRA} --tmpdir-prefix=${RUN_ROOT_DIR} "
245- EXTRA=" ${EXTRA} --tmp-outdir-prefix=${RUN_ROOT_DIR} "
246- EXTRA=" ${EXTRA} --workDir=${RUN_ROOT_DIR} "
247- EXTRA=" ${EXTRA} --coordinationDir=${RUN_ROOT_DIR} "
248- EXTRA=" ${EXTRA} --jobStore=${JOB_STORE} "
249- fi
250-
251264 # For toil + batch mode, we want to use the --batchSystem=slurm option.
252265 # And the --bypass-file-store is used to assume the data is available
253266 # everywhere (e.g., GPFS, Lustre).
@@ -270,39 +283,30 @@ run_tests() {
270283 TEST_FILE=" conformance_test_v1.0.yaml"
271284 fi
272285
273- # cwltest parallelism.
274- # Toil needs one test at a time because each cwltest invocation uses
275- # the same Toil job store .
276- TESTS_IN_PARALLEL= " $N_TESTS_IN_PARALLEL "
277- if [ " $TOOL " = " toil " ] && [ " $MODE " = " batch " ] ; then
278- TESTS_IN_PARALLEL=1
286+ CWLTEST_OUTDIR= " $RUN_ROOT_DIR / $( uuidgen ) "
287+
288+ # Pre-create all directories (cwltest only uses tmpdir, and it handles directory creation) .
289+ if [ " $TOOL " = " toil " ] ; then
290+ mkdir -p " ${RUN_DIRS[@]} "
291+ mkdir -p " $CWLTEST_OUTDIR "
279292 fi
280293
281- # Build base args
294+ # Build base args passed to cwltest.
282295 ARGS=(
283296 " --verbose"
284297 " --test=${TEST_FILE} "
298+ " --outdir=${CWLTEST_OUTDIR} "
285299 " --junit-verbose"
286300 " --junit-xml=${TOOL_DIR} /junit.xml"
287- " --timeout=600"
288- " -j${TESTS_IN_PARALLEL} "
301+ " -j${N_TESTS_IN_PARALLEL} "
289302 " --tool=$RUNNER "
290- " --"
303+ " --timeout=3600 "
291304 )
292-
293- if [ " $TOOL " = " toil" ]; then
294- ARGS=(
295- " --verbose"
296- " --test=${TEST_FILE} "
297- " --outdir=${RUN_ROOT_DIR} "
298- " --junit-verbose"
299- " --junit-xml=${TOOL_DIR} /junit.xml"
300- " --timeout=600"
301- " -j${TESTS_IN_PARALLEL} "
302- " --tool=$RUNNER "
303- " --"
304- )
305- fi
305+ # NOTE: On LUMI, the queues for the project I was using were a bit bad,
306+ # even though it was Sunday, and not many jobs were running
307+ # (fair-share?). Be careful with the timeout or you will have
308+ # several Timed-out errors.
309+ # "--timeout=600"
306310
307311 # split EXTRA into words safely
308312 read -r -a EXTRA_ARR <<< " $EXTRA"
@@ -321,16 +325,17 @@ run_tests() {
321325 echo " VERSION=$VERSION "
322326 echo " MODE=$MODE "
323327 echo " RUNNER=${TOOL_BIN[$TOOL]} "
324- echo " RUN_ROOT_DIR=${RUN_ROOT_DIR} "
325- echo " JOB_STORE=${JOB_STORE} "
328+ echo " HPC_SCRATCH_DIR=$HPC_SCRATCH_DIR "
329+ echo " RUN_ROOT_DIR=$RUN_ROOT_DIR "
330+ echo " CWLTEST_OUTDIR=$CWLTEST_OUTDIR "
326331 echo " EXTRA=${EXTRA} "
327332 echo " ================="
328333 echo " "
329334
330335 " $RUNNER " --version || true
331336 echo " "
332337 set -exv
333- " $TEST_SCRIPT " " ${ARGS[@]} " " ${EXTRA_ARR[@]} "
338+ " $TEST_SCRIPT " " ${ARGS[@]} " -- " ${EXTRA_ARR[@]} "
334339 set +exv
335340 }
336341
0 commit comments