What are members in CommMetaData #1821
-
I try to understand how to customize communication of struct CommMetaData
{
// The cache of local and send/recv per FillBoundary() or ParallelCopy().
bool m_threadsafe_loc = false;
bool m_threadsafe_rcv = false;
std::unique_ptr<CopyComTagsContainer> m_LocTags;
std::unique_ptr<MapOfCopyComTagContainers> m_SndTags;
std::unique_ptr<MapOfCopyComTagContainers> m_RcvTags;
}; where struct CopyComTag
{
Box dbox;
Box sbox;
int dstIndex;
int srcIndex;
/* omit constructors and typedefs */
};
using CopyComTagsContainer = std::vector<CopyComTag>;
using MapOfCopyComTagContainers = std::map<int, std::vector<CopyComTag>>; Question: Could you explain the member variables of those classes to me? Are LocTags (local tags?) of same shape as local FABs? What about the maps? Does dstIndex and srcIndex mean components? Can I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, I believe you can use |
Beta Was this translation helpful? Give feedback.
CopyComTag
stores the meta-data for copying the data from a subregionsbox
(heres
means source) of the sourceFabArray
to a subregiondbox
of the destinationFabArray
. The integerssrcIndex
anddstIndex
specify the global box index in theFabArray
s. That issource_fabarray[srcIndex]
gives us the source Fab (e.g.,FArrayBox
).CommMetaData::m_LocTags
are for copying data locally (as opposed to via MPI). The information for sending and receiving using MPI is stored inm_SndTags
andm_RcvTags
asstd::map
. The key to the map is the MPI rank (destination rank form_SndTags
and source rank form_RcvTags
). The two boolean flags are used to indicate if there are race conditions (i.e., multiple th…