STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::structure::StaticExclusionMask Class Reference

A simple pair list for an all-to-all calculation with exclusion masks. The list stores masks for 16 x 16 tiles of atoms indexed according to the atom order in some original topology. Each 16 x 16 tile mask will store the exclusions of 16 sending and 16 receiving atoms in the low 16 bits of an unsigned integer (probably 32-bit, but 16-bit format is also acceptable). The 16 x 16 tile masks are, in turn, arranged in groups of 16 x 16 such that each group of tiles covers the interactions of two consecutive sequences of 256 atoms apiece, for a total of 65,536 unique bits in 32kB (which counts the wasted high bits in each sending atom's mask as well as the reserved nature of the second sixteen bits). Many groups will have no exclusions at all, and these will all index into the first group stored in a master list. In this manner, a system of N atoms can have a complete pairlist constructed with ((N + 255) / 256)^2 super-tiles, with a storage requirement growing as N^2 but with a very small prefactor. With further hierarchical ordering, the pair list could even become O(N log N) in storage requirements. In the present scheme, simple pair lists can be built for very large systems if the exclusions are not spread throughout: a system of 131072 atoms with exclusions only between atoms +/-255 indices from one another would have space requirements of at most 52MB, probably much less. It is far better than the 2GB which would be required to store every exclusion as a unique bit. More...

#include <static_exclusionmask.h>

Public Member Functions

int getAtomCount () const
 Get the total atom count.
 
int getSuperTileStrideCount () const
 Get the number of supertile strides that the system contains (how many groups of up to 256 atoms will this system break into?)
 
int getTileStrideCount () const
 Get the number of supertile strides that the system contains (how many groups of up to 16 atoms will this system break into?)
 
int getUniqueSuperTileCount () const
 Get the total number of unique mask super-tiles.
 
std::vector< uint > getTileExclusions (int supertile_i_index, int supertile_j_index, int tile_i_index, int tile_j_index) const
 Get the exclusion masks for sending atoms in a particular tile.
 
const AtomGraphgetTopologyPointer () const
 Return a pointer to the topology that built this exclusion mask.
 
const StaticExclusionMaskReader data (HybridTargetLevel tier=HybridTargetLevel::HOST) const
 Get the abstract for this exclusion mask object.
 
const StaticExclusionMaskgetSelfPointer () const
 Get a pointer ot the object itself (useful when passing the object by const reference)
 
bool testExclusion (int atom_i, int atom_j) const
 Test whether some atom pair is an exclusion.
 
 StaticExclusionMask (const AtomGraph *ag_in=nullptr)
 The constructor requires a topology, which will have lists of exclusions.
 
 StaticExclusionMask (const AtomGraph &ag_in)
 
 StaticExclusionMask (const StaticExclusionMask &original)=default
 The default copy and move constructors as well as the copy assignment operator will suffice for this object, which has no POINTER-kind Hybrid objects among its members.
 
 StaticExclusionMask (StaticExclusionMask &&original)=default
 
StaticExclusionMaskoperator= (const StaticExclusionMask &other)=default
 
StaticExclusionMaskoperator= (StaticExclusionMask &&other)=default
 
int getUniqueTileCount () const
 Get the total number of unique tiles within a given super-tile.
 
int getUniqueTileCount (int supertile_i_index, int supertile_j_index) const
 

Detailed Description

A simple pair list for an all-to-all calculation with exclusion masks. The list stores masks for 16 x 16 tiles of atoms indexed according to the atom order in some original topology. Each 16 x 16 tile mask will store the exclusions of 16 sending and 16 receiving atoms in the low 16 bits of an unsigned integer (probably 32-bit, but 16-bit format is also acceptable). The 16 x 16 tile masks are, in turn, arranged in groups of 16 x 16 such that each group of tiles covers the interactions of two consecutive sequences of 256 atoms apiece, for a total of 65,536 unique bits in 32kB (which counts the wasted high bits in each sending atom's mask as well as the reserved nature of the second sixteen bits). Many groups will have no exclusions at all, and these will all index into the first group stored in a master list. In this manner, a system of N atoms can have a complete pairlist constructed with ((N + 255) / 256)^2 super-tiles, with a storage requirement growing as N^2 but with a very small prefactor. With further hierarchical ordering, the pair list could even become O(N log N) in storage requirements. In the present scheme, simple pair lists can be built for very large systems if the exclusions are not spread throughout: a system of 131072 atoms with exclusions only between atoms +/-255 indices from one another would have space requirements of at most 52MB, probably much less. It is far better than the 2GB which would be required to store every exclusion as a unique bit.

Constructor & Destructor Documentation

◆ StaticExclusionMask()

stormm::energy::StaticExclusionMask::StaticExclusionMask ( const AtomGraph * ag_in = nullptr)

The constructor requires a topology, which will have lists of exclusions.

Parameters
ag_inThe topology to base this all-to-all pair list upon (fed in as a pointer so that a private member variable may retain a pointer to the original topology)

Member Function Documentation

◆ getTileExclusions()

std::vector< uint > stormm::energy::StaticExclusionMask::getTileExclusions ( int supertile_i_index,
int supertile_j_index,
int tile_i_index,
int tile_j_index ) const

Get the exclusion masks for sending atoms in a particular tile.

Parameters
supertile_i_indexThe ith stretch of 256 atoms is interacting with the jth
supertile_j_indexThe jth stretch of 256 atoms is interacting with the ith
tile_i_indexThe ith group of 16 atoms within the supertile is sending to collect interactions
tile_j_indexThe jth group of 16 atoms within the supertile is receiving to collect interactions

◆ getUniqueTileCount()

int stormm::energy::StaticExclusionMask::getUniqueTileCount ( ) const

Get the total number of unique tiles within a given super-tile.

Overloaded:

  • Get the total number of unique 16 x 16 atom tiles in all super-tiles (no arguments)
  • Get the number of unique 16 x 16 atom tiles in a particular super-tile
Parameters
supertile_i_indexThe ith group of 256 atoms is sending to collect interactions
supertile_j_indexThe jth group of 256 atoms is receiving to collect interactions

◆ testExclusion()

bool stormm::energy::StaticExclusionMask::testExclusion ( int atom_i,
int atom_j ) const

Test whether some atom pair is an exclusion.

Parameters
atom_iThe ith atom to test for a pair exclusion with atom_j
atom_jThe jth atom to test for a pair exclusion with atom_i

The documentation for this class was generated from the following files: