#!/bin/sh cp -r "$AMSHOME/examples/infretis/water_dimer/ams_inp" . cp "$AMSHOME/examples/infretis/water_dimer/infretis.toml" . export NSCM=1 # MPI ranks per infretis worker export OMP_NUM_THREADS=1 # OpenMP threads per MPI rank # The following retry loop is only needed for regression testing purposes, # ordinary simulations need just the few lines between "BEGIN infretis run" and # "END infretis run" i=0 retry_limit=4 while true; do # BEGIN infretis run cp -r "$AMSHOME/examples/infretis/water_dimer/load" . $AMSBIN/uv_scm run infretis exec infretisrun -i infretis.toml # -nskip 10 is only needed to make wham work for this extremely short run $AMSBIN/uv_scm run infretis exec inft wham -nskip 10 # END infretis run # What follows is purely regression testing logic if awk 'BEGIN { max_Pcross = 0.25; } END { exit(!($2 != 0 && $2 <= max_Pcross && $3 != 0 && $3 <= max_Pcross && $4 != 0 && $4 <= max_Pcross)); }' wham/Pcross.txt; then # All Pcross are nonzero => WHAM successfull # We also check that Pcross aren't too large, which does happen randomly # and would just trigger a spurious diff, so we just retry in that case # to see if the diff goes away. break fi if [[ ! -s wham/Pcross.txt ]]; then # Something went badly wrong, bail out exit 1 elif ((i++ < retry_limit)); then echo "WHAM failed, retrying..." rm -rf load/ wham/ worker*/ amsworker_*/ restart.toml infretis_data.txt *.log else echo "Giving up after $i attempts" exit 2 fi done echo "Success, had to retry $i times" echo "BEGIN pathlengths.txt" # skip [0-] as that is the least well-defined one grep -v '^-1' wham/pathlengths.txt echo "END pathlengths.txt" for f in wham/{ploc_unscaled,Pcross}.txt; do echo "BEGIN ${f#*/}" cat "$f" echo "END ${f#*/}" done echo "BEGIN overall Pcross" tail -n 1 wham/Pcross.txt echo "END overall Pcross"