+while true; do
+ case "$1" in
+ "-np" | "-n")
+ NUMPROCS="$2"
+ shift 2
+ ;;
+ "-bandwidth")
+ NETWORK_BANDWIDTH="$2"
+ shift 2
+ ;;
+ "-latency")
+ NETWORK_LATENCY="$2"
+ shift 2
+ ;;
+ "-platform")
+ PLATFORM="$2"
+ if [ ! -f "${PLATFORM}" ]; then
+ die "the file '${PLATFORM}' does not exist"
+ fi
+ shift 2
+ ;;
+ "-hostfile")
+ HOSTFILE="$2"
+ if [ ! -f "${HOSTFILE}" ]; then
+ die "the file '${HOSTFILE}' does not exist"
+ fi
+ shift 2
+ ;;
+ "-machinefile")
+ HOSTFILE="$2"
+ if [ ! -f "${HOSTFILE}" ]; then
+ die "the file '${HOSTFILE}' does not exist"
+ fi
+ shift 2
+ ;;
+ "-ext")
+ EXTOPT="$2"
+ shift 2
+ ;;
+ "-no-privatize")
+ PRIVATIZE=""
+ shift 1
+ ;;
+ "-map")
+ MAPOPT=1
+ shift 1
+ ;;
+ "-trace")
+ TRACE_ACTIVE="true"
+ shift 1
+ ;;
+ "-trace-ti")
+ TRACE_ACTIVE="true"
+ TRACE_TI_ACTIVE="true"
+ shift 1
+ ;;
+ "-trace-comment")
+ TRACE_COMMENT="$2"
+ shift 2
+ ;;
+ "-trace-comment-file")
+ TRACE_COMMENT_FILE="$2"
+ shift 2
+ ;;
+ "-trace-file")
+ TRACE_FILENAME="$2"
+ shift 2
+ ;;
+ "-trace-grouped")
+ TRACE_GROUPED="true"
+ shift 1
+ ;;
+ "-trace-resource")
+ TRACE_RESOURCE="true"
+ shift 1
+ ;;
+ "-trace-viva")
+ TRACE_VIVA="true"
+ shift 1
+ ;;
+ "-keep-temps")
+ KEEP="true"
+ SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+ shift 1
+ ;;
+ "-wrapper")
+ WRAPPER="$2"
+ shift 2
+ ;;
+ "-help" | "--help" | "-h")
+ usage
+ exit 0
+ ;;
+ "-version" | "--version" | "-v")
+ printf '%b\n' "$SIMGRID_VERSION"
+ exit 0
+ ;;
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
+ "--cfg="*|"--log="*)
+ for OPT in ${1#*=}
+ do
+ SIMOPTS="$SIMOPTS ${1%%=*}=$OPT"
+ done
+ shift 1
+ ;;
+ "-foreground")
+ # Nothing to do, compatibility.
+ shift 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+# check if we still have at least one parameter beyond options
+if [ $# -eq 0 ]
+then
+ echo "Error: no program to execute!"
+ usage
+ exit