From c53b3566b577e61ff0797a233c6ac97cfedea2b1 Mon Sep 17 00:00:00 2001 From: Tim Griesbach Date: Wed, 27 Sep 2023 10:37:45 +0200 Subject: [PATCH 1/2] feature-io: Accept all MPI error codes --- src/p4est_io.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/p4est_io.c b/src/p4est_io.c index dd0f8e939..a134aaab3 100644 --- a/src/p4est_io.c +++ b/src/p4est_io.c @@ -1815,8 +1815,8 @@ p4est_file_error_code (int errcode, int *p4est_errcode) return P4EST_FILE_ERR_SUCCESS; default: - /* errcode is not a valid error code */ - SC_ABORT_NOT_REACHED (); + /* errcode may be MPI version 1.1 error code */ + return sc_MPI_Error_class (errcode, p4est_errcode); break; } } @@ -1828,8 +1828,9 @@ p4est_file_error_string (int errclass, char *string, int *resultlen) const char *tstr = NULL; P4EST_ASSERT (resultlen != NULL); - P4EST_ASSERT (P4EST_FILE_ERR_SUCCESS <= errclass - && errclass < P4EST_FILE_ERR_LASTCODE); + P4EST_ASSERT ((sc_MPI_SUCCESS <= errclass && errclass < sc_MPI_ERR_LASTCODE) + || (P4EST_FILE_ERR_SUCCESS <= errclass + && errclass < P4EST_FILE_ERR_LASTCODE)); if (string == NULL || resultlen == NULL) { return sc_MPI_ERR_ARG; @@ -1887,8 +1888,8 @@ p4est_file_error_string (int errclass, char *string, int *resultlen) return sc_MPI_Error_string (sc_MPI_ERR_UNKNOWN, string, resultlen); default: - /* no valid p4est file error code */ - SC_ABORT_NOT_REACHED (); + /* errcode may be MPI version 1.1 error code */ + return sc_MPI_Error_string (errclass, string, resultlen); } P4EST_ASSERT (tstr != NULL); From f1b9d10b46db89631b775fbd3b6474b06cd90a79 Mon Sep 17 00:00:00 2001 From: Tim Griesbach Date: Thu, 28 Sep 2023 11:08:02 +0200 Subject: [PATCH 2/2] feature-io: Map unkown/new error codes to FILE_ERR_UNKNOWN --- src/p4est_io.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/p4est_io.c b/src/p4est_io.c index a134aaab3..d4d66ba95 100644 --- a/src/p4est_io.c +++ b/src/p4est_io.c @@ -1816,8 +1816,8 @@ p4est_file_error_code (int errcode, int *p4est_errcode) default: /* errcode may be MPI version 1.1 error code */ - return sc_MPI_Error_class (errcode, p4est_errcode); - break; + *p4est_errcode = P4EST_FILE_ERR_UNKNOWN; + return P4EST_FILE_ERR_SUCCESS; } } @@ -1828,9 +1828,8 @@ p4est_file_error_string (int errclass, char *string, int *resultlen) const char *tstr = NULL; P4EST_ASSERT (resultlen != NULL); - P4EST_ASSERT ((sc_MPI_SUCCESS <= errclass && errclass < sc_MPI_ERR_LASTCODE) - || (P4EST_FILE_ERR_SUCCESS <= errclass - && errclass < P4EST_FILE_ERR_LASTCODE)); + P4EST_ASSERT (P4EST_FILE_ERR_SUCCESS <= errclass + && errclass < P4EST_FILE_ERR_LASTCODE); if (string == NULL || resultlen == NULL) { return sc_MPI_ERR_ARG; @@ -1888,8 +1887,8 @@ p4est_file_error_string (int errclass, char *string, int *resultlen) return sc_MPI_Error_string (sc_MPI_ERR_UNKNOWN, string, resultlen); default: - /* errcode may be MPI version 1.1 error code */ - return sc_MPI_Error_string (errclass, string, resultlen); + /* no valid p4est file error code */ + SC_ABORT_NOT_REACHED (); } P4EST_ASSERT (tstr != NULL);