Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#play a usage message.
usage () {
cat <<EOF
Usage: image-mpi [ options ] <program> [ <args> ]
Open MPI mpirun wrapper for Singularity images. Use "man mpirun" for further help.
EOF
}
if [ -z "$IMAGE_PATH_LOCAL" ]; then
echo -e "An error occured, exiting..."
exit 1
fi
if [ -z "$1" ]; then
usage
exit 1
fi
PARAM=""
EXEC=""
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-gmca|--gmca|-mca|--mca)
PARAM="$PARAM $1 $2 $3"
shift # past argument
shift
;;
-N|--npernode|-max-vm-size|--max-vm-size|-H|-host|--host|-hostfile|--hostfile|-default-hostfile|--default-hostfile|-machinefile|--machinefile|-cpu-set|--cpu-set|-c|-n|--n|-np|-map-by|-npersocket|--npersocket|-npernode|--npernode|--map-by|--rank-by|--bind-to|-cpus-per-proc|--cpus-per-proc|-cpus-per-rank|--cpus-per-rank|-rf|--rankfile|-output-filename|--output-filename|-stdin|--stdin|-xml-file|--xml-file|-xterm|--xterm|-path|--path|--prefix|--preload-files|-wd|-wdir|-x|-am|-debugger|--debugger|--app|-cf|--cartofile|-max-restarts|--max-restarts|-ompi-server|--ompi-server|-personality|--personality|--ppr|-report-events|--report-events|-report-pid|--report-pid|-report-uri|--report-uri|--timeout)
PARAM="$PARAM $1 $2"
shift # past argument
;;
-h|--help|-q|--quiet|-v|--verbose|-V|--version|-display-map|--display-map|-display-allocation|--display-allocation|-output-proctable|--output-proctable|-dvm|--dvm|-novm|--novm|-pernode|--pernode|-bycore|--bycore|-byslot|--byslot|-nolocal|--nolocal|-nooversubscribe|--nooversubscribe|-oversubscribe|--oversubscribe|-bynode|--bynode|-bind-to-core|--bind-to-core|-bind-to-socket|--bind-to-socket|-report-bindings|--report-bindings|-tag-output|--tag-output|-timestamp-output|--timestamp-output|-xml|--xml|--noprefix|-s|--preload-binary|-set-cwd-to-session-dir|--set-cwd-to-session-dir|-debug|--debug|--get-stack-traces|-tv|--tv|--allow-run-as-root|-disable-recovery|--disable-recovery|-do-not-launch|--do-not-launch|-do-not-resolve|--do-not-resolve|-enable-recovery|--enable-recovery|-index-argv-by-rank|--index-argv-by-rank|-leave-session-attached|--leave-session-attached|-report-child-jobs-separately|--report-child-jobs-separately|-show-progress|--show-progress|-use-hwthread-cpus|--use-hwthread-cpus|-use-regexp|--use-regexp|-d|--debug-devel|--debug-daemons|--debug-daemons-file|-display-devel-allocation|--display-devel-allocation|-display-devel-map|--display-devel-map|-display-diffable-map|--display-diffable-map|-display-topo|--display-topo|-launch-agent|--launch-agent|--report-state-on-timeout)
PARAM="$PARAM $1"
;;
*)
EXEC="$@"
break
;;
esac
shift # past argument or value
done
PARAM=$(echo "$PARAM" | sed -e 's/ */ /g' -e 's/^ *\(.*\) *$/\1/')