00001 00007 /* 00008 Migration messages are sent from HomePatch to HomePatch 00009 with lists of atoms and atom information (if any) that 00010 need to be migrated. A message must be sent from a 00011 neighbor even if null so that the HomePatch knows 00012 what atoms it will have before commencing a positionsReady() 00013 to its Computes. 00014 */ 00015 00016 #ifndef MIGRATEATOMSMSG_H 00017 #define MIGRATEATOMSMSG_H 00018 00019 #include "charm++.h" 00020 00021 #include "NamdTypes.h" 00022 #include "SortedArray.h" 00023 #include "Migration.h" 00024 #include "PatchMgr.decl.h" 00025 00026 // Message which stores list of atoms and their data 00027 // which are to be migrated from one patch to another. 00028 // This message does not contain information that will change asynchronously 00029 // It does not need to be prepacked 00030 class MigrateAtomsMsg : public CMessage_MigrateAtomsMsg { 00031 public: 00032 NodeID fromNodeID; 00033 PatchID srcPatchID; 00034 PatchID destPatchID; 00035 MigrationList migrationList; 00036 00037 MigrateAtomsMsg(PatchID source, PatchID destination, MigrationList &m); 00038 MigrateAtomsMsg(void) { ; } 00039 00040 // pack and unpack functions 00041 static void* pack(MigrateAtomsMsg* msg); 00042 static MigrateAtomsMsg* unpack(void *ptr); 00043 }; 00044 00045 class MigrateAtomsCombinedMsg : public CMessage_MigrateAtomsCombinedMsg 00046 { 00047 public: 00048 NodeID fromNodeID; 00049 ResizeArray<PatchID> srcPatchID; 00050 ResizeArray<PatchID> destPatchID; 00051 ResizeArray<int> numAtoms; 00052 int totalAtoms; 00053 MigrationList migrationList; 00054 00055 MigrateAtomsCombinedMsg(void); 00056 ~MigrateAtomsCombinedMsg(void) { }; 00057 00058 void add(PatchID source, PatchID destination, MigrationList &m); 00059 void distribute(void); 00060 00061 // pack and unpack functions 00062 static void* pack(MigrateAtomsCombinedMsg *msg); 00063 static MigrateAtomsCombinedMsg* unpack(void *ptr); 00064 }; 00065 00066 #endif 00067
1.3.9.1