CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
decomposition.c File Reference

Parallel domain decomposition. More...

#include "decomposition.h"
#include <assert.h>
#include "memUtils.h"
#include "parallel.h"
Include dependency graph for decomposition.c:

Go to the source code of this file.

Functions

DomaininitDecomposition (int xproc, int yproc, int zproc, real3 globalExtent)
 
int processorNum (Domain *domain, int dix, int diy, int diz)
 Find the MPI rank of a neighbor domain from a relative coordinate. More...
 

Detailed Description

Parallel domain decomposition.

This version of CoMD uses a simple spatial Cartesian domain decomposition. The simulation box is divided into equal size bricks by a grid that is xproc by yproc by zproc in size.

Definition in file decomposition.c.

Function Documentation

Domain* initDecomposition ( int  xproc,
int  yproc,
int  zproc,
real3  globalExtent 
)
read
Parameters
[in]xprocx-size of domain decomposition grid.
[in]yprocy-size of domain decomposition grid.
[in]zprocz-size of domain decomposition grid.
[in]globalExtentSize of the simulation domain (in Angstroms).

Definition at line 18 of file decomposition.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int processorNum ( Domain domain,
int  dix,
int  diy,
int  diz 
)

Find the MPI rank of a neighbor domain from a relative coordinate.

Calculates the rank of the processor with grid coordinates (ix+dix, iy+diy, iz+diz) where (ix, iy, iz) are the grid coordinates of the local rank. Assumes periodic boundary conditions. The deltas cannot be smaller than -procGrid[ii].

Definition at line 57 of file decomposition.c.

Here is the caller graph for this function: