Skip to content

Commit

Permalink
coll: add missing fn_fail
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhou committed Jun 28, 2024
1 parent 4221a07 commit f717faf
Show file tree
Hide file tree
Showing 23 changed files with 112 additions and 28 deletions.
3 changes: 3 additions & 0 deletions src/mpi/coll/alltoall/alltoall_inter_pairwise_exchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ int MPIR_Alltoall_inter_pairwise_exchange(const void *sendbuf, MPI_Aint sendcoun
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ int MPIR_Alltoall_intra_pairwise_sendrecv_replace(const void *sendbuf,
}
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 3 additions & 0 deletions src/mpi/coll/alltoallv/alltoallv_inter_pairwise_exchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,8 @@ int MPIR_Alltoallv_inter_pairwise_exchange(const void *sendbuf, const MPI_Aint *
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ int MPIR_Alltoallv_intra_pairwise_sendrecv_replace(const void *sendbuf, const MP
}
}

fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}
4 changes: 4 additions & 0 deletions src/mpi/coll/alltoallw/alltoallw_inter_pairwise_exchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,9 @@ int MPIR_Alltoallw_inter_pairwise_exchange(const void *sendbuf, const MPI_Aint s
recvcount, recvtype, src, MPIR_ALLTOALLW_TAG, comm_ptr, &status);
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ int MPIR_Alltoallw_intra_pairwise_sendrecv_replace(const void *sendbuf, const MP
}
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 3 additions & 0 deletions src/mpi/coll/barrier/barrier_intra_k_dissemination.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ int MPIR_Barrier_intra_dissemination(MPIR_Comm * comm_ptr)
mask <<= 1;
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}

/* Algorithm: high radix dissemination
Expand Down
3 changes: 3 additions & 0 deletions src/mpi/coll/barrier/barrier_intra_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ int MPIR_Barrier_intra_smp(MPIR_Comm * comm_ptr)
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 3 additions & 0 deletions src/mpi/coll/bcast/bcast_inter_remote_send_local_bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ int MPIR_Bcast_inter_remote_send_local_bcast(void *buffer,
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 1 addition & 2 deletions src/mpi/coll/bcast/bcast_intra_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ int MPIR_Bcast_intra_smp(void *buffer, MPI_Aint count, MPI_Datatype datatype, in
* algorithm that (at least approximately) minimized internode
* communication. */
mpi_errno =
MPIR_Bcast_intra_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr,
errflag);
MPIR_Bcast_intra_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr);
MPIR_ERR_CHECK(mpi_errno);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/mpi/coll/bcast/bcast_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ int MPII_Scatter_for_bcast(void *buffer ATTRIBUTE((unused)),
mask >>= 1;
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 3 additions & 0 deletions src/mpi/coll/gather/gather_inter_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ int MPIR_Gather_inter_linear(const void *sendbuf, MPI_Aint sendcount, MPI_Dataty
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
3 changes: 1 addition & 2 deletions src/mpi/coll/gather/gather_inter_local_gather_remote_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ int MPIR_Gather_inter_local_gather_remote_send(const void *sendbuf, MPI_Aint sen

/* now do the a local gather on this intracommunicator */
mpi_errno = MPIR_Gather(sendbuf, sendcount, sendtype,
tmp_buf, sendcount * sendtype_sz, MPI_BYTE, 0, newcomm_ptr,
errflag);
tmp_buf, sendcount * sendtype_sz, MPI_BYTE, 0, newcomm_ptr);
MPIR_ERR_CHECK(mpi_errno);

if (rank == 0) {
Expand Down
15 changes: 12 additions & 3 deletions src/mpi/coll/iallgather/iallgather_tsp_recexch.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ static int MPIR_TSP_Iallgather_sched_intra_recexch_data_exchange(int rank, int n
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -91,8 +93,11 @@ static int MPIR_TSP_Iallgather_sched_intra_recexch_step1(int step1_sendto, int *
}
}

fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -169,9 +174,11 @@ static int MPIR_TSP_Iallgather_sched_intra_recexch_step2(int step1_sendto, int s

*nrecvs_ = nrecvs;

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -201,9 +208,11 @@ static int MPIR_TSP_Iallgather_sched_intra_recexch_step3(int step1_sendto, int *
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down
16 changes: 12 additions & 4 deletions src/mpi/coll/iallgatherv/iallgatherv_tsp_recexch.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ static int MPIR_TSP_Iallgatherv_sched_intra_recexch_data_exchange(int rank, int
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -101,9 +103,11 @@ static int MPIR_TSP_Iallgatherv_sched_intra_recexch_step1(int step1_sendto, int
}
}

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -185,9 +189,11 @@ int MPIR_TSP_Iallgatherv_sched_intra_recexch_step2(int step1_sendto, int step2_n

*nrecvs_ = nrecvs;

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down Expand Up @@ -222,9 +228,11 @@ static int MPIR_TSP_Iallgatherv_sched_intra_recexch_step3(int step1_sendto, int
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}

/* Routine to schedule a recursive exchange based allgather */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ int MPIR_TSP_Iallreduce_sched_intra_recexch_step1(const void *sendbuf,
}
}
}

fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}
23 changes: 14 additions & 9 deletions src/mpi/coll/ialltoall/ialltoall_tsp_brucks.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
static int
brucks_sched_pup(int pack, void *rbuf, void *pupbuf, MPI_Datatype rtype, MPI_Aint count,
int phase, int k, int digitval, int comm_size, int *pupsize,
MPIR_TSP_sched_t sched, int ninvtcs, int *invtcs)
MPIR_TSP_sched_t sched, int ninvtcs, int *invtcs, int *sink_id)
{
MPI_Aint type_extent, type_lb, type_true_extent;
int pow_k_phase, offset, nconsecutive_occurrences, delta;
int *dtcopy_id;
int counter;
int sink_id, vtx_id;
int vtx_id;
int mpi_errno = MPI_SUCCESS;

MPIR_FUNC_ENTER;
Expand Down Expand Up @@ -99,14 +99,16 @@ brucks_sched_pup(int pack, void *rbuf, void *pupbuf, MPI_Datatype rtype, MPI_Ain
*pupsize += count * type_extent; /* NOTE: This may not be extent, it might be type_size - CHECK THIS */
}

mpi_errno = MPIR_TSP_sched_selective_sink(sched, counter, dtcopy_id, &sink_id);
mpi_errno = MPIR_TSP_sched_selective_sink(sched, counter, dtcopy_id, sink_id);
MPIR_ERR_CHECK(mpi_errno);

MPL_free(dtcopy_id);

fn_exit:
MPIR_FUNC_EXIT;

return sink_id;
return mpi_errno;
fn_fail:
goto fn_exit;
}

int
Expand Down Expand Up @@ -271,10 +273,11 @@ MPIR_TSP_Ialltoall_sched_intra_brucks(const void *sendbuf, MPI_Aint sendcount,
pack_invtcs[k - 1] = sendids[j - 1];
pack_ninvtcs = k;
}
packids[j - 1] =
mpi_errno =
brucks_sched_pup(1, recvbuf, tmp_sbuf[i][j - 1],
recvtype, recvcount, i, k, j, size,
&packsize, sched, pack_ninvtcs, pack_invtcs);
&packsize, sched, pack_ninvtcs, pack_invtcs, &packids[j - 1]);
MPIR_ERR_CHECK(mpi_errno);
*unpack_invtcs = packids[j - 1];
unpack_ninvtcs = 1;

Expand All @@ -295,10 +298,12 @@ MPIR_TSP_Ialltoall_sched_intra_brucks(const void *sendbuf, MPI_Aint sendcount,

*(unpack_invtcs + 1) = recvids[j - 1];
unpack_ninvtcs = 2;
unpackids[j - 1] =
mpi_errno =
brucks_sched_pup(0, recvbuf, tmp_rbuf[i][j - 1], recvtype,
recvcount, i, k, j, size,
&packsize, sched, unpack_ninvtcs, unpack_invtcs);
&packsize, sched, unpack_ninvtcs, unpack_invtcs,
&unpackids[j - 1]);
MPIR_ERR_CHECK(mpi_errno);
num_unpacks_in_last_phase++;
}
MPIR_Localcopy(unpackids, sizeof(int) * (k - 1), MPI_BYTE,
Expand Down
4 changes: 3 additions & 1 deletion src/mpi/coll/ireduce_scatter/ireduce_scatter_tsp_recexch.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ int MPIR_TSP_Ireduce_scatter_sched_intra_recexch_step2(void *tmp_results, void *
if (is_out_vtcs)
*reduce_id_ = reduce_id;

fn_exit:
MPIR_FUNC_EXIT;

return mpi_errno;
fn_fail:
goto fn_exit;
}


Expand Down
5 changes: 4 additions & 1 deletion src/mpi/coll/scatter/scatter_inter_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int MPIR_Scatter_inter_linear(const void *sendbuf, MPI_Aint sendcount, MPI_Datat

if (root == MPI_PROC_NULL) {
/* local processes other than root do nothing */
return MPI_SUCCESS;
goto fn_exit;
}

remote_size = comm_ptr->remote_size;
Expand All @@ -42,5 +42,8 @@ int MPIR_Scatter_inter_linear(const void *sendbuf, MPI_Aint sendcount, MPI_Datat
MPIR_ERR_CHECK(mpi_errno);
}

fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ int MPIR_Scatter_inter_remote_send_local_scatter(const void *sendbuf, MPI_Aint s
if (root == MPI_ROOT) {
/* root sends all data to rank 0 on remote group and returns */
mpi_errno =
MPIC_Send(sendbuf, sendcount * remote_size, sendtype, 0, MPIR_SCATTER_TAG, comm_ptr,
errflag);
MPIC_Send(sendbuf, sendcount * remote_size, sendtype, 0, MPIR_SCATTER_TAG, comm_ptr);
MPIR_ERR_CHECK(mpi_errno);
goto fn_exit;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,21 +455,21 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_POSIX_nb_release_gather_ibcast_impl(void *loc
mpi_errno =
MPIR_TSP_sched_generic(finish_send_recv_type_id, data, sched, 1, &first_vtx_id,
&second_vtx_id);
MPI_ERR_CHECK(mpi_errno);
MPIR_ERR_CHECK(mpi_errno);

mpi_errno =
MPIR_TSP_sched_generic(update_release_flag_type_id, data, sched, 1, &second_vtx_id,
&third_vtx_id);
MPI_ERR_CHECK(mpi_errno);
MPIR_ERR_CHECK(mpi_errno);

mpi_errno =
MPIR_TSP_sched_cb(&MPIDI_POSIX_NB_RG_non_root_datacopy_cb, data, sched, 1,
&third_vtx_id, &fourth_vtx_id);
MPI_ERR_CHECK(mpi_errno);
MPIR_ERR_CHECK(mpi_errno);

mpi_errno =
MPIR_TSP_sched_generic(gather_type_id, data, sched, 1, &fourth_vtx_id, &fifth_vtx_id);
MPI_ERR_CHECK(mpi_errno);
MPIR_ERR_CHECK(mpi_errno);

mpi_errno =
MPIR_TSP_sched_cb(&MPIDI_POSIX_NB_RG_update_gather_flag_cb, data, sched, 1,
Expand Down
2 changes: 2 additions & 0 deletions src/mpid/ch4/shm/posix/release_gather/release_gather.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,6 @@ int MPIDI_POSIX_mpi_release_gather_comm_free(MPIR_Comm * comm_ptr)
fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}
Loading

0 comments on commit f717faf

Please sign in to comment.