Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/mpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module mpi
integer, parameter :: MPI_THREAD_FUNNELED = 1

integer, parameter :: MPI_INTEGER = -10002
integer, parameter :: MPI_REAL = -10003
integer, parameter :: MPI_DOUBLE_PRECISION = -10004
integer, parameter :: MPI_REAL4 = -10013
integer, parameter :: MPI_REAL8 = -10014
Expand Down Expand Up @@ -173,10 +174,12 @@ integer(kind=MPI_HANDLE_KIND) function handle_mpi_info_f2c(info_f) result(c_info
end function handle_mpi_info_f2c

integer(kind=MPI_HANDLE_KIND) function handle_mpi_datatype_f2c(datatype_f) result(c_datatype)
use mpi_c_bindings, only: c_mpi_float, c_mpi_double, c_mpi_int, c_mpi_logical, c_mpi_character
use mpi_c_bindings, only: c_mpi_float, c_mpi_double, c_mpi_int, c_mpi_logical, c_mpi_character, c_mpi_real
integer, intent(in) :: datatype_f
if (datatype_f == MPI_REAL4) then
c_datatype = c_mpi_float
else if (datatype_f == MPI_REAL) then
c_datatype = c_mpi_real
else if (datatype_f == MPI_REAL8 .OR. datatype_f == MPI_DOUBLE_PRECISION) then
c_datatype = c_mpi_double
else if (datatype_f == MPI_INTEGER) then
Expand Down
1 change: 1 addition & 0 deletions src/mpi_c_bindings.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module mpi_c_bindings
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_REAL") :: c_mpi_real
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
Expand Down
4 changes: 3 additions & 1 deletion src/mpi_constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ MPI_Op c_MPI_MAX = MPI_MAX;

MPI_Datatype c_MPI_LOGICAL = MPI_LOGICAL;

MPI_Datatype c_MPI_CHARACTER = MPI_CHARACTER;
MPI_Datatype c_MPI_CHARACTER = MPI_CHARACTER;

MPI_Datatype c_MPI_REAL = MPI_REAL;