From e623dfd74a59450402d5b53952fe0ff69265a995 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 28 Apr 2025 15:50:07 +0530 Subject: [PATCH 1/5] use "MPI_STATUSES_IGNORE" global variable as bindC --- src/mpi.f90 | 2 +- src/mpi_c_bindings.f90 | 10 ++++------ src/mpi_wrapper.c | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index 5996808..9828535 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -754,7 +754,7 @@ subroutine MPI_Waitall_proc(count, array_of_requests, array_of_statuses, ierror) integer(kind=MPI_HANDLE_KIND), dimension(count) :: c_requests type(c_ptr) :: MPI_STATUSES_IGNORE_from_c - MPI_STATUSES_IGNORE_from_c = c_mpi_statuses_ignore() + MPI_STATUSES_IGNORE_from_c = c_mpi_statuses_ignore ! Convert Fortran requests to C requests. do i = 1, count diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index 283f1a1..d17a955 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -1,4 +1,5 @@ module mpi_c_bindings + use iso_c_binding, only: c_ptr implicit none #ifdef OPEN_MPI @@ -7,8 +8,10 @@ module mpi_c_bindings #define MPI_HANDLE_KIND 4 #endif + type(c_ptr), bind(C, name="c_MPI_STATUSES_IGNORE") :: c_mpi_statuses_ignore + interface - + function c_mpi_comm_f2c(comm_f) bind(C, name="MPI_Comm_f2c") use iso_c_binding, only: c_int, c_ptr integer(c_int), value :: comm_f @@ -77,11 +80,6 @@ function c_mpi_info_f2c(info_f) bind(C, name="MPI_Info_f2c") integer(kind=MPI_HANDLE_KIND) :: c_mpi_info_f2c end function c_mpi_info_f2c - function c_mpi_statuses_ignore() bind(C, name="get_c_MPI_STATUSES_IGNORE") - use iso_c_binding, only: c_ptr - type(c_ptr) :: c_mpi_statuses_ignore - end function c_mpi_statuses_ignore - function c_mpi_in_place_f2c() bind(C,name="get_c_MPI_IN_PLACE") use iso_c_binding, only: c_ptr type(c_ptr) :: c_mpi_in_place_f2c diff --git a/src/mpi_wrapper.c b/src/mpi_wrapper.c index 4e11a30..a410c9b 100644 --- a/src/mpi_wrapper.c +++ b/src/mpi_wrapper.c @@ -28,6 +28,4 @@ void* get_c_MPI_IN_PLACE() { return MPI_IN_PLACE; } -MPI_Status* get_c_MPI_STATUSES_IGNORE() { - return MPI_STATUSES_IGNORE; -} +MPI_Status* c_MPI_STATUSES_IGNORE = MPI_STATUSES_IGNORE; From 2adad91b9e1fe6b365b6a3af70917893ae0c08b0 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 28 Apr 2025 15:55:40 +0530 Subject: [PATCH 2/5] use MPI_INFO_NULL as global variable with bindC --- src/mpi.f90 | 2 +- src/mpi_c_bindings.f90 | 5 +---- src/mpi_wrapper.c | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index 9828535..f0f8643 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -151,7 +151,7 @@ integer(kind=MPI_HANDLE_KIND) function handle_mpi_info_f2c(info_f) result(c_info use mpi_c_bindings, only: c_mpi_info_f2c, c_mpi_info_null integer, intent(in) :: info_f if (info_f == MPI_INFO_NULL) then - c_info = c_mpi_info_null() + c_info = c_mpi_info_null else c_info = c_mpi_info_f2c(info_f) end if diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index d17a955..9fc07e8 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -9,6 +9,7 @@ module mpi_c_bindings #endif type(c_ptr), bind(C, name="c_MPI_STATUSES_IGNORE") :: c_mpi_statuses_ignore + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INFO_NULL") :: c_mpi_info_null interface @@ -48,10 +49,6 @@ function c_mpi_comm_world() bind(C, name="get_c_MPI_COMM_WORLD") integer(kind=MPI_HANDLE_KIND) :: c_mpi_comm_world end function c_mpi_comm_world - function c_mpi_info_null() bind(C, name="get_c_MPI_INFO_NULL") - integer(kind=MPI_HANDLE_KIND) :: c_mpi_info_null - end function c_mpi_info_null - function c_mpi_sum() bind(C, name="get_c_MPI_SUM") integer(kind=MPI_HANDLE_KIND) :: c_mpi_sum end function c_mpi_sum diff --git a/src/mpi_wrapper.c b/src/mpi_wrapper.c index a410c9b..3e58f3e 100644 --- a/src/mpi_wrapper.c +++ b/src/mpi_wrapper.c @@ -12,10 +12,6 @@ MPI_Datatype get_c_MPI_INT() { return MPI_INT; } -MPI_Info get_c_MPI_INFO_NULL() { - return MPI_INFO_NULL; -} - MPI_Op get_c_MPI_SUM() { return MPI_SUM; } @@ -29,3 +25,5 @@ void* get_c_MPI_IN_PLACE() { } MPI_Status* c_MPI_STATUSES_IGNORE = MPI_STATUSES_IGNORE; + +MPI_Info c_MPI_INFO_NULL = MPI_INFO_NULL; From 16bc4048fdee9c72a85b251d1b1f4981e6ae3b88 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 28 Apr 2025 16:02:22 +0530 Subject: [PATCH 3/5] use global bindC var's for MPI_Datatype --- src/mpi.f90 | 6 +++--- src/mpi_c_bindings.f90 | 21 ++++++++++++--------- src/mpi_wrapper.c | 6 ++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index f0f8643..ad9f768 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -161,11 +161,11 @@ integer(kind=MPI_HANDLE_KIND) function handle_mpi_datatype_f2c(datatype_f) resul use mpi_c_bindings, only: c_mpi_float, c_mpi_double, c_mpi_int integer, intent(in) :: datatype_f if (datatype_f == MPI_REAL4) then - c_datatype = c_mpi_float() + c_datatype = c_mpi_float else if (datatype_f == MPI_REAL8 .OR. datatype_f == MPI_DOUBLE_PRECISION) then - c_datatype = c_mpi_double() + c_datatype = c_mpi_double else if (datatype_f == MPI_INTEGER) then - c_datatype = c_mpi_int() + c_datatype = c_mpi_int end if end function diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index 9fc07e8..955f50e 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -10,6 +10,9 @@ module mpi_c_bindings type(c_ptr), bind(C, name="c_MPI_STATUSES_IGNORE") :: c_mpi_statuses_ignore integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INFO_NULL") :: c_mpi_info_null + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_DOUBLE") :: c_mpi_double + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_FLOAT") :: c_mpi_float + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INT") :: c_mpi_int interface @@ -53,17 +56,17 @@ function c_mpi_sum() bind(C, name="get_c_MPI_SUM") integer(kind=MPI_HANDLE_KIND) :: c_mpi_sum end function c_mpi_sum - function c_mpi_float() bind(C, name="get_c_MPI_FLOAT") - integer(kind=MPI_HANDLE_KIND) :: c_mpi_float - end function + ! function c_mpi_float() bind(C, name="get_c_MPI_FLOAT") + ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_float + ! end function - function c_mpi_double() bind(C, name="get_c_MPI_DOUBLE") - integer(kind=MPI_HANDLE_KIND) :: c_mpi_double - end function + ! function c_mpi_double() bind(C, name="get_c_MPI_DOUBLE") + ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_double + ! end function - function c_mpi_int() bind(C, name="get_c_MPI_INT") - integer(kind=MPI_HANDLE_KIND) :: c_mpi_int - end function + ! function c_mpi_int() bind(C, name="get_c_MPI_INT") + ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_int + ! end function function c_mpi_op_f2c(op_f) bind(C, name="MPI_Op_f2c") use iso_c_binding, only: c_ptr, c_int diff --git a/src/mpi_wrapper.c b/src/mpi_wrapper.c index 3e58f3e..98c7dab 100644 --- a/src/mpi_wrapper.c +++ b/src/mpi_wrapper.c @@ -27,3 +27,9 @@ void* get_c_MPI_IN_PLACE() { MPI_Status* c_MPI_STATUSES_IGNORE = MPI_STATUSES_IGNORE; MPI_Info c_MPI_INFO_NULL = MPI_INFO_NULL; + +MPI_Datatype c_MPI_DOUBLE = MPI_DOUBLE; + +MPI_Datatype c_MPI_FLOAT = MPI_FLOAT; + +MPI_Datatype c_MPI_INT = MPI_INT; From 4f2cd8d4678171ad7ebbdeac818c117e82692e0a Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 28 Apr 2025 16:06:31 +0530 Subject: [PATCH 4/5] use bindC global var for MPI_COMM_WORLD --- src/mpi.f90 | 14 +++++--------- src/mpi_c_bindings.f90 | 18 +----------------- src/mpi_wrapper.c | 18 ++---------------- 3 files changed, 8 insertions(+), 42 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index ad9f768..b3ce0f6 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -141,7 +141,7 @@ integer(kind=MPI_HANDLE_KIND) function handle_mpi_comm_f2c(comm_f) result(c_comm use mpi_c_bindings, only: c_mpi_comm_size, c_mpi_comm_f2c, c_mpi_comm_world integer, intent(in) :: comm_f if (comm_f == MPI_COMM_WORLD) then - c_comm = c_mpi_comm_world() + c_comm = c_mpi_comm_world else c_comm = c_mpi_comm_f2c(comm_f) end if @@ -280,7 +280,7 @@ subroutine MPI_Bcast_int_scalar(buffer, count, datatype, root, comm, ierror) end subroutine MPI_Bcast_int_scalar subroutine MPI_Bcast_real_2D(buffer, count, datatype, root, comm, ierror) - use mpi_c_bindings, only: c_mpi_bcast, c_mpi_comm_f2c, c_mpi_comm_world + use mpi_c_bindings, only: c_mpi_bcast, c_mpi_comm_f2c use iso_c_binding, only: c_int, c_ptr, c_loc real(8), dimension(:, :), target :: buffer integer, intent(in) :: count, root @@ -558,7 +558,7 @@ end subroutine MPI_Allreduce_1D_real_proc subroutine MPI_Allreduce_1D_int_proc(sendbuf, recvbuf, count, datatype, op, comm, ierror) use iso_c_binding, only: c_int, c_ptr, c_loc use mpi_c_bindings, only: c_mpi_allreduce, & - c_mpi_comm_f2c, c_mpi_in_place_f2c, c_mpi_comm_world + c_mpi_comm_f2c, c_mpi_in_place_f2c integer, dimension(:), intent(in), target :: sendbuf integer, dimension(:), intent(out), target :: recvbuf integer, intent(in) :: count, datatype, op, comm @@ -859,7 +859,7 @@ subroutine MPI_Cart_coords_proc(comm, rank, maxdims, coords, ierror) subroutine MPI_Cart_shift_proc(comm, direction, disp, rank_source, rank_dest, ierror) use iso_c_binding, only: c_int, c_ptr - use mpi_c_bindings, only: c_mpi_cart_shift, c_mpi_comm_f2c, c_mpi_comm_world + use mpi_c_bindings, only: c_mpi_cart_shift, c_mpi_comm_f2c integer, intent(in) :: comm integer, intent(in) :: direction, disp integer, intent(out) :: rank_source, rank_dest @@ -867,11 +867,7 @@ subroutine MPI_Cart_shift_proc(comm, direction, disp, rank_source, rank_dest, ie integer(kind=MPI_HANDLE_KIND) :: c_comm integer(c_int) :: local_ierr - if (comm == MPI_COMM_WORLD) then - c_comm = c_mpi_comm_world() - else - c_comm = c_mpi_comm_f2c(comm) - end if + c_comm = handle_mpi_comm_f2c(comm) local_ierr = c_mpi_cart_shift(c_comm, direction, disp, rank_source, rank_dest) diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index 955f50e..405313f 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -13,6 +13,7 @@ module mpi_c_bindings integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_DOUBLE") :: c_mpi_double integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_FLOAT") :: c_mpi_float integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INT") :: c_mpi_int + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_COMM_WORLD") :: c_mpi_comm_world interface @@ -47,27 +48,10 @@ function c_mpi_status_c2f(c_status, f_status) bind(C, name="MPI_Status_c2f") integer(c_int) :: c_mpi_status_c2f end function c_mpi_status_c2f - function c_mpi_comm_world() bind(C, name="get_c_MPI_COMM_WORLD") - use iso_c_binding, only: c_ptr - integer(kind=MPI_HANDLE_KIND) :: c_mpi_comm_world - end function c_mpi_comm_world - function c_mpi_sum() bind(C, name="get_c_MPI_SUM") integer(kind=MPI_HANDLE_KIND) :: c_mpi_sum end function c_mpi_sum - ! function c_mpi_float() bind(C, name="get_c_MPI_FLOAT") - ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_float - ! end function - - ! function c_mpi_double() bind(C, name="get_c_MPI_DOUBLE") - ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_double - ! end function - - ! function c_mpi_int() bind(C, name="get_c_MPI_INT") - ! integer(kind=MPI_HANDLE_KIND) :: c_mpi_int - ! end function - function c_mpi_op_f2c(op_f) bind(C, name="MPI_Op_f2c") use iso_c_binding, only: c_ptr, c_int integer(c_int), value :: op_f diff --git a/src/mpi_wrapper.c b/src/mpi_wrapper.c index 98c7dab..944e941 100644 --- a/src/mpi_wrapper.c +++ b/src/mpi_wrapper.c @@ -1,25 +1,9 @@ #include -MPI_Datatype get_c_MPI_DOUBLE() { - return MPI_DOUBLE; -} - -MPI_Datatype get_c_MPI_FLOAT() { - return MPI_FLOAT; -} - -MPI_Datatype get_c_MPI_INT() { - return MPI_INT; -} - MPI_Op get_c_MPI_SUM() { return MPI_SUM; } -MPI_Comm get_c_MPI_COMM_WORLD() { - return MPI_COMM_WORLD; -} - void* get_c_MPI_IN_PLACE() { return MPI_IN_PLACE; } @@ -28,6 +12,8 @@ MPI_Status* c_MPI_STATUSES_IGNORE = MPI_STATUSES_IGNORE; MPI_Info c_MPI_INFO_NULL = MPI_INFO_NULL; +MPI_Comm c_MPI_COMM_WORLD = MPI_COMM_WORLD; + MPI_Datatype c_MPI_DOUBLE = MPI_DOUBLE; MPI_Datatype c_MPI_FLOAT = MPI_FLOAT; From 5351d8bc0434fe357bdad3dd50d04b714f866690 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 28 Apr 2025 16:12:29 +0530 Subject: [PATCH 5/5] use global var for MPI_SUM and MPI_IN_PLACE with bindC --- src/mpi.f90 | 15 +++++++-------- src/mpi_c_bindings.f90 | 11 ++--------- src/mpi_wrapper.c | 12 ++++-------- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index b3ce0f6..5dee153 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -131,7 +131,7 @@ integer(kind=MPI_HANDLE_KIND) function handle_mpi_op_f2c(op_f) result(c_op) use mpi_c_bindings, only: c_mpi_op_f2c, c_mpi_sum integer, intent(in) :: op_f if (op_f == MPI_SUM) then - c_op = c_mpi_sum() + c_op = c_mpi_sum else c_op = c_mpi_op_f2c(op_f) end if @@ -461,7 +461,7 @@ subroutine MPI_Irecv_proc(buf, count, datatype, source, tag, comm, request, ierr subroutine MPI_Allreduce_scalar(sendbuf, recvbuf, count, datatype, op, comm, ierror) use iso_c_binding, only: c_int, c_ptr, c_loc - use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_in_place_f2c + use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_in_place real(8), intent(in), target :: sendbuf real(8), intent(out), target :: recvbuf integer, intent(in) :: count, datatype, op, comm @@ -471,7 +471,7 @@ subroutine MPI_Allreduce_scalar(sendbuf, recvbuf, count, datatype, op, comm, ier integer(c_int) :: local_ierr if (sendbuf == MPI_IN_PLACE) then - sendbuf_ptr = c_mpi_in_place_f2c() + sendbuf_ptr = c_mpi_in_place else sendbuf_ptr = c_loc(sendbuf) end if @@ -494,7 +494,7 @@ subroutine MPI_Allreduce_scalar(sendbuf, recvbuf, count, datatype, op, comm, ier subroutine MPI_Allreduce_1D_recv_proc(sendbuf, recvbuf, count, datatype, op, comm, ierror) use iso_c_binding, only: c_int, c_ptr, c_loc - use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_in_place_f2c + use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_in_place real(8), intent(in), target :: sendbuf real(8), dimension(:), intent(out), target :: recvbuf integer, intent(in) :: count, datatype, op, comm @@ -504,7 +504,7 @@ subroutine MPI_Allreduce_1D_recv_proc(sendbuf, recvbuf, count, datatype, op, com integer(c_int) :: local_ierr if (sendbuf == MPI_IN_PLACE) then - sendbuf_ptr = c_mpi_in_place_f2c() + sendbuf_ptr = c_mpi_in_place else sendbuf_ptr = c_loc(sendbuf) end if @@ -528,7 +528,7 @@ end subroutine MPI_Allreduce_1D_recv_proc subroutine MPI_Allreduce_1D_real_proc(sendbuf, recvbuf, count, datatype, op, comm, ierror) use iso_c_binding, only: c_int, c_ptr, c_loc - use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_in_place_f2c + use mpi_c_bindings, only: c_mpi_allreduce real(8), dimension(:), intent(in), target :: sendbuf real(8), dimension(:), intent(out), target :: recvbuf integer, intent(in) :: count, datatype, op, comm @@ -557,8 +557,7 @@ end subroutine MPI_Allreduce_1D_real_proc subroutine MPI_Allreduce_1D_int_proc(sendbuf, recvbuf, count, datatype, op, comm, ierror) use iso_c_binding, only: c_int, c_ptr, c_loc - use mpi_c_bindings, only: c_mpi_allreduce, & - c_mpi_comm_f2c, c_mpi_in_place_f2c + use mpi_c_bindings, only: c_mpi_allreduce, c_mpi_comm_f2c integer, dimension(:), intent(in), target :: sendbuf integer, dimension(:), intent(out), target :: recvbuf integer, intent(in) :: count, datatype, op, comm diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index 405313f..eddcc06 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -9,11 +9,13 @@ module mpi_c_bindings #endif type(c_ptr), bind(C, name="c_MPI_STATUSES_IGNORE") :: c_mpi_statuses_ignore + type(c_ptr), bind(C, name="c_MPI_IN_PLACE") :: c_mpi_in_place integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INFO_NULL") :: c_mpi_info_null integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_DOUBLE") :: c_mpi_double integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_FLOAT") :: c_mpi_float integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_INT") :: c_mpi_int integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_COMM_WORLD") :: c_mpi_comm_world + integer(kind=MPI_HANDLE_KIND), bind(C, name="c_MPI_SUM") :: c_mpi_sum interface @@ -48,10 +50,6 @@ function c_mpi_status_c2f(c_status, f_status) bind(C, name="MPI_Status_c2f") integer(c_int) :: c_mpi_status_c2f end function c_mpi_status_c2f - function c_mpi_sum() bind(C, name="get_c_MPI_SUM") - integer(kind=MPI_HANDLE_KIND) :: c_mpi_sum - end function c_mpi_sum - function c_mpi_op_f2c(op_f) bind(C, name="MPI_Op_f2c") use iso_c_binding, only: c_ptr, c_int integer(c_int), value :: op_f @@ -64,11 +62,6 @@ function c_mpi_info_f2c(info_f) bind(C, name="MPI_Info_f2c") integer(kind=MPI_HANDLE_KIND) :: c_mpi_info_f2c end function c_mpi_info_f2c - function c_mpi_in_place_f2c() bind(C,name="get_c_MPI_IN_PLACE") - use iso_c_binding, only: c_ptr - type(c_ptr) :: c_mpi_in_place_f2c - end function c_mpi_in_place_f2c - function c_mpi_init(argc, argv) bind(C, name="MPI_Init") use iso_c_binding, only : c_int, c_ptr !> TODO: is the intent need to be explicitly specified diff --git a/src/mpi_wrapper.c b/src/mpi_wrapper.c index 944e941..66502f1 100644 --- a/src/mpi_wrapper.c +++ b/src/mpi_wrapper.c @@ -1,13 +1,5 @@ #include -MPI_Op get_c_MPI_SUM() { - return MPI_SUM; -} - -void* get_c_MPI_IN_PLACE() { - return MPI_IN_PLACE; -} - MPI_Status* c_MPI_STATUSES_IGNORE = MPI_STATUSES_IGNORE; MPI_Info c_MPI_INFO_NULL = MPI_INFO_NULL; @@ -19,3 +11,7 @@ MPI_Datatype c_MPI_DOUBLE = MPI_DOUBLE; MPI_Datatype c_MPI_FLOAT = MPI_FLOAT; MPI_Datatype c_MPI_INT = MPI_INT; + +void* c_MPI_IN_PLACE = MPI_IN_PLACE; + +MPI_Op c_MPI_SUM = MPI_SUM;