Lines Matching +full:- +full:- +full:exit +full:- +full:code

3 # Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
4 # All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
6 # SPDX-License-Identifier: BSD-2-Clause
11 if [[ "${#BASH_ARGV[@]}" -ne "$#" ]]; then
16 exit_cmd=exit
22 num_proc_run=${num_proc_run:-""}
23 num_proc_node=${num_proc_node:-""}
30 mpiexec_np="-np"
44 if [[ -t 1 ]]; then
61 -h|--help print this usage information and exit
62 -b|--bp \"list\" choose the benchmark problems to run
63 -c|--ceed \"list\" choose the libCEED backends to benchmark
64 -r|--run <name> run the tests in the script <name>
65 -n|--num-proc \"list\" total number of MPI tasks to use in the tests
66 -p|--proc-node \"list\" number of MPI tasks per node to use in the tests
67 -d|--dry-run show (but do not run) the commands for the tests
68 -s|--shell execute bash shell commands before running the test
69 -v|--verbose print additional messages
70 -x enable script tracing with 'set -x'
77 $this_file --run petsc-bpsraw.sh
78 $this_file --run petsc-bps.sh
86 if [ ! -e $build_root/$example ]; then
95 mpi_run="${mpiexec:-mpirun} ${mpiexec_opts}"
96 mpi_run+=" ${mpiexec_np:--np} ${num_proc_run} ${mpiexec_post_opts}"
97 if [[ -n "$profiler" ]]; then
106 if [[ -z "${arg##* *}" ]]; then
117 if [[ -n "$num_proc_node" ]]; then
128 echo "Running the tests using a total of $num_proc_run MPI tasks ..." | tee -a $output_file
129 echo "... with $num_proc_node tasks per node ..." | tee -a $output_file
130 echo | tee -a $output_file
135 while [ $# -gt 0 ]; do
138 -h|--help)
143 -b|--bp)
145 [ $# -gt 0 ] || {
146 echo "Missing \"list\" in --bp \"list\""; $exit_cmd 1; }
149 -c|--ceed)
151 [ $# -gt 0 ] || {
152 echo "Missing \"list\" in --ceed \"list\""; $exit_cmd 1; }
155 -r|--run)
158 [ $# -gt 0 ] || { echo "Missing <name> in --run <name>"; $exit_cmd 1; }
160 [[ -r "$test_file" ]] || {
164 -n|--num-proc)
166 [ $# -gt 0 ] || {
167 echo "Missing \"list\" in --num-proc \"list\""; $exit_cmd 1; }
170 -p|--proc-node)
172 [ $# -gt 0 ] || {
173 echo "Missing \"list\" in --proc-node \"list\""; $exit_cmd 1; }
176 -d|--dry-run)
179 -s|--shell)
182 -v|--verbose)
185 -x)
186 set -x
201 num_proc_list=(${num_proc_run:-4})
203 num_proc_node_list=(${num_proc_node:-4})
207 The size of the number-of-processors list (option --num-proc) must be the same
208 as the size of the number-of-processors-per-node list (option --proc-node)."
231 output_file="${test_file%%.*}-$bp-$short_backend-output.txt"
232 rm -rf output_file
241 [ -n "$run" ] && {
244 echo "Test problem file, $test_basename:" | tee -a $output_file
245 echo "------------------------------------------------" | tee -a $output_file
246 cat $test_file | tee -a $output_file
247 echo "------------------------------------------------" | tee -a $output_file
248 echo | tee -a $output_file
256 echo "Reading test file: $test_file" | tee -a $output_file
257 echo | tee -a $output_file
262 echo "Example(s) required by the test: $test_required_examples" | tee -a $output_file
264 echo | tee -a $output_file
266 ## Loop over the number-of-processors list.
277 if [[ ! -t 1 ]]; then
278 echo "Standard output is not a terminal. Stop." | tee -a $output_file
281 echo "Reading shell commands, type 'c' to continue, 'exit' to stop ..." | tee -a $output_file
282 echo | tee -a $output_file
284 set -o emacs
286 [[ -r $HOME/.bashrc ]] && source $HOME/.bashrc
288 history -c
289 history -r
290 # bind '"\\C-i": menu-complete'
294 read -p "$prompt" -e line; do
295 history -s "$line"
296 history -w
297 shopt -q -s expand_aliases
299 shopt -q -u expand_aliases
301 [[ "${#line}" -eq 0 ]] && { echo; $exit_cmd 0; }
302 shopt -q -u expand_aliases
303 echo "Continuing ..." | tee -a $output_file
308 if [ -z "$dry_run" ]; then
317 trap - INT
324 echo "Sub-shell for backend '$backend' returned error code $?. Stop."