first class

This commit is contained in:
Saeed Maleki
2023-04-18 05:30:07 +00:00
parent 65597e1f63
commit 0315c29aba
2 changed files with 25 additions and 0 deletions

View File

@@ -20,6 +20,20 @@ struct mscclppBootstrapHandle
static_assert(sizeof(struct mscclppBootstrapHandle) <= sizeof(mscclppUniqueId),
"Bootstrap handle is too large to fit inside MSCCLPP unique ID");
class mscclppBootstrap : Bootstrap {
public:
mscclppBootstrap(std::string ip_port_pair, int rank, int nranks);
mscclppBootstrap(mscclppBootstrapHandle handle, int rank, int nranks);
mscclppBootstrapHandle mscclppGetUniqueId();
void Send(void* data, int size, int peer, int tag);
void Recv(void* data, int size, int peer, int tag);
void AllGather(void* allData, int size);
void Barrier();
private:
struct impl;
std::unique_ptr<impl> pimpl;
};
mscclppResult_t bootstrapNetInit(const char* ip_port_pair = NULL);
mscclppResult_t bootstrapCreateRoot(struct mscclppBootstrapHandle* handle);
mscclppResult_t bootstrapGetUniqueId(struct mscclppBootstrapHandle* handle, bool isRoot = true,

View File

@@ -247,6 +247,17 @@ typedef enum
mscclppNumResults = 8
} mscclppResult_t;
class Bootstrap {
public:
Bootstrap(){};
virtual ~Bootstrap() = 0;
virtual void Send(void* data, int size, int peer, int tag) = 0;
virtual void Recv(void* data, int size, int peer, int tag) = 0;
virtual void AllGather(void* allData, int size) = 0;
virtual void Barrier() = 0;
};
/* Create a unique ID for communication. Only needs to be called by one process.
* Use with mscclppCommInitRankFromId().
* All processes need to provide the same ID to mscclppCommInitRankFromId().