Skip to content

Commit 0447b26

Browse files
author
Chris Bording
committed
cp abaqus explicit to zeus examples directory
1 parent aedefe8 commit 0447b26

2 files changed

Lines changed: 170 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash --login
2+
# This is the README file is an executable script.
3+
# To run type: ./README
4+
#
5+
# Example OBJECTIVE: to demostrate how to run ABAQUS with a simple example
6+
# on Zeus with the explicit solvers.
7+
#
8+
# E3.inp: This benchmark consists of forming a sheet metal part by the deep drawing process.
9+
# The deformable sheet metal blank is meshed with shell elements of type S4R and uses an
10+
# isotropic hardening Mises plasticity material model. The tools are meshed using surface
11+
# elements of type SFM3D4R which are declared rigid. General contact is defined between the
12+
# blank and tools. The analysis sequence consists of two steps. During the first step the
13+
# blank is clamped between the binder and die and then during the second step the punch is
14+
# displaced to form the part. Since the process is essentially quasi-static the computations
15+
# are performed over a sufficiently long time period to render inertial effects negligible.
16+
# The performance of this analysis is a direct measure of the performance of the
17+
# three-dimensional general contact algorithm.
18+
19+
cp $GE_DIR/src/abaqus/e3.inp .
20+
21+
# To run this code load the necessary modules.
22+
# and specify the total number of MPI processes.
23+
24+
# SLURM directives
25+
#
26+
# Here we specify to SLURM that we want 2 nodes
27+
# "#SBATCH --nodes=2"
28+
# Then, to specify the queue or "partition" to --partition=workq
29+
# "#SBATCH --partition=workq"
30+
# To ensure that we have a correct defined environment use
31+
# "#SBATCH --export=NONE"
32+
33+
# we need to load the abaqus module as shown below:
34+
module load abaqus
35+
36+
# To submit the job to Zeus
37+
echo "commmand to submit the slurm script is "
38+
echo "sbatch abaqus_explicit.slurm"
39+
jobid=`sbatch abaqus_explicit.slurm | cut -d " " -f 4`
40+
41+
echo "The sbatch command returns what the jobid is for this job."
42+
echo "To check the status of your job, use the slurm command:"
43+
echo "squeue -u $USER"
44+
echo " "
45+
echo "Your job will be run in $MYSCRATCH/run_helloOmpC_gnu/${jobid}."
46+
echo " "
47+
echo "Your results will be saved in ${MYGROUP}/helloOmpC_gnu_results_zeus/${jobid}"
48+
echo "and the scratch directory will then be deleted."
49+
echo " "
50+
echo "To check the results change to your jobid directory, type:"
51+
echo "cd ${MYGROUP}/helloOmpC_gnu_results_zeus/${jobid}"
52+
echo " "
53+
echo "To view the results, use the cat command and type:"
54+
echo "cat helloOmpC_gnu.log"
55+
echo " "
56+
echo " PAWSEY user shortcuts! "
57+
echo '$MYSCRATCH' "is an environment variable it is set to $MYSCRATCH"
58+
echo '$MYGROUP' "is an environment variable it is set to $MYGROUP"
59+
echo " example: cd \$MYGROUP "
60+
echo " "
61+
echo "more information about Zeus/Zython can be found at:"
62+
echo " https://support.pawsey.org.au/documentation/pages/viewpage.action?pageId=2162999"
63+
echo " "
64+
echo "more information about SLURM and aprun can be found at:"
65+
echo " https://support.pawsey.org.au/documentation/display/US/Scheduling+and+Running+Jobs"
66+
echo " "
67+
echo " "
68+
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash --login
2+
#SBATCH --job-name=e3_GE-abaqus-mpi
3+
#SBATCH --partition=workq
4+
#SBATCH --account=pawsey0001
5+
#SBATCH --cpus-per-task=16
6+
#SBATCH --nodes=2
7+
#SBATCH --time=01:00:00
8+
##SBATCH --output e3_abaqus-mpi.%j.out
9+
##SBATCH --error e3_abaqus-mpi.%j.err
10+
11+
# Default loaded compiler module is gcc module
12+
# load the necessary modules to compile with GNU
13+
module load abaqus
14+
15+
# leave in, it lists the environment loaded by the modules
16+
#module list
17+
18+
# Note: SLURM_JOBID is a unique number for every job.
19+
# These are generic variables
20+
INPUT=e3
21+
SRC_DIR=${SLURM_SUBMIT_DIR}
22+
EXECUTABLE=abaqus
23+
SCRATCH=$MYSCRATCH/run_abaqus-mpi/$SLURM_JOBID
24+
RESULTS=$MYGROUP/abaqus-mpi-results_zeus/$SLURM_JOBID
25+
unset SLURM_GTIDS
26+
###############################################
27+
# Creates a unique directory in the SCRATCH directory for this job to run in.
28+
if [ ! -d $SCRATCH ]; then
29+
mkdir -p $SCRATCH
30+
fi
31+
echo SCRATCH is $SCRATCH
32+
33+
###############################################
34+
# Creates a unique directory in your GROUP directory for the results of this job
35+
if [ ! -d $RESULTS ]; then
36+
mkdir -p $RESULTS
37+
fi
38+
echo the results directory is $RESULTS
39+
40+
################################################
41+
# declare the name of the output file or log file
42+
43+
OUTPUT=abaqus_${INPUT}_mpi
44+
45+
#############################################
46+
# Copy input files to $SCRATCH
47+
# then change directory to $SCRATCH
48+
cp ${INPUT}.inp $SCRATCH
49+
50+
cd $SCRATCH
51+
52+
######################################
53+
# create the abaqus_v6.env file
54+
envFile=abaqus_v6.env
55+
56+
# The number of processors/cores per node
57+
ncpus=`echo $SLURM_CPUS_PER_TASK`
58+
# | cut -c1-2`
59+
echo cpu per task $SLURM_CPUS_PER_TASK
60+
echo "number of cores per nodes ${ncpus}"
61+
# total number of cores
62+
echo "total number of nodes $SLURM_NNODES"
63+
ncores=`expr $SLURM_NNODES \* $ncpus`
64+
echo "total number of cores is $ncores"
65+
# file of the node lists
66+
node_list=ABAQUS_NODES
67+
68+
srun hostname | sort > $node_list
69+
echo 'the node list is $node_list'
70+
mp_host_list="["
71+
for i in $(cat ${node_list}) ; do
72+
mp_host_list="${mp_host_list}['$i', $ncpus],"
73+
done
74+
echo host list ${mp_host_list}
75+
mp_host_list=`echo ${mp_host_list} | sed -e "s/,$//"`
76+
mp_host_list="${mp_host_list}]"
77+
78+
export mp_host_list
79+
#Write the environment variables to abaqus_v6.env
80+
echo "import os" > ${envFile}
81+
echo "os.environ['ABA_BATCH_OVERRIDE'] = '1'" >> ${envFile}
82+
echo "verbose=1" >> $envFile
83+
echo "mp_host_list=${mp_host_list}" >> ${envFile}
84+
echo "mp_mpi_implementation=PMPI" >> ${envFile}
85+
#
86+
87+
abaqus job=$OUTPUT input=$INPUT cpus=$ncores \
88+
standard_parallel=all mp_mode=mpi interactive
89+
90+
#############################################
91+
# move entire scratch directory to the unique results directory
92+
# note this can be a copy or move
93+
mv *.dat *.abq *.m* *.odb *.res *.p* *.s* ${RESULTS}
94+
95+
cd $HOME
96+
97+
###########################
98+
# Clean up $SCRATCH
99+
100+
rm -r $SCRATCH
101+
102+
echo abaqus-mpi job finished at `date`

0 commit comments

Comments
 (0)