-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run_OQStandard.sh: Restore "oq engine --run" for Hazard calculation #56
Conversation
@@ -147,61 +155,62 @@ echo "All initialization files exist - You're ready to go." | |||
#exit 0 | |||
#fi | |||
|
|||
oq dbserver start || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting dbserver manually here (instead of waiting till the first run of oq engine run
to start dbserver) is a workaround to prevent tee
in the first call of oq engine --run ... 2>&1 | tee ...
from getting stuck.
I changed &> logfile
to 2>&1 | tee logfile
in various places throughout the script because I wanted to not only save the logs but also see OpenQuake output at the same time. Sorry, I neglected to document that in the commit log. 😅
|
||
if [[ $HAZFLAG == "1" ]]; then | ||
echo "------------------------------------------------" | ||
echo "RUNNING HAZARD CALCULATION" | ||
echo "------------------------------------------------" | ||
#oq engine --run ${JOBDIR}/s_Hazard_${NAME}.ini &> ./${OUTDIR}/s_Hazard_${NAME}.log; | ||
oq engine --run "${JOBDIR}/s_Hazard_${NAME}.ini" 2>&1 | tee "./${OUTDIR}/s_Hazard_${NAME}.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original intent of this commit/PR was to uncomment this line so that oq engine
is run for Hazard calculation so that the script would work for Jeremy and me.
My other changes to this file are mostly to make ShellCheck (the linter) happy, and probably should be in a separate commit, but I got lazy and didn't do that... sorry!
@@ -2,9 +2,13 @@ | |||
# ========================================================================== | |||
# Script for running scenario calculations in the National Canada Risk Model | |||
# ========================================================================== | |||
|
|||
set -exo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall correctly, the motivation of setting set -o pipefail
etc. is another consequence of me changing &>
to 2>&1 | tee
, as the subsequent pipe in | tee
always succeed and wouldn't stop the script even if oq engine
failed unless set -o pipefail
etc. is set.
(renamed from generate_assets.yml) Hope it does not run out of disk space again for our 22 scenarios!
Also fix many shellcheck warnings
c87ef14
to
9a60025
Compare
Also fix ShellCheck warnings.