@@ -8,7 +8,7 @@ int gpucomm_new(gpucomm** comm, gpucontext* ctx, gpucommCliqueId comm_id,
88 int ndev , int rank ) {
99 if (ctx -> comm_ops == NULL ) {
1010 * comm = NULL ;
11- return GA_UNSUPPORTED_ERROR ;
11+ return error_set ( ctx -> err , GA_UNSUPPORTED_ERROR , "Collectives unavailable" ) ;
1212 }
1313 return ctx -> comm_ops -> comm_new (comm , ctx , comm_id , ndev , rank );
1414}
@@ -30,21 +30,21 @@ gpucontext* gpucomm_context(gpucomm* comm) {
3030}
3131int gpucomm_gen_clique_id (gpucontext * ctx , gpucommCliqueId * comm_id ) {
3232 if (ctx -> comm_ops == NULL )
33- return GA_COMM_ERROR ;
33+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
3434 return ctx -> comm_ops -> generate_clique_id (ctx , comm_id );
3535}
3636
3737int gpucomm_get_count (gpucomm * comm , int * gpucount ) {
3838 gpucontext * ctx = gpucomm_context (comm );
3939 if (ctx -> comm_ops == NULL )
40- return GA_COMM_ERROR ;
40+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
4141 return ctx -> comm_ops -> get_count (comm , gpucount );
4242}
4343
4444int gpucomm_get_rank (gpucomm * comm , int * rank ) {
4545 gpucontext * ctx = gpucomm_context (comm );
4646 if (ctx -> comm_ops == NULL )
47- return GA_COMM_ERROR ;
47+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
4848 return ctx -> comm_ops -> get_rank (comm , rank );
4949}
5050
@@ -53,7 +53,7 @@ int gpucomm_reduce(gpudata* src, size_t offsrc, gpudata* dest, size_t offdest,
5353 gpucomm * comm ) {
5454 gpucontext * ctx = gpucomm_context (comm );
5555 if (ctx -> comm_ops == NULL )
56- return GA_COMM_ERROR ;
56+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
5757 return ctx -> comm_ops -> reduce (src , offsrc , dest , offdest , count , typecode ,
5858 opcode , root , comm );
5959}
@@ -63,7 +63,7 @@ int gpucomm_all_reduce(gpudata* src, size_t offsrc, gpudata* dest,
6363 gpucomm * comm ) {
6464 gpucontext * ctx = gpucomm_context (comm );
6565 if (ctx -> comm_ops == NULL )
66- return GA_COMM_ERROR ;
66+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
6767 return ctx -> comm_ops -> all_reduce (src , offsrc , dest , offdest , count , typecode ,
6868 opcode , comm );
6969}
@@ -73,7 +73,7 @@ int gpucomm_reduce_scatter(gpudata* src, size_t offsrc, gpudata* dest,
7373 int opcode , gpucomm * comm ) {
7474 gpucontext * ctx = gpucomm_context (comm );
7575 if (ctx -> comm_ops == NULL )
76- return GA_COMM_ERROR ;
76+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
7777 return ctx -> comm_ops -> reduce_scatter (src , offsrc , dest , offdest , count ,
7878 typecode , opcode , comm );
7979}
@@ -82,7 +82,7 @@ int gpucomm_broadcast(gpudata* array, size_t offset, size_t count, int typecode,
8282 int root , gpucomm * comm ) {
8383 gpucontext * ctx = gpucomm_context (comm );
8484 if (ctx -> comm_ops == NULL )
85- return GA_COMM_ERROR ;
85+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
8686 return ctx -> comm_ops -> broadcast (array , offset , count , typecode , root , comm );
8787}
8888
@@ -91,7 +91,7 @@ int gpucomm_all_gather(gpudata* src, size_t offsrc, gpudata* dest,
9191 gpucomm * comm ) {
9292 gpucontext * ctx = gpucomm_context (comm );
9393 if (ctx -> comm_ops == NULL )
94- return GA_COMM_ERROR ;
94+ return error_set ( ctx -> err , GA_DEVSUP_ERROR , "Collectives unavailable" ) ;
9595 return ctx -> comm_ops -> all_gather (src , offsrc , dest , offdest , count , typecode ,
9696 comm );
9797}
0 commit comments