2.3. Preview

What is preview?

The Preview process is a tool to help monitor from a locally running job. There are two directives for Preview

  1. Preview Import - Import attaches files to a d3view simulation at a regular interval
  2. Preview Generate Generates a tsv file to look at the changing variable of the running job in a easily viewed format.

Requirements

  • Python 2.7 (Latest release of Python 2.7 can be found here)
  • Lucy
  • Connection to d3VIEW

Configure preview

Preview is configured by managing the d3view.json file in the ${LUCY_HOME}/etc/config directory.

The d3view.json file can be modified to change which files will be uploaded to d3VIEW from the compute node. To change this modify the section titled "preview":. By default the section looks as follows:

"preview": {
  "included_files": {
    "global": {
      "types": [
        "image",
        "curve"
      ],
      "extensions": [
        "txt",
        "log",
        "tsv"
      ]
    },
    "lsdyna": {
      "types": "dyna_d3plot"
    }
  }
}

The included files section lists all included files by type or by extension. To add a solver type, add a new tag under included_files. This tag should match the name of the solver.

The global tag affects all solvers.

types are specified as mimetypes, which are also defined in the d3view.json file.

extensions are specified as file extensions, the part of the filename that comes after the last ‘.’ for example ‘txt’ in ‘solver_1.txt’

Preview Import

How to run

The Preview tool is used by invoking Lucy, and specifying the arguments needed to monitor a job. The most basic command is as follows:

$ lucy preview import ``<<USERNAME>>`` ``<<APPLICATION_NAME>>`` ``<<SOLVER_LOG_FILE>>`` -d3view-url http://d3VIEW-internal.com -a ``<<API_KEY>>``

lucy preview import import USERNAME import APPLICATION_NAME import SOLVER_LOG_FILE import -d3view-url http://d3VIEW-internal.com import -a <<API_KEY>>

If you don’t have a job.json file prepared, one will automatically be created after running the command with the keyword arguments outlined below.

Import Arguments

Preview comes with a number of arguments to allow flexibility when sending data from different kinds of jobs.

All arguments are shown directly below, with links to their sections.

Parameter name When required
   
`Preview Import Positional arguments`_  
import USERNAME Always required
import APPLICATION_NAME Always required
import SOLVER_LOG_FILE Always required
   
`Preview Import Connection arguments`_  
import -d3view-url Always required
import -d3view-port Always required
import -a, import -api-key Always required
   
`Preview Import Simulation arguments`_  
import -s, import -hpcserver-name  
import -project-id  
import -loadcase-name  
import -loadcase-id  
import -r, import -response-template  
import -n, import -name, import -job-name  
import -d, import -description, import -job-desc  
import -vd, import -variable-definition,  
   
`Preview Import Additional arguments`_  
import -job-json  
import -job-id  
import -simulation-id  

These arguments are required for the application to be able to run, and should be specified in order.

USERNAME

d3VIEW user name.

APPLICATION_NAME

Name of application/solver

SOLVER_LOG_FILE

Name of the log file the solver will write to. Used in generating preview.tsv.

These Arguments are required for the application to be able to log into d3VIEW.

-d3view-url

The url to d3VIEW. Such as http://d3VIEW-internal.com (Note: do not include port number if shown, that is the next parameter.)

-d3view-port

The port to d3VIEW, if it is not 80, this should be set.

-a, -api-key

The `API Key`_ found in d3VIEW.

-s, -hpcserver-name

The name of the `HPC server`_ (in d3VIEW) that the simulation is going to be created on.

-project-id

The name of the d3VIEW project that the simulation should be part of.

-loadcase-name

The name of the d3VIEW loadcase that will be attached to the simulation.

-loadcase-id

The id of the loadcase in d3VIEW.

-r, -response-template

The name of the response template to apply

-n, -name, -job-name

The name of the simulation. If set to 'auto', Preview Import will name the simulation as a combination of the working directory and the parent directory.

If the folder structure is:

root
 ├ stage1
 │  ├ 1.1 (working directory)
 │  │  ├ main_input_file.k
 │  │  └ additional_input_file.key

The simulation will be named stage1_1.1. This is especially useful for LS-OPT where multiple simulations will be submitted from the same LS-OPT job.

-d, -description, -job-desc

The description of the simulation

-vd, -variable-definition

Path to the variable definition file.

-job-json

This option allows loading all parameters from a job.json file instead of having a large command.

The contents of the job.json file should look like:

{
  "api_url": "<URL>",
  "api_port": "<PORT>",
  "username": "<USER_NAME>",
  "api_key": "<API_KEY>",
  "hpcserver_name": "<SERVER_NAME>",
  "solver_type": "<SOLVER_TYPE>",
  "response_template": "<RESPONSE_TEMPLATE>",
  "job_name": "<JOB_NAME>",
  "job_description": "<DESCRIPTION>",
}
-job-id

The job id used to connect to an existing simulation.

-simulation-id

The simulation id used to connect to an existing simulation.

Preview Generate

How to run

The Generate directive is used by invoking Lucy, and specifying the arguments needed to generate a tsv. The most basic command is as follows:

$ lucy preview generate ``<<APPLICATION_NAME>>``

lucy preview generate generate APPLICATION_NAME

Generate Arguments

All arguments are shown directly below, with links to their sections.

Parameter name When required
   
`Preview Generate Positional arguments`_  
generate APPLICATION_NAME Always required
   
`Preview Generate Additional arguments`_  
generate -solver-log-file  

These arguments are required for the application to be able to run, and should be specified in order.

APPLICATION_NAME

Name of application/solver

These Arguments are required for the application to be able to log into d3VIEW.

-solver-log-file

Name of the log file the solver will write to. Used in generating preview.tsv.