Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/smalloc.h"
+ Include dependency graph for ga2la.h:

Description

Defines structures and functions for mapping from global to local atom indices. The functions are performance critical and should be inlined.

Author
Berk Hess hess@.nosp@m.kth..nosp@m.se

Classes

struct  gmx_laa_t
 Structure for the local atom info for a plain list. More...
 
struct  gmx_lal_t
 Structure for the local atom info for a hash table. More...
 
struct  gmx_ga2la_t
 Structure for all global to local mapping information. More...
 

Functions

static void ga2la_clear (gmx_ga2la_t *ga2la)
 Clear all the entries in the ga2la list. More...
 
static gmx_ga2la_tga2la_init (int natoms_total, int natoms_local)
 Initializes and returns a pointer to a gmx_ga2la_t structure. More...
 
static void ga2la_set (gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
 Sets the ga2la entry for global atom a_gl. More...
 
static void ga2la_del (gmx_ga2la_t *ga2la, int a_gl)
 Delete the ga2la entry for global atom a_gl. More...
 
static void ga2la_change_la (gmx_ga2la_t *ga2la, int a_gl, int a_loc)
 Change the local atom for present ga2la entry for global atom a_gl. More...
 
static gmx_bool ga2la_get (const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *cell)
 Returns if the global atom a_gl available locally. More...
 
static gmx_bool ga2la_get_home (const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
 Returns if the global atom a_gl is a home atom. More...
 
static gmx_bool ga2la_is_home (const gmx_ga2la_t *ga2la, int a_gl)
 Returns if the global atom a_gl is a home atom. More...
 

Function Documentation

static void ga2la_change_la ( gmx_ga2la_t ga2la,
int  a_gl,
int  a_loc 
)
static

Change the local atom for present ga2la entry for global atom a_gl.

Parameters
[in,out]ga2laThe global to local atom struct
[in]a_glThe global atom index
[in]a_locThe new local atom index
static void ga2la_clear ( gmx_ga2la_t ga2la)
static

Clear all the entries in the ga2la list.

Parameters
[in,out]ga2laThe global to local atom struct
static void ga2la_del ( gmx_ga2la_t ga2la,
int  a_gl 
)
static

Delete the ga2la entry for global atom a_gl.

Parameters
[in,out]ga2laThe global to local atom struct
[in]a_glThe global atom index
static gmx_bool ga2la_get ( const gmx_ga2la_t ga2la,
int  a_gl,
int *  a_loc,
int *  cell 
)
static

Returns if the global atom a_gl available locally.

Parameters
[in]ga2laThe global to local atom struct
[in]a_glThe global atom index
[out]a_locIf the return value is TRUE, the local atom index
[out]cellIf the return value is TRUE, the zone or for atoms more than one cell away zone+nzone
Returns
if the global atom a_gl available locally
static gmx_bool ga2la_get_home ( const gmx_ga2la_t ga2la,
int  a_gl,
int *  a_loc 
)
static

Returns if the global atom a_gl is a home atom.

Parameters
[in]ga2laThe global to local atom struct
[in]a_glThe global atom index
[out]a_locIf the return value is TRUE, the local atom index
Returns
if the global atom a_gl is a home atom
static gmx_ga2la_t* ga2la_init ( int  natoms_total,
int  natoms_local 
)
static

Initializes and returns a pointer to a gmx_ga2la_t structure.

Parameters
[in]natoms_totalThe total number of atoms in the system
[in]natoms_localAn estimate of the number of home+communicated atoms
Returns
a pointer to an initialized gmx_ga2la_t struct
static gmx_bool ga2la_is_home ( const gmx_ga2la_t ga2la,
int  a_gl 
)
static

Returns if the global atom a_gl is a home atom.

Parameters
[in]ga2laThe global to local atom struct
[in]a_glThe global atom index
Returns
if the global atom a_gl is a home atom
static void ga2la_set ( gmx_ga2la_t ga2la,
int  a_gl,
int  a_loc,
int  cell 
)
static

Sets the ga2la entry for global atom a_gl.

Parameters
[in,out]ga2laThe global to local atom struct
[in]a_glThe global atom index
[in]a_locThe local atom index
[in]cellThe cell index