Commit b77c1981 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Rename abort_ppm function to PPM_abort.

parent a0c28258
......@@ -59,21 +59,21 @@
void
abort_ppm_fwrap(MPI_Fint *comm_f, const char *msg, const char *source, int line)
PPM_abort_f(MPI_Fint *comm_f, const char *msg, const char *source, int line)
{
#if defined(USE_MPI) && defined(HAVE_MPI_COMM_F2C)
MPI_Comm comm_c = MPI_Comm_f2c((MPI_Fint)*comm_f);
#else
MPI_Comm comm_c = *comm_f;
#endif
abort_ppm(&comm_c, msg, source, line);
PPM_abort(&comm_c, msg, source, line);
}
FCALLSCSUB4(abort_ppm_fwrap, ABORT_PPM_F, abort_ppm_f, PVOID, STRING,
FCALLSCSUB4(PPM_abort_f, PPM_ABORT, ppm_abort, PVOID, STRING,
STRING, INT)
void
abort_ppm_default(MPI_Comm *comm, const char *msg, const char *source, int line)
PPM_abort_default(MPI_Comm *comm, const char *msg, const char *source, int line)
{
int flag = 0;
fprintf(stderr, "Fatal error in %s, line %d: %s\n", source, line, msg);
......@@ -87,7 +87,7 @@ abort_ppm_default(MPI_Comm *comm, const char *msg, const char *source, int line)
#endif
}
abort_func abort_ppm = abort_ppm_default;
PPM_abort_func PPM_abort = PPM_abort_default;
/*
* Local Variables:
......
......@@ -60,9 +60,9 @@ typedef int MPI_Comm;
typedef int MPI_Fint;
#endif
typedef void (*abort_func)(MPI_Comm *comm, const char *msg,
const char *source, int line);
extern abort_func abort_ppm;
typedef void (*PPM_abort_func)(MPI_Comm *comm, const char *msg,
const char *source, int line);
extern PPM_abort_func PPM_abort;
/*
* Local Variables:
* license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
......
......@@ -46,30 +46,30 @@
#include "core/core.h"
void
ppm_set_mpi_abort_handler(MPI_Comm comm)
PPM_set_mpi_abort_handler(MPI_Comm comm)
{
MPI_Errhandler errh;
if (MPI_Comm_create_errhandler((MPI_Comm_errhandler_fn *)abort,
&errh) != MPI_SUCCESS)
abort_ppm(&comm, "Error handler creation failed.", __FILE__, __LINE__);
PPM_abort(&comm, "Error handler creation failed.", __FILE__, __LINE__);
if (MPI_Comm_set_errhandler(comm, errh) != MPI_SUCCESS)
abort_ppm(&comm, "Error handler setup failed.", __FILE__, __LINE__);
PPM_abort(&comm, "Error handler setup failed.", __FILE__, __LINE__);
}
void
ppm_set_mpi_abort_handler_fwrap(MPI_Fint *comm_f)
PPM_set_mpi_abort_handler_f(MPI_Fint *comm_f)
{
#ifdef HAVE_MPI_COMM_F2C
MPI_Comm comm_c = MPI_Comm_f2c((MPI_Fint)*comm_f);
#else
MPI_Comm comm_c = *comm_f;
#endif
scales_ppm_set_mpi_abort_handler(comm_c);
PPM_set_mpi_abort_handler(comm_c);
}
FCALLSCSUB1(ppm_set_mpi_abort_handler_fwrap, SET_MPI_ABORT_HANDLER,
set_mpi_abort_handler, PVOID)
FCALLSCSUB1(PPM_set_mpi_abort_handler_f, PPM_SET_MPI_ABORT_HANDLER,
ppm_set_mpi_abort_handler, PVOID)
/*
......
......@@ -50,6 +50,12 @@ MODULE ppm_base
INTEGER, PARAMETER :: mpi_comm_world = 0
#endif
PRIVATE
INTERFACE
SUBROUTINE ppm_abort(comm, msg, source, line)
INTEGER, INTENT(in) :: comm, line
CHARACTER(*), INTENT(in) :: msg, source
END SUBROUTINE ppm_abort
END INTERFACE
PUBLIC :: abort_ppm, assertion
CONTAINS
SUBROUTINE abort_ppm(msg, source, line, comm)
......@@ -62,7 +68,7 @@ CONTAINS
ELSE
comm_dummy = mpi_comm_world
END IF
CALL abort_ppm_f(comm_dummy, msg, source, line)
CALL ppm_abort(comm_dummy, msg, source, line)
END SUBROUTINE abort_ppm
SUBROUTINE assertion(cond, origfile, origline, msg)
......
Supports Markdown
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