Example program that shows the use case for performing tag data exchange between parallel processors in order to sync data on shared entities. Driver
This example :
- Initialize MPI and instantiates MOAB
- Gets user options: Input mesh file name, vector tag length, ghost layer size etc
- Create the root and partition sets
- Instantiate ParallelComm and read the mesh file in parallel using appropriate options
- Create the required number of ghost layers as requested by the user (default = 3)
- Get 2D MPAS polygonal entities in the mesh and filter to get only the "owned" entities
- Create two tags: scalar_variable (single data/cell) and vector_variable (multiple data/cell)
- Set tag data using analytical functions for both scalar and vector fields on owned entities
- Exchange shared entity information and tags between processors
- If debugging is turned on, store mesh file and tag on root process (will not contain data on shared entities)
- Perform exchange of scalar tag data on shared entities
- Perform exchange of vector tag data on shared entities
- If debugging is turned on, store mesh file and tag on root process (will now contain data on all entities)
- Destroy the MOAB instance and finalize MPI
To run: mpiexec -n np ./ExchangeHalos –input <mpas_mesh_file> –nghosts <ghostlayers> –vtaglength <vector component
size> \ –nexchanges <number of exchange runs> Example: mpiexec -n 4 ./ExchangeHalos –input $MOAB_DIR/MeshFiles/unittest/io/mpasx1.642.t.2.nc –nghosts 3 –vtaglength 100
NOTE: –debug option can be added to write out extra files in h5m format to visualize some output (written from root task only)