Skip to content

Commit

Permalink
CORE: fix n deps overflow in pipelined schedule (openucx#1051)
Browse files Browse the repository at this point in the history
* CORE: fix n deps overflow in pipelined schedule

* REVIEW: fix review comments
  • Loading branch information
Sergei-Lebedev authored and fuxu committed Dec 26, 2024
1 parent aab3d69 commit d754a7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/schedule/ucc_schedule.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand Down Expand Up @@ -107,9 +107,9 @@ typedef struct ucc_coll_task {
/* used for lf mt progress queue */
ucc_lf_queue_elem_t lf_elem;
};
uint8_t n_deps;
uint8_t n_deps_satisfied;
uint8_t n_deps_base;
uint32_t n_deps;
uint32_t n_deps_satisfied;
uint32_t n_deps_base;
/* timestamp of the start time: either post or triggered_post */
double start_time;
uint32_t seq_num;
Expand Down
7 changes: 4 additions & 3 deletions src/schedule/ucc_schedule_pipelined.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand Down Expand Up @@ -254,9 +254,10 @@ ucc_status_t ucc_dependency_handler(ucc_coll_task_t *parent,
ucc_coll_task_t *task)
{
ucc_status_t status;
uint8_t n_deps_satisfied;
uint32_t n_deps_satisfied;

n_deps_satisfied = ucc_atomic_fadd8(&task->n_deps_satisfied, 1);
n_deps_satisfied = ucc_atomic_fadd32(&task->n_deps_satisfied, 1);
ucc_assert(task->n_deps_satisfied > n_deps_satisfied);

ucc_trace_req("task %p, n_deps %d, satisfied %d", task, task->n_deps,
n_deps_satisfied);
Expand Down

0 comments on commit d754a7e

Please sign in to comment.