diff --git a/src/schedule/ucc_schedule_pipelined.c b/src/schedule/ucc_schedule_pipelined.c index f1399282ed..eefb015640 100644 --- a/src/schedule/ucc_schedule_pipelined.c +++ b/src/schedule/ucc_schedule_pipelined.c @@ -210,11 +210,13 @@ 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; + + n_deps_satisfied = ucc_atomic_fadd8(&task->n_deps_satisfied, 1); - task->n_deps_satisfied++; ucc_trace_req("task %p, n_deps %d, satisfied %d", task, task->n_deps, - task->n_deps_satisfied); - if (task->n_deps == task->n_deps_satisfied) { + n_deps_satisfied); + if (task->n_deps == n_deps_satisfied + 1) { task->start_time = parent->start_time; status = task->post(task); if (status >= 0) { diff --git a/src/utils/ucc_atomic.h b/src/utils/ucc_atomic.h index aaecf605ea..d5aabd1829 100644 --- a/src/utils/ucc_atomic.h +++ b/src/utils/ucc_atomic.h @@ -11,6 +11,7 @@ #define ucc_atomic_add32 ucs_atomic_add32 #define ucc_atomic_fadd32 ucs_atomic_fadd32 +#define ucc_atomic_fadd8 ucs_atomic_fadd8 #define ucc_atomic_sub32 ucs_atomic_sub32 #define ucc_atomic_add64 ucs_atomic_add64 #define ucc_atomic_sub64 ucs_atomic_sub64