diff --git a/docs.it4i/software/viz/insitu.md b/docs.it4i/software/viz/insitu.md index 9cd552bcbc7c67b7f12536d67815fe9096d9d6b3..e0e1fb2e1e8b66769f081d2b2439c2f5f0aca964 100644 --- a/docs.it4i/software/viz/insitu.md +++ b/docs.it4i/software/viz/insitu.md @@ -2,24 +2,53 @@ ## Introduction -In situ visualization is a possibility how to visualize your data during the computation performed on multiple nodes of a supercomputer. It is a visualization pipeline that can be used on our [Salomon][1] cluster. The pipeline is based on [ParaView Catalyst][2] library. +In situ visualization is a possibility how to visualize your data while your computation is progressing on multiple nodes of a cluster. It is a visualization pipeline that can be used on our [Salomon][salomon_web] supercomputer. The pipeline is based on [ParaView Catalyst][catalyst_web] library. -TEST +To leverage the possibilities of the in situ visualization by Catalyst library, you have to write an adaptor code that will use the actual data from your simulation and process them in the way they can be passed to ParaView for visualization. We provide a simple example of such simulator/adaptor code that bind together to provide the in situ visualization. -[ParaView][a] is an open-source, multi-platform data analysis and visualization application. ParaView users can quickly build visualizations to analyze their data using qualitative and quantitative techniques. The data exploration can be done interactively in 3D or programmatically using ParaView's batch processing capabilities. - -ParaView was developed to analyze extremely large datasets using distributed memory computing resources. It can be run on supercomputers to analyze datasets of exascale size as well as on laptops for smaller data. +Detailed description of the Catalyst API can be found [here][catalyst_guide]. We restrict ourselves to provide more of an overall description of the code parts together with building description, and startup description to run it all on the cluster. + ## Installed Version -The Catalyst library is part of the ParaView module in version 5.6.0. It has been compiled with intel/2017a and installed on the Salomon cluster. +The Catalyst library is part of the ParaView module. More about ParaView can be found [here][paraview_web]. We use version 5.6.0. It has been compiled with intel/2017a and installed on the Salomon cluster. ## Usage -On the clusters, ParaView is to be used in client-server mode. A parallel ParaView server is launched on compute nodes by the user, and client is launched on your desktop PC to control and view the visualization. Download ParaView client application for your OS [here][b]. +All code concerning the simulator/adaptor are available to download from [here][code]. It is a package that contains following files: CMakeLists.txt, FEAdaptor.h, FEAdaptor.cxx, FEDataStructures.h, FEDataStructures.cxx, FEDriver.cxx and feslicescript.py. + +First unpack the [code][code]. You can do it by + +```console +$ tar xvf package_name +``` + + +Use CMake to manage the build process but first load the appropriate modules (CMake, compiler, ParaView) by + +```console +$ ml CMake intel/2017a ParaView/5.6.0-intel-2017a-mpi +``` + +```console +$ mkdir build +$ cd build +$ cmake ../ +``` + +Now you can build the simulator/adaptor code using make +```console +$ make +``` + +It will generate the CxxFullExampleAdaptor executable file. This can be later run together with ParaView and provide the in situ visualization. + +## Code explanation + + + +mpirun -n 2 ./CxxFullExample 30 30 30 ../SampleScripts/feslicescript.py -!!!Warning - Your version must match the version number installed on the cluster. ### Launching Server @@ -87,8 +116,7 @@ You can now use Parallel ParaView. Remember to close the interactive session after you finish working with ParaView server, as it will remain launched even after your client is disconnected and will continue to consume resources. -[1]: https://docs.it4i.cz/salomon/introduction/ -[2]: https://www.paraview.org/in-situ/ - -[a]: http://www.paraview.org/ -[b]: http://paraview.org/paraview/resources/software.php +[salomon_web]: https://docs.it4i.cz/salomon/introduction/ +[catalyst_web]: https://www.paraview.org/in-situ/ +[paraview_web]: http://www.paraview.org/ +[catalyst_guide]: https://www.paraview.org/files/catalyst/docs/ParaViewCatalystUsersGuide_v2.pdf diff --git a/docs.it4i/software/viz/insitu/CMakeLists.txt b/docs.it4i/software/viz/insitu/CMakeLists.txt index c1f7b97dfd678898b20c0000b1e94edb0d2cd7a8..387365643ce8b85929ad22f24ec22c7dd8e06909 100644 --- a/docs.it4i/software/viz/insitu/CMakeLists.txt +++ b/docs.it4i/software/viz/insitu/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.3) project(CatalystCxxFullExample) -include_directories(/apps/all/ParaView/5.6.0-intel-2017a-mpi/include/paraview-5.6/) -link_directories(/apps/all/ParaView/5.6.0-intel-2017a-mpi/lib/) - set(USE_CATALYST ON CACHE BOOL "Link the simulator with Catalyst") if(USE_CATALYST) - find_package(ParaView 4.1 REQUIRED COMPONENTS vtkPVPythonCatalyst) + find_package(ParaView 5.6 REQUIRED COMPONENTS vtkPVPythonCatalyst) include("${PARAVIEW_USE_FILE}") set(Adaptor_SRCS FEAdaptor.cxx diff --git a/docs.it4i/software/viz/insitu/feslicescript.py b/docs.it4i/software/viz/insitu/feslicescript.py index 21e9d7522339216c1cdd12cb24bef232d7e9f1d5..1a3344ec7a932093374eb41dfa605ae973e73c72 100644 --- a/docs.it4i/software/viz/insitu/feslicescript.py +++ b/docs.it4i/software/viz/insitu/feslicescript.py @@ -10,28 +10,7 @@ from paraview import coprocessing def CreateCoProcessor(): def _CreatePipeline(coprocessor, datadescription): class Pipeline: - filename_3_pvtu = coprocessor.CreateProducer( datadescription, "input" ) - - Slice1 = Slice( guiName="Slice1", Crinkleslice=0, SliceOffsetValues=[0.0], Triangulatetheslice=1, SliceType="Plane" ) - Slice1.SliceType.Offset = 0.0 - Slice1.SliceType.Origin = [34.5, 32.45, 27.95] - Slice1.SliceType.Normal = [1.0, 0.0, 0.0] - - # create a new 'Parallel PolyData Writer' - parallelPolyDataWriter1 = servermanager.writers.XMLPPolyDataWriter(Input=Slice1) - - # register the writer with coprocessor - # and provide it with information such as the filename to use, - # how frequently to write the data, etc. - coprocessor.RegisterWriter(parallelPolyDataWriter1, filename='slice_%t.pvtp', freq=10) - - # create a new 'Parallel UnstructuredGrid Writer' - unstructuredGridWriter1 = servermanager.writers.XMLPUnstructuredGridWriter(Input=filename_3_pvtu) - - # register the writer with coprocessor - # and provide it with information such as the filename to use, - # how frequently to write the data, etc. - coprocessor.RegisterWriter(unstructuredGridWriter1, filename='fullgrid_%t.pvtu', freq=100) + coprocessor.CreateProducer( datadescription, "input" ) return Pipeline() @@ -40,7 +19,7 @@ def CreateCoProcessor(): self.Pipeline = _CreatePipeline(self, datadescription) coprocessor = CoProcessor() - freqs = {'input': [10, 100]} + freqs = {'input': []} coprocessor.SetUpdateFrequencies(freqs) return coprocessor @@ -53,7 +32,7 @@ coprocessor = CreateCoProcessor() #-------------------------------------------------------------- # Enable Live-Visualizaton with ParaView -coprocessor.EnableLiveVisualization(False) +coprocessor.EnableLiveVisualization(True) # ---------------------- Data Selection method ---------------------- diff --git a/docs.it4i/software/viz/insitu/insitu.tar.gz b/docs.it4i/software/viz/insitu/insitu.tar.gz index d207465c54760da5dc15d3fae7c05591f7bf5547..fb1e220751d15bb35345d41f906a58159171ceeb 100644 Binary files a/docs.it4i/software/viz/insitu/insitu.tar.gz and b/docs.it4i/software/viz/insitu/insitu.tar.gz differ