Skip to content

Commit bf4e1b4

Browse files
authored
Merge pull request #8008 from jsquyres/pr/cleanup-of-mpi-errors-and-exceptions
Cleanup of MPI errors and exceptions
2 parents f3832c1 + 20c772e commit bf4e1b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+411
-440
lines changed

ompi/communicator/comm_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static void ompi_comm_destruct(ompi_communicator_t* comm)
419419
from one communicator to another and we end up destroying the
420420
new communication while propagating the error up the stack. We
421421
want to make it all the way up the stack to invoke the MPI
422-
exception, not cause a seg fault in pml_del_comm because it was
422+
error, not cause a seg fault in pml_del_comm because it was
423423
never pml_add_com'ed. */
424424

425425
if ( MPI_COMM_NULL != comm && OMPI_COMM_IS_PML_ADDED(comm) ) {

ompi/debuggers/ompi_mpihandles_dll.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ int mpidbg_init_per_process(mqs_process *process,
390390
&mpidbg_errhandler_name_map[i++]);
391391
fill_map(image, "MPI_ERRHANDLER_NULL", "ompi_mpi_errhandler_null",
392392
&mpidbg_errhandler_name_map[i++]);
393-
/* MPI::ERRORS_THROW_EXCEPTIONS exists as a symbol in OMPI; no
394-
need to alias it here */
395393

396394
/* Sentinel value */
397395
mpidbg_errhandler_name_map[i].map_name = NULL;

ompi/errhandler/errhandler.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ ompi_predefined_errhandler_t *ompi_mpi_errors_abort_addr =
7474
ompi_predefined_errhandler_t ompi_mpi_errors_return = {{{0}}};
7575
ompi_predefined_errhandler_t *ompi_mpi_errors_return_addr =
7676
&ompi_mpi_errors_return;
77-
ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions = {{{0}}};
78-
ompi_predefined_errhandler_t *ompi_mpi_errors_throw_exceptions_addr =
79-
&ompi_mpi_errors_throw_exceptions;
8077

8178
static opal_mutex_t errhandler_init_lock = OPAL_MUTEX_STATIC_INIT;
8279
ompi_errhandler_t* ompi_initial_error_handler_eh = NULL;
@@ -192,26 +189,6 @@ int ompi_errhandler_init(void)
192189
"MPI_ERRORS_ABORT",
193190
sizeof(ompi_mpi_errors_abort.eh.eh_name));
194191

195-
/* If we're going to use C++, functions will be fixed up during
196-
MPI::Init. Note that it is proper to use ERRHANDLER_LANG_C here;
197-
the dispatch function is in C (although in libmpi_cxx); the
198-
conversion from C handles to C++ handles happens in that dispatch
199-
function -- not the errhandler_invoke.c stuff here in libmpi. */
200-
OBJ_CONSTRUCT( &ompi_mpi_errors_throw_exceptions.eh, ompi_errhandler_t );
201-
ompi_mpi_errors_throw_exceptions.eh.eh_mpi_object_type =
202-
OMPI_ERRHANDLER_TYPE_PREDEFINED;
203-
ompi_mpi_errors_throw_exceptions.eh.eh_lang = OMPI_ERRHANDLER_LANG_C;
204-
ompi_mpi_errors_throw_exceptions.eh.eh_comm_fn =
205-
ompi_mpi_errors_are_fatal_comm_handler;
206-
ompi_mpi_errors_throw_exceptions.eh.eh_file_fn =
207-
ompi_mpi_errors_are_fatal_file_handler;
208-
ompi_mpi_errors_throw_exceptions.eh.eh_win_fn =
209-
ompi_mpi_errors_are_fatal_win_handler ;
210-
ompi_mpi_errors_throw_exceptions.eh.eh_fort_fn = NULL;
211-
opal_string_copy(ompi_mpi_errors_throw_exceptions.eh.eh_name,
212-
"MPI_ERRORS_THROW_EXCEPTIONS",
213-
sizeof(ompi_mpi_errors_throw_exceptions.eh.eh_name));
214-
215192
/* Lets initialize the initial error handler if not already done */
216193
char *env = getenv("OMPI_MCA_mpi_initial_errhandler");
217194
if( NULL != env ) {
@@ -228,7 +205,6 @@ int ompi_errhandler_finalize(void)
228205
{
229206
OBJ_DESTRUCT(&ompi_mpi_errhandler_null.eh);
230207
OBJ_DESTRUCT(&ompi_mpi_errors_return.eh);
231-
OBJ_DESTRUCT(&ompi_mpi_errors_throw_exceptions.eh);
232208
OBJ_DESTRUCT(&ompi_mpi_errors_are_fatal.eh);
233209

234210
/* JMS Add stuff here checking for unreleased errorhandlers,

ompi/errhandler/errhandler.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ OMPI_DECLSPEC extern ompi_predefined_errhandler_t *ompi_mpi_errors_return_addr;
175175
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errors_abort;
176176
OMPI_DECLSPEC extern ompi_predefined_errhandler_t *ompi_mpi_errors_abort_addr;
177177

178-
/**
179-
* Global variable for MPI::ERRORS_THROW_EXCEPTIONS. Will abort if
180-
* MPI_INIT wasn't called as MPI::INIT (_addr flavor is for F03 bindings)
181-
*/
182-
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions;
183-
184178
/**
185179
* Table for Fortran <-> C errhandler handle conversion
186180
*/
@@ -387,7 +381,7 @@ struct ompi_request_t;
387381
*
388382
* @returns err_code The same value as the parameter
389383
*
390-
* This function invokes the MPI exception function on the error
384+
* This function invokes the MPI error function on the error
391385
* handler. If the errhandler was created from fortran, the error
392386
* handler will be invoked with fortran linkage. Otherwise, it is
393387
* invoked with C linkage.
@@ -400,7 +394,7 @@ struct ompi_request_t;
400394

401395

402396
/**
403-
* Invoke an MPI exception on the first request found in the array
397+
* Invoke an MPI error on the first request found in the array
404398
* that has a non-MPI_SUCCESS value for MPI_ERROR in its status. It
405399
* is safe to invoke this function if none of the requests have an
406400
* outstanding error; MPI_SUCCESS will be returned.

ompi/errhandler/errhandler_invoke.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int ompi_errhandler_request_invoke(int count,
141141
ompi_mpi_object_t mpi_object;
142142

143143
/* Find the *first* request that has an error -- that's the one
144-
that we'll invoke the exception on. In an error condition, the
144+
that we'll invoke the error on. In an error condition, the
145145
request will not have been reset back to MPI_REQUEST_NULL, so
146146
there's no need to cache values from before we call
147147
ompi_request_test(). */
@@ -162,18 +162,18 @@ int ompi_errhandler_request_invoke(int count,
162162

163163
/* Since errors on requests cause them to not be freed (until we
164164
can examine them here), go through and free all requests with
165-
errors. We only invoke the exception on the *first* request
165+
errors. We only invoke the error on the *first* request
166166
that had an error. */
167167
for (; i < count; ++i) {
168168
if (MPI_REQUEST_NULL != requests[i] &&
169169
MPI_SUCCESS != requests[i]->req_status.MPI_ERROR) {
170170
/* Ignore the error -- what are we going to do? We're
171-
already going to invoke an exception */
171+
already going to invoke an error */
172172
ompi_request_free(&(requests[i]));
173173
}
174174
}
175175

176-
/* Invoke the exception */
176+
/* Invoke the error */
177177
switch (type) {
178178
case OMPI_REQUEST_PML:
179179
case OMPI_REQUEST_COLL:

ompi/mca/io/base/io_base_find_available.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int init_query_2_0_0(const mca_base_component_t *ls,
5353
* and destroy the opened list.
5454
*
5555
* It is *not* an error if there are no io components available.
56-
* Appropriate run-time MPI exceptions will be invoked during
56+
* Appropriate run-time MPI errors will be invoked during
5757
* MPI_FILE_OPEN and MPI_FILE_DELETE.
5858
*/
5959
int mca_io_base_find_available(bool enable_progress_threads,

ompi/mpi/c/errhandler_free.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
4444

4545
if (MPI_PARAM_CHECK) {
4646
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
47-
/* Raise an MPI exception if we got NULL or if we got an intrinsic
47+
/* Raise an MPI error if we got NULL or if we got an intrinsic
4848
*and* the reference count is 1 (meaning that this FREE would
4949
actually free the underlying intrinsic object). This is ugly
5050
but necessary -- see below. */

ompi/mpi/java/java/CartComm.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected CartComm(long[] commRequest)
9292
* Duplicates this communicator.
9393
* <p>Java binding of {@code MPI_COMM_DUP}.
9494
* @return copy of this communicator
95-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
95+
* @throws MPIException Signals that an MPI error of some sort has occurred.
9696
*/
9797
@Override public CartComm dup() throws MPIException
9898
{
@@ -106,7 +106,7 @@ protected CartComm(long[] commRequest)
106106
* <p>The new communicator can't be used before the operation completes.
107107
* The request object must be obtained calling {@link #getRequest}.
108108
* @return copy of this communicator
109-
* @throws MPIException Signals that an MPI exception of some sort has occurred. Signals that an MPI exception of some sort has occurred.
109+
* @throws MPIException Signals that an MPI error of some sort has occurred. Signals that an MPI exception of some sort has occurred.
110110
*/
111111
@Override public CartComm iDup() throws MPIException
112112
{
@@ -119,7 +119,7 @@ protected CartComm(long[] commRequest)
119119
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
120120
* @param info info object to associate with the new communicator
121121
* @return copy of this communicator
122-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
122+
* @throws MPIException Signals that an MPI error of some sort has occurred.
123123
*/
124124
@Override public CartComm dupWithInfo(Info info) throws MPIException
125125
{
@@ -134,7 +134,7 @@ protected CartComm(long[] commRequest)
134134
* <p>The number of dimensions can be obtained from the size of (eg)
135135
* {@code dims} field of the returned object.
136136
* @return object containing dimensions, periods and local coordinates
137-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
137+
* @throws MPIException Signals that an MPI error of some sort has occurred.
138138
*/
139139
public CartParms getTopo() throws MPIException
140140
{
@@ -149,7 +149,7 @@ public CartParms getTopo() throws MPIException
149149
* <p>Java binding of the MPI operation {@code MPI_CART_RANK}.
150150
* @param coords Cartesian coordinates of a process
151151
* @return rank of the specified process
152-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
152+
* @throws MPIException Signals that an MPI error of some sort has occurred.
153153
*/
154154
public int getRank(int[] coords) throws MPIException
155155
{
@@ -164,7 +164,7 @@ public int getRank(int[] coords) throws MPIException
164164
* <p>Java binding of the MPI operation {@code MPI_CART_COORDS}.
165165
* @param rank rank of a process
166166
* @return Cartesian coordinates of the specified process
167-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
167+
* @throws MPIException Signals that an MPI error of some sort has occurred.
168168
*/
169169
public int[] getCoords(int rank) throws MPIException
170170
{
@@ -180,7 +180,7 @@ public int[] getCoords(int rank) throws MPIException
180180
* @param direction coordinate dimension of shift
181181
* @param disp displacement
182182
* @return object containing ranks of source and destination processes
183-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
183+
* @throws MPIException Signals that an MPI error of some sort has occurred.
184184
*/
185185
public ShiftParms shift(int direction, int disp) throws MPIException
186186
{
@@ -197,7 +197,7 @@ private native ShiftParms shift(long comm, int direction, int disp)
197197
* @param remainDims by dimension, {@code true} if dimension is to be kept,
198198
* {@code false} otherwise
199199
* @return communicator containing subgrid including this process
200-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
200+
* @throws MPIException Signals that an MPI error of some sort has occurred.
201201
*/
202202
public CartComm sub(boolean[] remainDims) throws MPIException
203203
{
@@ -215,7 +215,7 @@ public CartComm sub(boolean[] remainDims) throws MPIException
215215
* @param periods {@code true} if grid is periodic,
216216
* {@code false} if not, in each dimension
217217
* @return reordered rank of calling process
218-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
218+
* @throws MPIException Signals that an MPI error of some sort has occurred.
219219
*/
220220
public int map(int[] dims, boolean[] periods) throws MPIException
221221
{
@@ -231,7 +231,7 @@ private native int map(long comm, int[] dims, boolean[] periods)
231231
* <p>Java binding of the MPI operation {@code MPI_DIMS_CREATE}.
232232
* @param nnodes number of nodes in a grid
233233
* @param dims array specifying the number of nodes in each dimension
234-
* @throws MPIException Signals that an MPI exception of some sort has occurred.
234+
* @throws MPIException Signals that an MPI error of some sort has occurred.
235235
*/
236236
public static void createDims(int nnodes, int[] dims) throws MPIException
237237
{

0 commit comments

Comments
 (0)