Skip to content

Commit cc68810

Browse files
authored
[CRL] Bootstrap extension (#491)
1 parent 947a0d2 commit cc68810

33 files changed

Lines changed: 1710 additions & 861 deletions

flagcx/adaptor/ccl/bootstrap_adaptor.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const char *bootstrapAdaptorGetLastError(flagcxInnerComm_t comm) {
7373
flagcxResult_t bootstrapAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
7474
flagcxUniqueId_t /*commId*/,
7575
int rank,
76-
bootstrapState *bootstrap) {
76+
struct bootstrapState *bootstrap) {
7777
if (*comm == NULL) {
7878
FLAGCXCHECK(flagcxCalloc(comm, 1));
7979
}
@@ -142,7 +142,7 @@ flagcxResult_t bootstrapAdaptorCommSuspend(flagcxInnerComm_t comm) {
142142

143143
flagcxResult_t bootstrapAdaptorCommCount(const flagcxInnerComm_t comm,
144144
int *count) {
145-
*count = comm->base->nranks;
145+
*count = bootstrapGetNranks(comm->base);
146146
return flagcxSuccess;
147147
}
148148

@@ -154,7 +154,7 @@ flagcxResult_t bootstrapAdaptorCommCuDevice(const flagcxInnerComm_t comm,
154154

155155
flagcxResult_t bootstrapAdaptorCommUserRank(const flagcxInnerComm_t comm,
156156
int *rank) {
157-
*rank = comm->base->rank;
157+
*rank = bootstrapGetRank(comm->base);
158158
return flagcxSuccess;
159159
}
160160

flagcx/adaptor/ccl/cncl_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const char *cnclAdaptorGetLastError(flagcxInnerComm_t comm) {
6464

6565
flagcxResult_t cnclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
6666
flagcxUniqueId_t commId, int rank,
67-
bootstrapState * /*bootstrap*/) {
67+
struct bootstrapState * /*bootstrap*/) {
6868
if (*comm == NULL) {
6969
flagcxCalloc(comm, 1);
7070
}

flagcx/adaptor/ccl/dunccl_adaptor.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ const char *duncclAdaptorGetLastError(flagcxInnerComm_t comm) {
3131
return ncclGetLastError(comm->base);
3232
}
3333

34-
flagcxResult_t duncclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
35-
flagcxUniqueId_t commId, int rank,
36-
bootstrapState * /*bootstrap*/) {
34+
flagcxResult_t
35+
duncclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
36+
flagcxUniqueId_t commId, int rank,
37+
struct bootstrapState * /*bootstrap*/) {
3738
if (*comm == NULL) {
3839
flagcxCalloc(comm, 1);
3940
}

flagcx/adaptor/ccl/eccl_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ flagcxResult_t ecclAdaptorGetStagedBuffer(const flagcxInnerComm_t comm,
3737

3838
flagcxResult_t ecclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
3939
flagcxUniqueId_t commId, int rank,
40-
bootstrapState * /*bootstrap*/) {
40+
struct bootstrapState * /*bootstrap*/) {
4141
if (*comm == NULL) {
4242
flagcxCalloc(comm, 1);
4343
}

flagcx/adaptor/ccl/gloo_adaptor.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,14 @@ const char *glooAdaptorGetLastError(flagcxInnerComm_t comm) {
8585

8686
flagcxResult_t glooAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
8787
flagcxUniqueId_t /*commId*/, int rank,
88-
bootstrapState *bootstrap) {
88+
struct bootstrapState *bootstrap) {
8989
// Create gloo transport device
9090
std::shared_ptr<::gloo::transport::Device> dev;
91-
flagcxNetProperties_t *properties =
92-
(flagcxNetProperties_t *)bootstrap->properties;
91+
flagcxNetProperties_t *properties = bootstrapGetNetProperties();
9392
if (flagcxParamGlooIbDisable() || flagcxParamTopoDetectionDisable()) {
9493
// Use transport tcp
9594
::gloo::transport::tcp::attr attr;
96-
attr.iface = std::string(bootstrap->bootstrapNetIfName);
95+
attr.iface = std::string(bootstrapGetNetIfName());
9796
dev = ::gloo::transport::tcp::CreateDevice(attr);
9897
} else {
9998
// Use transport ibverbs

flagcx/adaptor/ccl/hccl_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const char *hcclAdaptorGetLastError(flagcxInnerComm_t comm) {
9696

9797
flagcxResult_t hcclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
9898
flagcxUniqueId_t commId, int rank,
99-
bootstrapState * /*bootstrap*/) {
99+
struct bootstrapState * /*bootstrap*/) {
100100
if (*comm == NULL) {
101101
flagcxCalloc(comm, 1);
102102
}

flagcx/adaptor/ccl/ixnccl_adaptor.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ const char *ixncclAdaptorGetLastError(flagcxInnerComm_t comm) {
3131
return ncclGetLastError(comm->base);
3232
}
3333

34-
flagcxResult_t ixncclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
35-
flagcxUniqueId_t commId, int rank,
36-
bootstrapState * /*bootstrap*/) {
34+
flagcxResult_t
35+
ixncclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
36+
flagcxUniqueId_t commId, int rank,
37+
struct bootstrapState * /*bootstrap*/) {
3738
if (*comm == NULL) {
3839
flagcxCalloc(comm, 1);
3940
}

flagcx/adaptor/ccl/mccl_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const char *mcclAdaptorGetLastError(flagcxInnerComm_t comm) {
3838

3939
flagcxResult_t mcclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
4040
flagcxUniqueId_t commId, int rank,
41-
bootstrapState * /*bootstrap*/) {
41+
struct bootstrapState * /*bootstrap*/) {
4242
if (*comm == NULL) {
4343
flagcxCalloc(comm, 1);
4444
}

flagcx/adaptor/ccl/mpi_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const char *mpiAdaptorGetLastError(flagcxInnerComm_t comm) {
9191

9292
flagcxResult_t mpiAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
9393
flagcxUniqueId_t /*commId*/, int rank,
94-
bootstrapState *bootstrap) {
94+
struct bootstrapState *bootstrap) {
9595
int initialized;
9696
MPI_Initialized(&initialized);
9797

flagcx/adaptor/ccl/musa_mccl_adaptor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const char *mcclAdaptorGetLastError(flagcxInnerComm_t comm) {
3434

3535
flagcxResult_t mcclAdaptorCommInitRank(flagcxInnerComm_t *comm, int nranks,
3636
flagcxUniqueId_t commId, int rank,
37-
bootstrapState * /*bootstrap*/) {
37+
struct bootstrapState * /*bootstrap*/) {
3838
if (*comm == NULL) {
3939
flagcxCalloc(comm, 1);
4040
}

0 commit comments

Comments
 (0)