Gromacs  2026.0-dev-20250318-75a6c20
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
#include "gmxpre.h"
#include "config.h"
#include <array>
#include <numeric>
#include <vector>
#include <gtest/gtest.h>
#include "gromacs/domdec/atomdistribution.h"
#include "gromacs/domdec/domdec_internal.h"
#include "gromacs/domdec/gpuhaloexchange.h"
#include "gromacs/gpu_utils/gpueventsynchronizer.h"
#include "gromacs/gpu_utils/hostallocator.h"
#include "gromacs/mdtypes/inputrec.h"
#include "testutils/mpitest.h"
#include "testutils/test_hardware_environment.h"
+ Include dependency graph for haloexchange_mpi.cpp:

Description

Tests for the halo exchange.

The test sets up the rank topology and performs a coordinate halo exchange (for both CPU and GPU codepaths) for several 1D and 2D pulse configurations. Each pulse involves a few non-contiguous indices. The sending rank, atom number and spatial 3D index are encoded in the x values, to allow correctness checking following the halo exchange.

Todo:
Add 3D case
Author
Alan Gray alang.nosp@m.@nvi.nosp@m.dia.c.nosp@m.om

Functions

float gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::encodedValue (const int sendRank, const int atomNumber, const int spatial3dIndex)
 Get encoded numerical value for sending rank, atom number and spatial 3D index. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::initHaloData (RVec *x, const int numHomeAtoms, const int numAtomsTotal)
 Initialize halo array. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::gpuHalo (gmx_domdec_t *dd, matrix box, HostVector< RVec > *h_x, int numAtomsTotal)
 Perform GPU halo exchange, including required setup and data transfers. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define1dRankTopology (gmx_domdec_t *dd)
 Define 1D rank topology with 4 MPI tasks. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define2dRankTopology (gmx_domdec_t *dd)
 Define 2D rank topology with 4 MPI tasks. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define1dHaloWith1Pulse (gmx_domdec_t *dd, std::vector< gmx_domdec_ind_t > *indvec)
 Define a 1D halo with 1 pulses. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define1dHaloWith2Pulses (gmx_domdec_t *dd, std::vector< gmx_domdec_ind_t > *indvec)
 Define a 1D halo with 2 pulses. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define2dHaloWith1PulseInEachDim (gmx_domdec_t *dd, std::vector< gmx_domdec_ind_t > *indvec)
 Define a 2D halo with 1 pulse in each dimension. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::define2dHaloWith2PulsesInDim1 (gmx_domdec_t *dd, std::vector< gmx_domdec_ind_t > *indvec)
 Define a 2D halo with 2 pulses in the first dimension. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::checkResults1dHaloWith1Pulse (const RVec *x, const gmx_domdec_t *dd, const int numHomeAtoms)
 Check results for above-defined 1D halo with 1 pulse. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::checkResults1dHaloWith2Pulses (const RVec *x, const gmx_domdec_t *dd, const int numHomeAtoms)
 Check results for above-defined 1D halo with 2 pulses. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::checkResults2dHaloWith1PulseInEachDim (const RVec *x, const gmx_domdec_t *dd, const int numHomeAtoms)
 Check results for above-defined 2D halo with 1 pulse in each dimension. More...
 
void gmx::test::anonymous_namespace{haloexchange_mpi.cpp}::checkResults2dHaloWith2PulsesInDim1 (const RVec *x, const gmx_domdec_t *dd, const int numHomeAtoms)
 Check results for above-defined 2D halo with 2 pulses in the first dimension. More...