LS-OPT

Back to documentation index

LS-OPT Versions

There are various LS-OPT versions available on POD. Use the module command to see the available versions. If you need any additional versions installed, please email pod@penguincomputing.com.

[penguin@podmt1 ~]$  module avail lsopt

-------------------------------------------------- /public/modulefiles --------------------------------------------------
lsopt/4.2 lsopt/5.0

Configuring LS-OPT

To configure LS-OPT to submit jobs to the PBS scheduler, one has to provide a custom script to submit the job, and tell LS-OPT that the jobs are executed by the scheduler. This is achieved by setting the appropriate keywords in the LS-OPT command file. For instance

...
solver dyna960 '1'
solver queue pbs
solver command "../../submit_smp_pbs"
solver concurrent jobs 0
...

In the above, the solver is LS_DYNA (solver dyna960 '1'), jobs are run by the PBS queue (solver queue pbs), and the solver command points to a script that submits the LS-DYNA job (sample submission scripts are shown in the Examples section). Note that the path to the submission script is specified relative to the working folder of the LS-DYNA job. This folder is created by LS-OPT at runtime, and the example assumes the script 'submit_smp_pbs' to be located in the same folder as the LS-OPT command file.

The last line (solver concurrent jobs 0) tells LS-OPT to submit all jobs in an iteration concurrently. This is the recommended setting when using a job scheduler.

Running LS-OPT

Once the LS-OPT command file and DYNA submissions scripts are in place, LS-OPT can be run interactively on a MT1 login node. In this way the optimization calculation will be performed on the login node, while the LS-DYNA jobs will be executed on the cluster compute nodes.

To run LS-OPT on the login node type the following commands at the linux prompt:

[penguin@podmt1 ~]$  module load lsopt/4.2
[penguin@podmt1 ~]$  lsopt <command-file>

where <command-file> is the name of the LS-OPT command file

Examples

Sample files for the LS-OPT examples discussed below can be found in /public/examples/lsopt-examples. To run the sample calculation, copy the folder to your home storage then run LS-OPT interactively:

[penguin@podmt1 ~]$  cp -ar /public/examples/lsopt-examples ~
[penguin@podmt1 ~]$  cd ~/lsopt-examples
[penguin@podmt1 ~]$  module load lsopt/4.2
[penguin@podmt1 ~]$  lsopt run.opt

The run will submit a first batch of five LS-DYNA jobs for the first iteration, followed by a sixth job for the second iteration. The whole LS-OPT run will take about 5 minutes.

Using SMP LS-DYNA

Here is a template for using the SMP version of the LS-DYNA solver:

...
solver dyna960 '1'
solver queue pbs
solver command "../../submit_smp_pbs"
solver concurrent jobs 0
...

the submit_smp_pbs script is shown below:

#!/bin/bash 

# Script to generate and submit an smp LS-DYNA job for an LS-OPT run

# Create a job name based on the working dir
jname=dynscr_$(pwd | sed -n 's/.*\/\(.*\)\/\(.*\)/\1\/\2/p')

cat > dynscr << EOF
# 
# dynscr script 
# ======================================================================= 
#PBS -S /bin/bash
#PBS -N ${jname}
#PBS -q H30
#PBS -l nodes=1:ppn=16
# 
module load lsopt/4.2
module load lsdyna/7.1.1
export LSOPT_HOST=${LSOPT_HOST}
export LSOPT_PORT=${LSOPT_PORT}
cd \$PBS_O_WORKDIR
# The input file name is required for LS-OPT 
wrapper smp971 ncpu=\$PBS_NP i=DynaOpt.inp
# ======================================================================= 
EOF

qsub dynscr 

The above script submits the job to the H30 queue. To use the M40 queue two lines need to be changed:

#PBS -q M40
#PBS -l nodes=1:ppn=12

Using MPP LS-DYNA

For MPP LS-DYNA one needs a slightly different submission script:

...
solver dyna960 '1'
solver queue pbs
solver command "../../submit_mmp_pbs"
solver concurrent jobs 0
...

And the submit_mpp_pbs script is shown below:

#!/bin/bash 

# Script to generate and submit an mpp LS-DYNA job for an LS-OPT run

# Create a job name based on the working dir
jname=dynscr_$(pwd | sed -n 's/.*\/\(.*\)\/\(.*\)/\1\/\2/p')

cat > dynscr << EOF
# 
# dynscr script 
# ======================================================================= 
#PBS -S /bin/bash
#PBS -N ${jname}
#PBS -q H30
#PBS -l nodes=1:ppn=16
# 
module load lsopt/4.2
module load lsdyna/7.1.1
export LSOPT_HOST=${LSOPT_HOST}
export LSOPT_PORT=${LSOPT_PORT}
cd \$PBS_O_WORKDIR
# The input file name is required for LS-OPT 
wrapper mpirun mpp971 i=DynaOpt.inp
# ======================================================================= 
EOF

qsub dynscr 

The above script submits a 16 processors job to the H30 queue. One can modify the queue and node selection, for instance:

#PBS -q M40
#PBS -l nodes=4:ppn=12