How to Use Paraview in Client-Server Mode Oliver Yang∗ School of Engineering and Centre for Scientific Computing February 11, 2014 In this tutorial, I will demonstrate how to use Paraview in client-server mode on Minerva system at University of Warwick. This is an extremely useful feature for Paraview when you want to visualized very large data set. First, I’d like to thank Mr Olav Smørholm for kindly making Paraview work on Minerva cluster and the useful discussion about Paraview and VisIt softwares with Professor Tony Arber and Dr Keith Bennett. If you are interesting at the problem we had about Paraview on Minerva, please refer to this bug on CSC bugzilla: https://bugzilla.csc.warwick.ac.uk/bugzilla/show_ bug.cgi?id=8553. 1 Launch Paraview-3.14.1 Client Currently, there are two Paraview versions installed on Minerva, i.e., Paraview-3.14.1 and Paraview-4.1.0. According to my experience, Paraview-3.14.1 tends to work more robust than Paraview-4.1.0, thus I will do the demonstration base on Paraview-3.14.1. To be noticed that, when you use Client-Server mode of Paraview, the Client and Server must use the same Paraview version, otherwise you will end with a connection failure. For the client end, we will use our local desktop. If you have a good video card available on your desktop, that would be perfect! To make Paraview-3.14.1 available on the desktop, the simplest way is to go to the Paraview official webpage and download the binary package for Paraview-3.14.1, http://www.paraview.org/paraview/resources/ ∗ University of Warwick, Coventry, CV4 7AL, U.K. 1 software.php. Figure 1: Download Paraview-3.14.1 for your platform. Extract the file, and enter ParaView-3.14.1-Linux-64bit/bin/ folder, you should be able to see the executable file paraview. Type ./paraview on your terminal window to launch Paraview on your desktop. 2 Launch Paraview-3.14.1 Server We don’t have a specific server for Paraview on Minerva, but we can request some resource from some queue on Minerva, just like a normal job. You need to do the following commands to launch Paraview-3.14.1 server. 1) Connect to Minerva using ssh: esrmae@santorini:$ ssh minerva.csc.warwick.ac.uk 2) Clear all the modules you have loaded by default: esrmae@hpclogin1:$ module purge 3) There are two module sections on Minerva, one is called oldmodules, which is the default, and the other is called minerva-2.0. Paraview-3.14.1 is installed in minerva2.0, thus we need to swap the two module sections: esrmae@hpclogin1:$ module swap oldmodules minerva-2.0 4) Load Paraview-3.14.1. To be noticed, it should be the server part, not the client part. esrmae@hpclogin1:$ module load goolf/1.6.10/ParaView/3.14.1-server 5) Request sources from a queue. This includes how many processors and how much memory you want to use for the Paraview-3.14.1 server. Below is an example .pbs file. 2 Here, we are requesting 4 processors and each processor has 1900 MB memory in develop queue. mpirun pvserver will launch the Paraview server in parallel using the resource requested. The paraview server will be listening to Port 11111 once the job starts to run. Submit the .pbs file by esrmae@hpclogin1:$ msub server.pbs **********server.pbs********** #!/bin/bash #PBS -N pvserver #PBS -q devel #PBS -l nodes=4:ppn=1,pvmem=1900mb,walltime=01:00:00 #PBS -V cd $PBS_O_WORKDIR mpirun pvserver --use-offscreen-rendering --server-port=11111 > pvserver.log 2>&1 exit 3 Connect Client and Server Once the request resource is available, check the log file for the job pvserver.log to see which node you are using for the Paraview server. Below is an example for the content of pvserver.log. Waiting for client... Connection URL: cs://node6:11111 Accepting connection(s): node6:11111 A tunnel between our local desktop and Minerva need to be established. This can be done by typing the following command in a new terminal window. esrmae@santorini:$ ssh -L 11111:node6:11111 minerva.csc.warwick.ac.uk You can check the established port on your local computer by running: esrmae@santorini:$ netstat -lnt 3 And you should see a new port address 127.0.0.1:11111. Keep the terminal window for the tunnel alive all the time while you are running Paraview. Now you can connect to Paraview server by click the connect button ( ) on the client. Following the steps to establish the server. 1) Click add server. Then configure the server as shown. You can give any name for the server you like. Figure 2: Configure Paraview server. 2) Set startup as manual, then save it. You can also click Save Servers to save the current configuration, so that you can Load Servers directly, rather than configure the server again when you use it next time. Figure 3: Set startup as manual and save it. 4 3) Click Connect. If the connection is successful, you will get the message from both sides. In the client, you can observer . And in the pvserver.log file, you can see Client connected. Congratulation! you are now using the client-server mode of Paraview-3.14.1. For every button you click on the client, the calculation will be down on the Paraview server, but only the rendering is done on your local desktop. To be noticed that, when using client-server mode, your input files are on Minerva side, while your output files are on your local desktop side. Below is an example visualized in this way. The surface is coloured by the processor ID, so that you can see how the job is distributed among the processors. Figure 4: Near wall turbulent structure in a channel flow, colored by the processor ID. 4 Run scripts on batch mode Even though client-server mode is a very powerful way to use paraview, it is still not wise to run Paraview interactively for a very big data set. Because you may waste lots of time waiting in front of your client. In this situation, pvbatch can be very helpful. 5 First, you need to record a script file in Paraview by using a smaller data set. To start recording the script file, go to Tools → Start Trace. A message will shown at the . You can then use left bottom of Paraview, saying the mouse to set the snapshot you want. After that, click Tools → Stop Trace, and you will see the content of the script file written in python language, as shown in figure 5. Save it to somewhere. You can use vim to open the script file, say trace.py, and change the input path to your large data set. Figure 5: Script file in python. You can then run the script file with pvbatch in parallel. The .pbs file should look like this. **********trace.pbs********** #!/bin/bash #PBS -l nodes=4:ppn=1,pvmem=1900mb,walltime=00:30:00 #PBS -V cd $PBS_O_WORKDIR mpirun pvbatch --use-offscreen-rendering trace.py exit 0 ∼ Thank you for your reading! ∼ 6
© Copyright 2024