Skip to content

Commit

Permalink
small syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yaeliyac committed Dec 13, 2024
1 parent 67990af commit 1e113ef
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/components/cl/basic/cl_basic_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ UCC_CLASS_INIT_FUNC(ucc_cl_basic_context_t,
self->super.tl_ctxs = NULL;
return UCC_ERR_NOT_FOUND;
}
cl_debug(cl_config->cl_lib, "initialized :) cl context: %p", self);
cl_debug(cl_config->cl_lib, "initialized cl context: %p", self);
return UCC_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ec/cuda/ec_cuda_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ucc_status_t ucc_cuda_executor_init(const ucc_ee_executor_params_t *params,
eee->requested_ops = 1;
}

//ec_debug(&ucc_ec_cuda.super, "executor init, eee: %p", eee);
ec_debug(&ucc_ec_cuda.super, "executor init, eee: %p", eee);
eee->super.ee_type = params->ee_type;
eee->state = UCC_EC_CUDA_EXECUTOR_INITIALIZED;

Expand Down
18 changes: 6 additions & 12 deletions src/components/tl/ucp/allgather/allgather_knomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ void ucc_tl_ucp_allgather_knomial_progress(ucc_coll_task_t *coll_task)
ucc_status_t status;
size_t extra_count;

uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;

if(!USE_CUDA){
if (!use_cuda) {
if (UCC_INPROGRESS == ucc_tl_ucp_test(task)){
return;
}
}

if(USE_CUDA) EXEC_TASK_TEST(UCC_KN_PHASE_INIT, "failed during ee task test", task->allgather_kn.etask);
if (use_cuda) EXEC_TASK_TEST(UCC_KN_PHASE_INIT, "failed during ee task test", task->allgather_kn.etask);
task->allgather_kn.etask = NULL;

UCC_KN_GOTO_PHASE(task->allgather_kn.phase);
Expand Down Expand Up @@ -227,7 +227,7 @@ ucc_status_t ucc_tl_ucp_allgather_knomial_start(ucc_coll_task_t *coll_task)
ucc_ee_executor_t *exec;
void *rbuf;

uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;

UCC_TL_UCP_PROFILE_REQUEST_EVENT(coll_task, "ucp_allgather_kn_start", 0);
ucc_tl_ucp_task_reset(task, UCC_INPROGRESS);
Expand All @@ -240,7 +240,7 @@ ucc_status_t ucc_tl_ucp_allgather_knomial_start(ucc_coll_task_t *coll_task)
ucc_dt_size(args->dst.info.datatype);
rbuf = args->dst.info.buffer;
if (!UCC_IS_INPLACE(*args)) {
if(USE_CUDA){
if (use_cuda) {
status = ucc_coll_task_get_executor(&task->super, &exec);
if (ucc_unlikely(status != UCC_OK)) {
task->super.status = status;
Expand Down Expand Up @@ -332,13 +332,7 @@ ucc_status_t ucc_tl_ucp_allgather_knomial_init_r(
task->super.post = ucc_tl_ucp_allgather_knomial_start;
task->super.progress = ucc_tl_ucp_allgather_knomial_progress;
*task_h = &task->super;
/*if(!UCC_IS_INPLACE(*args)){
printf("registering inplace %p size: %ld\n", args->src.info.buffer, (int)args->src.info.count * ucc_dt_size(args->src.info.datatype));
ucc_tl_ucp_pre_register_mem(tl_team, args->src.info.buffer, args->src.info.count * ucc_dt_size(args->src.info.datatype), args->src.info.mem_type);
}
printf("registering dst %p size: %ld\n", args->dst.info.buffer, (int)args->dst.info.count * ucc_dt_size(args->dst.info.datatype));
ucc_tl_ucp_pre_register_mem(tl_team, args->dst.info.buffer, args->dst.info.count * ucc_dt_size(args->dst.info.datatype), args->dst.info.mem_type);
*/

return UCC_OK;
}

Expand Down
10 changes: 5 additions & 5 deletions src/components/tl/ucp/allgather/allgather_neighbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ ucc_status_t ucc_tl_ucp_allgather_neighbor_start(ucc_coll_task_t *coll_task)
0);
ucc_tl_ucp_task_reset(task, UCC_INPROGRESS);

uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;

if (!UCC_IS_INPLACE(TASK_ARGS(task))) {
if(!USE_CUDA){
if (use_cuda) {
status = ucc_mc_memcpy(PTR_OFFSET(rbuf, data_size * trank), sbuf,
data_size, rmem, smem);
if (ucc_unlikely(UCC_OK != status)) {
return status;
}
} else {
/* Loopback */
UCPCHECK_GOTO(ucc_tl_ucp_send_nb(sbuf, data_size, smem, trank, team, task),task, out2);
UCPCHECK_GOTO(ucc_tl_ucp_recv_nb(PTR_OFFSET(rbuf, data_size * trank), data_size, rmem, trank, team, task),task, out2);
UCPCHECK_GOTO(ucc_tl_ucp_send_nb(sbuf, data_size, smem, trank, team, task),task, err);
UCPCHECK_GOTO(ucc_tl_ucp_recv_nb(PTR_OFFSET(rbuf, data_size * trank), data_size, rmem, trank, team, task),task, err);
}
}
if (trank % 2) {
Expand All @@ -183,6 +183,6 @@ ucc_status_t ucc_tl_ucp_allgather_neighbor_start(ucc_coll_task_t *coll_task)
task, out);
out:
return ucc_progress_queue_enqueue(UCC_TL_CORE_CTX(team)->pq, &task->super);
out2:
err:
return task->super.status;
}
10 changes: 5 additions & 5 deletions src/components/tl/ucp/allgather/allgather_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void ucc_tl_ucp_allgather_ring_progress(ucc_coll_task_t *coll_task)
recvfrom = ucc_ep_map_eval(task->subset.map, (trank - 1 + tsize) % tsize);


uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int iter = USE_CUDA ? tsize - 1 : tsize;
uint32_t use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int iter = use_cuda ? tsize - 1 : tsize;

while (task->tagged.send_posted < iter) {

step = USE_CUDA ? task->tagged.send_posted : task->tagged.send_posted - 1;
step = use_cuda ? task->tagged.send_posted : task->tagged.send_posted - 1;

sblock = task->allgather_ring.get_send_block(&task->subset, trank,
tsize, step);
Expand Down Expand Up @@ -102,11 +102,11 @@ ucc_status_t ucc_tl_ucp_allgather_ring_start(ucc_coll_task_t *coll_task)
UCC_TL_UCP_PROFILE_REQUEST_EVENT(coll_task, "ucp_allgather_ring_start", 0);
ucc_tl_ucp_task_reset(task, UCC_INPROGRESS);

uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;

if (!UCC_IS_INPLACE(TASK_ARGS(task))) {
block = task->allgather_ring.get_send_block(&task->subset, trank, tsize, 0);
if(USE_CUDA){
if (use_cuda) {
status = ucc_mc_memcpy(PTR_OFFSET(rbuf, data_size * block),
sbuf, data_size, rmem, smem);
if (ucc_unlikely(UCC_OK != status)) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tl/ucp/allgather/allgather_sparbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ ucc_status_t ucc_tl_ucp_allgather_sparbit_start(ucc_coll_task_t *coll_task)
task->allgather_sparbit.i = 0; // setup iteration
task->allgather_sparbit.data_expected = 1;

uint32_t USE_CUDA = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;
int use_cuda = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_cuda;

if (!UCC_IS_INPLACE(TASK_ARGS(task))) {
if(USE_CUDA){
if (use_cuda) {
status = ucc_mc_memcpy(PTR_OFFSET(rbuf, data_size * trank), sbuf,
data_size, rmem, smem);
if (ucc_unlikely(UCC_OK != status)) {
Expand Down

0 comments on commit 1e113ef

Please sign in to comment.