Abaqus

From NJIT-ARCS HPC Wiki
Jump to: navigation, search

The following instructions are for running the "ABAQUS/Standard performance benchmark S4d: Cylinder head bolt-up" in parallel on kong.

Load the abaqus module:

module load abaqus

Create a directory for this run:

mkdir abaqus_s4d
cd abaqus_s4d

Get the Abaqus s4d input file:

abaqus fetch job=s4d

Edit the submit script as directed:

#!/bin/bash
###############################################################################
#
# EXAMPLE ABAQUS PARALLEL SCRIPT FOR SGE
# abaqus_submit.sh
# To use, change all of the following to real values:
#     JOB_NAME, QUEUE, UCID, NUMBER_OF_CPUS, /path/to/abaqus/input
# You must also un-comment one of the "module load mpi" lines.
#
# Please see https://wiki.hpc.arcs.njit.edu/ for additional information.
#
# Modified by Basement Supercomputing 1/2/2006 DJE
# Modified for NJIT - AM 18Apr06
# Updated for modules, QRSH_PORT, additional documenation. 31-Aug-2015 /KJW
# Updated for Abaqus 21-Jul-2016 (freely stolen and modified from
# https://service.clustervision.com/content/grid-engine-job-script-example-abaqus )/GW
#
###############################################################################
# Change JOB_NAME to a one-word alphanumeric description. This will be used for
# part of output file name and in status listings.
###############################################################################
#$ -N JOB_NAME

###############################################################################
# Change QUEUE to a valid queue. On kong this would be one of "short",
# "medium", or "long." See https://wiki.hpc.arcs.njit.edu/index.php/KongQueues
# or https://wiki.hpc.arcs.njit.edu/index.php/SthenoQueues for more info
###############################################################################
#$ -q QUEUE

###############################################################################
# Send email when jobs starts and again when it finishes or if it aborts.
###############################################################################
#$ -M UCID@njit.edu
#$ -m abe

###############################################################################
# Use current working directory where "qsub" was invoked.
###############################################################################
#$ -cwd

###############################################################################
# Join stdout and stderr
###############################################################################
#$ -j y

###############################################################################
# Set your number of processors here by changing NUMBER_OF_CPUS to an integer
# value.
#
# Abaqus can use either ompi or threaded environment. The recommended
# environment is "ompi"
#
#      ompi
#      threaded
#
# Abaqus uses it's own Grid Engine aware mpi installation.
###############################################################################
#$ -pe ompi NUMBER_OF_CPUS

###############################################################################
# Run job through bash shell
###############################################################################
#$ -S /bin/bash

###############################################################################
# Load the abaqus module. If using your own subroutine requiring
# the intel compiler load that module as well
###############################################################################
module load abaqus
#module load intel/compiler

###############################################################################
# The following are for reporting only and not really needed to run the job;
# their results will show up in your output file.
# The "mpirun" line is relevant only to the mpich2 parallel environment.
###############################################################################
echo "Got $NSLOTS processors."
echo "cwd=$(pwd)"

###############################################################################
# Define Abaqus particulars of this run:
###############################################################################
ABAQUS_PROGRAM=abaqus
ABAQUS_INPUT=/path/to/abaqus/input
ABAQUS_JOBNAME=ABAQUS_${JOB_ID}
ABAQUS_ARGS=""
ABAQUS_SCRATCH_DIR=/scratch/

###############################################################################
# To manage abaqus jobs, you need to catch signals
# and use "abaqus terminate" to stop the job
###############################################################################
exit_gracefully () {
  abaqus terminate job=$ABAQUS_JOBNAME
  echo Abaqus job $ABAQUS_JOBNAME terminated
  exit
}
###############################################################################
# Invoke abaqus in the background on the compute node:
###############################################################################
trap exit_gracefully SIGUSR2

###############################################################################
# Use this for MPI (distributed memory) parallelism
###############################################################################
$ABAQUS_PROGRAM cpus=$NSLOTS mp_mode=mpi job=$ABAQUS_JOBNAME input=$ABAQUS_INPUT scratch=$ABAQUS_SCRATCH_DIR $ABAQUS_ARGS

###############################################################################
# now sleep until lock file disappears
###############################################################################
sleep 60
while [ -f ${ABAQUS_JOBNAME}.lck ]; do
sleep 5
done

Submit the script:

qsub abaqus_submit.sh