Skip to content

Commit

Permalink
Updated m_python_proxy master script to be more clear about submittin…
Browse files Browse the repository at this point in the history
…g batch jobs
  • Loading branch information
sbryngelson committed Aug 5, 2019
1 parent dd596a2 commit cbbb3ee
Showing 1 changed file with 26 additions and 80 deletions.
106 changes: 26 additions & 80 deletions src/master_scripts/m_python_proxy.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1549,11 +1549,9 @@ def f_execute_mfc_component(comp_name, case_dict, mfc_dir, engine): # ----------
#output, errors = cmd_status.communicate()
else:
f_create_batch_file(comp_name, case_dict, mfc_dir)
# Submit job to queue (Hooke/Thomson/Darter/Gordon)
# Submit job to queue (qsub)
# cmd_status = Popen('qsub ' + comp_name + '.sh', shell=True, stdout=PIPE)
# cmd_status = Popen('qsub -W depend=afterany:442190 ' + comp_name + '.sh', shell=True, stdout=PIPE)
# cmd_status = Popen('qsub -W depend=afterok:442883 ' + comp_name + '.sh', shell=True, stdout=PIPE)
# submit job to queue (Comet/Stampede)
# submit job to queue (sbatch)
cmd_status = Popen('sbatch ' + comp_name + '.sh', shell=True, stdout=PIPE)
output, errors = cmd_status.communicate()
print( '\n' + output)
Expand Down Expand Up @@ -1646,92 +1644,66 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
'#!/bin/sh' + '\n' \
\
# Account to be charged for the job:
# (Darter)
# '#PBS -A TG-CTS120005' + '\n' \
# (Stampede)
# '#SBATCH -A TG-CTS120005' + '\n' \
# (Comet)
#'#SBATCH -A cit129' + '\n' \
# (PBS)
# '#PBS -A xxx' + '\n' \
# (Slurm)
# '#SBATCH -A xxx' + '\n' \
\
# Name of the queue to which the job should be submitted:
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# '#PBS -q ' + str(pbs_dict['queue']) + '\n' \
# (Comet/Stampede)
# (Slurm)
'#SBATCH -p ' + str(pbs_dict['queue']) + '\n' \
\
# Name of the job to be submitted to the scheduler:
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# '#PBS -N ' + comp_name + '\n' \
# (Comet/Stampede)
# (Slurm)
'#SBATCH -J ' + comp_name + '\n' \
\
# Node(s) and processor(s) per node (ppn) for job:
# (Thomson)
# '#PBS -l nodes=' + str(pbs_dict['nodes']) \
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + '\n' \
# (Hooke)
# (PBS)
# '#PBS -l nodes=0' + str(pbs_dict['nodes']) \
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + '\n' \
# (Darter)
# '#PBS -l size=' + str( pbs_dict['nodes']*pbs_dict['ppn'] \
# + min(1,( pbs_dict['nodes'] \
# * pbs_dict[ 'ppn' ] )%16) \
# * (16 - ( pbs_dict['nodes'] \
# * pbs_dict[ 'ppn' ] )%16) ) + '\n' \
# (Gordon)
# '#PBS -l nodes=' + str(pbs_dict['nodes']) \
# + ':ppn=' + str(pbs_dict[ 'ppn' ]) + ':native' + '\n' \
# (Stampede)
# '#SBATCH -n ' + str( pbs_dict['nodes']*pbs_dict['ppn'] \
# + min(1,( pbs_dict['nodes'] \
# * pbs_dict[ 'ppn' ] )%16) \
# * (16 - ( pbs_dict['nodes'] \
# * pbs_dict[ 'ppn' ] )%16) ) + '\n' \
# \
# '#SBATCH -N ' + str( pbs_dict['nodes'] ) + '\n' \
# (Comet)
# (Slurm)
'#SBATCH --nodes=' + str(pbs_dict['nodes']) + '\n' \
'#SBATCH --ntasks-per-node=' + str(pbs_dict['ppn']) + '\n' \
\
# Constrain allocated nodes to single rack for best code efficiency:
# (Comet)
'#SBATCH --switches=1' + '\n' \
\
# Maximum amount of time to commit to the execution of the job:
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# '#PBS -l walltime=' + str(pbs_dict['walltime']) + '\n' \
# (Comet/Stampede)
# (Slurm)
'#SBATCH -t ' + str(pbs_dict['walltime']) + '\n' \
\
# Declare the job rerunable (y) or non-rerunable (n)
# (Hooke/Thomson)
# (PBS)
# '#PBS -r n' + '\n' \
# \
# Output standard output and error in a single file
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# '#PBS -j oe' + '\n' \
# (Comet/Stampede)
# (Slurm)
'#SBATCH -o ' + comp_name + '.o%j' + '\n' \
'#SBATCH -e ' + comp_name + '.o%j' + '\n' \
\
# Notify by email when job begins (b), aborts (a), and/or ends (e):
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# '#PBS -m bae' + '\n' \
# '#PBS -M ' + str(pbs_dict['mail_list']) + '\n' \
# (Comet/Stampede)
# (Slurm)
'#SBATCH --mail-type=all' + '\n' \
'#SBATCH --mail-user=' + str(pbs_dict['mail_list']) + '\n' \
\
#'sleep 30s' + '\n' \
# Total number of processor(s) allocated for job execution
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# 'num_procs=$(cat $PBS_NODEFILE | wc -l)' + '\n' \
\
# Moving to the case directory
# (Hooke/Thomson/Darter/Gordon)
# (PBS)
# 'cd $PBS_O_WORKDIR' + '\n' \
\
# Setting up environment variables for MPI I/O on Cray systems (Darter)
# Setting up environment variables for MPI I/O on Cray systems
# 'export MPICH_PTL_UNEX_EVENTS=400000' + '\n' \
# \
# 'export MPICH_PTL_OTHER_EVENTS=100000' + '\n' \
Expand All @@ -1741,19 +1713,18 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
# 'export MPICH_MPIIO_HINTS=*:romio_ds_write=disable' + '\n' \
# \
# Setting up the output file's header information:
# (Hooke/Thomson/Darter/Gordon)
# 'echo MFC v3.0 - Cases - ' + basename(getcwd()) \
# (PBS)
# 'echo MFC - Cases - ' + basename(getcwd()) \
# + ': $PBS_JOBNAME.o${PBS_JOBID:0:7}' + '\n' \
# 'echo Description: $PBS_JOBID executed on $num_procs ' \
# (Comet/Stampede)
'echo MFC v3.0 - Cases - ' + basename(getcwd()) \
# (Slurm)
'echo MFC - Cases - ' + basename(getcwd()) \
+ ': $SLURM_JOB_NAME.o$SLURM_JOB_ID' + '\n' \
'echo Description: $SLURM_JOB_ID executed on $SLURM_NTASKS ' \

+ 'processor\'(s)\'. The' + '\n' + 'echo ' \
+ '\' \' command-line output ' \
+ 'information may be found below.' + '\n' \
'echo Author: Vedran Coralic' + '\n' \
'echo Start-date: `date +%D`' + '\n' \
'echo Start-time: `date +%T`' + '\n' \
'echo' + '\n' + 'echo' + '\n' \
Expand All @@ -1764,31 +1735,6 @@ def f_create_batch_file(comp_name, case_dict, mfc_dir): # ----------------------
't_start=$(date +%s)' + '\n' \
\
# Executing job:
# (Hooke)
# '/opt/mvapich2/ch3_mrail_gen2-intel12/bin/mpirun ' \
# + mfc_dir + '/' + comp_name \
# + '_code' + '/' + comp_name + '\n' \
# (Darter)
# 'aprun -n ' + str(pbs_dict['nodes']*pbs_dict['ppn']) + ' ' \
# + mfc_dir + '/' + comp_name \
# + '_code' + '/' + comp_name + '\n' \
# (Thomson)
# '/share/apps/openmpi-1.4.3/nag_fort/bin/mpirun ' \
# + mfc_dir + '/' + comp_name \
# + '_code' + '/' + comp_name + '\n' \
# (Comet)
#'ibrun ' \
# (Stampede)
# 'ibrun tacc_affinity ' \
# + mfc_dir + '/' + comp_name \
# + '_code' + '/' + comp_name + '\n' \
# (Gordon)
# 'mpirun_rsh -np ' + str(pbs_dict['nodes']*pbs_dict['ppn']) + ' ' \
# + '-hostfile $PBS_NODEFILE ' \
# + mfc_dir + '/' + comp_name \
# + '_code' + '/' + comp_name + '\n' \
# \
# (Richardson)
'mpirun ' \
+ mfc_dir + '/' + comp_name \
+ '_code' + '/' + comp_name + '\n' \
Expand Down

0 comments on commit cbbb3ee

Please sign in to comment.