Skip to content
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

Feature/jstassi/#75 #76 updates #85

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parallel_build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if ($name != $name:t) then
set scriptname = $name:t
cd $name:h
endif
set srcdir = `pwd`
set srcdir = `pwd -L`
setenv ESMADIR $srcdir

# Save the original argv because I'm not a good
Expand Down
46 changes: 38 additions & 8 deletions src/Applications/GEOSdas_App/fvsetup
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
# 25Jul2017 Holdaway Added resource files associated with NGGPS FV3 tlm/adjoint, sens and svec
# 19Jul2018 Wargan Additions for OMPS
#-------------------------------------------------------------------------
use Cwd qw(cwd);
use Cwd qw(abs_path cwd);
use English;
use Env; # make env vars readily available
use File::Basename qw(basename dirname);
Expand Down Expand Up @@ -379,7 +379,7 @@ my ($gocart_tracers, $radcor, $emiss, $lsmodel_flag, $rroute_flag);
my ($agcm_rst_flg, $sensdeg, %setupfile, @otherheaders);
my ($checkFLG, $dbqueue, $runjobFLG, $saveFLG, $stopFLG);
my (@fvprompt, @fvANS1, @fvANS2, $fvsetupflags);
my ($fvhome, $fvroot, $fvbin, $checkID, $siteID);
my ($fvhome, $fvroot, $fvbin, $bindir, $pwdL, $pwdP, $checkID, $siteID);
my ($remNODE, $remID);
my ($qsub);
my ($acqloc);
Expand All @@ -394,12 +394,42 @@ system clear;
get_runtime_values();
$ENV{"PATH"} = $FindBin::Bin .":$ENV{PATH}";

# FVROOT is directory above bin dir where binaries have been installed
# --------------------------------------------------------------------
$fvroot = dirname($FindBin::Bin);
$fvroot =~ s|/u/.realmounts/share|/share|; # for portability across
# NAS machines
$fvbin = "$fvroot/bin";
# FVROOT is directory above fvbin where binaries have been installed
# ------------------------------------------------------------------
$fvbin = $FindBin::Bin; # absolute path of fvbin

chomp($pwdL = `pwd -L`); # logical path of calling program
chomp($pwdP = `pwd -P`); # physical (absolute) path of calling program

# if fvsetup is called from local directory
#------------------------------------------
if ($pwdP eq $FindBin::Bin) { $fvbin = $pwdL }

# if fvsetup is called from remote directory
#-------------------------------------------
else {
$bindir = dirname($0);

# remove single-dot (".") path segments
#--------------------------------------
while ($bindir =~ m|^\./|) { $bindir =~ s|^\./|| }
while ($bindir =~ m|/\./|) { $bindir =~ s|/\./|/| }
while ($bindir =~ m|/\.$|) { $bindir =~ s|/\.$|| }

# remove leading double-dot ("..") path segments
#-----------------------------------------------
while ($bindir =~ m|^\.\.|) {
$bindir =~ s|^\.\.||;
$pwdL = dirname($pwdL);
$bindir =~ s|^/||;
}

# determine path of fvbin
#------------------------
$bindir = "$pwdL/$bindir" unless $bindir =~ m|^/|;
$fvbin = $bindir if -e $bindir and abs_path($bindir) eq $fvbin;
}
$fvroot = dirname($fvbin);
$fvetc = "$fvroot/etc";
$user = getpwuid($<) unless ($user = $ENV{"USER"});

Expand Down
63 changes: 35 additions & 28 deletions src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ my ($EXPID, $FVHOME, $PBS_BIN, $account, $listdir, $mnthlyRC);
my ($numnodes_mm, $numnodes_mp, $plotHISTrc, $qcmd, $rundir);
my ($script, $siteID, $workdir, $yyyymm, %newrc, %JOBID);
my ($walltime_cl, $walltime_mm, $walltime_mp, $walltime_pf);
my ($MONTHLY_PARTITION, $MONTHLY_QOS);
my ($partition, $qos);

#$MONTHLY_PARTITION = "preops";
#$MONTHLY_QOS = "dastest";
#$partition = "preops";
#$qos = "dastest";

my %valid = ( "fetch" => 1,
"means" => 1,
Expand Down Expand Up @@ -115,6 +115,9 @@ sub init {
"finish_plots" => \$finish,
"nopush" => \$nopush,

"partition=s" => \$partition,
"qos=s" => \$qos,

"rc|mrc=s" => \$mnthlyRC,
"newrc:s" => \@newrc,

Expand Down Expand Up @@ -381,7 +384,7 @@ sub fetch_calc_tar_and_clean {
sub fetch_inputs {
my (%opts, $filestring, $ftype, $htype, $do_dmput, $do_tar);
my ($tmpl, $prefetch_j, $jobname, $outfile);
my ($job_name, $time, $output, $partition, $vFLG);
my ($job_name, $time, $output, $parFLG, $vFLG);
my (%value, @deps, $dependFLG, $cmd);

# input arguments
Expand All @@ -405,14 +408,14 @@ sub fetch_inputs {
$job_name = "SBATCH --job-name=$jobname";
$time = "SBATCH --time=$walltime_pf";
$output = "SBATCH --output=$outfile";
$partition = "SBATCH --partition=datamove";
$parFLG = "SBATCH --partition=datamove";
$vFLG = "--export=outfile=$outfile";
}
else {
$job_name = "PBS -N $jobname";
$time = "PBS -l walltime=$walltime_pf";
$output = "PBS -o $outfile";
$partition = "";
$parFLG = "";
$vFLG = "-v outfile=$outfile";
}

Expand All @@ -421,7 +424,7 @@ sub fetch_inputs {
$value{"__TIME__"} = $time;
$value{"__ACCOUNT__"} = $account;
$value{"__OUTPUT__"} = $output;
$value{"__PARTITION__"} = $partition;
$value{"__PARTITION__"} = $parFLG;

$value{"__FILESTRING__"} = $filestring;
$value{"__HOURTYPE__"} = $htype;
Expand Down Expand Up @@ -488,8 +491,8 @@ sub calc_monthly_means {
$nodes = "SBATCH --nodes=$numnodes_mm";
$per_node = "SBATCH --tasks-per-node=$tasks_per_node";
$vFLG = "--export=outfile=$outfile";
$parFLG = "SBATCH --partition=$MONTHLY_PARTITION" if $MONTHLY_PARTITION;
$qosFLG = "SBATCH --qos=$MONTHLY_QOS" if $MONTHLY_QOS;
$parFLG = "SBATCH --partition=$partition" if $partition;
$qosFLG = "SBATCH --qos=$qos" if $qos;
}
else {
$job_name = "PBS -N $jobname";
Expand Down Expand Up @@ -549,7 +552,7 @@ sub calc_monthly_means {
sub tar_and_clean_inputs {
my (%opts, $filestring, $ftype, $do_tar, $lastFLG);
my ($tmpl, $tarandclean_j, $jobname, $outfile);
my ($job_name, $time, $output, $partition, $vFLG);
my ($job_name, $time, $output, $parFLG, $vFLG);
my (%value, $walltime, @deps, $dependFLG, $cmd);

# input arguments
Expand All @@ -572,14 +575,14 @@ sub tar_and_clean_inputs {
$job_name = "SBATCH --job-name=$jobname";
$time = "SBATCH --time=$walltime_cl";
$output = "SBATCH --output=$outfile";
$partition = "SBATCH --partition=datamove";
$parFLG = "SBATCH --partition=datamove";
$vFLG = "--export=outfile=$outfile";
}
else {
$job_name = "PBS -N $jobname ";
$time = "PBS -l walltime=$walltime_cl";
$output = "PBS -o $outfile";
$partition = "";
$parFLG = "";
$vFLG = "-v outfile=$outfile";
}

Expand All @@ -588,7 +591,7 @@ sub tar_and_clean_inputs {
$value{"__TIME__"} = $time;
$value{"__ACCOUNT__"} = $account;
$value{"__OUTPUT__"} = $output;
$value{"__PARTITION__"} = $partition;
$value{"__PARTITION__"} = $parFLG;

$value{"__FILESTRING__"} = $filestring;
$value{"__YYYYMM__"} = $yyyymm;
Expand Down Expand Up @@ -733,7 +736,7 @@ sub archive_monthly_files {
#=======================================================================
sub monthly_plots {
my ($tmpl, $transfer_csh, $plots_j, $jobname, $outfile);
my ($job_name, $nodes, $time, $output, $partition);
my ($job_name, $nodes, $time, $output, $parFLG);
my (%value, @deps, $dependFLG, $vFLG, $cmd);

# create plots transfer job script
Expand All @@ -747,14 +750,14 @@ sub monthly_plots {
$job_name = "SBATCH --job-name=$jobname";
$time = "SBATCH --time=$walltime_cl";
$output = "SBATCH --output=$outfile";
$partition = "SBATCH --partition=datamove";
$parFLG = "SBATCH --partition=datamove";
$vFLG = "--export=outfile=$outfile";
}
else {
$job_name = "PBS -N $jobname";
$time = "PBS -l walltime=$walltime_cl";
$output = "PBS -o $outfile";
$partition = "";
$parFLG = "";
$vFLG = "-v outfile=$outfile";
}

Expand All @@ -763,7 +766,7 @@ sub monthly_plots {
$value{"__TIME__"} = $time;
$value{"__ACCOUNT__"} = $account;
$value{"__OUTPUT__"} = $output;
$value{"__PARTITION__"} = $partition;
$value{"__PARTITION__"} = $parFLG;

$value{"__TRANSFER__"} = basename($transfer_csh);
$value{"__RUNDIR__"} = $rundir;
Expand Down Expand Up @@ -1038,21 +1041,25 @@ purpose: calculate means, tar inputs, and/or produce plots for monthly data
usage: $script [process options] [plot option] [other options]

process options (see Notes below)
-means calculate monthly means
-tar tar input files
-plots produce monthly plots from monthly means
-finish_plots finish monthly plots job which stopped before completion
-means calculate monthly means
-tar tar input files
-plots produce monthly plots from monthly means
-finish_plots finish monthly plots job which stopped before completion

plot option (only valid when used with -plots or -finish_plots)
-nopush do not transfer gif files to Web server after plotting
-nopush do not transfer gif files to Web server after plotting

slurm directive options
-partition partition send monthly means jobs to specified partition
-qos qos send monthly means jobs to specified qos

other options
-rc mnthlyRC name of monthly rc file [run/monthly.rc]
-newrc [n] re-create resource files prior to any other processing
if n==1, then write new monthly rc file
if n==2, then write new plots HISTORY.rc_tmpl
if no value for n is given, then n==1,2
-h print usage information
-rc mnthlyRC name of monthly rc file [run/monthly.rc]
-newrc [n] re-create resource files prior to any other processing
if n==1, then write new monthly rc file
if n==2, then write new plots HISTORY.rc_tmpl
if no value for n is given, then n==1,2
-h print usage information

Notes:
1. Plots cannot be produced unless monthly means are calculated
Expand Down