-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix spaces handling in array job arguments (#45)
* Use shell arrays for command arguments in submission script * Add integration test for arguments containing spaces Signed-off-by: yichen88 <[email protected]>
- Loading branch information
Showing
9 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
computation-slurm/src/test/resources/expectedShell/argsWithSpaces.batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
case $SLURM_ARRAY_TASK_ID in | ||
0) | ||
ARGS=("line 1,line 2" "v2") | ||
;; | ||
1) | ||
ARGS=("line 1,line 2" "v2") | ||
;; | ||
2) | ||
ARGS=("line 1,line 2" "v2") | ||
;; | ||
esac | ||
touch "${ARGS[@]}" | ||
rc=$?; if [[ $rc != 0 ]]; then touch /tmp/flags/myerror_workingPath_12345_$SLURM_ARRAY_JOB_ID-$SLURM_ARRAY_TASK_ID; exit $rc; fi |
10 changes: 5 additions & 5 deletions
10
computation-slurm/src/test/resources/expectedShell/group3.batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#!/bin/sh | ||
case $SLURM_ARRAY_TASK_ID in | ||
0) | ||
ARGS_0=""5s"" ARGS_1=""sub2"" | ||
ARGS_0=("5s") ARGS_1=("sub2") | ||
;; | ||
1) | ||
ARGS_0=""5s"" ARGS_1=""sub2"" | ||
ARGS_0=("5s") ARGS_1=("sub2") | ||
;; | ||
2) | ||
ARGS_0=""5s"" ARGS_1=""sub2"" | ||
ARGS_0=("5s") ARGS_1=("sub2") | ||
;; | ||
esac | ||
sleep $ARGS_0 | ||
sleep "${ARGS_0[@]}" | ||
rc=$?; if [[ $rc != 0 ]]; then touch /tmp/flags/myerror_workingPath_12345_$SLURM_ARRAY_JOB_ID-$SLURM_ARRAY_TASK_ID; exit $rc; fi | ||
echo $ARGS_1 | ||
echo "${ARGS_1[@]}" | ||
rc=$?; if [[ $rc != 0 ]]; then touch /tmp/flags/myerror_workingPath_12345_$SLURM_ARRAY_JOB_ID-$SLURM_ARRAY_TASK_ID; exit $rc; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
computation-slurm/src/test/resources/expectedShell/simpleCmdWithCount3.batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/bin/sh | ||
case $SLURM_ARRAY_TASK_ID in | ||
0) | ||
ARGS=""te1st0"" | ||
ARGS=("te1st0") | ||
;; | ||
1) | ||
ARGS=""te1st1"" | ||
ARGS=("te1st1") | ||
;; | ||
2) | ||
ARGS=""te1st2"" | ||
ARGS=("te1st2") | ||
;; | ||
esac | ||
echo $ARGS | ||
echo "${ARGS[@]}" | ||
rc=$?; if [[ $rc != 0 ]]; then touch /tmp/flags/myerror_workingPath_12345_$SLURM_ARRAY_JOB_ID-$SLURM_ARRAY_TASK_ID; exit $rc; fi |