Commit 49f9f562 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r9782] Partial revert of r9775.

parent 18bdf5ab
......@@ -644,12 +644,16 @@ int MPIR_Allreduce_inter (
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
fn_exit:
if (mpi_errno_ret)
mpi_errno = mpi_errno_ret;
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
/* MPIR_Allreduce performs an allreduce using point-to-point messages.
......
......@@ -644,6 +644,7 @@ int MPIR_Alltoall_inter(
}
}
fn_exit:
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
if (mpi_errno_ret)
......@@ -652,6 +653,8 @@ int MPIR_Alltoall_inter(
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
......
......@@ -324,6 +324,7 @@ int MPIR_Alltoallv_inter (
}
}
fn_exit:
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
if (mpi_errno_ret)
......@@ -331,6 +332,8 @@ int MPIR_Alltoallv_inter (
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
......
......@@ -320,6 +320,7 @@ int MPIR_Alltoallw_inter (
}
}
fn_exit:
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
if (mpi_errno_ret)
......@@ -327,6 +328,8 @@ int MPIR_Alltoallw_inter (
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
......
......@@ -93,6 +93,8 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, int *errflag )
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
/* A simple utility function to that calls the comm_ptr->coll_fns->Barrier
......
......@@ -29,4 +29,7 @@ int MPIR_Barrier_group( MPID_Comm *comm_ptr, MPID_Group *group_ptr, int tag, int
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
......@@ -342,11 +342,14 @@ static int scatter_for_bcast(
mask >>= 1;
}
fn_exit:
if (mpi_errno_ret)
mpi_errno = mpi_errno_ret;
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
/*
......@@ -1029,11 +1032,14 @@ static int MPIR_SMP_Bcast(
}
}
fn_exit:
if (mpi_errno_ret)
mpi_errno = mpi_errno_ret;
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
......@@ -1189,6 +1195,8 @@ fn_exit:
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
goto fn_exit;
}
......@@ -1275,6 +1283,7 @@ int MPIR_Bcast_inter (
}
}
fn_fail:
MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_BCAST_INTER);
if (mpi_errno_ret)
mpi_errno = mpi_errno_ret;
......
......@@ -589,8 +589,11 @@ int MPIC_Send_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
else
mpi_errno = MPIC_Send(buf, count, datatype, dest, tag, comm);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SEND_FT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
......@@ -657,8 +660,11 @@ int MPIC_Ssend_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag
else
mpi_errno = MPIC_Ssend(buf, count, datatype, dest, tag, comm);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SSEND_FT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
......@@ -794,8 +800,11 @@ int MPIC_Isend_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag
else
mpi_errno = MPIC_Isend(buf, count, datatype, dest, tag, comm, request);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_ISEND_FT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
......@@ -815,8 +824,11 @@ int MPIC_Irecv_ft(void *buf, int count, MPI_Datatype datatype, int source,
else
mpi_errno = MPIC_Irecv(buf, count, datatype, source, tag, comm, request);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_IRECV_FT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
......
......@@ -105,6 +105,8 @@ int MPIR_Reduce_local_impl(void *inbuf, void *inoutbuf, int count, MPI_Datatype
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif
......
......@@ -105,6 +105,7 @@ int MPIR_Comm_init(MPID_Comm *comm_p)
/* Fields not set include context_id, remote and local size, and
kind, since different communicator construction routines need
different values */
fn_fail:
return mpi_errno;
}
......@@ -1641,6 +1642,7 @@ int MPIR_Comm_copy_data(MPID_Comm *comm_ptr, MPID_Comm **outcomm_ptr)
*outcomm_ptr = newcomm_ptr;
fn_fail:
fn_exit:
MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_COPY_DATA);
return mpi_errno;
}
......
......@@ -73,6 +73,8 @@ int MPIR_Group_compare_impl(MPID_Group *group_ptr1, MPID_Group *group_ptr2, int
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif
......
......@@ -97,7 +97,10 @@ int MPIR_Group_translate_ranks_impl(MPID_Group *gp1, int n, int *ranks1,
}
}
}
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
......
......@@ -469,6 +469,7 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
if (mpi_errno == MPI_SUCCESS)
mpi_errno = MPID_InitCompleted();
fn_exit:
MPIU_THREAD_CS_EXIT(INIT,required);
return mpi_errno;
......
......@@ -39,7 +39,8 @@ int MPIR_Progress_wait_request(MPID_Request *req)
}
MPID_Progress_end(&progress_state);
}
fn_fail:
fn_fail: /* no special err handling at this level */
fn_exit:
return mpi_errno;
}
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_changed_impl(int *stamp)
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_get_categories_impl(int cat_index, int len, int indices[])
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_get_cvars_impl(int cat_index, int len, int indices[])
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_get_info_impl(int cat_index, char *name, int *name_len, char
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_get_num_impl(int *num_cat)
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
......@@ -34,7 +34,10 @@ int MPIR_T_category_get_pvars_impl(int cat_index[], int len, int indices[])
/* TODO implement this function */
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
#endif /* MPICH_MPI_FROM_PMPI */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment