mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Revise processing of -j flag
- Accept only integer numbers for -j flag - Allow for -j as standalone flag
This commit is contained in:
parent
399e6db9ee
commit
3dc8098074
1 changed files with 13 additions and 1 deletions
|
|
@ -374,7 +374,19 @@ while [ $# -ge 1 ]; do
|
|||
case ${1} in
|
||||
-j)
|
||||
shift
|
||||
export NPROCS_OVERWRITE="${1}"
|
||||
case "${1}" in
|
||||
-*)
|
||||
export NPROCS_OVERWRITE="$(get_nprocs)"
|
||||
;;
|
||||
[0-9]*)
|
||||
export NPROCS_OVERWRITE="${1}"
|
||||
;;
|
||||
*)
|
||||
report_error ${LINENO} \
|
||||
"The -j flag can only be followed by an integer number, found ${1}."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-j[0-9]*)
|
||||
export NPROCS_OVERWRITE="${1#-j}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue