- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -

Hawk PrePostProcessing: Difference between revisions

From HLRS Platforms
Jump to navigationJump to search
No edit summary
Line 51: Line 51:
===== Connection of ParaView Client and Server via pvconnect =====
===== Connection of ParaView Client and Server via pvconnect =====
[[File:ParaView client connected to pvserver.png|thumb|ParaView Client connected to pvserver]]
[[File:ParaView client connected to pvserver.png|thumb|ParaView Client connected to pvserver]]
To connect a graphical ParaView client executed within the vnc session on Vulcan with the server running on the Hawk compute nodes a ssh tunnel has to be established. For convenience we provide in the client installation the <code>pvconnect</code> script. The script takes two arguments.  
To connect a graphical ParaView client executed within the vnc session on Vulcan with the server running on the Hawk compute nodes a ssh tunnel has to be established. For convenience we provide in the client installation the <code>pvconnect</code> script. Please note that the script assumes that public / provate key, ssh connection without password is possible between Vulcan and Hawk.
 
The script takes two arguments.  


#<code>-pvs</code> is the combination <code><servername>:<portnumber></code> isseued during pvserver startup under <code>Accepting connection(s):</code>.  
#<code>-pvs</code> is the combination <code><servername>:<portnumber></code> isseued during pvserver startup under <code>Accepting connection(s):</code>.  

Revision as of 15:13, 18 June 2021

For pre- and post-processing purposes with large memory requirements multi user smp nodes are available. These nodes are reachable via the smp queue. Please see the node types, examples and smp sections of the batch system documentation.

Remote Visualization

Since Hawk is not equipped with Graphic Hardware, the visualization has to be done remotely either in the Vulcan cluster or in locally installed clients.

Paraview

ParaView server is installed on Hawk with mpi support for parallel execution and rendering on the compute nodes. The installation is available via the module environment.

module load paraview/server[/<version>]

To enable parallel data processing and rendering on the CPU Paraview is installed with the mesa llvm gallium pipe. This means the Qt based graphical user interface (GUI) is not available i.e. the paraview command and the ParaView client. Scripted usage is possible via pvbatch. For interactive parallel post-processing and visualization pvserver has to be used.

Client-Server Execution using the Vulcan Cluster

Graphical ParaView clients matching the server versions on Hawk are installed on the Vulcan cluster. For efficient connection we recommend to use the vis_via_vnc.sh script available via the VirtualGL module on Vulcan. More information can be found at Graphic_Environment

Vnc desktop session.png
Setting up the VNC desktop session
ssh vulcan.hww.hlrs.de
module load tools/VirtualGL
vis_via_vnc.sh

Please note that this will reserve a standard visualization node in Vulcan for one hour. Additional nodes with other graphic hardware are available and the reservation time can of course be increased. for a full list of options please use

vis_via_vnc.sh --help

To connect to the vnc session on the visualization node from your local client computer use one of the methodologies issued by the vis_via_vnc.sh script. The recommended way is to use a TigerVNC viewer or TurboVNC viewer with the -via option.

vncviewer -via <user_name>@cl5fr2.hww.hlrs.de <node_name>:<display_number>

After successful connection you should be logged in to a remote Xvnc desktop session.

Setting up pvserver

In parallel a regular compute node job has to be requested on Hawk. E.g.

qsub -l select=2:node_type=rome:mpiprocs=128,walltime=01:00:00 -I

Once logged in to the interactive compute node job load the paraview/server module and launch pvserver.

module load paraview/server[/<version>]
mpirun -n 256 pvserver

If pvserver was launched successfully it should issue the connection details for the paraview client. E.g.:

s32979 r41c2t6n4 203$ mpirun -n 256 pvserver
Waiting for client...
Connection URL: cs://r41c2t6n4:11111
Accepting connection(s): r41c2t6n4:11111
Connection of ParaView Client and Server via pvconnect
ParaView Client connected to pvserver

To connect a graphical ParaView client executed within the vnc session on Vulcan with the server running on the Hawk compute nodes a ssh tunnel has to be established. For convenience we provide in the client installation the pvconnect script. Please note that the script assumes that public / provate key, ssh connection without password is possible between Vulcan and Hawk.

The script takes two arguments.

  1. -pvs is the combination <servername>:<portnumber> isseued during pvserver startup under Accepting connection(s):.
  2. -via is the hostname of the machine over which to tunnel onto the pv server host.

Usually this is hawk.hww.hlrs.de. So taking the example from the server startup given above, to launch a ParaView client within a VNC desktop session and directly connect it to a running server on Hawk compute nodes use:

module load tools/paraview
pvconnect -pvs r41c2t6n4:11111 -via hawk.hww.hlrs.de

The connection and memory load on the server can be checked within the client by activating the Memory Inspector via the View menu within the ParaView client.

Client-Server Execution using a local client

It is also possible to connect a locally running ParaView to a server running on Hawk. For that we recommend to compile a matching ParaView client on your local machine.

ParaView Installation

So either check out the correct ParaView sources version from the ParaView git repositories or download the source tar archive we provide in the ParaView intallation directory on Hawk. With the ParaView module loaded the sources can be found in

$PARAVIEW_ROOT/../src

On your local machine, extract the archive, define your installation location

export PV_PREFIX=<path_to_installation_directory>

Setup your build directory

cd ParaView/
export PV_VERSION=`git describe --tags`
echo $PV_VERSION
cd ..
mkdir ParaView_${PV_VERSION}_build_client
cd ParaView_${PV_VERSION}_build_client

Configure the ParaView installation process with cmake

cmake ../ParaView \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CXX_COMPILER=c++ \
      -DCMAKE_C_COMPILER=gcc \
      -DCMAKE_Fortran_COMPILER=gfortran \
      -DPARAVIEW_USE_PYTHON=ON \
      -DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON \
      -DPARAVIEW_BUILD_SHARED_LIBS=ON \
      -DBUILD_TESTING=OFF \
      -DCMAKE_INSTALL_PREFIX=$PV_PREFIX/paraview/${PV_VERSION}/client

Build and install with

make -j 20
make install

And finally extend your PATH and LD_LIBRARY_PATH environment variables:

export PATH=$PV_PREFIX/paraview/${PV_VERSION}/client/bin:$PATH
export LD_LIBRARY_PATH=$PV_PREFIX/paraview/${PV_VERSION}/client/lib64:$LD_LIBRARY_PATH

The newly installed client should now be executable.

Using pvconnect locally

On the Vulcan cluster we provide the pvconnect script to set up a ssh tunnel, launch a ParaView client and directly connect it to a pvserver running on Hawk. The script is also usable from a local client if the nettest utility is available. Simply copy the code below into a local file and connect to a running pvserver as described above.

#!/bin/bash
###############################################################################
# pvconnect
# --------------
# The script opens a ssh-tunnel to a given compute node via a mom node and 
# launches a paraview client with the correct -url option
###############################################################################
usage()
{
	echo
	echo "USAGE: $0"
	echo "       -pvs pvserver[:port] -via host"
	echo
	echo "-pvs = ParaView server to connect to. Either the hostname alone or "
	echo "       hostname:port can be given. The hostname:port combination is"
	echo "       normally returned the pvserver by the comment:"
	echo "       Accepting connection(s): hostname:port"
	echo "       if no port is given the default port 11111 is used"
	echo "-via = Hostname via which to connect to the server. If the server was"
	echo "       launched by aprun this should be the name of the mom node"
	echo "       on which the aprun was executed."
	echo
	exit $1
}
#
if [ $# -eq 0 ]; then
	usage 0
fi
#
port=`nettest -findport`
#
# -----------------------------------------------------------------------------
# Parse Arguments -------------------------------------------------------------
while [ $# -gt 0 ]
do
	case "$1" in
	-pvs*) acc_con=$2; shift ;;
	-via*) VIA=$2; shift ;;
	-help*) usage 0;;
   --help*) usage 0;;
	*) break ;;
	esac
	shift
done
#
if [ -z $acc_con ]; then
   echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
   echo "!! Argument for ParaView server is missing !!"
   echo "!! Please specify the -pvs option          !!"
   echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
   exit 1
fi
#
if [ -z $VIA ]; then
   echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
   echo "!! Found no host to connect through in arguments !!"
   echo "!! Please specify the -via option                !!"
   echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
   exit 1
fi
#
# -----------------------------------------------------------------------------
# Get target and port ---------------------------------------------------------
TARGET=`echo $acc_con | cut -d: -f1`
PVP=`echo $acc_con | cut -d: -f2`
#
if [ -z $PVP ]; then
   PVP=11111
   echo " "
   echo " Found no ParaView server port in arguments"
   echo " Using the default one: 11111"
fi
#
# -----------------------------------------------------------------------------
# Open tunnel -----------------------------------------------------------------
ssh -N -L $port:$TARGET:$PVP $VIA &
sshpid=$!
#
sleep 10
#
echo " "
echo " Opened ssh-tunnel with process id : ${sshpid}"
echo " Tunnel command was                : ssh -N -L $port:$TARGET:$PVP $VIA &"
#
# -----------------------------------------------------------------------------
# Launch paraview client ------------------------------------------------------
echo " "
echo " Launching paraview client : vglrun paraview -url=cs://localhost:$port"
paraview -url=cs://localhost:$port
#
kill ${sshpid}
#