Commit 598ab44d authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Parallel AMR Data-Transfer utility

A simple utility to test and demonstrate the
functionality for AMR inter-block data-transfer.
parent 108f2391
/*=========================================================================
Program: Visualization Toolkit
Module: AMRDataTransferPipeline.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .SECTION Description
// A simple utility to demonstrate & test the parallel AMR functionality
// and inter-block data transfer.
#include <mpi.h>
#include "vtkUniformGrid.h"
#include "vtkAMRBox.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkMultiProcessController.h"
#include "vtkAssertUtils.hpp"
// Global Variables
vtkMultiProcessController *Controller;
// Function Prototypes
vtkHierarchicalBoxDataSet* GetAMRDataSet( );
vtkUniformGrid* GetGrid( vtkAMRBox &gridBox );
int main( int argc, char **argv )
{
MPI_Init( &argc, &argv );
Controller = vtkMultiProcessController::GetGlobalController();
vtkAssertUtils::assertNotNull( Controller,__FILE__,__LINE__ );
vtkHierarchicalBoxDataSet *amrData = GetAMRDataSet();
vtkAssertUtils::assertNotNull( amrData, __FILE__, __LINE__ );
MPI_Finalize();
return 0;
}
//=============================================================================
// Function Prototype Implementation
//=============================================================================
vtkHierarchicalBoxDataSet* GetAMRDataSet( )
{
vtkAssertUtils::assertNotNull( Controller, __FILE__, __LINE__ );
vtkHierarchicalBoxDataSet *data = vtkHierarchicalBoxDataSet::New( );
vtkAssertUtils::assertNotNull( data, __FILE__, __LINE__ );
switch( Controller->GetLocalProcessId() )
{
case 0:
// TODO: implement this
break;
case 1:
// TODO: implement this
break;
default:
/* Note: Code should not reach here! */
return NULL;
}
return( data );
}
//----------------------------------------------------------------------------
vtkUniformGrid* GetGrid( vtkAMRBox &gridBox )
{
// TODO: implement this
return NULL;
}
......@@ -8,10 +8,37 @@ ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
IF (VTK_USE_MPI)
INCLUDE_DIRECTORIES("${MPI_INCLUDE_PATH} ${VTK_USE_FILE}")
IF (MPI_LIBRARY)
SET(MPI_LIBRARIES ${MPI_LIBRARY})
ENDIF (MPI_LIBRARY)
IF (MPI_EXTRA_LIBRARY)
SET(MPI_LIBRARIES ${MPI_LIBRARIES} "${MPI_EXTRA_LIBRARY}")
ENDIF (MPI_EXTRA_LIBRARY)
# Needed for mpich 2
ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK")
ENDIF (VTK_USE_MPI)
## Add HierarchicalBoxPipeline executable
ADD_EXECUTABLE(HierarchicalBoxPipeline HierarchicalBoxPipeline.cxx)
TARGET_LINK_LIBRARIES(HierarchicalBoxPipeline vtkRendering vtkIO)
## Add TestAMRBoxGrhodCellExtrusion executable
ADD_EXECUTABLE(TestAMRBoxGhostCellExtrusion TestAMRBoxGhostCellExtrusion.cxx)
TARGET_LINK_LIBRARIES(TestAMRBoxGhostCellExtrusion vtkFiltering)
\ No newline at end of file
TARGET_LINK_LIBRARIES(TestAMRBoxGhostCellExtrusion vtkFiltering)
## Add AMRDataTransferPipeline executable
ADD_EXECUTABLE(AMRDataTransferPipeline AMRDataTransferPipeline.cxx)
TARGET_LINK_LIBRARIES( AMRDataTransferPipeline
vtkGraphics
vtkFiltering
vtkRendering
vtkIO
vtkAMR
vtkParallel
${MPI_LIBRARIES}
)
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