Skip to content

Commit

Permalink
Issue #474 & #475
Browse files Browse the repository at this point in the history
- Fixed bug in VTK exporter introduced by In-situ changes
  • Loading branch information
aancel committed Dec 2, 2014
1 parent 2506d36 commit 767a94f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions feel/feelfilters/exporterVTK.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ public Exporter<MeshType,N>

/* class members for in-situ visualization */
#if VTK_MAJOR_VERSION >= 6 && defined(VTK_HAS_PARALLEL)
mutable MPI_Comm lComm;
mutable vtkMPICommunicatorOpaqueComm * opaqueComm;
#if defined(FEELPP_VTK_INSITU_ENABLED)
mutable vtkSmartPointer<vtkCPProcessor> inSituProcessor;
Expand Down
17 changes: 10 additions & 7 deletions feel/feelfilters/exporterVTK_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ ExporterVTK<MeshType,N>::ExporterVTK( ExporterVTK const & __ex )
template<typename MeshType, int N>
ExporterVTK<MeshType,N>::~ExporterVTK()
{
#if VTK_MAJOR_VERSION >= 6 && defined(VTK_HAS_PARALLEL) && defined(FEELPP_VTK_INSITU_ENABLED)
#if VTK_MAJOR_VERSION >= 6 && defined(VTK_HAS_PARALLEL)
#if defined(FEELPP_VTK_INSITU_ENABLED)
/* end up in situ simulation */
inSituProcessor->Finalize();
//inSituProcessor->Delete();
if(boption( _name="exporter.vtk.insitu.enable" ))
{
inSituProcessor->Finalize();
//inSituProcessor->Delete();
}
#endif

/* clean memory */
delete this->opaqueComm;
Expand Down Expand Up @@ -114,9 +119,9 @@ ExporterVTK<MeshType,N>::init()

#if VTK_MAJOR_VERSION >= 6 && defined(VTK_HAS_PARALLEL)
/* before version 5.10, we cannot initialize a MPIController with an external MPI_Comm */
MPI_Comm comm = this->worldComm().comm();
this->lComm = this->worldComm().comm();
/* initialize the VTK communicator from the current MPI communicator */
this->opaqueComm = new vtkMPICommunicatorOpaqueComm(&comm);
this->opaqueComm = new vtkMPICommunicatorOpaqueComm(&(this->lComm));

#if defined(FEELPP_VTK_INSITU_ENABLED)
/* initialize in-situ visualization if needed */
Expand Down Expand Up @@ -306,8 +311,6 @@ ExporterVTK<MeshType,N>::write( typename timeset_type::step_ptrtype step, std::s
#if VTK_MAJOR_VERSION >= 6 && defined(VTK_HAS_PARALLEL)
/* Build vtk objects while reusing the current mpi communicator */
/* before version 5.10, we cannot initialize a MPIController with an external MPI_Comm */
MPI_Comm comm = this->worldComm().comm();

vtkSmartPointer<vtkMPICommunicator> mpicomm = vtkSmartPointer<vtkMPICommunicator>::New();
mpicomm->InitializeExternal(this->opaqueComm);
vtkSmartPointer<vtkMPIController> mpictrl = vtkSmartPointer<vtkMPIController>::New();
Expand Down

0 comments on commit 767a94f

Please sign in to comment.