From b55a9feb47e9366731bea8d460c3109fb94a4176 Mon Sep 17 00:00:00 2001 From: Joe Stassi Date: Tue, 30 Nov 2021 16:18:14 -0500 Subject: [PATCH] Issue #83: Run AOD in parallel and wait rather than running as separate job (and rather than running in parallel and not waiting) --- src/Applications/GEOSdas_App/GEOSdas.csm | 2 +- src/Applications/GEOSdas_App/fvsetup | 38 +++++++++++++----------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Applications/GEOSdas_App/GEOSdas.csm b/src/Applications/GEOSdas_App/GEOSdas.csm index a908d734..e2fdfd5f 100755 --- a/src/Applications/GEOSdas_App/GEOSdas.csm +++ b/src/Applications/GEOSdas_App/GEOSdas.csm @@ -4403,7 +4403,7 @@ endif # run at command line #-------------------- chmod 744 $jobf - $jobf $aod_parallel_flag >&! $gaasLOG & + $jobf $aod_parallel_flag >&! $gaasLOG else diff --git a/src/Applications/GEOSdas_App/fvsetup b/src/Applications/GEOSdas_App/fvsetup index 9eca6011..f7d8d041 100755 --- a/src/Applications/GEOSdas_App/fvsetup +++ b/src/Applications/GEOSdas_App/fvsetup @@ -2538,7 +2538,7 @@ sub get_expid { my (%already_asked); $expid = "u000_"."$res"; - if ( $g5gcm ) { $expdsc = "${expid}__${cvstag}__agrid_${res}__ogrid_${ores}" } + if ( $g5gcm ) { $expdsc = "${expid}__agrid_${res}__ogrid_${ores}" } else { $expdsc = "FVGCM-based_run" } print <<"EOF"; @@ -2596,7 +2596,7 @@ EOF } } } - $expdsc = "${expid}__${cvstag}__agrid_${res}__ogrid_${ores}" if $g5gcm; + $expdsc = "${expid}__agrid_${res}__ogrid_${ores}" if $g5gcm; $expdsc = query(" EXPDSC?", $expdsc); return 0; } @@ -2739,10 +2739,10 @@ EOF last if -d $fvbcs; if ($loop++ < 3) { - warn ">> ERROR << cannot find directory $fvbcs"; + warn ">> WARNING << Cannot find directory $fvbcs; Try again;"; redo; } else { - die ">> ERROR << cannot find directory $fvbcs"; + die ">> ERROR << Cannot find directory $fvbcs;"; } } @@ -2759,10 +2759,10 @@ EOF last if -d $fvrtbcs; if ($loop++ < 3) { - warn ">> ERROR << cannot find directory $fvrtbcs"; + warn ">> WARNING << Cannot find directory $fvrtbcs; Try again;"; redo; } else { - die ">> ERROR << cannot find directory $fvrtbcs"; + die ">> ERROR << Cannot find directory $fvrtbcs;"; } } @@ -2793,10 +2793,10 @@ sub get_extdata { unless (-d $extdata{$set}) { if ($loop++ < 3) { - warn ">> ERROR << cannot find directory: $extdata{$set}"; + warn ">> WARNING << Cannot find directory: $extdata{$set}; Try again;"; redo; } else { - die ">> ERROR << cannot find directory: $extdata{$set}"; + die ">> ERROR << Cannot find directory: $extdata{$set};"; } } $loop = 0; @@ -3182,10 +3182,10 @@ EOF $nymde = query(" Ending year-month-day?", $nymde); unless ($nymde =~ /^\s*\d{8}\s*$/) { if ($loop++ < 3) { - warn ">> ERROR << Date must be in yyyymmdd format. Try again.\n\n"; + warn ">> WARNING << Date must be in yyyymmdd format; Try again;"; redo; } else { - die "Date must be in yyyymmdd format. Try again.\n\n"; + die ">> ERROR << Date must be in yyyymmdd format;"; } } } @@ -3202,11 +3202,11 @@ EOF { $fhours21 = query(" Length of FORECAST run segments (in hours)?", $fhours21); if ($fhours21 % 3 != 0) { - if ($loop < 3) { - warn ">> Error << Number of hours should be a multiple of 3. Try again.\n"; + if ($loop++ < 3) { + warn ">> WARNING << Number of hours should be a multiple of 3; Try again;"; redo; } else { - die " Number of hours should be a multiple of 3. Try again.\n"; + die ">> ERROR << Number of hours should be a multiple of 3;"; } } } @@ -7621,7 +7621,7 @@ print SCRIPT <<"EOF"; setenv NCPUS_GPERT $ncpus_gpert # Number of CPUs to run gcmPERT setenv NCPUS_AOD $ncpus_aod # Number of CPUs to run PSAS-AOD setenv O_SERVERS $o_servers # Number of IO servers - setenv GAAS_RUN_SLURM 1 # launch AOD analysis as separate batch job + #setenv GAAS_RUN_SLURM 1 # launch AOD analysis as separate batch job setenv AODBLOCKJOB 1 EOF if ($ncpus_per_node) { @@ -10804,8 +10804,9 @@ sub merge_txt { } #======================================================================= sub write_saved_inputs { - my ($save_file, $dashes, $len, $prompt, $ans); - my (%varDef, @fvANS, $var, %alreadyWarned); + my ($save_file); + my ($ans, $dashes, $fvID, $len, $prompt, $var); + my (%alreadyWarned, %varDef, @fvANS); $save_file = shift @_; @@ -10818,12 +10819,15 @@ sub write_saved_inputs { $len = length("$expid.input")+1; $dashes = "-"x$len; + chomp($fvID = `git hash-object $0 | cut -c1-10`); + print SAVE "#$dashes\n"; print SAVE "# $expid.input\n"; print SAVE "#$dashes\n\n"; + print SAVE "codeID: $cvstag\n"; print SAVE "description: $expdsc\n"; - print SAVE "tag: $cvstag\n"; + print SAVE "fvsetupID: $fvID\n"; print SAVE "fvsetupflags:".$fvsetupflags."\n" if $fvsetupflags; %varDef = ();