1
1

Ensure that we invoke fortran errorhandlers with a function prototype

that uses MPI_Fint's, and that we convert the C int's to MPI_Fint's
before invocation.

This commit was SVN r5029.
Этот коммит содержится в:
Jeff Squyres 2005-03-25 20:25:28 +00:00
родитель b5082f09c2
Коммит df8c736993
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -43,7 +43,8 @@ enum {
/** /**
* Typedef for all fortran errhandler functions * Typedef for all fortran errhandler functions
*/ */
typedef void (ompi_errhandler_fortran_handler_fn_t)(int *, int *, ...); typedef void (ompi_errhandler_fortran_handler_fn_t)(MPI_Fint *,
MPI_Fint *, ...);
/** /**
* Typedef for generic errhandler function * Typedef for generic errhandler function

Просмотреть файл

@ -20,12 +20,13 @@
#include "win/win.h" #include "win/win.h"
#include "file/file.h" #include "file/file.h"
#include "errhandler/errhandler.h" #include "errhandler/errhandler.h"
#include "mpi/f77/fint_2_int.h"
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object, int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
int object_type, int err_code, const char *message) int object_type, int err_code, const char *message)
{ {
int fortran_handle; MPI_Fint fortran_handle, fortran_err_code = OMPI_INT_2_FINT(err_code);
ompi_communicator_t *comm; ompi_communicator_t *comm;
#if OMPI_WANT_MPI2_ONE_SIDED #if OMPI_WANT_MPI2_ONE_SIDED
ompi_win_t *win; ompi_win_t *win;
@ -44,8 +45,8 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
case OMPI_ERRHANDLER_TYPE_COMM: case OMPI_ERRHANDLER_TYPE_COMM:
comm = (ompi_communicator_t *) mpi_object; comm = (ompi_communicator_t *) mpi_object;
if (errhandler->eh_fortran_function) { if (errhandler->eh_fortran_function) {
fortran_handle = comm->c_f_to_c_index; fortran_handle = OMPI_INT_2_FINT(comm->c_f_to_c_index);
errhandler->eh_fort_fn(&fortran_handle, &err_code); errhandler->eh_fort_fn(&fortran_handle, &fortran_err_code);
} else { } else {
errhandler->eh_comm_fn(&comm, &err_code, message, NULL); errhandler->eh_comm_fn(&comm, &err_code, message, NULL);
} }
@ -55,8 +56,8 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
case OMPI_ERRHANDLER_TYPE_WIN: case OMPI_ERRHANDLER_TYPE_WIN:
win = (ompi_win_t *) mpi_object; win = (ompi_win_t *) mpi_object;
if (errhandler->eh_fortran_function) { if (errhandler->eh_fortran_function) {
fortran_handle = win->w_f_to_c_index; fortran_handle = OMPI_INT_2_FINT(win->w_f_to_c_index);
errhandler->eh_fort_fn(&fortran_handle, &err_code); errhandler->eh_fort_fn(&fortran_handle, &fortran_err_code);
} else { } else {
errhandler->eh_win_fn(&win, &err_code, message, NULL); errhandler->eh_win_fn(&win, &err_code, message, NULL);
} }
@ -66,8 +67,8 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
case OMPI_ERRHANDLER_TYPE_FILE: case OMPI_ERRHANDLER_TYPE_FILE:
file = (ompi_file_t *) mpi_object; file = (ompi_file_t *) mpi_object;
if (errhandler->eh_fortran_function) { if (errhandler->eh_fortran_function) {
fortran_handle = file->f_f_to_c_index; fortran_handle = OMPI_INT_2_FINT(file->f_f_to_c_index);
errhandler->eh_fort_fn(&fortran_handle, &err_code); errhandler->eh_fort_fn(&fortran_handle, &fortran_err_code);
} else { } else {
errhandler->eh_file_fn(&file, &err_code, message, NULL); errhandler->eh_file_fn(&file, &err_code, message, NULL);
} }