From 2cb73863c9699ee36e6d69f6dcdb9198117ef110 Mon Sep 17 00:00:00 2001 From: mkavulich Date: Fri, 16 Dec 2016 07:56:00 -0700 Subject: [PATCH] Adding error to submit scripts if Data directory does not exist --- bsub_this_to_run_all_compilers.csh | 9 +++++++++ run_from_github.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/bsub_this_to_run_all_compilers.csh b/bsub_this_to_run_all_compilers.csh index 4aae4c5..3dec8fe 100644 --- a/bsub_this_to_run_all_compilers.csh +++ b/bsub_this_to_run_all_compilers.csh @@ -12,6 +12,15 @@ #BSUB -N unsetenv MP_PE_AFFINITY + +if ( ! -e Data ) then + echo "ERROR ERROR ERROR" + echo "" + echo "'Data' directory not found" + echo "If on Yellowstone, link /glade/p/wrf/Data into your WTF directory" + exit 1 +endif + if ( ! -d /glade/scratch/${user}/TMPDIR_FOR_PGI_COMPILE ) then mkdir /glade/scratch/${user}/TMPDIR_FOR_PGI_COMPILE endif diff --git a/run_from_github.py b/run_from_github.py index 0073bb0..fe1350b 100755 --- a/run_from_github.py +++ b/run_from_github.py @@ -33,6 +33,15 @@ def usage(exit_code=0): #If no exit code is specified, this indicates successful def main(): + # First things first: check if user has a "Data" directory, quit with helpful message if they don't + if not os.path.isfile("Data"): + print("\nERROR ERROR ERROR\n") + print("'Data' directory not found") + print("If on Yellowstone, link /glade/p/wrf/Data into your WTF directory") + print("If you do not have access to Yellowstone, contact kavulich@ucar.edu for help") + sys.exit("\nExiting script") + + tardir = "tarballs" if len(sys.argv) > 1: