Skip to content

Commit

Permalink
Concatenate error outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hollas committed Dec 11, 2023
1 parent 99a22ef commit b187f88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion interfaces/BAGEL-SH/bagel_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function bagel_error {
local bagel_output="$2"
local copy="$3"
if [[ -f "$bagel_output" && -n "$copy" ]]; then
cp "$bagel_output" "$copy"
# NOTE: There might be multiple errors per timestep so concatenate
cat "$bagel_output" >> "$copy"
fi
>&2 echo -e "${errmsg}"
>&2 echo "Inspect file $(dirname "$0")/$copy"
Expand Down
4 changes: 2 additions & 2 deletions interfaces/BAGEL-SH/r.bagel-sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function converge_casscf {
if grep -q "$casscf_error" "$output"; then
error=true
local savefile=$output.casscf_error.$timestep
cp "$output" "$savefile"
cat "$output" >> "$savefile"
>&2 echo "ERROR: CASSCF did not converge, see file $savefile"
# Return if we reached the maximum threshold value,
# further increase would lead to inaccurate results.
Expand Down Expand Up @@ -127,7 +127,7 @@ if grep -q "$smith_error" "$input.out"; then
maxiter_CASPT2=1000
>&2 echo "ERROR: CASPT2 did not converge, trying again with thresh=$thresh_CASPT2 and maxiter=$maxiter_CASPT2."
>&2 echo "See file $savefile"
cp "$input.out" "$savefile"
cat "$input.out" >> "$savefile"
generate_input "$input.json" "$method"
exec_bagel "$input".json "$input".out "$timestep"
returncode=$?
Expand Down

0 comments on commit b187f88

Please sign in to comment.