Skip to content

Commit

Permalink
snb-run; only save over files if job submit command successful (to …
Browse files Browse the repository at this point in the history
…avoid excessive duplication of files if e.g. user repeatedly runs over all defects but with queue limits/low budgets)
  • Loading branch information
kavanase committed Jan 30, 2024
1 parent 349d3c9 commit 6e85876
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shakenbreak/scripts/SnB_run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ SnB_run_loop() {
fi

echo "${i%?} not (fully) relaxed, saving files and rerunning"
bash "${DIR}"/save_vasp_files.sh

if [[ -f "CONTCAR" ]] && [[ $(wc -l < "CONTCAR") -ge 9 ]]; then # CONTCAR exists and greater than 9 lines
"cp" CONTCAR POSCAR
Expand All @@ -205,7 +204,10 @@ SnB_run_loop() {
echo "Running job for ${i%?}"
folder_shortname="${i#*_*_}"
# Remove % from folder_shortname as messes with some HPC schedulers
${job_submit_command} "${job_name_option}" "${defect_name%?}"_"${folder_shortname%?}" "${job_filename}" 2>/dev/null || ${job_submit_command} "${job_name_option}" "${defect_name%?}"_"${folder_shortname%??}" "${job_filename}"
if "${job_submit_command}" "${job_name_option}" "${defect_name%?}"_"${folder_shortname%?}" "${job_filename}" 2>/dev/null || \
"${job_submit_command}" "${job_name_option}" "${defect_name%?}"_"${folder_shortname%??}" "${job_filename}"; then
bash "${DIR}"/save_vasp_files.sh # only save over files if job submit command is successful (to prevent unwanted duplication of files)
fi
fi
builtin cd .. || return
else
Expand Down

0 comments on commit 6e85876

Please sign in to comment.