2.3.2. Altair’s Sample Script

Altair’s Sample script is not intended to be a full solution for running ANSYS Fluent jobs in PBS Professional, but rather a simple starting point. It runs the jobs out of the directory from which they are submitted (PBS_O_WORKDIR). Care should be taken to submit jobs from locations that are going to be available on any node (perhaps via NFS).

 #!/bin/sh
 cd $PBS_O_WORKDIR
 
 #We assume that if they didn’t specify arguments then they should use the
 #config file if [ "xx${input}${case}${mpp}${fluent_args}zz" = "xxzz" ]; then
   if [ -f pbs_fluent.conf ]; then
     . pbs_fluent.conf
   else
     printf "No command line arguments specified, "
     printf "and no configuration file found.  Exiting \n"
   fi
 fi
 
 #Set up the license information (Note: you need to substitute your own
 #port and server in this command)
 export ANSYSLMD_License_FILE
 
 #Augment the ANSYS Fluent command line arguments case "$mpp" in
   true)
     #MPI job execution scenario
     num_nodes=‘cat $PBS_NODEFILE | sort -u | wc -l‘
     cpus=‘expr $num_nodes \* $NCPUS‘
     #Default arguments for mpp jobs, these should be changed to suit your
     #needs.
     fluent_args="-t${cpus} $fluent_args -cnf=$PBS_NODEFILE"
     ;;
   *)
     #SMP case
     #Default arguments for smp jobs, should be adjusted to suit your
     #needs.
     fluent_args="-t$NCPUS $fluent_args"
     ;;
 esac
 #Default arguments for all jobs
 fluent_args="-ssh -g -i $input $fluent_args"

 echo "---------- Going to start a fluent job with the following settings:
 Input: $input
 Case: $case
 Output: $outfile
 Fluent arguments: $fluent_args"
 
 #run the solver
 /ansys_inc/v182/fluent/bin/fluent $fluent_args  > $outfile

Note that for versions of ANSYS Fluent prior to 12.0, the final line of the sample script should be changed to the following:

  usr/apps/Fluent.Inc/bin/fluent $fluent_args  > $outfile 

Release 18.2 - © ANSYS, Inc. All rights reserved.