From 12414d9764a8659c6c5bea2267e9e9b640021f15 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Mon, 31 Mar 2025 17:40:19 +0530 Subject: [PATCH] remove duplicate function 'get_c_datatype_from_fortran' 'get_c_datatype_from_fortran' and 'c_mpi_datatype_f2c' serve the same purpose --- src/mpi.f90 | 4 ++-- src/mpi_c_bindings.f90 | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mpi.f90 b/src/mpi.f90 index 5a8be9e..0b67449 100644 --- a/src/mpi.f90 +++ b/src/mpi.f90 @@ -297,7 +297,7 @@ subroutine MPI_Isend_3d(buf, count, datatype, dest, tag, comm, request, ierror) subroutine MPI_Irecv_proc(buf, count, datatype, source, tag, comm, request, ierror) use iso_c_binding, only: c_int, c_ptr - use mpi_c_bindings, only: c_mpi_irecv, c_mpi_comm_f2c, get_c_datatype_from_fortran, c_mpi_request_c2f + use mpi_c_bindings, only: c_mpi_irecv, c_mpi_comm_f2c, c_mpi_datatype_f2c, c_mpi_request_c2f real(8), dimension(:,:) :: buf integer, intent(in) :: count, source, tag integer, intent(in) :: datatype @@ -310,7 +310,7 @@ subroutine MPI_Irecv_proc(buf, count, datatype, source, tag, comm, request, ierr type(c_ptr) :: c_request c_comm = c_mpi_comm_f2c(comm) - c_datatype = get_c_datatype_from_fortran(datatype) + c_datatype = c_mpi_datatype_f2c(datatype) local_ierr = c_mpi_irecv(buf, count, c_datatype, source, tag, c_comm, c_request) request = c_mpi_request_c2f(c_request) diff --git a/src/mpi_c_bindings.f90 b/src/mpi_c_bindings.f90 index aeb6134..7a273b8 100644 --- a/src/mpi_c_bindings.f90 +++ b/src/mpi_c_bindings.f90 @@ -14,12 +14,6 @@ function c_mpi_comm_c2f(comm_c) bind(C, name="MPI_Comm_c2f") integer(c_int) :: c_mpi_comm_c2f end function - function get_c_datatype_from_fortran(datatype) bind(C, name="get_c_datatype_from_fortran") - use iso_c_binding, only: c_int, c_ptr - integer(c_int), value :: datatype - type(c_ptr) :: get_c_datatype_from_fortran - end function get_c_datatype_from_fortran - function c_mpi_request_c2f(request) bind(C, name="MPI_Request_c2f") use iso_c_binding, only: c_int, c_ptr type(c_ptr), value :: request