Commit 505fe6a1 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

remove set_grid

this is not needed for now
parent fa345307
......@@ -52,9 +52,8 @@ module mpi_process_m
contains
procedure :: Init => Init_mpi_process
procedure :: Print => Print_mpi_process
procedure :: Set_grid
end type mpi_process_t
contains
!----------------------------------------------------------------------------------------------------------------------------------
!> Initialize process
......@@ -83,111 +82,4 @@ contains
end subroutine Print_mpi_process
!----------------------------------------------------------------------------------------------------------------------------------
subroutine Set_grid(this, cube_to_proc, param, proc_to_cube)
class(mpi_process_t), intent(inout) :: this
integer(kind=4), intent(in), dimension(:) :: cube_to_proc
type(type_parameter_pfof_snap), intent(in) :: param
integer(kind=4), intent(in), dimension(:) :: proc_to_cube
integer(kind=IDKIND) :: my_cube_id, dist_cube_id
integer(kind=4), dimension(3) :: my_cube_coords
integer(kind=4), dimension(3) :: dist_coords
integer(kind=4) :: direction
integer(kind=4) :: mpierr
my_cube_id = proc_to_cube(procid+1)
call id_to_coord(my_cube_id, my_cube_coords, dims)
! we are looking for the neighbours with respect to the cube coordinates
do direction = 1, 3
dist_coords = my_cube_coords
dist_coords(direction) = mod(my_cube_coords(direction)-1+dims(direction),dims(direction))
call coord_to_id(dist_coords, dist_cube_id, dims)
info_proc%global_comm%neighbours(direction*2-1) = cube_to_proc(dist_cube_id)
dist_coords(direction) = mod(my_cube_coords(direction)+1, dims(direction))
call coord_to_id(dist_coords, dist_cube_id, dims)
info_proc%global_comm%neighbours(direction*2) = cube_to_proc(dist_cube_id)
end do
#ifdef debug
print *,'neighbours with respect to the data cubes coordinates:',procid,&
' ; ', info_proc%global_comm%neighbours
#endif
info_proc%global_comm%name = mpi_comm_world
info_proc%global_comm%dims = dims
info_proc%global_comm%pid = procid
info_proc%global_comm%size = procnb
info_proc%global_comm%periods = periods
info_proc%global_comm%color = 0
info_proc%global_comm%coords = my_cube_coords
if(param%gatherwrite_factor > 1) then
#ifdef DEBUG
if(procid==0) then
print *, '*** creating specific communicator for gathered cube output ***'
end if
#endif
commcolorwrite = my_cube_coords(1)/param%gatherwrite_factor + &
(my_cube_coords(2)/param%gatherwrite_factor) * (dims(1)/param%gatherwrite_factor) &
+ (my_cube_coords(3)/param%gatherwrite_factor) * (dims(1)/param%gatherwrite_factor)*&
(dims(1)/param%gatherwrite_factor)
call mpi_comm_split(MPI_COMM_WORLD, commcolorwrite, procid, mpisubcubewrite, mpierr)
call mpi_comm_rank(mpisubcubewrite, scprocidwrite, mpierr)
call mpi_comm_size(mpisubcubewrite, scprocnbwrite, mpierr)
info_proc%write_comm%name = mpisubcubewrite
info_proc%write_comm%dims = 0
info_proc%write_comm%pid = scprocidwrite
info_proc%write_comm%size = scprocnbwrite
info_proc%write_comm%periods = .false.
info_proc%write_comm%color = commcolorwrite
info_proc%write_comm%coords = 0
info_proc%write_comm%neighbours = 0
else
info_proc%write_comm%name = -1
info_proc%write_comm%dims = -1
info_proc%write_comm%pid = -1
info_proc%write_comm%size = -1
info_proc%write_comm%periods = .false.
info_proc%write_comm%color = -1
info_proc%write_comm%coords = -1
info_proc%write_comm%neighbours = -1
end if
if(param%gatherread_factor > 1) then
#ifdef DEBUG
if(procid==0) then
print *, '*** creating specific communicator for gathered cube input ***'
end if
#endif
commcolorread = my_cube_coords(1)/param%gatherread_factor + &
(my_cube_coords(2)/param%gatherread_factor) * (dims(1)/param%gatherread_factor) &
+ (my_cube_coords(3)/param%gatherread_factor) * (dims(1)/param%gatherread_factor)* &
(dims(1)/param%gatherread_factor)
call mpi_comm_split(MPI_COMM_WORLD, commcolorread, procid, mpisubcuberead, mpierr)
call mpi_comm_rank(mpisubcuberead, scprocidread, mpierr)
call mpi_comm_size(mpisubcuberead, scprocnbread, mpierr)
info_proc%read_comm%name = mpisubcuberead
info_proc%read_comm%dims = 0
info_proc%read_comm%pid = scprocidread
info_proc%read_comm%size = scprocnbread
info_proc%read_comm%periods = .false.
info_proc%read_comm%color = commcolorread
info_proc%read_comm%coords = 0
info_proc%read_comm%neighbours = 0
else
info_proc%read_comm%name = -1
info_proc%read_comm%dims = -1
info_proc%read_comm%pid = -1
info_proc%read_comm%size = -1
info_proc%read_comm%periods = .false.
info_proc%read_comm%color = -1
info_proc%read_comm%coords = -1
info_proc%read_comm%neighbours = -1
end if
end subroutine Set_grid
end module mpi_process_m
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment