I recently encountered dam behavior. If I run the following code on my machine (using the latest version of cygwin, Open MPI version 1.8.6), I get a ramp up memory usage that quickly overloads my computer.
program memoryTest
use mpi
implicit none
integer :: ierror,errorStatus ! error codes
integer :: my_rank ! rank of process
integer :: p ! number of processes
integer :: i,a,b
call MPI_Init(ierror)
call MPI_Comm_rank(MPI_COMM_WORLD, my_rank, ierror)
call MPI_Comm_size(MPI_COMM_WORLD, p, ierror)
b=0
do i=1,10000000
a=1*my_rank
call MPI_REDUCE(a,b,1,MPI_INTEGER,MPI_MAX,0,MPI_COMM_WORLD,errorStatus)
end do
call MPI_Finalize(ierror)
stop
end program memoryTest
Any idea what could be the problem? The code looks great for my newbies. Compilation line
mpif90 -O2 -o memoryTest.exe memoryTest.f90
source
share