Skip to content

Commit

Permalink
Merge branch 'main' into launchBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-rowe authored Nov 24, 2021
2 parents 4819fb6 + b07ec0b commit 6e70742
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ main
opt

# CMake
/build/
/build

# Bin
/bin/*
Expand Down
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

0 comments on commit 6e70742

Please sign in to comment.