How can I run a pyensight script in parallel

I have a pyensight script (attached) that runs serially on HPC systems ... it processes LS DYNA data and takes about 15 minutes to output an AVI movie. I would like to run this script in parallel.
I can run client-server sessions of EnSight, connecting to the system where my data is located. I thought that if I could kick off a session where I have several nodes, and several processes per node - then load the script through the COMMAND interface, it might run in parallel using the resources allocated by PBS Pro settings of the job. However, I am unsuccessful in finding a way to run this script from within a client-server session. The only way I know to execute the script is from the command line:
% cpython my_pyensight_script.py
Basically, I am looking for instructions for executing the script in a parallel manner that would speed up processing the files.
- Can the script be modified to run in parallel?
- Is there a way to launch the script from a parallel ensight client-server session?
Thanks for any suggestions ...
Answers
-
Hi @richwalt I'm not sure I understand, what's to stop you from turning the mechanisms in your python script into a Python module which you could then call in a second script which contains multiprocessing logic etc.?
0 -
If you are using 2024R2/2025R1, then the following PyEnSight launch command could work:
session = LocalLauncher(use_sos=5,additional_command_line_options='--rsh=ssh,--np=5,--mpi=openmpi,--cnf=hostfile').start()
Here, there are 4 EnSight Servers being launched (5 includes the SoS). The file ‘hostfile’ contains a list of atleast 2 machines on which EnSight will be run.
The 'additional_command_line_options' does allow you to pass the command line options that you would have done in regular EnSight running.
In 2025R2, we have worked a bit more on this command line option to simplify the launch a bit more.
Note, that this operation is just replicating the Single Client, Multiple Servers to handle the dataset. Temporal SoS for large number of timestep transients, while Spatial SoS for large element count parallel. Note, this does NOT parallelize the client. If your post processing is bound by client rendering, or transfer from server to client, these SoS options are unlikely to help significantly.
0