epoch creation

This commit is contained in:
Saeed Maleki
2023-05-02 21:39:43 +00:00
parent c44b48b361
commit a4e6ffe2bc
5 changed files with 23 additions and 11 deletions

View File

@@ -17,7 +17,7 @@
if (res != mscclppSuccess && res != mscclppInProgress) { \
throw std::runtime_error(std::string("Call to " #call " failed with error code ") + mscclppGetErrorString(res)); \
} \
} while (0);
} while (false)
#define CUDATHROW(cmd) \
do { \

View File

@@ -35,15 +35,16 @@ public:
// TODO: move implementations of these helpers out of this header
void send(const std::vector<char>& data, int peer, int tag)
{
send((void*)data.size(), sizeof(size_t), peer, tag);
send((void*)data.data(), data.size(), peer, tag);
size_t size = data.size();
send((void*)&size, sizeof(size_t), peer, tag);
send((void*)data.data(), data.size(), peer, tag+1);
}
void recv(std::vector<char>& data, int peer, int tag)
{
size_t size;
recv((void*)&size, sizeof(size_t), peer, tag);
data.resize(size);
recv((void*)data.data(), data.size(), peer, tag);
recv((void*)data.data(), data.size(), peer, tag+1);
}
};