Ansys Job Submission on hopper:

  • For Ansys there is no graphical user interface provided
  • You must submit your job in batch mode using qsub
  • A sample linux script is provided and you may change source file name and output file name
  • You can change number of processors and number of nodes according to your need
  • In your input file that calls the model file from inside, you can add the following lines on the top

       /BATCH
       resume, model.db

your script begins here

#!/bin/sh
#name the program, your default output error file are S.oJobid
#and D0005.eJobid
#PBS -N /home/username/Ansys
#follwing 2 lines ensures that you'll be notified by email when your job is done
#PBS -M username@auburn.edu
#PBS -m abe
#you are asking for 1 node 16 processor each, 16 processor as a total for 50hrs
#after 50 hours your job will be killed
#PBS -l nodes=1:ppn=1,walltime=70:00:00
#your directory path that can be obtained by pwd
#PBS -d /home/username/Ansys
#loading variables do not change this

export PATH=/tools/licensed/ansys-17.0/v170/ansys/bin:$PATH

#writing mpd_nodes to boot mpd in these nodes and conf_file to select processors
`sort -u $PBS_NODEFILE > mpd_nodes`

#assignin nhosts variable to number of nodes
nhosts=`cat mpd_nodes | wc -l`

#generating conf_file to select processors
`sort $PBS_NODEFILE > conf_file`
proc=`cat conf_file | wc -l`

#printing initial timestamp
date > out.txt

#printing which host performed computation
/bin/hostname >> out.txt

#executing ansys with 16 processor, < your input file that call model file inside from it >> your output file
/tools/licensed/ansys-17.0/v170/ansys/bin/ansys170 -b -np $proc < example-apdl-file.txt>> out.txt


#end time stamp

date >> out.txt

end of your script

  • Create a directory using "mkdir Ansys"
  • Go to that directory using "cd Ansys"
  • Use the "nano" editor to create the file above:  nano run_ansys.sh
  • Make changes in your script (e.g. change 'username' to your username)
  • Use Ctrl + x to exit nano (you will be prompted to save your changes).
  • Make sure it is executable by "chmod 755 run_ansys.sh"
  • Submit the job using "qsub ./run_ansys.sh"
  • Use the "showq" command to see if your job is running
  • You can terminate the session using "exit" but your job will be running.
  • You will be notified by email when your job completes.
  • You should use SCP to transfer the result files back to your local computer

Basic Example files to go with the run_ansys.sh above are provided below.  Upload them to your Ansys folder on the hopper cluster:

example-apdl-file.txt

write-results.txt