ParaView/AdiosStage

From KitwarePublic
Jump to navigationJump to search

How To Run a Stage use case with ParaView

Introduction

All the informations and paths provided are based on the jaguarpf computer. To get more informations on how to build ParaView itself on such computer, please refere to another documentation (ParaView/Jaguarpf). This documentation intend to explain how and which script/job should be started on jaguarpf and how to connect to the running application with a ParaView client and connect to it.

Client Setup

To be able to connect to the Jaguarpf ParaView server, you will need a ParaView 3.8.0 client with the AdiosReader plugin. Once this pre-requisit has been fulfill, you will need to had a macro that will allow you to create the AdiosReader with the proper parameter as well as updating the Reader itself to read the next staging timestep.

 # =============
 # All-in-one macro
 # file: AdiosStageReader.py
 # =============
 from paraview.simple import *
 
 if (FindSource("AdiosReader") == None):
    reader = ADIOSReader(guiName="AdiosReader", ReadMethod = 2, FileName = "pixie3d.bp")
    Show(reader)
 
 FindSource("AdiosReader").InvokeCommand("Poll")
 Render()
 

To register a file as a Macro, go in the menu "Tools -> Python Shell". In the directoy view on the right, select the file that you created and click on the "Add Macro" button. At that point, you should have seen a Toolbar button named with the filename. It's your Macro.

Once the Macro has been registered inside ParaView, you should be able to initiate a Client/Server mode that will wait the server to connect to it. To do so:

- click on the "Connect to" button in the toolbar.
- (only once, otherwise just 'Connect' to Jaguarpf)
    - Add Server
       - Name         : Jaguarpf 
       - Server Type  : Client / Server (reverse connection)
       - Port         : 11111
    - Configure Server
       - Startup Type : Manual

At that point, your ParaView is waiting for external connection. You will just need to wait till the server has been started on Jaguarpf to connect into it.

Once the server is connected, you will have to

- Load the AdiosReader plugin (MPI)
- Execute the Macro 
- Setup your visualization pipeline
- Execute the Macro again to go to the next Timestep.
  • Caution: Once, the job reach is time limit on the Server, the ParaView server will be killed, therefore, the client won't be able to interact anymore with the data.

Server Setup

I've created 2 scripts to ease the demo setting on the Jaguarpf for your account. One is used to install/copy the necessary files from /ccs/proj/csc025/jourdain to your /tmp/work/$USER directory. And the other one is used to automatically set the IP address of the front node to forward ParaView communication to it.

Even if I simplified the procedure, you will still need to setup some port forwarding to allow the ParaView server to connect to your client. Depending on the access that you have to Jaguarpf, you may be able to simplify this whole network configuration.

Installing the files

In order to install the environment for the demonstration, you will need to login to Jaguarpf and execute the /ccs/proj/csc025/jourdain/install-work.sh script that will create 2 directories in your /tmp/work/$USER one. The "pythonhome" and "run-staging-paraview" directory will be filled by a set of preconfigured files. The "pythonhome" one is used for ParaView when used in Batch mode with Python scripting. The "run-staging-paraview" directory contains the job and the Pixie/Pixplot executable that are going to be queued for the demonstration.

Basically when all the settings will be completed, the commands line that you will have to do will be:

 > cd /tmp/work/$USER/run-staging-paraview
 > qsub job

But before that, make sure you setup the network correctly so the ParaView server will be able to contact your ParaView client.

Networking configuration

In-site setting

This configuration is meant for you if Jaguarpf can directly connect to your computer without bouncing to the login nodes. To do so, you will need to edit the lines host and maybe port of the file /tmp/work/$USER/run-staging-paraview/job like shown in the following snippet.

  ...
  # Start Readtest
  pvserver_exe=/ccs/proj/csc025/jourdain/ParaView-3.8.0/bin/pvserver
  export PYTHONHOME=/tmp/work/$USER/pythonhome
  export PYTHONPATH=/tmp/work/$USER/pythonhome/lib
  host=10.32.70.161
  port=11111
  echo "-- Start pvserver"
  ...

Once this file changed and your ParaView client setup and waiting for the server connection, you can simply submit the "job" by typing

 > cd /tmp/work/$USER/run-staging-paraview
 > qsub job


Remote setting

This configuration is meant for you if you can only access Jaguarpf through SSH and if Jaguarpf has no way to communicated directly to your computer where you want to visualize your data.

1) Configure your SSH so you can easily reach "home"

On your local computer where you want to run the ParaView Client. Edit the file ~/.ssh/config and add those lines with fixing "YourLoginOnJaguar" value.

 Host jaguarpf
    HostName jaguarpf.ccs.ornl.gov
    User YourLoginOnJaguar
    RemoteForward 50123 localhost:22

On the Jaguarpf computer where you want to run the ParaView Server. Edit the file ~/.ssh/config and add those lines with fixing "YourLoginOnYourComputer" value.

 Host home
    HostName localhost
    User YourLoginOnYourComputer
    Port 50123
  • CAUTION:
    • This configuration part can be skiped if you connect to jaguar with the following command line as well as the /ccs/proj/csc025/jourdain/tunnel/tunnel_command.sh one.
> ssh -R22222:localhost:11111 user@host

2) Connect with SSH to Jaguarpf after (1) was done.

To make sure that your ssh configuration is working correclty you can type

 > ssh home

And you should be able to connect to your local conputer. Once this test validated, just disconnect.

 > Ctrl+d (Exit the ssh home connection)
 > Ctrl+d (Exit the ssh jaguarpf connection)

As you will need to start several processes, we will use the "screen" application to use the same SSH connection.

So I will not explain all the steps but I will provide the procedure to follow.

 // From your local computer
 > ssh jaguarpf
 > screen (+ [Enter])
 > /ccs/proj/csc025/jourdain/tunnel/tunnel_command.sh (+ fully connect to your computer with your password)
 > Ctrl+a c
 > /ccs/proj/csc025/jourdain/tunnel/portfwd_command.sh
 > Ctrl+a c
 > cd /tmp/work/$USER/run-staging-paraview
 > /ccs/proj/csc025/jourdain/config-host.sh
 > qsub job

Demonstration Procedure

General

 0) Make sure that all the setup have been previously done and everything has 
    been closed such as SSH connection and ParaView.

ParaView Side

 1) Start ParaView 3.8.0
 2) Connect to Server: Jaguarpf
 3) Wait for server connection

Server side

 4) ssh jaguarpf
 5) Choose the path to start the server job (remote or in-site network config)


(A) Remote

> screen (+ [Enter])
> /ccs/proj/csc025/jourdain/tunnel/tunnel_command.sh (+ fully connect to your computer with your password)
> Ctrl+a c
> /ccs/proj/csc025/jourdain/tunnel/portfwd_command.sh
> Ctrl+a c
> cd /tmp/work/$USER/run-staging-paraview
> /ccs/proj/csc025/jourdain/config-host.sh
> qsub job

(B) In-site (Make sure that the host/port in job file is correct)

> cd /tmp/work/$USER/run-staging-paraview
> qsub job

ParaView Side (again)

 6) Once the server connected 
 7) Load locally the Adios plugin
 8) Wait till you know that some data are available in the stage
 9) Click on your macro button to execute the Adios macro.
10) Setup your visualization pipeline
11) Repeat the macro execution for each timestep.