Skip to content

Commit

Permalink
BUILD: fix coverity warns (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev authored Jun 29, 2023
1 parent 22dc12d commit ccfb77c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
25 changes: 16 additions & 9 deletions src/components/cl/hier/bcast/bcast_2step.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,26 @@ ucc_cl_hier_bcast_2step_init_schedule(ucc_base_coll_args_t *coll_args,
n_tasks++;
}

ucc_task_subscribe_dep(&schedule->super, tasks[first_task],
UCC_EVENT_SCHEDULE_STARTED);
ucc_schedule_add_task(schedule, tasks[first_task]);
UCC_CHECK_GOTO(ucc_task_subscribe_dep(&schedule->super, tasks[first_task],
UCC_EVENT_SCHEDULE_STARTED),
out, status);
UCC_CHECK_GOTO(ucc_schedule_add_task(schedule, tasks[first_task]),
out, status);
if (n_tasks > 1) {
if (root == rank) {
ucc_task_subscribe_dep(&schedule->super, tasks[(first_task + 1) % 2],
UCC_EVENT_SCHEDULE_STARTED);
UCC_CHECK_GOTO(ucc_task_subscribe_dep(&schedule->super,
tasks[(first_task + 1) % 2],
UCC_EVENT_SCHEDULE_STARTED),
out, status);
} else {
ucc_task_subscribe_dep(tasks[first_task],
tasks[(first_task + 1) % 2],
UCC_EVENT_COMPLETED);
UCC_CHECK_GOTO(ucc_task_subscribe_dep(tasks[first_task],
tasks[(first_task + 1) % 2],
UCC_EVENT_COMPLETED),
out, status);
}
ucc_schedule_add_task(schedule, tasks[(first_task + 1) % 2]);
UCC_CHECK_GOTO(ucc_schedule_add_task(schedule,
tasks[(first_task + 1) % 2]),
out, status);
}

schedule->super.post = ucc_cl_hier_bcast_2step_start;
Expand Down
10 changes: 7 additions & 3 deletions src/components/tl/ucp/alltoall/alltoall_bruck.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,13 @@ void ucc_tl_ucp_alltoall_bruck_progress(ucc_coll_task_t *coll_task)
} else {
data = PTR_OFFSET(scratch, send_buffer_index * seg_size);
}
ucc_mc_memcpy(PTR_OFFSET(mergebuf, seg_size * snd_count),
data, seg_size, UCC_MEMORY_TYPE_HOST,
UCC_MEMORY_TYPE_HOST);
st = ucc_mc_memcpy(PTR_OFFSET(mergebuf, seg_size * snd_count),
data, seg_size, UCC_MEMORY_TYPE_HOST,
UCC_MEMORY_TYPE_HOST);
if (ucc_unlikely(UCC_OK != st)) {
task->super.status = st;
return;
}
snd_count++;
}
data = PTR_OFFSET(scratch, level * nrecv_segs * seg_size);
Expand Down
15 changes: 8 additions & 7 deletions src/utils/ucc_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static int ucc_check_section(ucc_section_desc_t sec_desc,
return 1;
}

static inline int ucc_check_range(char *range_str, size_t *begin, size_t *end)
static inline int ucc_check_range(char *range_str, ucc_rank_t *begin,
ucc_rank_t *end)
{
char **range = ucc_str_split(range_str, "-");
char *str_end;
Expand Down Expand Up @@ -143,22 +144,22 @@ ucc_parse_section_name_to_desc(const char *sec_name, ucc_section_desc_t *desc)
desc->mask |= UCC_TUNING_DESC_FIELD_MODEL;
}
else if (strcmp(cur_str[0], "team_size") == 0) {
if (!ucc_check_range(cur_str[1], (size_t *) &desc->min_team_size,
(size_t *) &desc->max_team_size)) {
if (!ucc_check_range(cur_str[1], &desc->min_team_size,
&desc->max_team_size)) {
goto err_key;
}
desc->mask |= UCC_TUNING_DESC_FIELD_TEAM_SIZE;
}
else if (strcmp(cur_str[0], "ppn") == 0) {
if (!ucc_check_range(cur_str[1], (size_t *) &desc->min_ppn,
(size_t *) &desc->max_ppn)) {
if (!ucc_check_range(cur_str[1], &desc->min_ppn,
&desc->max_ppn)) {
goto err_key;
}
desc->mask |= UCC_TUNING_DESC_FIELD_PPN;
}
else if (strcmp(cur_str[0], "nnodes") == 0) {
if (!ucc_check_range(cur_str[1], (size_t *) &desc->min_nnodes,
(size_t *) &desc->max_nnodes)) {
if (!ucc_check_range(cur_str[1], &desc->min_nnodes,
&desc->max_nnodes)) {
goto err_key;
}
desc->mask |= UCC_TUNING_DESC_FIELD_NNODES;
Expand Down

0 comments on commit ccfb77c

Please sign in to comment.