Skip to content

Commit

Permalink
Fix graph_comm.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoki MORITA committed May 12, 2023
1 parent 790fa34 commit 14205e1
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/graph/graph_comm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subroutine monolis_com_get_comm_table(monolis, N, NP, nid)
integer(kint), allocatable :: counts(:), outer_node_id_local(:), local_nid(:)
integer(kint), allocatable :: outer_node_id_all(:), outer_dom_id_all(:), temp(:)
integer(kint), allocatable :: displs(:), internal_node_id(:), is_neib(:), neib_id(:)
integer(kint), allocatable :: send_n_list(:), rbuf(:)
integer(kint), allocatable :: send_n_list(:)
integer(kint), allocatable :: ws(:), wr(:)
integer(kint), allocatable :: sta1(:,:)
integer(kint), allocatable :: sta2(:,:)
Expand Down Expand Up @@ -170,17 +170,15 @@ subroutine monolis_com_get_comm_table(monolis, N, NP, nid)
!> send の作成
!> slave から master に個数を送信
allocate(send_n_list(commsize), source = 0)
allocate(rbuf(commsize), source = 0)

do i = 1, n_neib_recv
id = recv_list(i)%domid
in = recv_list(i)%nnode
send_n_list(id + 1) = in
enddo

call mpi_alltoall(send_n_list, 1, MPI_INTEGER, &
rbuf, 1, MPI_INTEGER, monolis%COM%comm, ierr)
send_n_list = rbuf
call mpi_alltoall(MPI_IN_PLACE, 1, MPI_INTEGER, &
send_n_list, 1, MPI_INTEGER, monolis%COM%comm, ierr)

!> send 個数の確保
n_neib_send = 0
Expand Down Expand Up @@ -309,7 +307,7 @@ subroutine monolis_com_get_comm_table_analysis(N, NP, nid, &
integer(kint), allocatable :: counts(:), outer_node_id_local(:), local_nid(:)
integer(kint), allocatable :: outer_node_id_all(:), outer_dom_id_all(:)
integer(kint), allocatable :: displs(:), internal_node_id(:), is_neib(:), neib_id(:)
integer(kint), allocatable :: send_n_list(:), rbuf(:)
integer(kint), allocatable :: send_n_list(:)

myrank = monolis_global_myrank()
commsize = monolis_global_commsize()
Expand Down Expand Up @@ -417,17 +415,15 @@ subroutine monolis_com_get_comm_table_analysis(N, NP, nid, &
!> send の作成
!> slave から master に個数を送信
allocate(send_n_list(commsize), source = 0)
allocate(rbuf(commsize), source = 0)

do i = 1, n_neib_recv
id = recv_list(i)%domid
in = recv_list(i)%nnode
send_n_list(id + 1) = in
enddo

call mpi_alltoall(send_n_list, 1, MPI_INTEGER, &
rbuf, 1, MPI_INTEGER, comm, ierr)
send_n_list = rbuf
call mpi_alltoall(MPI_IN_PLACE, 1, MPI_INTEGER, &
send_n_list, 1, MPI_INTEGER, comm, ierr)

!> send 個数の確保
n_neib_send = 0
Expand Down Expand Up @@ -508,7 +504,7 @@ subroutine monolis_com_get_comm_table_set(monolis, N, NP, nid)
integer(kint), allocatable :: counts(:), outer_node_id_local(:), local_nid(:)
integer(kint), allocatable :: outer_node_id_all(:), outer_dom_id_all(:), temp(:)
integer(kint), allocatable :: displs(:), internal_node_id(:), is_neib(:), neib_id(:)
integer(kint), allocatable :: send_n_list(:), rbuf(:)
integer(kint), allocatable :: send_n_list(:)
integer(kint), allocatable :: ws(:), wr(:)
integer(kint), allocatable :: sta1(:,:)
integer(kint), allocatable :: sta2(:,:)
Expand Down Expand Up @@ -643,17 +639,15 @@ subroutine monolis_com_get_comm_table_set(monolis, N, NP, nid)
!> send の作成
!> slave から master に個数を送信
allocate(send_n_list(commsize), source = 0)
allocate(rbuf(commsize), source = 0)

do i = 1, n_neib_recv
id = recv_list(i)%domid
in = recv_list(i)%nnode
send_n_list(id + 1) = in
enddo

call mpi_alltoall(send_n_list, 1, MPI_INTEGER, &
call mpi_alltoall(MPI_IN_PLACE, 1, MPI_INTEGER, &
send_n_list, 1, MPI_INTEGER, monolis%COM%comm, ierr)
send_n_list = rbuf

!> send 個数の確保
n_neib_send = 0
Expand Down

0 comments on commit 14205e1

Please sign in to comment.