-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenericAbqScript.sh
executable file
·184 lines (151 loc) · 5.59 KB
/
genericAbqScript.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
# ====================================================================================
# Name: cpuScale.sh
# Description: This script will launch a series of Abaqus jobs based on core count and
# other parameters passed beloew
# Author: Nick Southorn
# Last mod: 05/04/19
# Updated help file
# ====================================================================================
# This script will launch a series of Abaqus jobs based on core count and other
# parameters passed below.
# Specify the total number of cores for the PBS job including any hyperthreads
CoreCounts="72"
#CoreCounts="48 24 72 96 12"
#CoreCounts="144 " # 120 96 72 48 24"
# Specify the total number of cores per node with/without hyperthreads
# Compute node with 12phys cores plus 12vthreads, set PPN=12 only using phys
# cores. If using phys cores plus hyperthreads set PPN=24.
PPN=24
# Specify the scratch location where the job will run on the compute node
# if a local drive exists on the compute node then use the /scratch file system
# for large jobs which are I/O bound. A "./" will write to the current NFS directory.
SCRATCH_LOC="/nas/sshaw"
# Estimate the termination wallclock time in HH:MM:SS
EST_WALLCLOCK_HH_MM_SS="4:0:0"
# Specify the full path location of the Abaqus binary
ABQ_BIN=/data/apps/abaqus/6.13-3/code/bin/abq6133
# Do you want to preserve the result files like *.prt,*.odb,*.stt,*.abq,*.res,*.sim?
# PRESERVE_RESULT_FILES=1 (yes)
# The above files can be GBs in size so the default is 0 (no)
PRESERVE_RESULT_FILES=0
# To specify additional group options like vnode or mem required for the job
# Valid options to pass are: ":vnode=[node]", ":mem=[mem in kb]" or "" for nothing
# Examples are: ":vnode=n031", ":mem=99197516kb" or "" for nothing
PBS_SELECT_GRP=""
# list the input file for each job seperated with a space ie. job1.inp job2.inp
MASTER_INP="Block_Stud_28-84kn.inp "
# list the following include files below seperated with a space or by \
# examples:
#ADDITIONAL_BMARKFILES="ABQ_test_AFRAME.include ABQ_test_BC.include"
# Or the following is valid
#ADDITIONAL_BMARKFILES=" \
# ABQ_test_AFRAME.include \
# ABQ_test_BC.include "
ADDITIONAL_BMARKFILES=""
# list any additional abaqus support file needed to be part of the job
ABA_SUPPORT_FILES="abaqus_v6.env"
#PBS queue
queue=feaq
#####################################################
##### do not modify anything below this comment line #####
#####################################################
TIMEFMT="--format=Elapsed: %e User: %U System: %S (U+S)/E: %P MaxRSS: %M"
Create_QUEFILE()
{
cat <<PBS > qs_aba_${NPES}c_${TCASE}
#!/bin/bash
#PBS -N customer${NPES}c
#PBS -l select=${NNODES}:ncpus=${PPN}:mpiprocs=${PPN}:sales_op=none
#PBS -l place=scatter:excl
#PBS -l walltime=${EST_WALLCLOCK_HH_MM_SS}
#PBS -j oe
#PBS -q feaq
cd \${PBS_O_WORKDIR}
. /usr/share/modules/init/bash
module purge
module load intel-tools-13
ORIG_PBS_O_WORKDIR=\${PBS_O_WORKDIR}
NEW_PBS_O_WORKDIR=${SCRATCH_LOC}/\${PBS_JOBID}
# Create a new working directory
if [ ! -d "\${NEW_PBS_O_WORKDIR}" ]; then
mkdir -vp \${NEW_PBS_O_WORKDIR}
if [ \$? -ne 0 ]; then
echo -e "\nERR: failed to create new working directory, \${NEW_PBS_O_WORKDIR}. Exiting...\n"
exit
fi
fi
# Copy input & support files to new working directory
err_stat=0
for aba_file in ${MASTER_INP} ${ADDITIONAL_BMARKFILES} ${ABA_SUPPORT_FILES}
do
if [ -f \${aba_file} ]; then
cp -vp \${aba_file} \${NEW_PBS_O_WORKDIR}
if [ \$? -ne 0 ]; then
echo -e "\nERR: An error occured while copying \${aba_file} file. \n"
err_stat=\$(( \${err_stat} + 1 ))
fi
else
echo -e "\nERR: File \${aba_file} does not exist. \n"
err_stat=\$(( \${err_stat} + 1 ))
fi
done
if [ \${err_stat} -ne 0 ]; then
echo -e "\nFATAL ERROR: \${err_stat} failures occured during the copying of files. Exiting...\n"
exit
fi
# Set PBS working directory to new location
export PBS_O_WORKDIR=\${NEW_PBS_O_WORKDIR}
# Change directory to new location
cd \${PBS_O_WORKDIR}
#Run Abaqus
(/usr/bin/time "${TIMEFMT}" ${ABQ_BIN} j=${TCASE}_${comment} interactive input=${INPFILE} cpus=${NPES} scratch='./' ) >& ${TCASE}_${comment}.log
# Cleanup and copy result files back to orignal PBS Wk dir
if [ ${PRESERVE_RESULT_FILES} ]; then
rm -f *.mdl *.pac *.prt *.odb *.sel *.stt *.abq *.res *.fil *.sim *023
fi
cp -p ${TCASE}_${comment}* \${ORIG_PBS_O_WORKDIR}
rm -vrf \${NEW_PBS_O_WORKDIR}
#
export PBS_O_WORKDIR=\${ORIG_PBS_O_WORKDIR}
cd \${PBS_O_WORKDIR}
PBS
}
DEPEND=""
dependcnt=0
NoJOBS=$( echo ${MASTER_INP} | wc -w )
echo -e "\nSubmitting ${NoJOBS} jobs to PBS Queue.\n"
for INPFILE in ${MASTER_INP}
do
for NPES in ${CoreCounts}
do
dependcnt=$(( $dependcnt + 1))
NNODES=$(( ($NPES + $PPN - 1 ) / $PPN ))
comment=sgi_${NPES}c_\${PBS_JOBID}
TCASE=$( echo ${INPFILE} | cut -d'.' -f1 )
Create_QUEFILE
if [ $dependcnt -gt 2 ]; then
CMD="qsub ${DEPEND} qs_aba_${NPES}c_${TCASE}_gpu"
else
CMD="qsub qs_aba_${NPES}c_${TCASE}"
fi
PrevJOBID=$( ${CMD} | cut -f1 -d'.' )
DEPEND="-W depend=afterany:${PrevJOBID}"
printf "Parameters passed:\n"
printf "\t Num Cores: ${NPES}\n"
printf "\t Cores/Node: ${PPN}\n"
printf "\t Num Nodes: ${NNODES}\n"
printf "\t PBS Queue: ${queue}\n"
printf "\t Scratch Loc: ${SCRATCH_LOC}\n"
printf "\t Est Walltime: ${EST_WALLCLOCK_HH_MM_SS}\n"
printf "\t Master INP: ${INPFILE}\n"
printf "\tAbaqus Binary: ${ABQ_BIN}\n"
printf "\tAbaqus Support Files: ${ABA_SUPPORT_FILES}\n"
printf "\t Additional Files: ${ADDITIONAL_BMARKFILES}\n"
printf "\n"
done
dependcnt=0
done
#=====================================================================================
# END OF FILE
#=====================================================================================