Skip to content

Commit

Permalink
-u USER flag introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
oloapinivad committed Mar 2, 2018
1 parent 8e087fb commit 9b786d3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 45 deletions.
5 changes: 1 addition & 4 deletions conf/marconi/README_marconi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ This configuration os for the Marconi machine at CINECA (defined by ISAC-CNR)
add these line to your $HOME/.bashrc
```
export ECE3_POSTPROC_TOPDIR=$HOME/ecearth3/ece3-postproc #<dir where this file is>
export ECE3_POSTPROC_RUNDIR=$CINECA_SCRATCH/ece3 #<top dir where your ecearth runs are located -see your config-run.xml>
export ECE3_POSTPROC_DATADIR=$WORK/ECE3-DATA_primavera # <dir where your ecearth data are located -see your config-run.xml> #
export ECE3_POSTPROC_MACHINE=marconi #<name of your (HPC) machine>
export ECE3_POSTPROC_ACCOUNT=Pra13_3311 #<HPC account>
export ECE3_POSTPROC_ISAC_STRUCTURE=1 <extra flag to support for ISAC-CNR data structure>
export ECE3_POSTPROC_ACCOUNT= #<HPC account>
```

~
12 changes: 5 additions & 7 deletions conf/marconi/conf_hiresclim_marconi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@
#
# Must include $EXPID and be single-quoted
#
# optional variable are $USER*, $LEGNB, $year
export COREIFSDIR='${EXPID}/output/Output_${year}/IFS'
export CORENEMODIR='${EXPID}/output/Output_${year}/NEMO'

export IFSRESULTS0=${ECE3_POSTPROC_RUNDIR}/${COREIFSDIR}
export NEMORESULTS0=${ECE3_POSTPROC_RUNDIR}/${CORENEMODIR}
# optional variable are $USERexp/$USER, $LEGNB, $year
export ${USERexp:=$USER}
export IFSRESULTS0='/marconi_scratch/userexternal/${USERexp}/ece3/${EXPID}/output/Output_${year}/IFS'
export NEMORESULTS0='/marconi_scratch/userexternal/${USERexp}/ece3/${EXPID}/output/Output_${year}/NEMO'

# --- PATTERN TO DEFINE WHERE TO SAVE POST-PROCESSED DATA
#
# Must include ${EXPID} and be single-quoted
#
export ECE3_POSTPROC_POSTDIR='${CINECA_SCRATCH}/ece3/${EXPID}/post'
export ECE3_POSTPROC_POSTDIR='/marconi_scratch/userexternal/${USER}/ece3/${EXPID}/post'

# --- PROCESSING TO PERFORM (uncomment to change default)
# ECE3_POSTPROC_HC_IFS_MONTHL=1
Expand Down
18 changes: 5 additions & 13 deletions hiresclim2/master_hiresclim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -eu

usage()
{
echo "Usage: ./master_hiresclim.sh [-r rundir] [-p postdir] [-m months_per_leg] EXP YEAR YREF"
echo "Usage: ./master_hiresclim.sh [-m months_per_leg] [-u userexp] EXP YEAR YREF"
echo "Example: ./master_hiresclim.sh io01 1995 1990"
}

Expand All @@ -24,19 +24,18 @@ usage()
#########################

months_per_leg=12 # nb of months per legs. Default: yearly legs.
ALT_RUNDIR=""
ALT_POSTDIR=""
#ALT_RUNDIR=""
#ALT_POSTDIR=""

while getopts "h?m:r:" opt; do
while getopts "h?m:r:u:" opt; do
case "$opt" in
h|\?)
usage
exit 0
;;
r) ALT_RUNDIR=$OPTARG
;;
m) months_per_leg=$OPTARG
;;
u) USERexp=$OPTARG
esac
done
shift $((OPTIND-1))
Expand Down Expand Up @@ -104,13 +103,6 @@ PROGDIR=$ECE3_POSTPROC_TOPDIR/hiresclim2
# cdo table for conversion GRIB parameter --> variable name
export ecearth_table=$PROGDIR/script/ecearth.tab

# where to find the results from the EC-EARTH experiment
if [[ -n $ALT_RUNDIR ]]
then
export IFSRESULTS0=$ALT_RUNDIR/${COREIFSDIR}
export NEMORESULTS0=$ALT_RUNDIR/${CORENEMODIR}
fi

# get the experiment directories
eval_dirs 1

Expand Down
17 changes: 4 additions & 13 deletions script/autohc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
usage()
{
echo "Usage:"
echo " hc.sh [-a account] [-r rundir] [-m months_per_leg] EXP"
echo " hc.sh [-a account] [-u USERexp] [-m months_per_leg] EXP"
echo
echo "Submit to a job scheduler an HIRESCLIM2 postprocessing of experiment EXP"
echo " (started in YREF) from YEAR1 to YEAR2. For each year, the script makes a"
Expand All @@ -13,8 +13,7 @@ usage()
echo
echo "Options are:"
echo " -a ACCOUNT : specify a different special project for accounting (default: ${ECE3_POSTPROC_ACCOUNT:-unknown})"
echo " -r RUNDIR : fully qualified path to another user EC-Earth RUNDIR"
echo " that is RUNDIR/EXP/output must exists and be readable (default output structure assumed)"
echo " -u USERexp : alternative user owner of the experiment, default $USER"
echo " -m months_per_leg : run was performed with months_per_leg legs (yearly legs expected by default)"
echo " -n numprocs : set number of processors to use (default is 12)"
}
Expand All @@ -23,13 +22,12 @@ set -ue

# -- default options
account="${ECE3_POSTPROC_ACCOUNT-}"
ALT_RUNDIR=""
options=""
nprocs=12
yref=""

# -- options
while getopts "hr:a:m:n:" opt; do
while getopts "hu:a:m:n:" opt; do
case "$opt" in
h)
usage
Expand All @@ -39,8 +37,7 @@ while getopts "hr:a:m:n:" opt; do
;;
m) options=${options}" -m $OPTARG"
;;
r) options=${options}" -r '$OPTARG'"
ALT_RUNDIR="$OPTARG"
u) USERexp=$OPTARG
;;
a) account=$OPTARG
;;
Expand All @@ -67,12 +64,6 @@ CONFDIR=${ECE3_POSTPROC_TOPDIR}/conf/${ECE3_POSTPROC_MACHINE}

. ${CONFDIR}/conf_hiresclim_${ECE3_POSTPROC_MACHINE}.sh

# --alternative directory
if [[ -n $ALT_RUNDIR ]]
then
export IFSRESULTS0=$ALT_RUNDIR/${COREIFSDIR}
fi

# -- add here options for submit commands
case "${submit_cmd}" in
sbatch) queue_cmd="squeue -u $USER -o %.16j" ;;
Expand Down
13 changes: 5 additions & 8 deletions script/hc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
usage()
{
echo "Usage:"
echo " hc.sh [-a account] [-r rundir] [-m months_per_leg] EXP YEAR1 YEAR2 YREF"
echo " hc.sh [-a account] [-u userexp] [-m months_per_leg] EXP YEAR1 YEAR2 YREF"
echo
echo "Submit to a job scheduler an HIRESCLIM2 postprocessing of experiment EXP"
echo " (started in YREF) from YEAR1 to YEAR2. For each year, the script makes a"
Expand All @@ -14,8 +14,7 @@ usage()
echo "Options are:"
echo " -a ACCOUNT : specify a different special project for accounting (default: ${ECE3_POSTPROC_ACCOUNT:-unknown})"
echo " -c : check for success"
echo " -r RUNDIR : fully qualified path to another user EC-Earth RUNDIR"
echo " that is RUNDIR/EXP/output must exists and be readable (default output structure assumed)"
echo " -u USERexp : alternative user owner of the experiment, default $USER"
echo " -m months_per_leg : run was performed with months_per_leg legs (yearly legs expected by default)"
echo " -n numprocs : set number of processors to use (default is 12)"
}
Expand All @@ -24,13 +23,12 @@ set -ue

# -- default options
account="${ECE3_POSTPROC_ACCOUNT-}"
ALT_RUNDIR=""
checkit=0
options=""
nprocs=12

# -- options
while getopts "hcr:a:m:n:" opt; do
while getopts "hcu:a:m:n:" opt; do
case "$opt" in
h)
usage
Expand All @@ -40,9 +38,8 @@ while getopts "hcr:a:m:n:" opt; do
;;
m) options=${options}" -m $OPTARG"
;;
r) options=${options}" -r '$OPTARG'"
ALT_RUNDIR="$OPTARG"
;;
u) USERexp=$OPTARG
;;
c) checkit=1
;;
a) account=$OPTARG
Expand Down

0 comments on commit 9b786d3

Please sign in to comment.