Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fortran] Use mpi_f08 module to fix Intel compiler warnings #539

Merged
merged 1 commit into from
Nov 24, 2021
Merged
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
15 changes: 8 additions & 7 deletions examples/fortran/10_mpi/main.f90
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
program main
use mpi
use mpi_f08
use occa
use, intrinsic :: iso_fortran_env, only : stdout=>output_unit, &
stderr=>error_unit

implicit none

integer :: ierr, id
integer :: myid, npes, gcomm, tag ! MPI variables
integer, dimension(2) :: request
integer, dimension(MPI_STATUS_SIZE) :: status
integer :: myid, npes, tag ! MPI variables
type(MPI_Comm) :: gcomm
type(MPI_Request), dimension(2) :: request
type(MPI_Status) :: status
integer :: otherID, offset
integer(occaUDim_t) :: iu
integer(occaUDim_t) :: entries = 8
Expand Down Expand Up @@ -97,15 +98,15 @@ program main
request = MPI_REQUEST_NULL
call MPI_IRecv(ab_ptr(otherID*offset+1), &
offset, &
MPI_FLOAT, &
MPI_REAL4, &
otherID, &
tag, &
gcomm, &
request(1), &
ierr)
call MPI_ISend(ab_ptr(myid*offset+1), &
offset, &
MPI_FLOAT, &
MPI_REAL4, &
otherID, &
tag, &
gcomm, &
Expand All @@ -121,7 +122,7 @@ program main
call flush(stdout)
ab_sum = myid
ab_gather = sum(ab_ptr)
call MPI_Gather(ab_gather, 1, MPI_FLOAT, ab_sum, 1, MPI_FLOAT, 0, gcomm, ierr)
call MPI_Gather(ab_gather, 1, MPI_REAL4, ab_sum, 1, MPI_REAL4, 0, gcomm, ierr)
if (myid == 0) then
if (abs(ab_sum(myid) - ab_sum(otherID)) > 1.0e-8) stop "*** Wrong result ***"
end if
Expand Down