Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit 7a840266 authored by David Thompson's avatar David Thompson

Fix the VTK-m contour analysis.

This also adds some documentation.
parent 4ef50aa6
......@@ -14,6 +14,13 @@ endif()
if (ENABLE_VTK_M)
list(APPEND SENSEI_VTK_COMPONENTS vtkAcceleratorsVTKm vtkIOLegacy
vtkFiltersGeometry vtkImagingCore)
# Now find VTK-m so it can be used independently of VTK
# This makes the vtkm_cont library available as well as
# targets vtkm::tbb and vtkm::cuda if they exist (so that
# device support can be conditionally compiled) using
# IF (TARGET vtkm::tbb) ... ENDIF()
find_package(VTKm REQUIRED QUIET)
endif()
if (NOT ENABLE_CATALYST)
......
......@@ -103,21 +103,22 @@ $ make install
### Build Options
| Build Option | Default | Description |
|--------------|---------|---------------------------------|
| ENABLE_SENSEI | ON | Enables the core SENSEI library. Requires VTK |
| ENABLE_PYTHON | OFF | Enables Python bindings. Requires VTK, Python, Numpy, mpi4py, and SWIG. |
| ENABLE_VTK_GENERIC_ARRAYS | OFF | Enables use of VTK's generic array feature. |
| ENABLE_CATALYST | OFF | Enables the Catalyst analysis adaptor. Depends on ParaView Catalyst. Set ParaView_DIR. |
| ENABLE_CATALYST_PYTHON | OFF | Enables Python features of the Catalyst analysis adaptor. |
| ENABLE_ADIOS | OFF | Enables ADIOS adaptors and endpoints. Set ADIOS_DIR. |
| ENABLE_LIBSIM | OFF | Enables Libsim data and analysis adaptors. Requires Libsim. Set VTK_DIR and LIBSIM_DIR. |
| ENABLE_VTK_IO | OFF | Enables adaptors to write to VTK XML format. |
| ENABLE_VTK_MPI | OFF | Enables MPI parallel VTK filters, such as parallel I/O. |
| ENABLE_PARALLEL3D | ON | Enables the parallel 3D mini-app. |
| ENABLE_OSCILLATORS | ON | Enables the oscillators mini-app. |
| VTK_DIR | | Set to the directory containing VTKConfig.cmake. |
| ParaView_DIR | | Set to the directory containing ParaViewConfig.cmake. |
| ADIOS_DIR | | Set to the directory containing ADIOSConfig.cmake |
| LIBSIM_DIR | | Path to libsim install. |
| `ENABLE_SENSEI` | ON | Enables the core SENSEI library. Requires VTK. When this is disabled, the included mini-apps will run fixed analyses. When enabled, the mini-apps will pass data through SENSEI and the analysis may be configured at run-time. This allows SENSEI overhead to be characterized.|
| `ENABLE_PYTHON` | OFF | Enables Python bindings. Requires VTK, Python, Numpy, mpi4py, and SWIG. |
| `ENABLE_VTK_GENERIC_ARRAYS` | OFF | Enables use of VTK's generic array feature. |
| `ENABLE_CATALYST` | OFF | Enables the Catalyst analysis adaptor. Depends on ParaView Catalyst. Set `ParaView_DIR`. |
| `ENABLE_CATALYST_PYTHON` | OFF | Enables Python features of the Catalyst analysis adaptor. |
| `ENABLE_ADIOS` | OFF | Enables ADIOS adaptors and endpoints. Set `ADIOS_DIR`. |
| `ENABLE_LIBSIM` | OFF | Enables Libsim data and analysis adaptors. Requires Libsim. Set `VTK_DIR` and `LIBSIM_DIR`. |
| `ENABLE_VTK_IO` | OFF | Enables adaptors to write to VTK XML format. |
| `ENABLE_VTK_MPI` | OFF | Enables MPI parallel VTK filters, such as parallel I/O. |
| `ENABLE_VTK_M` | ON | Enables analyses that use VTKm directly instead of via VTK. |
| `ENABLE_PARALLEL3D` | ON | Enables the parallel 3D mini-app. |
| `ENABLE_OSCILLATORS` | ON | Enables the oscillators mini-app. |
| `VTK_DIR` | | Set to the directory containing VTKConfig.cmake. |
| `ParaView_DIR` | | Set to the directory containing ParaViewConfig.cmake. |
| `ADIOS_DIR` | | Set to the directory containing ADIOSConfig.cmake |
| `LIBSIM_DIR` | | Path to libsim install. |
### For use with ADIOS
......
......@@ -5,6 +5,11 @@ The included initial condition, initializes an area roughly the size of, the
solar system with a number of of planets of varying masses at randomly chosen
locations. A sun sized body is placed at the center of the domain.
Unlike other miniapps, this one requires you to build the project with
`ENABLE_SENSEI` turned on; the python script must be able to import the
sensei module. (The other mini-apps will run a fixed, non-configurable
analysis when `ENABLE_SENSEI` is off.)
## Command line options
```bash
usage: newton.py [-h] [--analysis ANALYSIS] [--analysis_opts ANALYSIS_OPTS]
......@@ -54,8 +59,8 @@ export LD_LIBRARY_PATH=/work/SENSEI/PV/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=/work/SENSEI/PV/lib/site-packages/:/work/SENSEI/PV/lib/:$PYTHONPATH
# configure the build
cmake -DENABLE_PYTHON=ON -DENABLE_CATALYST=ON -DENABLE_CATALYST_PYTHON=ON \
-DParaView_DIR=/work/SENSEI/PV ../sensei/
cmake -DENABLE_SENSEI:BOOL=ON -DENABLE_PYTHON:BOOL=ON -DENABLE_CATALYST:BOOL=ON \
-DENABLE_CATALYST_PYTHON:BOOL=ON -DParaView_DIR:PATH=/work/SENSEI/PV ../sensei/
```
### Running
......
......@@ -215,6 +215,9 @@ int ConfigurableAnalysis::InternalsType::AddVTKmContour(pugi::xml_node node)
return -1;
}
auto mesh = node.attribute("mesh");
auto array = node.attribute("array");
double value = node.attribute("value").as_double(0.0);
bool writeOutput = node.attribute("write_output").as_bool(false);
......@@ -223,7 +226,7 @@ int ConfigurableAnalysis::InternalsType::AddVTKmContour(pugi::xml_node node)
if (this->Comm != MPI_COMM_NULL)
contour->SetCommunicator(this->Comm);
contour->Initialize(mesh.value(),array.value(), value, writeOutput);
contour->Initialize(mesh.value(), array.value(), value, writeOutput);
this->Analyses.push_back(contour.GetPointer());
......
#include "VTKmContourAnalysis.h"
#include "DataAdaptor.h"
#include "Error.h"
#include <vtkObjectFactory.h>
#include <vtkmAverageToPoints.h>
......@@ -56,11 +57,11 @@ VTKmContourAnalysis::~VTKmContourAnalysis()
}
//-----------------------------------------------------------------------------
void VTKmContourAnalysis::Initialize(const std::string &meshName,
const std::string &arrayName, double value, bool writeOutput)
void VTKmContourAnalysis::Initialize(const std::string& meshName,
const std::string& arrayName, double value, bool writeOutput)
{
this->MeshName = meshName;
this->ArrayName = arrayname;
this->ArrayName = arrayName;
this->Value = value;
this->WriteOutput = writeOutput;
}
......@@ -382,9 +383,10 @@ bool VTKmContourAnalysis::Execute(sensei::DataAdaptor* data)
prev->Register(0);
}
MPI_Comm comm = this->GetCommunicator();
vtkMPICommunicatorOpaqueComm ocomm(&comm);
vtkNew<vtkMPICommunicator> vtkComm;
vtkMPICommunicatorOpaqueComm h(&this->GetCommunicator());
vtkComm->InitializeExternal(&h);
vtkComm->InitializeExternal(&ocomm);
vtkNew<vtkMPIController> con;
con->SetCommunicator(vtkComm.GetPointer());
......@@ -392,9 +394,9 @@ bool VTKmContourAnalysis::Execute(sensei::DataAdaptor* data)
vtkMultiProcessController::SetGlobalController(con.GetPointer());
vtkDataObject* mesh = nullptr;
if (data->GetMesh(meshName, false, mesh))
if (data->GetMesh(this->MeshName, false, mesh))
{
SENSEI_ERROR("Failed to get mesh \"" << meshName << "\"")
SENSEI_ERROR("Failed to get mesh \"" << this->MeshName << "\"");
return false;
}
......
......@@ -19,7 +19,7 @@ public:
static VTKmContourAnalysis* New();
vtkTypeMacro(VTKmContourAnalysis, AnalysisAdaptor);
void Initialize(const std::string& arrayname,
void Initialize(const std::string& meshName, const std::string& arrayname,
double value, bool writeOutput);
bool Execute(sensei::DataAdaptor* data) override;
......@@ -30,6 +30,7 @@ protected:
VTKmContourAnalysis();
virtual ~VTKmContourAnalysis();
std::string MeshName;
std::string ArrayName;
double Value;
bool WriteOutput;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment