Brick Library 0.1
Performance-portable stencil datalayout & codegen
Classes | Functions | Variables
brick-mpi.h File Reference

MPI stuff related to bricks. More...

#include <vector>
#include <unordered_map>
#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iostream>
#include <mpi.h>
#include <omp.h>
#include <unistd.h>
#include "brick.h"
#include "bitset.h"
#include "memfd.h"
Include dependency graph for brick-mpi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  grid_access< T, dim, 1 >
 
struct  grid_access< T, dim, d >
 Generic base template for Accessing grid indices using []. More...
 
struct  ExchangeView
 PUT view of the ghost and surface region using mmap. More...
 
struct  MultiStageExchangeView
 SHIFT view of the ghost and surface region using mmap. More...
 
struct  MultiStageExchangeView::Package
 
class  BrickDecomp< dim, BDims >
 Decomposition for MPI communication. More...
 
struct  BrickDecomp< dim, BDims >::g_region
 Record start and end of each region. More...
 
struct  mpi_stats
 Statistics collection for MPI programs. More...
 

Functions

void allneighbors (BitSet cur, long idx, long dim, std::vector< BitSet > &neighbors)
 Enumerate all neighbors. More...
 
template<unsigned dim, unsigned ... BDims>
void populate (MPI_Comm &comm, BrickDecomp< dim, BDims... > &bDecomp, BitSet neighbor, int d, int *coo)
 Populate neighbor-rank map for BrickDecomp using MPI_Comm. More...
 
mpi_stats mpi_statistics (double stats, MPI_Comm comm)
 
std::ostream & operator<< (std::ostream &os, const mpi_stats &stats)
 pretty print an mpi_stats object More...
 

Variables

double packtime
 
double calltime
 
double waittime
 
double movetime
 
double calctime
 
std::vector< BitSetskin3d_good
 Optimized surface ordering for 3D. More...
 
std::vector< BitSetskin3d_normal
 
std::vector< BitSetskin3d_bad
 

Detailed Description

MPI stuff related to bricks.

Function Documentation

◆ allneighbors()

void allneighbors ( BitSet  cur,
long  idx,
long  dim,
std::vector< BitSet > &  neighbors 
)

Enumerate all neighbors.

Parameters
[in]curusually 0
[in]idxcurrent dimension, starts from 1
[in]dimtotal number of dimensions
[out]neighborsa list of neighbors
Here is the call graph for this function:

◆ mpi_statistics()

mpi_stats mpi_statistics ( double  stats,
MPI_Comm  comm 
)
inline

Collect a stats within a certain communicator to its root

Parameters
statsa double represent a stat
commcommunicator
Returns
a stats object

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const mpi_stats stats 
)
inline

pretty print an mpi_stats object

◆ populate()

template<unsigned dim, unsigned ... BDims>
void populate ( MPI_Comm &  comm,
BrickDecomp< dim, BDims... > &  bDecomp,
BitSet  neighbor,
int  d,
int *  coo 
)

Populate neighbor-rank map for BrickDecomp using MPI_Comm.

Template Parameters
dimnumber of dimensions
BDimsBrick dimensions
Parameters
comm
bDecomp
neighbor
dcurrent dimension
cooThis rank's coo

Example:

populate(cart, brickDecomp, 0, 1, coo);
void populate(MPI_Comm &comm, BrickDecomp< dim, BDims... > &bDecomp, BitSet neighbor, int d, int *coo)
Populate neighbor-rank map for BrickDecomp using MPI_Comm.
Definition: brick-mpi.h:731
Here is the call graph for this function:

Variable Documentation

◆ calctime

double calctime

◆ calltime

double calltime

◆ movetime

double movetime

◆ packtime

double packtime
extern

◆ skin3d_bad

std::vector<BitSet> skin3d_bad

◆ skin3d_good

std::vector<BitSet> skin3d_good
extern

Optimized surface ordering for 3D.

BrickDecomp<3, 8,8,8> bDecomp({128,128,128}, 8);
std::vector< BitSet > skin3d_good
Optimized surface ordering for 3D.
Definition: brick-mpi.cpp:25
Decomposition for MPI communication.
Definition: brick-mpi.h:180
void initialize(const std::vector< BitSet > &skinlist)
initialize the decomposition using skinlist
Definition: brick-mpi.h:322

◆ skin3d_normal

std::vector<BitSet> skin3d_normal
extern

◆ waittime

double waittime