Skip to content

Commit

Permalink
Update scripts, rename variables from CICE_ to ICE_ to be more
Browse files Browse the repository at this point in the history
reusable in icepack.
  • Loading branch information
apcraig committed Sep 15, 2017
1 parent d1980d4 commit 98e0307
Show file tree
Hide file tree
Showing 33 changed files with 441 additions and 443 deletions.
6 changes: 3 additions & 3 deletions README.test
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ Additional Details:
- In general, the baseline generation, baseline compare, and test diff are independent.
- Use the '-bd' flag to specify the location where you want the baseline dataset
to be written. Without specifying '-bd', the baseline dataset will be written
to the default baseline directory found in the env.<machine> file (CICE_MACHINE_BASELINE).
to the default baseline directory found in the env.<machine> file (ICE_MACHINE_BASELINE).
- If '-bd' is not passed, the scripts will look for baseline datasets in the default
baseline directory found in the env.<machine> file (CICE_MACHINE_BASELINE).
baseline directory found in the env.<machine> file (ICE_MACHINE_BASELINE).
If the '-bd' option is passed, the scripts will look for baseline datasets in the
location passed to the -bd argument.
- To generate a baseline dataset for a specific version (for regression testing),
use '-bg <version_name>'. The scripts will then place the baseline dataset
in $CICE_MACHINE_BASELINE/<version_name>/
in $ICE_MACHINE_BASELINE/<version_name>/
- The '-testid' flag allows users to specify a testing id that will be added to the
end of the case directory. For example, "./create.case -m wolf -t smoke -testid t12 -p 4x1"
creates the directory wolf_smoke_gx3_4x1.t12. This flag is REQUIRED if using -t or -ts.
50 changes: 25 additions & 25 deletions configuration/scripts/cice.batch.csh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ else
endif

source ./cice.settings
source ${CICE_CASEDIR}/env.${CICE_MACHINE} || exit 2
source ${ICE_CASEDIR}/env.${ICE_MACHINE} || exit 2

set jobfile = $1

set ntasks = ${CICE_NTASKS}
set nthrds = ${CICE_NTHRDS}
set maxtpn = ${CICE_MACHINE_TPNODE}
set acct = ${CICE_MACHINE_ACCT}
set ntasks = ${ICE_NTASKS}
set nthrds = ${ICE_NTHRDS}
set maxtpn = ${ICE_MACHINE_TPNODE}
set acct = ${ICE_MACHINE_ACCT}

@ taskpernode = ${maxtpn} / $nthrds
@ nnodes = ${ntasks} / ${taskpernode}
Expand All @@ -34,7 +34,7 @@ EOF0

#==========================================

if (${CICE_MACHINE} =~ yellowstone*) then
if (${ICE_MACHINE} =~ yellowstone*) then
cat >> ${jobfile} << EOFB
#BSUB -n ${ntasks}
#BSUB -R "span[ptile=${ptile}]"
Expand All @@ -44,44 +44,44 @@ cat >> ${jobfile} << EOFB
#BSUB -a poe
#BSUB -o poe.stdout.%J
#BSUB -e poe.stderr.%J
#BSUB -J ${CICE_CASENAME}
#BSUB -W ${CICE_RUNLENGTH}
#BSUB -J ${ICE_CASENAME}
#BSUB -W ${ICE_RUNLENGTH}
#BSUB -P ${acct}
EOFB

#==========================================

else if (${CICE_MACHINE} =~ cheyenne*) then
else if (${ICE_MACHINE} =~ cheyenne*) then
cat >> ${jobfile} << EOFB
#PBS -j oe
#PBS -m ae
#PBS -V
#PBS -q regular
#PBS -N ${CICE_CASENAME}
#PBS -A ${CICE_ACCT}
#PBS -N ${ICE_CASENAME}
#PBS -A ${ICE_ACCT}
#PBS -l select=${nnodes}:ncpus=${corespernode}:mpiprocs=${taskpernodelimit}:ompthreads=${nthrds}
#PBS -l walltime=${CICE_RUNLENGTH}
#PBS -l walltime=${ICE_RUNLENGTH}
EOFB

else if (${CICE_MACHINE} =~ thunder* || ${CICE_MACHINE} =~ gordon* || ${CICE_MACHINE} =~ conrad*) then
else if (${ICE_MACHINE} =~ thunder* || ${ICE_MACHINE} =~ gordon* || ${ICE_MACHINE} =~ conrad*) then
cat >> ${jobfile} << EOFB
#PBS -N ${CICE_CASENAME}
#PBS -N ${ICE_CASENAME}
#PBS -q debug
#PBS -A ${acct}
#PBS -l select=${nnodes}:ncpus=${maxtpn}:mpiprocs=${taskpernode}
#PBS -l walltime=${CICE_RUNLENGTH}
#PBS -l walltime=${ICE_RUNLENGTH}
#PBS -j oe
###PBS -M [email protected]
###PBS -m be
EOFB

else if (${CICE_MACHINE} =~ cori*) then
else if (${ICE_MACHINE} =~ cori*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${CICE_CASENAME}
#SBATCH -J ${ICE_CASENAME}
#SBATCH -p debug
###SBATCH -A ${acct}
#SBATCH -N ${nnodes}
#SBATCH -t ${CICE_RUNLENGTH}
#SBATCH -t ${ICE_RUNLENGTH}
#SBATCH -L SCRATCH
#SBATCH -C haswell
###SBATCH -e filename
Expand All @@ -90,10 +90,10 @@ cat >> ${jobfile} << EOFB
###SBATCH --mail-user [email protected]
EOFB

else if (${CICE_MACHINE} =~ wolf*) then
else if (${ICE_MACHINE} =~ wolf*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${CICE_CASENAME}
#SBATCH -t ${CICE_RUNLENGTH}
#SBATCH -J ${ICE_CASENAME}
#SBATCH -t ${ICE_RUNLENGTH}
#SBATCH -A ${acct}
#SBATCH -N ${nnodes}
#SBATCH -e slurm%j.err
Expand All @@ -103,10 +103,10 @@ cat >> ${jobfile} << EOFB
#SBATCH --qos=low
EOFB

else if (${CICE_MACHINE} =~ pinto*) then
else if (${ICE_MACHINE} =~ pinto*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${CICE_CASENAME}
#SBATCH -t ${CICE_RUNLENGTH}
#SBATCH -J ${ICE_CASENAME}
#SBATCH -t ${ICE_RUNLENGTH}
#SBATCH -A ${acct}
#SBATCH -N ${nnodes}
#SBATCH -e slurm%j.err
Expand All @@ -117,7 +117,7 @@ cat >> ${jobfile} << EOFB
EOFB

else
echo "${0} ERROR: ${CICE_MACHINE} unknown"
echo "${0} ERROR: ${ICE_MACHINE} unknown"
exit -1
endif

Expand Down
108 changes: 54 additions & 54 deletions configuration/scripts/cice.build
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
#! /bin/csh -f

source ./cice.settings
source ${CICE_CASEDIR}/env.${CICE_MACHINE} || exit 2
source ${ICE_CASEDIR}/env.${ICE_MACHINE} || exit 2

if (${CICE_MACHINE} != ${CICE_MACHINE_ENVNAME}) then
echo "WARNING, is CICE_MACHINE setting OK, ${CICE_MACHINE}, ${CICE_MACHINE_ENV}"
if (${ICE_MACHINE} != ${ICE_MACHINE_ENVNAME}) then
echo "WARNING, is ICE_MACHINE setting OK, ${ICE_MACHINE}, ${ICE_MACHINE_ENV}"
endif

echo " "
echo "${0}:"

set stamp = `date '+%y%m%d-%H%M%S'`
set CICE_BLDLOG_FILE = "cice.bldlog.${stamp}"
set ICE_BLDLOG_FILE = "cice.bldlog.${stamp}"

if (${CICE_CLEANBUILD} == 'true') then
if (${ICE_CLEANBUILD} == 'true') then
echo "cleaning objdir"
rm -r -f ${CICE_OBJDIR}
rm -r -f ${ICE_OBJDIR}
endif
if !(-d ${CICE_OBJDIR}) mkdir -p ${CICE_OBJDIR}
cd ${CICE_OBJDIR}
if !(-d ${ICE_OBJDIR}) mkdir -p ${ICE_OBJDIR}
cd ${ICE_OBJDIR}

setenv CICE_CPPDEFS "-DNXGLOB=${CICE_NXGLOB} -DNYGLOB=${CICE_NYGLOB} -DBLCKX=${CICE_BLCKX} -DBLCKY=${CICE_BLCKY} -DMXBLCKS=${CICE_MXBLCKS} -DNICELYR=${NICELYR} -DNSNWLYR=${NSNWLYR} -DNICECAT=${NICECAT} -DTRAGE=${TRAGE} -DTRFY=${TRFY} -DTRLVL=${TRLVL} -DTRPND=${TRPND} -DTRBRI=${TRBRI} -DNTRAERO=${NTRAERO} -DTRZS=${TRZS} -DNBGCLYR=${NBGCLYR} -DTRALG=${TRALG} -DTRBGCZ=${TRBGCZ} -DTRDOC=${TRDOC} -DTRDOC=${TRDOC} -DTRDIC=${TRDIC} -DTRDON=${TRDON} -DTRFED=${TRFED} -DTRFEP=${TRFEP} -DTRZAERO=${TRZAERO} -DTRBGCS=${TRBGCS} -DNUMIN=${NUMIN} -DNUMAX=${NUMAX}"
setenv ICE_CPPDEFS "-DNXGLOB=${ICE_NXGLOB} -DNYGLOB=${ICE_NYGLOB} -DBLCKX=${ICE_BLCKX} -DBLCKY=${ICE_BLCKY} -DMXBLCKS=${ICE_MXBLCKS} -DNICELYR=${NICELYR} -DNSNWLYR=${NSNWLYR} -DNICECAT=${NICECAT} -DTRAGE=${TRAGE} -DTRFY=${TRFY} -DTRLVL=${TRLVL} -DTRPND=${TRPND} -DTRBRI=${TRBRI} -DNTRAERO=${NTRAERO} -DTRZS=${TRZS} -DNBGCLYR=${NBGCLYR} -DTRALG=${TRALG} -DTRBGCZ=${TRBGCZ} -DTRDOC=${TRDOC} -DTRDOC=${TRDOC} -DTRDIC=${TRDIC} -DTRDON=${TRDON} -DTRFED=${TRFED} -DTRFEP=${TRFEP} -DTRZAERO=${TRZAERO} -DTRBGCS=${TRBGCS} -DNUMIN=${NUMIN} -DNUMAX=${NUMAX}"

if ($DITTO == 'yes') then
setenv CICE_CPPDEFS "${CICE_CPPDEFS} -DREPRODUCIBLE"
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -DREPRODUCIBLE"
endif

if (${CICE_NTASKS} == 1) then
setenv CICE_COMMDIR serial
if (${ICE_NTASKS} == 1) then
setenv ICE_COMMDIR serial
else
setenv CICE_COMMDIR mpi
setenv ICE_COMMDIR mpi
endif

if (${CICE_IOTYPE} == 'netcdf') then
if (${ICE_IOTYPE} == 'netcdf') then
set IODIR = io_netcdf
setenv CICE_CPPDEFS "${CICE_CPPDEFS} -Dncdf"
else if (${CICE_IOTYPE} == 'pio') then
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -Dncdf"
else if (${ICE_IOTYPE} == 'pio') then
set IODIR = io_pio
setenv CICE_CPPDEFS "${CICE_CPPDEFS} -Dncdf"
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -Dncdf"
else
set IODIR = io_binary
endif

### List of source code directories (in order of importance).
cat >! Filepath << EOF
${CICE_SANDBOX}/cicecore/drivers/${CICE_DRVOPT}
${CICE_SANDBOX}/cicecore/cicedynB/dynamics
${CICE_SANDBOX}/cicecore/cicedynB/general
${CICE_SANDBOX}/cicecore/cicedynB/analysis
${CICE_SANDBOX}/cicecore/cicedynB/infrastructure
${CICE_SANDBOX}/cicecore/cicedynB/infrastructure/io/$IODIR
${CICE_SANDBOX}/cicecore/cicedynB/infrastructure/comm/${CICE_COMMDIR}
${CICE_SANDBOX}/cicecore/shared
${CICE_SANDBOX}/cicecore/shared/constants/${CICE_CONSTOPT}
${CICE_SANDBOX}/icepack/columnphysics
${CICE_SANDBOX}/icepack/columnphysics/constants/${CICE_CONSTOPT}
${ICE_SANDBOX}/cicecore/drivers/${ICE_DRVOPT}
${ICE_SANDBOX}/cicecore/cicedynB/dynamics
${ICE_SANDBOX}/cicecore/cicedynB/general
${ICE_SANDBOX}/cicecore/cicedynB/analysis
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure/io/$IODIR
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure/comm/${ICE_COMMDIR}
${ICE_SANDBOX}/cicecore/shared
${ICE_SANDBOX}/cicecore/shared/constants/${ICE_CONSTOPT}
${ICE_SANDBOX}/icepack/columnphysics
${ICE_SANDBOX}/icepack/columnphysics/constants/${ICE_CONSTOPT}
EOF

echo " "
echo CICE_GRID = ${CICE_GRID}
echo CICE_NTASK = ${CICE_NTASKS}
echo CICE_NTHRD = ${CICE_NTHRDS}
echo ICE_GRID = ${ICE_GRID}
echo ICE_NTASK = ${ICE_NTASKS}
echo ICE_NTHRD = ${ICE_NTHRDS}
echo "global N, block_size"
echo "x ${CICE_NXGLOB}, ${CICE_BLCKX}"
echo "y ${CICE_NYGLOB}, ${CICE_BLCKY}"
echo "max_blocks = ${CICE_MXBLCKS}"
echo "CICE_CPPDEFS = ${CICE_CPPDEFS}"
echo "x ${ICE_NXGLOB}, ${ICE_BLCKX}"
echo "y ${ICE_NYGLOB}, ${ICE_BLCKY}"
echo "max_blocks = ${ICE_MXBLCKS}"
echo "ICE_CPPDEFS = ${ICE_CPPDEFS}"
echo "Filepath = "
cat ${CICE_OBJDIR}/Filepath
cat ${ICE_OBJDIR}/Filepath
echo " "

echo "building makdep"
cc -o makdep ${CICE_CASEDIR}/makdep.c || exit 2
cc -o makdep ${ICE_CASEDIR}/makdep.c || exit 2

echo "building cice > ${CICE_OBJDIR}/${CICE_BLDLOG_FILE}"
if !(-d ${CICE_RUNDIR}) mkdir -p ${CICE_RUNDIR}
if !($?CICE_MACHINE_BLDTHRDS) then
set CICE_MACHINE_BLDTHRDS = 1
echo "building cice > ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}"
if !(-d ${ICE_RUNDIR}) mkdir -p ${ICE_RUNDIR}
if !($?ICE_MACHINE_BLDTHRDS) then
set ICE_MACHINE_BLDTHRDS = 1
endif
if (-e ${CICE_BLDLOG_FILE}) rm ${CICE_BLDLOG_FILE}
gmake -j ${CICE_MACHINE_BLDTHRDS} VPFILE=Filepath EXEC=${CICE_RUNDIR}/cice CICE_CPPDEFSDEFS="${CICE_CPPDEFS}" \
-f ${CICE_CASEDIR}/Makefile MACFILE=${CICE_CASEDIR}/Macros.${CICE_MACHINE} | tee ${CICE_BLDLOG_FILE}
echo "#---" >! ${CICE_CASEDIR}/test_output
if (-e ${ICE_BLDLOG_FILE}) rm ${ICE_BLDLOG_FILE}
gmake -j ${ICE_MACHINE_BLDTHRDS} VPFILE=Filepath EXEC=${ICE_RUNDIR}/cice ICE_CPPDEFSDEFS="${ICE_CPPDEFS}" \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHINE} | tee ${ICE_BLDLOG_FILE}
echo "#---" >! ${ICE_CASEDIR}/test_output
if ($status != 0) then
echo "${0}: COMPILE FAILED, see"
echo " cat ${CICE_OBJDIR}/${CICE_BLDLOG_FILE}"
if ( ${CICE_TEST} != ${CICE_SPVAL} ) then
echo " cat ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}"
if ( ${ICE_TEST} != ${ICE_SPVAL} ) then
# This is a test case. Write output to test_output file
echo "FAIL ${CICE_TESTNAME} build" >> ${CICE_CASEDIR}/test_output
echo "FAIL ${ICE_TESTNAME} build" >> ${ICE_CASEDIR}/test_output
endif
exit 99
endif

if !(-d ${CICE_LOGDIR}) mkdir -p ${CICE_LOGDIR}
cp -p ${CICE_BLDLOG_FILE} ${CICE_LOGDIR}/
echo "`date` ${0}:${CICE_CASENAME} build completed ${CICE_BLDLOG_FILE}" >> ${CICE_CASEDIR}/README.case
echo "${0}: COMPILE SUCCESSFUL, ${CICE_LOGDIR}/${CICE_BLDLOG_FILE}"
if ( ${CICE_TEST} != ${CICE_SPVAL} ) then
echo "PASS ${CICE_TESTNAME} build" >> ${CICE_CASEDIR}/test_output
if !(-d ${ICE_LOGDIR}) mkdir -p ${ICE_LOGDIR}
cp -p ${ICE_BLDLOG_FILE} ${ICE_LOGDIR}/
echo "`date` ${0}:${ICE_CASENAME} build completed ${ICE_BLDLOG_FILE}" >> ${ICE_CASEDIR}/README.case
echo "${0}: COMPILE SUCCESSFUL, ${ICE_LOGDIR}/${ICE_BLDLOG_FILE}"
if ( ${ICE_TEST} != ${ICE_SPVAL} ) then
echo "PASS ${ICE_TESTNAME} build" >> ${ICE_CASEDIR}/test_output
endif

36 changes: 18 additions & 18 deletions configuration/scripts/cice.launch.csh
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,52 @@ source ./cice.settings

set jobfile = $1

set ntasks = ${CICE_NTASKS}
set nthrds = ${CICE_NTHRDS}
set ntasks = ${ICE_NTASKS}
set nthrds = ${ICE_NTHRDS}

#==========================================

if (${CICE_MACHINE} =~ yellowstone*) then
if (${ICE_MACHINE} =~ yellowstone*) then
cat >> ${jobfile} << EOFR
setenv MP_TASK_AFFINITY core:\${OMP_NUM_THREADS}
mpirun.lsf ./cice >&! \$CICE_RUNLOG_FILE
mpirun.lsf ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ cheyenne*) then
else if (${ICE_MACHINE} =~ cheyenne*) then
cat >> ${jobfile} << EOFR
mpiexec_mpt -n ${ntasks} ./cice >&! \$CICE_RUNLOG_FILE
mpiexec_mpt -n ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ thunder*) then
else if (${ICE_MACHINE} =~ thunder*) then
cat >> ${jobfile} << EOFR
mpiexec_mpt -np ${ntasks} omplace ./cice >&! \$CICE_RUNLOG_FILE
mpiexec_mpt -np ${ntasks} omplace ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ gordon* || ${CICE_MACHINE} =~ conrad*) then
else if (${ICE_MACHINE} =~ gordon* || ${ICE_MACHINE} =~ conrad*) then
cat >> ${jobfile} << EOFR
aprun -n ${ntasks} -N ${ntasks} -d ${nthrds} ./cice >&! \$CICE_RUNLOG_FILE
aprun -n ${ntasks} -N ${ntasks} -d ${nthrds} ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ cori*) then
else if (${ICE_MACHINE} =~ cori*) then
cat >> ${jobfile} << EOFR
srun -n ${ntasks} -c ${nthrds} ./cice >&! \$CICE_RUNLOG_FILE
srun -n ${ntasks} -c ${nthrds} ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ wolf*) then
else if (${ICE_MACHINE} =~ wolf*) then
cat >> ${jobfile} << EOFR
mpirun -np ${ntasks} ./cice >&! \$CICE_RUNLOG_FILE
mpirun -np ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE
EOFR

else if (${CICE_MACHINE} =~ pinto*) then
else if (${ICE_MACHINE} =~ pinto*) then
cat >> ${jobfile} << EOFR
mpirun -np ${ntasks} ./cice >&! \$CICE_RUNLOG_FILE
mpirun -np ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE
EOFR
#cat >> ${jobfile} << EOFR
#srun -n ${ntasks} -c ${nthrds} ./cice >&! \$CICE_RUNLOG_FILE
#srun -n ${ntasks} -c ${nthrds} ./cice >&! \$ICE_RUNLOG_FILE
#EOFR

else
echo "${0} ERROR ${CICE_MACHINE} unknown"
echo "${0} ERROR ${ICE_MACHINE} unknown"
exit -1
endif

Expand Down
Loading

0 comments on commit 98e0307

Please sign in to comment.