Thanks to Bryan Putnam <bfp@purdue.edu>.
in a more tutorial approach in [66].
Thanks to Bryan Putnam <bfp@purdue.edu>.
if (rank .gt. rows)but should read
if (myid .gt. rows)Thanks to Weiqun Zhang <zhang@ucolick.org>.
double precision buffer(MAX_ACOLS), ans(MAX_ACOLS)should be
double precision buffer(MAX_ACOLS), ans(MAX_BCOLS)Thanks to Bryan Putnam <bfp@purdue.edu>.
Thanks to Anthony Chan <chan@mcs.anl.gov>.
If Figure 3.12, all of the calls to MPI_LOG_EVENT need an additional
argument IERR at the end of the argument list; i.e.,
call MPE_LOG_EVENT(2, 0, "bend", ierr)Note that laster versions of the Fortran MPE routines return the error code as the value of the function, and hence would nee
ierr = MPE_LOG_EVENT( 2, 0, "bsend" )In Figure 3.11 on page 50, the call to MPI_BCAST is not shown in the code. The call is referred to at the line
.... initialization of a and b, broadcast of bbut the code itself is not shown. It is the same as in Figure 3.12:
do 85 i = 1,bcols
call MPI_BCAST(b(1,i), brows, MPI_DOUBLE_PRECISION, master, &
MPI_COMM_WORLD, ierr)
85 continue
if (request) {
for (i = 0; i < CHUNKSIZE; ) {
rands[i] = random();
if (rands[i] <= INT_MAX) i++;
}
Thanks to Kevin T. Pedretti <pedretti@eng.uiowa.edu>.
Thanks to Dan Negrut.
integer i, j, n
double precision u(0:n+1,0:n+1), unew(0:n+1,0:n+1)
do 10 j=1, n
do 10 i=1, n
unew(i,j) = &
0.25*(u(i-1,j)+u(i,j+1)+u(i,j-1)+u(i+1,j) - &
h * h * f(i,j))
10 continue
Thanks to Steven Knudsen <sknudsen@softwareresearch.org>.
Thanks to Dan Negrut.
Predicted time for a 1-D (solid) and 2-D (dashed) decomposition of the 2-D Poisson problemThanks to Paul Hovland <hovland@mcs.anl.gov>.
integer i, j, n
double precision u(sx-1:ex+1,sy-1:ey+1), &
unew(sx-1:ex+1,sy-1:ey+1)
do 10 j=sy+1, ey-1
do 10 i=sx+1, ex-1
unew(i,j) = &
0.25*(u(i-1,j)+u(i,j+1)+u(i,j-1)+u(i+1,j) - &
h * h * f(i,j))
10 continue
... In this example, there is one double-precision item per block; the double-precision values are ex + 1 - (sx - 1) + 1 = ex - sx + 3 apart, and there are ey - (sy) + 1 = ey - sy + 1 of them, since only the interior elements are needed. ...
The arguments to MPI_Type_vector describe a block, which consists of a number of (contiguous) copies of the input datatype given by the fourth argument. The first argument is the number of blocks; the second is the numberThe final two sentences of this paragraph should read
In this example, there is one double-precision item per block; the double-precision values are ex + 1 - (sx - 1) + 1 = ex - sx + 3 apart, and there are ey - sy + 1 = ey - sy + 1 of them. Figure 4.19 illustrates an MPI vector datatype.Thanks to Hartmut Kapitza <hartmut.kapitza@gkss.de>.
integer i, j, n
double precision u(sx-1:ex+1,sy-1:ey+1), &
unew(sx-1:ex+1,sy-1:ey+1)
do 10 j=sy+1, ey-1
do 10 i=sx+1, ex-1
unew(i,j) = &
0.25*(u(i-1,j)+u(i,j+1)+u(i,j-1)+u(i+1,j) - &
h * h * f(i,j))
10 continue
do 100 k=1, 4
call MPI_WAITANY(4,requests,idx,status,ierr)
goto (1,2,3,4), idx
...
enddo
call MPI_WAITALL(4, requests(4), MPI_STATUSES_IGNORE, ierr)
Thanks to Rusty Lusk <lusk@mcs.anl.gov>.
MPI_Allgather( myparticles, count, particletype,
allparticles, totalcount, particletype, MPI_COMM_WORLD );
Thanks to Dinesh Kaushik <kaushik@mcs.anl.gov>.
MPI_Start( request );but should read
MPI_Start( &request );Thanks to Barry Smith <bsmith@mcs.anl.gov>.
Thanks to Dan Negrut.
Thanks to Dan Negrut.
Thanks to Rusty Lusk <lusk@mcs.anl.gov>.
MPI_Copy_functionMPI_Comm oldcomm, int *keyval, void *extra_state, void *attribute_value_in, void *attribute_value_out, int *flagtypedef int MPI_Delete_functionMPI_Comm comm, int *keyval, void *attribute_value, void *extra_statetypedef int
Thanks to Emil Ong <onge@mcs.anl.gov>.
program main
use mpi
integer ocean_or_atmos_comm, intercomm, ocean_comm, atmos_comm
integer nprocs, rank, ierr, color, remote_leader
integer OCEAN, ATMOS
parameter (OCEAN=0,ATMOS=1)
call MPI_INIT( ierr )
call MPI_COMM_SIZE( MPI_COMM_WORLD, nprocs, ierr )
call MPI_COMM_RANK( MPI_COMM_WORLD, rank, ierr )
if (rank .lt. size/2) then
color = OCEAN
remote_leader = size/2
else
color = ATMOS
remote_leader = 0
endif
call MPI_COMM_SPLIT( MPI_COMM_WORLD, color, rank, &
ocean_or_atmos_comm, ierr )
call MPI_INTERCOMM_CREATE( ocean_or_atmos_comm, 0, &
MPI_COMM_WORLD, remote_leader, &
0, intercomm, ierr )
if (color .eq. OCEAN) then
ocean_comm = ocean_or_atmos_comm
call do_ocean( ocean_comm )
else
atmos_comm = ocean_or_atmos_comm
call do_atmos( atmos_comm )
endif
call ocean_and_atmos( intercomm )
...
end
Thanks to Richard Rogers <rrogers@mediosystems.com>.
To see this, remember that the formula for the locations of the elements of a(i,j,k) is offset + (i-1) + nx * ((j-1) + ny * (z-1)).should be
To see this, remember that the formula for the locations of the elements of a(i,j,k) is offset + (i-1) + nx * ((j-1) + ny * (k-1)).(the z-1 should be k-1). At the bottom of the page,
call MPI_TYPE_VECTOR( ny * nz, 1, nx * ny, &
MPI_DOUBLE_PRECISION, newx, ierror )
should be
call MPI_TYPE_VECTOR( ny * nz, 1, nx, &
MPI_DOUBLE_PRECISION, newx, ierror )
Thanks to Mehdi Bostandoost <smb51+@pitt.edu>.