LS-PrePost

From TRACC Wiki
Revision as of 18:10, February 3, 2021 by Amiot (talk | contribs) (Created page with "=== Getting started === Before you use LS-PrePost on TRACC cluster you will need to load module: module load ls-dyna/base To start LS-PrePost 2.4, use the command "lspp24"....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Getting started

Before you use LS-PrePost on TRACC cluster you will need to load module:

module load ls-dyna/base

To start LS-PrePost 2.4, use the command "lspp24".

To start LS-PrePost 3.0, use the command "lspp30".

To start LS-PrePost 3.1, use the command "lspp31".

To start LS-PrePost 4.0, use the command "lspp40".

To start LS-PrePost 4.1, use the command "lspp41".

Examples:

To open an input file in LS-PrePost 3.0 from command line, use the command "lspp30 my_input_file.k"

To open a binary output file in LS-PrePost 2.4 from command line, use the command "lspp24 d3plot"

File:Lspp.png
LS-PrePost on TRACC Cluster

Introduction

LS-PrePost can be used for extracting data in an optimization sequence. As an optimization often needs numerous simulations
to be carried out, it is preferred to use several cluster nodes which causes problems, if eg. images are to be printed showing eg. stress distributions or such.


The following is referenced from http://alpha.iprod.auc.dk/wiki/index.php/Prepost_without_graphics and is valid for versions 3.x and up.

Extracting non-graphical data

If LS-PrePost is to be used for extracting eg. curve data, there should be no problem using the regular "blind" prepost by setting up a command-file (see command file) and then issuing the command:

lsprepost -nographics c=command.file

where the command file could contain something like:

ascii glstat open "./glstat" 0
ascii glstat plot 1/2
xyplot 1 savefile curve_file "./test.curve" 1 all 

Extracting graphical data

If you want to extract graphical data, the -nographics option will not do, as prepost needs an framebuffer / screen provided by the X-server to draw the graphics (bonus linux info at wikipedia ).
This requires a little magic including a dummy framebuffer, on which the LS-PrePost graphics are then drawn and later on copied from to the output graphics file.


Linux pr default sends all its graphic program output to the display specified in the shell variable $DISPLAY. The current value of this variable can be found using the "echo" command:

$  echo $DISPLAY
localhost:17.0

You can save the value of the variable into another temporary variable using:

$  export DISPLAYTEMP=`echo $DISPLAY`

Be aware that back-tics are used on the right side! On a danish keyboard layout this is made as "shift" + the button left to backspace.


A virtual frame-buffer is started using:

Xvfb :7 -ac -screen 0 1600x1200x24 &

where "7" is the number of the framebuffer and "1600x1200x24" is the resolution and color depth.


The display variable is now set to the new virtual frame-buffer as:

$  export DISPLAY=:7.0


Prepost can now be started using a command file, as the mouse is not available as input

$  prepost c=command.file /path/to/binaryInputFile


When the PrePost session is over, the display variable is set back to the default value using

export DISPLAY=`echo $DISPLAYTEMP`


A complete shell script for a blind LS-PrePost session could then be saved to "blindpost.sh"

DISPLAYTEMP=`echo $DISPLAY`
Xvfb :7 -ac -screen 0 1600x1200x24 &
DISPLAY=:7.0
prepost c=command.file /path/to/binaryInputFile
DISPLAY=`echo $DISPLAYTEMP`
killall Xvfb

The "export" statement is not needed within command-files but only when executed directly from the terminal.