2.4. Publishing

What is publishing?

The Publish process is a tool to help send files from a completed job to d3VIEW.

Requirements

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

Configure publishing

Publishing 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 "publisher":. By default the section looks as follows:

"publisher": {
  "included_files": {
    "global": {
      "types": [
        "image",
        "curve",
        "cad"
      ],
      "extensions": [
        "txt",
        "log",
        "tsv"
      ]
    },
    "lsdyna": {
      "types": [
        "dyna_d3plot",
        "dyna_binout",
        "dyna_d3hsp"
      ],
      "grouped_curves": [
        {
          "name": "energy",
          "curves": [
            "internal_energy",
            "total_energy",
            "kinetic_energy",
            "spring_and_damper_energy",
            "hourglass_energy",
            "sliding_interface_energy"
          ]
        },
        {
          "name": "eroded_energy",
          "curves": [
            "eroded_kinetic_energy",
            "eroded_internal_energy",
            "eroded_hourglass_energy"
          ]
        },
        {
          "name": "joint and total",
          "curves": [
            "joint_internal_energy",
            "total_energy"
          ]
        }
      ]
    }
  }
}

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’

grouped_curves can be defined for each solver. When publishing, the selected curves will be grouped into a single response where the name matches the name of the group, and the curves included will match each curve in the curves list.

How to run

The Publish tool is used by invoking Lucy, and specifying the arguments needed to publish files to a simulation job. The most basic command is as follows:

$ lucy publish ``<<USERNAME>>`` -d3view-url http://d3VIEW-internal.com -a ``<<API_KEY>>``

lucy publish publish USERNAME publish -d3view-url http://d3VIEW-internal.com publish -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.

Arguments

Publish 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
   
publish Positional arguments  
publish USERNAME Always required
   
publish Connection arguments  
publish -d3view-url Always required
publish -d3view-port Always required
publish -a, publish -api-key Always required
   
publish Simulation arguments  
publish -hpcserver-name  
publish -project-id  
publish -loadcase-name  
publish -loadcase-id  
publish -solver-type  
publish -solver-log-file  
publish -r, publish -response-template  
publish -n, publish -name, publish -job-name  
publish -d, publish -description, publish -job-desc  
publish -vd, publish -variable-definition,  
   
publish Additional arguments  
publish -job-json  
publish -job-id  
publish -simulation-id  

Publish Positional arguments

This argument is required for the application to be able to run, and must always be specified.

USERNAME

d3VIEW user name.

Publish Connection arguments

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.

Publish Simulation arguments

-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.

-t, -solver-type

The type of solver that was run, such as lsdyna

-solver-log-file

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

-r, -response-template

The name of the response template to apply

-n, -name, -job-name

The name of the simulation. If set to 'auto', Publish 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.

Publish Additional arguments

-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.