From d843dddf186cac409e1b5a790e01bdc16f8bc24e Mon Sep 17 00:00:00 2001 From: Vishal Sahay Date: Mon, 20 Sep 2004 06:28:41 +0000 Subject: [PATCH] The last few f77 bindings This commit was SVN r2771. --- src/mpi/f77/abort_f.c | 4 +++- src/mpi/f77/accumulate_f.c | 19 +++++++++++++++++-- src/mpi/f77/add_error_class_f.c | 7 ++++++- src/mpi/f77/add_error_code_f.c | 9 ++++++++- src/mpi/f77/add_error_string_f.c | 21 +++++++++++++++++++-- src/mpi/f77/address_f.c | 6 +++++- src/mpi/f77/alloc_mem_f.c | 4 +++- src/mpi/f77/comm_get_parent_f.c | 6 +++++- src/mpi/f77/profile/prototypes_pmpi.h | 10 +++++----- src/mpi/f77/prototypes_mpi.h | 10 +++++----- 10 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/mpi/f77/abort_f.c b/src/mpi/f77/abort_f.c index d0b71f5918..9dcd6cd8ae 100644 --- a/src/mpi/f77/abort_f.c +++ b/src/mpi/f77/abort_f.c @@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ABORT, void mpi_abort_f(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Comm c_comm = MPI_Comm_f2c(*comm); + + *ierr = OMPI_INT_2_FINT(MPI_Abort(c_comm, OMPI_FINT_2_INT(*errorcode))); } diff --git a/src/mpi/f77/accumulate_f.c b/src/mpi/f77/accumulate_f.c index 1b24d71c9e..0a04e0c54c 100644 --- a/src/mpi/f77/accumulate_f.c +++ b/src/mpi/f77/accumulate_f.c @@ -46,7 +46,22 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ACCUMULATE, #include "mpi/f77/profile/defines.h" #endif -void mpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr) +void mpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count, + MPI_Fint *origin_datatype, MPI_Fint *target_rank, + MPI_Fint *target_disp, MPI_Fint *target_count, + MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, + MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype); + MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype); + MPI_Win c_win = MPI_Win_f2c(*win); + MPI_Op c_op = MPI_Op_f2c(*op); + + *ierr = OMPI_INT_2_FINT(MPI_Accumulate(origin_addr, + OMPI_FINT_2_INT(*origin_count), + c_origin_datatype, + OMPI_FINT_2_INT(*target_rank), + (MPI_Aint) *target_disp, + OMPI_FINT_2_INT(*target_count), + c_target_datatype, c_op, c_win)); } diff --git a/src/mpi/f77/add_error_class_f.c b/src/mpi/f77/add_error_class_f.c index e55c29c9c0..c8b4c1cd2f 100644 --- a/src/mpi/f77/add_error_class_f.c +++ b/src/mpi/f77/add_error_class_f.c @@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ADD_ERROR_CLASS, void mpi_add_error_class_f(MPI_Fint *errorclass, MPI_Fint *ierr) { - /* This function not yet implemented */ + OMPI_SINGLE_NAME_DECL(errorclass); + + *ierr = OMPI_INT_2_FINT(MPI_Add_error_class(OMPI_SINGLE_NAME_CONVERT(errorclass) + )); + + OMPI_SINGLE_INT_2_FINT(errorclass); } diff --git a/src/mpi/f77/add_error_code_f.c b/src/mpi/f77/add_error_code_f.c index 54c701b5fb..9840d5edf2 100644 --- a/src/mpi/f77/add_error_code_f.c +++ b/src/mpi/f77/add_error_code_f.c @@ -48,5 +48,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ADD_ERROR_CODE, void mpi_add_error_code_f(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr) { - /* This function not yet implemented */ + OMPI_SINGLE_NAME_DECL(errorcode); + + *ierr = OMPI_INT_2_FINT(MPI_Add_error_code(OMPI_FINT_2_INT(*errorclass), + OMPI_SINGLE_NAME_CONVERT(errorcode) + )); + + OMPI_SINGLE_INT_2_FINT(errorcode); + } diff --git a/src/mpi/f77/add_error_string_f.c b/src/mpi/f77/add_error_string_f.c index b7e7fff17d..35db5d357f 100644 --- a/src/mpi/f77/add_error_string_f.c +++ b/src/mpi/f77/add_error_string_f.c @@ -8,6 +8,10 @@ #include "mpi.h" #include "mpi/f77/bindings.h" +#include "mpi/f77/constants.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" +#include "mpi/f77/strings.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER #pragma weak PMPI_ADD_ERROR_STRING = mpi_add_error_string_f @@ -46,7 +50,20 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ADD_ERROR_STRING, #include "mpi/f77/profile/defines.h" #endif -void mpi_add_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *ierr) +void mpi_add_error_string_f(MPI_Fint *errorcode, char *string, + MPI_Fint *ierr, int len) { - /* This function not yet implemented */ + char *c_string; + int c_err; + + if (len > MPI_MAX_ERROR_STRING) { + c_err = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + "MPI_ADD_ERROR_STRING"); + *ierr = OMPI_INT_2_FINT(c_err); + return; + } + + ompi_fortran_string_f2c(string, len, &c_string); + *ierr = OMPI_INT_2_FINT(MPI_Add_error_string(OMPI_FINT_2_INT(*errorcode), + c_string)); } diff --git a/src/mpi/f77/address_f.c b/src/mpi/f77/address_f.c index 23b44a43d3..f1eb750e28 100644 --- a/src/mpi/f77/address_f.c +++ b/src/mpi/f77/address_f.c @@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ADDRESS, void mpi_address_f(char *location, MPI_Fint *address, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Aint addr; + + *ierr = OMPI_INT_2_FINT(MPI_Address(location, &addr)); + + *address = (MPI_Fint) addr; } diff --git a/src/mpi/f77/alloc_mem_f.c b/src/mpi/f77/alloc_mem_f.c index b074c6f4c5..9a8be8726f 100644 --- a/src/mpi/f77/alloc_mem_f.c +++ b/src/mpi/f77/alloc_mem_f.c @@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ALLOC_MEM, void mpi_alloc_mem_f(MPI_Fint *size, MPI_Fint *info, char *baseptr, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Info c_info = MPI_Info_f2c(*info); + + *ierr = OMPI_INT_2_FINT(MPI_Alloc_mem((MPI_Aint) *size, c_info, baseptr)); } diff --git a/src/mpi/f77/comm_get_parent_f.c b/src/mpi/f77/comm_get_parent_f.c index d64e8bde29..0a34aa5cb0 100644 --- a/src/mpi/f77/comm_get_parent_f.c +++ b/src/mpi/f77/comm_get_parent_f.c @@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_GET_PARENT, void mpi_comm_get_parent_f(MPI_Fint *parent, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Comm c_parent; + + *ierr = OMPI_INT_2_FINT(MPI_Comm_get_parent(&c_parent)); + + *parent = MPI_Comm_c2f(c_parent); } diff --git a/src/mpi/f77/profile/prototypes_pmpi.h b/src/mpi/f77/profile/prototypes_pmpi.h index 04c060b347..83ad74f34d 100644 --- a/src/mpi/f77/profile/prototypes_pmpi.h +++ b/src/mpi/f77/profile/prototypes_pmpi.h @@ -21,7 +21,7 @@ void pmpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void pmpi_add_error_class_f(MPI_Fint *errorclass, MPI_Fint *ierr); void pmpi_add_error_code_f(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_add_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void pmpi_add_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void pmpi_address_f(char *location, MPI_Fint *address, MPI_Fint *ierr); void pmpi_allgather_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_allgatherv_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -313,7 +313,7 @@ void pmpi_abort(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_accumulate(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void pmpi_add_error_class(MPI_Fint *errorclass, MPI_Fint *ierr); void pmpi_add_error_code(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_add_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void pmpi_add_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void pmpi_address(char *location, MPI_Fint *address, MPI_Fint *ierr); void pmpi_allgather(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_allgatherv(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -600,7 +600,7 @@ void pmpi_abort_(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_accumulate_(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void pmpi_add_error_class_(MPI_Fint *errorclass, MPI_Fint *ierr); void pmpi_add_error_code_(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_add_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void pmpi_add_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void pmpi_address_(char *location, MPI_Fint *address, MPI_Fint *ierr); void pmpi_allgather_(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_allgatherv_(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -887,7 +887,7 @@ void pmpi_abort__(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void pmpi_accumulate__(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void pmpi_add_error_class__(MPI_Fint *errorclass, MPI_Fint *ierr); void pmpi_add_error_code__(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void pmpi_add_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void pmpi_add_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void pmpi_address__(char *location, MPI_Fint *address, MPI_Fint *ierr); void pmpi_allgather__(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void pmpi_allgatherv__(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -1174,7 +1174,7 @@ void PMPI_ABORT(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void PMPI_ACCUMULATE(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void PMPI_ADD_ERROR_CLASS(MPI_Fint *errorclass, MPI_Fint *ierr); void PMPI_ADD_ERROR_CODE(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void PMPI_ADD_ERROR_STRING(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void PMPI_ADD_ERROR_STRING(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void PMPI_ADDRESS(char *location, MPI_Fint *address, MPI_Fint *ierr); void PMPI_ALLGATHER(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void PMPI_ALLGATHERV(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); diff --git a/src/mpi/f77/prototypes_mpi.h b/src/mpi/f77/prototypes_mpi.h index 2c6c014852..3aa0a74b7a 100644 --- a/src/mpi/f77/prototypes_mpi.h +++ b/src/mpi/f77/prototypes_mpi.h @@ -25,7 +25,7 @@ void mpi_abort_f(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void mpi_add_error_class_f(MPI_Fint *errorclass, MPI_Fint *ierr); void mpi_add_error_code_f(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_add_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void mpi_add_error_string_f(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void mpi_address_f(char *location, MPI_Fint *address, MPI_Fint *ierr); void mpi_allgather_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void mpi_allgatherv_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -334,7 +334,7 @@ void mpi_abort(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_accumulate(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void mpi_add_error_class(MPI_Fint *errorclass, MPI_Fint *ierr); void mpi_add_error_code(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_add_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void mpi_add_error_string(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void mpi_address(char *location, MPI_Fint *address, MPI_Fint *ierr); void mpi_allgather(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void mpi_allgatherv(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -635,7 +635,7 @@ void mpi_abort_(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_accumulate_(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void mpi_add_error_class_(MPI_Fint *errorclass, MPI_Fint *ierr); void mpi_add_error_code_(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_add_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void mpi_add_error_string_(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void mpi_address_(char *location, MPI_Fint *address, MPI_Fint *ierr); void mpi_allgather_(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void mpi_allgatherv_(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -936,7 +936,7 @@ void mpi_abort__(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void mpi_accumulate__(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void mpi_add_error_class__(MPI_Fint *errorclass, MPI_Fint *ierr); void mpi_add_error_code__(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void mpi_add_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void mpi_add_error_string__(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void mpi_address__(char *location, MPI_Fint *address, MPI_Fint *ierr); void mpi_allgather__(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void mpi_allgatherv__(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); @@ -1237,7 +1237,7 @@ void MPI_ABORT(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr); void MPI_ACCUMULATE(char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr); void MPI_ADD_ERROR_CLASS(MPI_Fint *errorclass, MPI_Fint *ierr); void MPI_ADD_ERROR_CODE(MPI_Fint *errorclass, MPI_Fint *errorcode, MPI_Fint *ierr); -void MPI_ADD_ERROR_STRING(MPI_Fint *errorcode, char *string, MPI_Fint *ierr); +void MPI_ADD_ERROR_STRING(MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l); void MPI_ADDRESS(char *location, MPI_Fint *address, MPI_Fint *ierr); void MPI_ALLGATHER(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr); void MPI_ALLGATHERV(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr);