MigrateAtomsCombinedMsg Class Reference

#include <MigrateAtomsMsg.h>

List of all members.

Public Member Functions

 MigrateAtomsCombinedMsg (void)
 ~MigrateAtomsCombinedMsg (void)
void add (PatchID source, PatchID destination, MigrationList &m)
void distribute (void)

Static Public Member Functions

static void * pack (MigrateAtomsCombinedMsg *msg)
static MigrateAtomsCombinedMsgunpack (void *ptr)

Public Attributes

NodeID fromNodeID
ResizeArray< PatchIDsrcPatchID
ResizeArray< PatchIDdestPatchID
ResizeArray< int > numAtoms
int totalAtoms
MigrationList migrationList

Detailed Description

Definition at line 44 of file MigrateAtomsMsg.h.


Constructor & Destructor Documentation

MigrateAtomsCombinedMsg::MigrateAtomsCombinedMsg ( void   ) 
MigrateAtomsCombinedMsg::~MigrateAtomsCombinedMsg ( void   )  [inline]

Definition at line 55 of file MigrateAtomsMsg.h.

00055 { };


Member Function Documentation

void MigrateAtomsCombinedMsg::add ( PatchID  source,
PatchID  destination,
MigrationList m 
)

Definition at line 40 of file MigrateAtomsMsg.C.

References ResizeArray< Elem >::add(), destPatchID, migrationList, numAtoms, ResizeArray< Elem >::size(), srcPatchID, and totalAtoms.

Referenced by PatchMgr::sendMigrationMsgs().

00041 {
00042   srcPatchID.add(source);
00043   destPatchID.add(destination);
00044   int n = m.size();
00045   numAtoms.add(n);
00046   totalAtoms += n;
00047   for ( int i = 0; i < n; ++i )
00048   {
00049     migrationList.add(m[i]);
00050   }
00051 }

void MigrateAtomsCombinedMsg::distribute ( void   ) 

Definition at line 54 of file MigrateAtomsMsg.C.

References DebugM, HomePatch::depositMigration(), destPatchID, MigrateAtomsMsg::destPatchID, fromNodeID, MigrateAtomsMsg::fromNodeID, PatchMap::homePatch(), j, migrationList, MigrateAtomsMsg::migrationList, NAMD_bug(), numAtoms, PatchMap::Object(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::size(), MigrateAtomsMsg::srcPatchID, srcPatchID, and totalAtoms.

Referenced by PatchMgr::recvMigrateAtomsCombined().

00055 {
00056   int n = srcPatchID.size();
00057   int m = 0;
00058   for ( int i = 0; i < n; ++i )
00059   {
00060     MigrateAtomsMsg *msg = new MigrateAtomsMsg;
00061     msg->fromNodeID = fromNodeID;
00062     msg->srcPatchID = srcPatchID[i];
00063     msg->destPatchID = destPatchID[i];
00064     int l = numAtoms[i];
00065     {
00066       DebugM(3,"Distributing " << l << " atoms to patch " << msg->destPatchID << "\n");
00067       msg->migrationList.resize(l);
00068       for ( int j = 0; j < l; ++j ) msg->migrationList[j] = migrationList[m+j];
00069       m += l;
00070     }
00071     PatchMap::Object()->homePatch(msg->destPatchID)->depositMigration(msg);
00072   }
00073   if ( m != totalAtoms ) NAMD_bug("MigrateAtomsCombinedMsg::distribute bad atom count");
00074 }

static void* MigrateAtomsCombinedMsg::pack ( MigrateAtomsCombinedMsg msg  )  [static]
static MigrateAtomsCombinedMsg* MigrateAtomsCombinedMsg::unpack ( void *  ptr  )  [static]

Member Data Documentation

Definition at line 49 of file MigrateAtomsMsg.h.

Referenced by add(), and distribute().

Definition at line 47 of file MigrateAtomsMsg.h.

Referenced by distribute().

Definition at line 52 of file MigrateAtomsMsg.h.

Referenced by add(), and distribute().

Definition at line 50 of file MigrateAtomsMsg.h.

Referenced by add(), and distribute().

Definition at line 48 of file MigrateAtomsMsg.h.

Referenced by add(), distribute(), and PatchMgr::recvMigrateAtomsCombined().

Definition at line 51 of file MigrateAtomsMsg.h.

Referenced by add(), and distribute().


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

Generated on 11 Nov 2019 for NAMD by  doxygen 1.6.1