Skip to content

Commit cbbb3ee

Browse files
committed
Updated m_python_proxy master script to be more clear about submitting batch jobs
1 parent dd596a2 commit cbbb3ee

File tree

1 file changed

+26
-80
lines changed

1 file changed

+26
-80
lines changed

src/master_scripts/m_python_proxy.py

100755100644
Lines changed: 26 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,11 +1549,9 @@ def f_execute_mfc_component(comp_name, case_dict, mfc_dir, engine): # ----------
15491549
#output, errors = cmd_status.communicate()
15501550
else:
15511551
f_create_batch_file(comp_name, case_dict, mfc_dir)
1552-
# Submit job to queue (Hooke/Thomson/Darter/Gordon)
1552+
# Submit job to queue (qsub)
15531553
# cmd_status = Popen('qsub ' + comp_name + '.sh', shell=True, stdout=PIPE)
1554-
# cmd_status = Popen('qsub -W depend=afterany:442190 ' + comp_name + '.sh', shell=True, stdout=PIPE)
1555-
# cmd_status = Popen('qsub -W depend=afterok:442883 ' + comp_name + '.sh', shell=True, stdout=PIPE)
1556-
# submit job to queue (Comet/Stampede)
1554+
# submit job to queue (sbatch)
15571555
cmd_status = Popen('sbatch ' + comp_name + '.sh', shell=True, stdout=PIPE)
15581556
output, errors = cmd_status.communicate()
15591557
print( '\n' + output)
@@ -1646,92 +1644,66 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
16461644
'#!/bin/sh' + '\n' \
16471645
\
16481646
# Account to be charged for the job:
1649-
# (Darter)
1650-
# '#PBS -A TG-CTS120005' + '\n' \
1651-
# (Stampede)
1652-
# '#SBATCH -A TG-CTS120005' + '\n' \
1653-
# (Comet)
1654-
#'#SBATCH -A cit129' + '\n' \
1647+
# (PBS)
1648+
# '#PBS -A xxx' + '\n' \
1649+
# (Slurm)
1650+
# '#SBATCH -A xxx' + '\n' \
16551651
\
16561652
# Name of the queue to which the job should be submitted:
1657-
# (Hooke/Thomson/Darter/Gordon)
1653+
# (PBS)
16581654
# '#PBS -q ' + str(pbs_dict['queue']) + '\n' \
1659-
# (Comet/Stampede)
1655+
# (Slurm)
16601656
'#SBATCH -p ' + str(pbs_dict['queue']) + '\n' \
16611657
\
16621658
# Name of the job to be submitted to the scheduler:
1663-
# (Hooke/Thomson/Darter/Gordon)
1659+
# (PBS)
16641660
# '#PBS -N ' + comp_name + '\n' \
1665-
# (Comet/Stampede)
1661+
# (Slurm)
16661662
'#SBATCH -J ' + comp_name + '\n' \
16671663
\
16681664
# Node(s) and processor(s) per node (ppn) for job:
1669-
# (Thomson)
1670-
# '#PBS -l nodes=' + str(pbs_dict['nodes']) \
1671-
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + '\n' \
1672-
# (Hooke)
1665+
# (PBS)
16731666
# '#PBS -l nodes=0' + str(pbs_dict['nodes']) \
16741667
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + '\n' \
1675-
# (Darter)
1676-
# '#PBS -l size=' + str( pbs_dict['nodes']*pbs_dict['ppn'] \
1677-
# + min(1,( pbs_dict['nodes'] \
1678-
# * pbs_dict[ 'ppn' ] )%16) \
1679-
# * (16 - ( pbs_dict['nodes'] \
1680-
# * pbs_dict[ 'ppn' ] )%16) ) + '\n' \
1681-
# (Gordon)
1682-
# '#PBS -l nodes=' + str(pbs_dict['nodes']) \
1683-
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + ':native' + '\n' \
1684-
# (Stampede)
1685-
# '#SBATCH -n ' + str( pbs_dict['nodes']*pbs_dict['ppn'] \
1686-
# + min(1,( pbs_dict['nodes'] \
1687-
# * pbs_dict[ 'ppn' ] )%16) \
1688-
# * (16 - ( pbs_dict['nodes'] \
1689-
# * pbs_dict[ 'ppn' ] )%16) ) + '\n' \
1690-
# \
1691-
# '#SBATCH -N ' + str( pbs_dict['nodes'] ) + '\n' \
1692-
# (Comet)
1668+
# (Slurm)
16931669
'#SBATCH --nodes=' + str(pbs_dict['nodes']) + '\n' \
16941670
'#SBATCH --ntasks-per-node=' + str(pbs_dict['ppn']) + '\n' \
16951671
\
1696-
# Constrain allocated nodes to single rack for best code efficiency:
1697-
# (Comet)
1698-
'#SBATCH --switches=1' + '\n' \
1699-
\
17001672
# Maximum amount of time to commit to the execution of the job:
1701-
# (Hooke/Thomson/Darter/Gordon)
1673+
# (PBS)
17021674
# '#PBS -l walltime=' + str(pbs_dict['walltime']) + '\n' \
1703-
# (Comet/Stampede)
1675+
# (Slurm)
17041676
'#SBATCH -t ' + str(pbs_dict['walltime']) + '\n' \
17051677
\
17061678
# Declare the job rerunable (y) or non-rerunable (n)
1707-
# (Hooke/Thomson)
1679+
# (PBS)
17081680
# '#PBS -r n' + '\n' \
17091681
# \
17101682
# Output standard output and error in a single file
1711-
# (Hooke/Thomson/Darter/Gordon)
1683+
# (PBS)
17121684
# '#PBS -j oe' + '\n' \
1713-
# (Comet/Stampede)
1685+
# (Slurm)
17141686
'#SBATCH -o ' + comp_name + '.o%j' + '\n' \
17151687
'#SBATCH -e ' + comp_name + '.o%j' + '\n' \
17161688
\
17171689
# Notify by email when job begins (b), aborts (a), and/or ends (e):
1718-
# (Hooke/Thomson/Darter/Gordon)
1690+
# (PBS)
17191691
# '#PBS -m bae' + '\n' \
17201692
# '#PBS -M ' + str(pbs_dict['mail_list']) + '\n' \
1721-
# (Comet/Stampede)
1693+
# (Slurm)
17221694
'#SBATCH --mail-type=all' + '\n' \
17231695
'#SBATCH --mail-user=' + str(pbs_dict['mail_list']) + '\n' \
17241696
\
17251697
#'sleep 30s' + '\n' \
17261698
# Total number of processor(s) allocated for job execution
1727-
# (Hooke/Thomson/Darter/Gordon)
1699+
# (PBS)
17281700
# 'num_procs=$(cat $PBS_NODEFILE | wc -l)' + '\n' \
17291701
\
17301702
# Moving to the case directory
1731-
# (Hooke/Thomson/Darter/Gordon)
1703+
# (PBS)
17321704
# 'cd $PBS_O_WORKDIR' + '\n' \
17331705
\
1734-
# Setting up environment variables for MPI I/O on Cray systems (Darter)
1706+
# Setting up environment variables for MPI I/O on Cray systems
17351707
# 'export MPICH_PTL_UNEX_EVENTS=400000' + '\n' \
17361708
# \
17371709
# 'export MPICH_PTL_OTHER_EVENTS=100000' + '\n' \
@@ -1741,19 +1713,18 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
17411713
# 'export MPICH_MPIIO_HINTS=*:romio_ds_write=disable' + '\n' \
17421714
# \
17431715
# Setting up the output file's header information:
1744-
# (Hooke/Thomson/Darter/Gordon)
1745-
# 'echo MFC v3.0 - Cases - ' + basename(getcwd()) \
1716+
# (PBS)
1717+
# 'echo MFC - Cases - ' + basename(getcwd()) \
17461718
# + ': $PBS_JOBNAME.o${PBS_JOBID:0:7}' + '\n' \
17471719
# 'echo Description: $PBS_JOBID executed on $num_procs ' \
1748-
# (Comet/Stampede)
1749-
'echo MFC v3.0 - Cases - ' + basename(getcwd()) \
1720+
# (Slurm)
1721+
'echo MFC - Cases - ' + basename(getcwd()) \
17501722
+ ': $SLURM_JOB_NAME.o$SLURM_JOB_ID' + '\n' \
17511723
'echo Description: $SLURM_JOB_ID executed on $SLURM_NTASKS ' \
17521724

17531725
+ 'processor\'(s)\'. The' + '\n' + 'echo ' \
17541726
+ '\' \' command-line output ' \
17551727
+ 'information may be found below.' + '\n' \
1756-
'echo Author: Vedran Coralic' + '\n' \
17571728
'echo Start-date: `date +%D`' + '\n' \
17581729
'echo Start-time: `date +%T`' + '\n' \
17591730
'echo' + '\n' + 'echo' + '\n' \
@@ -1764,31 +1735,6 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
17641735
't_start=$(date +%s)' + '\n' \
17651736
\
17661737
# Executing job:
1767-
# (Hooke)
1768-
# '/opt/mvapich2/ch3_mrail_gen2-intel12/bin/mpirun ' \
1769-
# + mfc_dir + '/' + comp_name \
1770-
# + '_code' + '/' + comp_name + '\n' \
1771-
# (Darter)
1772-
# 'aprun -n ' + str(pbs_dict['nodes']*pbs_dict['ppn']) + ' ' \
1773-
# + mfc_dir + '/' + comp_name \
1774-
# + '_code' + '/' + comp_name + '\n' \
1775-
# (Thomson)
1776-
# '/share/apps/openmpi-1.4.3/nag_fort/bin/mpirun ' \
1777-
# + mfc_dir + '/' + comp_name \
1778-
# + '_code' + '/' + comp_name + '\n' \
1779-
# (Comet)
1780-
#'ibrun ' \
1781-
# (Stampede)
1782-
# 'ibrun tacc_affinity ' \
1783-
# + mfc_dir + '/' + comp_name \
1784-
# + '_code' + '/' + comp_name + '\n' \
1785-
# (Gordon)
1786-
# 'mpirun_rsh -np ' + str(pbs_dict['nodes']*pbs_dict['ppn']) + ' ' \
1787-
# + '-hostfile $PBS_NODEFILE ' \
1788-
# + mfc_dir + '/' + comp_name \
1789-
# + '_code' + '/' + comp_name + '\n' \
1790-
# \
1791-
# (Richardson)
17921738
'mpirun ' \
17931739
+ mfc_dir + '/' + comp_name \
17941740
+ '_code' + '/' + comp_name + '\n' \

0 commit comments

Comments
 (0)