m***@hotmail.com
2008-10-07 19:55:36 UTC
Hello All,
I have been struggling with numerous access violations when I use
allgatherv to reassamble a matrix row by row as follows (in
fortran90). I am trying to gather local row ilx and put it into global
row igx, for example: I have a local matrix on each proc that is
100x1000. The global matrix is 200x1000. The local matrix on proc 0
is the first halft (rows 1:100) of the global matrix and the on proc 1
it is the 2nd half of the global matrix (rows 101:200)
! Local matrix
allocate( lmat( 100, 1000))
allocate( gmat( 200, 1000))
.......
call MPI_TYPE_VECTOR( 100, 1, 1000, MPI_DOUBLE_COMPLEX, local_type,
ierr)
call MPI_TYPE_COMMIT( local_type,ierr)
call MPI_TYPE_VECTOR( 200, 1, 1000, MPI_DOUBLE_COMPLEX, global_type,
ierr)
call MPI_TYPE_COMMIT( global_type,ierr)
! The following test of gathering the 44th local row into the global
matrix, that is proc 0 row goes to global row 44, and proc 1 row goes
to global row 144.
counts = (/1, 1/)
disps = (/0, 100/)
call MPI_ALLGATHERv( lmat(44,1), 1, local_type, gmat(1,1), counts,
disps, globa_type, MPI_COMM_WORLD,ierr)
I run the code and get:
% forrtl: severe (157): Program Exception - access violation
Using send and recv works:
if (iam == 1) then
call MPI_SEND( lmat(44,1), 1, local_type, 0 , 1, MPI_COMM_WORLD,
ierr)
else
call MPI_RECV( gmat(144,1), 1, global_type, 1 , 1, MPI_COMM_WORLD,
status_array, ierr)
end if
Thanks all
I have been struggling with numerous access violations when I use
allgatherv to reassamble a matrix row by row as follows (in
fortran90). I am trying to gather local row ilx and put it into global
row igx, for example: I have a local matrix on each proc that is
100x1000. The global matrix is 200x1000. The local matrix on proc 0
is the first halft (rows 1:100) of the global matrix and the on proc 1
it is the 2nd half of the global matrix (rows 101:200)
! Local matrix
allocate( lmat( 100, 1000))
allocate( gmat( 200, 1000))
.......
call MPI_TYPE_VECTOR( 100, 1, 1000, MPI_DOUBLE_COMPLEX, local_type,
ierr)
call MPI_TYPE_COMMIT( local_type,ierr)
call MPI_TYPE_VECTOR( 200, 1, 1000, MPI_DOUBLE_COMPLEX, global_type,
ierr)
call MPI_TYPE_COMMIT( global_type,ierr)
! The following test of gathering the 44th local row into the global
matrix, that is proc 0 row goes to global row 44, and proc 1 row goes
to global row 144.
counts = (/1, 1/)
disps = (/0, 100/)
call MPI_ALLGATHERv( lmat(44,1), 1, local_type, gmat(1,1), counts,
disps, globa_type, MPI_COMM_WORLD,ierr)
I run the code and get:
% forrtl: severe (157): Program Exception - access violation
Using send and recv works:
if (iam == 1) then
call MPI_SEND( lmat(44,1), 1, local_type, 0 , 1, MPI_COMM_WORLD,
ierr)
else
call MPI_RECV( gmat(144,1), 1, global_type, 1 , 1, MPI_COMM_WORLD,
status_array, ierr)
end if
Thanks all