HyperStudy

Sample Script: Running Solvers Using a Queuing System on Unix

Sample Script: Running Solvers Using a Queuing System on Unix

Previous topic Next topic No expanding text in this topic  

Sample Script: Running Solvers Using a Queuing System on Unix

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

The following is a sample script to run a solver using a queuing system on UNIX. The sample file is set up for running LS-DYNA with the NQS queuing system.

The script contains a ‘wait loop’, which makes sure that the optimization process stops until the solver has completely finished. This is necessary for an optimization study where all analyses must be performed in sequence. The wait loop can be omitted when performing a DOE study. This allows for multiple analyses to be carried out in parallel, with the network queuing system controlling the allocation of resources. The wait loop is checking the d3hsp file for the string "N o r m a l    t e r m i n a t i o n" signaling the end of the solution process. If another solver or queuing system is used, the script needs to be changed accordingly. For optimization studies, the respective ASCII output file should be screened for a string signaling the proper end of the solver run.

The sample script also shows how to include certain post-processing tasks such as translating the results into a HyperMesh result file and deleting files not needed to save disc space.

 

#!/bin/sh

#

#  Set base filename for the optimization study

#

 base=filename

#

#  Set name of the que

#

 que =quename

#

#  Set environment variables for the solver

#

LSTC_FILE=/soft/usr/dyna/pass/v940_902

export LSTC_FILE

#

#  Submit solution to the que

#

(

echo "cd $PWD"

echo "/soft/usr/dyna/v940_902 i=$base.bdf x=99 memory=50000000"

) | qsub -q $que

#

#  Wait for the solver run to be finished. This can be omitted when

#  running a DOE Study. Thereby allowing multiple runs to be performed

#  in parallel, with the queuing system controlling the allocation of

#  resources.

#

MSG=""

while [ "$MSG" = "" ] ; do

 MSG=`grep "N o r m a l    t e r m i n a t i o n" d3hsp 2>/dev/null`

 sleep 30

done

#

#   Post-process data, if necessary (Create HyperMesh result file)

#

/soft/net/hmdyna d3plot $base.res

#

#   Delete data not needed

#

/bin/rm –f d3p* d3d*

#

#   End of script

#