diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/Makefile.depends b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/Makefile.depends index 58a9fefb..a5f3008d 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/Makefile.depends +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/Makefile.depends @@ -156,13 +156,13 @@ set_vr_rtm_sym_mat_tsmp.o: $(SPH_COMMDIR)/set_vr_rtm_sym_mat_tsmp.f90 m_precisio $(F90) -c $(F90OPTFLAGS) $< small_matmul_leg_trans_krin.o: $(SPH_COMMDIR)/small_matmul_leg_trans_krin.F90 m_precision.o m_constants.o matmul_for_legendre_trans.o $(F90) -c $(F90OPTFLAGS) $(F90CPPFLAGS) $< -sph_prt_FFTPACK5.o: $(SPH_COMMDIR)/sph_prt_FFTPACK5.f90 m_precision.o m_constants.o m_machine_parameter.o m_elapsed_labels_SPH_TRNS.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFT.o t_sph_FFTPACK5.o calypso_mpi.o set_comm_table_prt_FFTPACK.o copy_rtp_data_to_FFTPACK.o +sph_prt_FFTPACK5.o: $(SPH_COMMDIR)/sph_prt_FFTPACK5.f90 m_precision.o m_constants.o m_machine_parameter.o m_elapsed_labels_SPH_TRNS.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFT.o t_sph_FFTPACK5.o calypso_mpi.o set_comm_table_prt_FFTPACK.o copy_field_smp.o copy_rtp_data_to_FFTPACK.o $(F90) -c $(F90OPTFLAGS) $< -sph_prt_FFTW.o: $(SPH_COMMDIR)/sph_prt_FFTW.f90 m_precision.o m_constants.o m_machine_parameter.o m_fftw_parameters.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFTW.o t_sph_field_FFTW.o set_comm_table_prt_FFTW.o copy_rtp_data_to_FFTPACK.o +sph_prt_FFTW.o: $(SPH_COMMDIR)/sph_prt_FFTW.f90 m_precision.o m_constants.o m_machine_parameter.o m_fftw_parameters.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFTW.o t_sph_field_FFTW.o set_comm_table_prt_FFTW.o copy_field_smp.o copy_rtp_data_to_FFTPACK.o $(F90) -c $(F90OPTFLAGS) $< -sph_prt_domain_FFTPACK5.o: $(SPH_COMMDIR)/sph_prt_domain_FFTPACK5.f90 m_precision.o m_constants.o m_machine_parameter.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFT.o t_sph_domain_FFTPACK5.o set_comm_table_prt_FFTPACK.o copy_rtp_data_to_FFTPACK.o +sph_prt_domain_FFTPACK5.o: $(SPH_COMMDIR)/sph_prt_domain_FFTPACK5.f90 m_precision.o m_constants.o m_machine_parameter.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFT.o t_sph_domain_FFTPACK5.o set_comm_table_prt_FFTPACK.o copy_field_smp.o copy_rtp_data_to_FFTPACK.o $(F90) -c $(F90OPTFLAGS) $< -sph_prt_domain_FFTW.o: $(SPH_COMMDIR)/sph_prt_domain_FFTW.f90 m_precision.o m_constants.o m_machine_parameter.o m_fftw_parameters.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFTW.o t_sph_field_FFTW.o set_comm_table_prt_FFTW.o copy_rtp_data_to_FFTPACK.o +sph_prt_domain_FFTW.o: $(SPH_COMMDIR)/sph_prt_domain_FFTW.f90 m_precision.o m_constants.o m_machine_parameter.o m_fftw_parameters.o m_elapsed_labels_SPH_TRNS.o calypso_mpi.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFTW.o t_sph_field_FFTW.o set_comm_table_prt_FFTW.o copy_field_smp.o copy_rtp_data_to_FFTPACK.o $(F90) -c $(F90OPTFLAGS) $< sph_rtp_FFTPACK5.o: $(SPH_COMMDIR)/sph_rtp_FFTPACK5.f90 m_precision.o m_constants.o m_machine_parameter.o m_elapsed_labels_SPH_TRNS.o t_spheric_rtp_data.o t_sph_trans_comm_tbl.o t_sph_comm_table_from_FFT.o t_sph_FFTPACK5.o calypso_mpi.o set_comm_table_rtp_FFTPACK.o copy_rtp_data_to_FFTPACK.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/copy_rtp_data_to_FFTPACK.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/copy_rtp_data_to_FFTPACK.f90 index c141d044..f2c63fe0 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/copy_rtp_data_to_FFTPACK.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/copy_rtp_data_to_FFTPACK.f90 @@ -16,13 +16,6 @@ !! & irt_rtp_smp_stack, X_FFT, X_rtp) !! subroutine copy_FFTPACK_from_rtp_comp(nnod_rtp, nidx_rtp, & !! & irt_rtp_smp_stack, X_rtp, X_FFT) -!! -!! subroutine copy_FFTPACK_to_prt_field & -!! & (nnod_rtp, ncomp_bwd, X_FFT, X_prt) -!! subroutine copy_FFTPACK_from_prt_field & -!! & (nnod_rtp, ncomp_fwd, X_prt, X_FFT) -!! -!! subroutine copy_FFTPACK_to_prt_comp(nnod_rtp, X_prt, X_FFT) !!@endverbatim !! module copy_rtp_data_to_FFTPACK @@ -128,20 +121,18 @@ subroutine copy_FFTPACK_to_rtp_comp(nnod_rtp, nidx_rtp, & & :: X_rtp(irt_rtp_smp_stack(np_smp),nidx_rtp(3)) ! ! - integer(kind = kint) :: m, j, ip, ist, num + integer(kind = kint) :: m, ip, ist, num integer(kind = kint) :: inod_c, ist_fft ! ! -!$omp parallel do private(ip,m,j,ist,num,inod_c,ist_fft) +!$omp parallel do private(ip,m,ist,num,inod_c,ist_fft) do ip = 1, np_smp ist = irt_rtp_smp_stack(ip-1) num = irt_rtp_smp_stack(ip) - irt_rtp_smp_stack(ip-1) ist_fft = irt_rtp_smp_stack(ip-1) * nidx_rtp(3) do m = 1, nidx_rtp(3) inod_c = (m-1)*num + ist_fft - do j = 1, num - X_rtp(j+ist,m) = X_FFT(j+inod_c) - end do + X_rtp(1+ist:num+ist,m) = X_FFT(1+inod_c:num+inod_c) end do end do !$omp end parallel do @@ -162,11 +153,11 @@ subroutine copy_FFTPACK_from_rtp_comp(nnod_rtp, nidx_rtp, & ! real(kind = kreal), intent(inout) :: X_FFT(nnod_rtp) ! - integer(kind = kint) :: m, j, ip, ist, num + integer(kind = kint) :: m, ip, ist, num integer(kind = kint) :: inod_c, ist_fft ! ! -!$omp parallel do private(m,j,ist,num,inod_c,ist_fft) +!$omp parallel do private(m,ist,num,inod_c,ist_fft) do ip = 1, np_smp ist = irt_rtp_smp_stack(ip-1) num = irt_rtp_smp_stack(ip) - irt_rtp_smp_stack(ip-1) @@ -174,9 +165,7 @@ subroutine copy_FFTPACK_from_rtp_comp(nnod_rtp, nidx_rtp, & ! do m = 1, nidx_rtp(3) inod_c = (m-1)*num + ist_fft - do j = 1, num - X_FFT(j+inod_c) = X_rtp(j+ist,m) - end do + X_FFT(1+inod_c:num+inod_c) = X_rtp(1+ist:num+ist,m) end do end do !$omp end parallel do @@ -184,73 +173,5 @@ subroutine copy_FFTPACK_from_rtp_comp(nnod_rtp, nidx_rtp, & end subroutine copy_FFTPACK_from_rtp_comp ! ! ------------------------------------------------------------------ -! ------------------------------------------------------------------ -! - subroutine copy_FFTPACK_to_prt_field & - & (nnod_rtp, ncomp_bwd, X_FFT, X_prt) -! - integer(kind = kint), intent(in) :: nnod_rtp -! - integer(kind = kint), intent(in) :: ncomp_bwd - real(kind = kreal), intent(in) :: X_FFT(ncomp_bwd*nnod_rtp) -! - real(kind = kreal), intent(inout) :: X_prt(nnod_rtp,ncomp_bwd) -! - integer(kind = kint) :: nd, inod_c, inod -! -! -!$omp parallel do private(inod,nd,inod_c) - do inod = 1, nnod_rtp - do nd = 1, ncomp_bwd - inod_c = nd + (inod-1) * ncomp_bwd - X_prt(inod_c,nd) = X_FFT(inod_c) - end do - end do -!$omp end parallel do -! - end subroutine copy_FFTPACK_to_prt_field -! -! ------------------------------------------------------------------ -! - subroutine copy_FFTPACK_from_prt_field & - & (nnod_rtp, ncomp_fwd, X_prt, X_FFT) -! - integer(kind = kint), intent(in) :: nnod_rtp -! - integer(kind = kint), intent(in) :: ncomp_fwd - real(kind = kreal), intent(in) :: X_prt(nnod_rtp,ncomp_fwd) -! - real(kind = kreal), intent(inout) :: X_FFT(ncomp_fwd*nnod_rtp) -! - integer(kind = kint) :: inod, inod_c -! -! -!$omp parallel do private(inod,inod_c) - do inod = 1, nnod_rtp - inod_c = (inod-1) * ncomp_fwd - X_FFT(inod_c+1:inod_c+ncomp_fwd) = X_prt(inod,1:ncomp_fwd) - end do -!$omp end parallel do -! - end subroutine copy_FFTPACK_from_prt_field -! -! ------------------------------------------------------------------ -! ------------------------------------------------------------------ -! - subroutine copy_FFTPACK_to_prt_comp(nnod_rtp, X_prt, X_FFT) -! - integer(kind = kint), intent(in) :: nnod_rtp - real(kind = kreal), intent(in):: X_prt(nnod_rtp) -! - real(kind = kreal), intent(inout) :: X_FFT(nnod_rtp) -! -! -!$omp parallel workshare - X_FFT(1:nnod_rtp) = X_prt(1:nnod_rtp) -!$omp end parallel workshare -! - end subroutine copy_FFTPACK_to_prt_comp -! -! ------------------------------------------------------------------ ! end module copy_rtp_data_to_FFTPACK diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTPACK5.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTPACK5.f90 index de7d785a..7be8ec9c 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTPACK5.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTPACK5.f90 @@ -157,6 +157,7 @@ end subroutine verify_prt_FFTPACK5 subroutine prt_RFFTMF_to_send & & (sph_rtp, ncomp_fwd, n_WS, X_rtp, WS, fftpack_t) ! + use copy_field_smp use copy_rtp_data_to_FFTPACK use set_comm_table_prt_FFTPACK ! @@ -177,7 +178,9 @@ subroutine prt_RFFTMF_to_send & ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+4) nsize = ncomp_fwd * sph_rtp%nnod_rtp - call copy_FFTPACK_to_prt_comp(nsize, X_rtp(1,1), fftpack_t%X(1)) +!$omp parallel + call copy_nod_scalar_smp(nsize, X_rtp(1,1), fftpack_t%X(1)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+4) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+5) @@ -208,6 +211,7 @@ end subroutine prt_RFFTMF_to_send subroutine prt_RFFTMB_from_recv(sph_rtp, comm_rtp, ncomp_bwd, & & n_WR, WR, X_rtp, fftpack_t) ! + use copy_field_smp use copy_rtp_data_to_FFTPACK use set_comm_table_prt_FFTPACK ! @@ -251,8 +255,10 @@ subroutine prt_RFFTMB_from_recv(sph_rtp, comm_rtp, ncomp_bwd, & ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+3) nsize = ncomp_bwd * sph_rtp%nnod_rtp - call copy_FFTPACK_to_prt_comp(nsize, fftpack_t%X(1), X_rtp(1,1)) - if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+3) +!$omp parallel + call copy_nod_scalar_smp(nsize, fftpack_t%X(1), X_rtp(1,1)) +!$omp end parallel + if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+3) ! end subroutine prt_RFFTMB_from_recv ! diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTW.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTW.f90 index 57d9e4f7..4e00529a 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTW.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_FFTW.f90 @@ -181,6 +181,7 @@ end subroutine verify_prt_FFTW subroutine prt_fwd_FFTW_to_send & & (sph_rtp, comm_rtp, ncomp_fwd, n_WS, X_rtp, WS, FFTW_f) ! + use copy_field_smp use set_comm_table_prt_FFTW use copy_rtp_data_to_FFTPACK ! @@ -201,7 +202,9 @@ subroutine prt_fwd_FFTW_to_send & ! ntot = sph_rtp%nnod_rtp * ncomp_fwd if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+4) - call copy_FFTPACK_to_prt_comp(ntot, X_rtp(1,1), FFTW_f%X(1)) +!$omp parallel + call copy_nod_scalar_smp(ntot, X_rtp(1,1), FFTW_f%X(1)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+4) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+5) @@ -234,6 +237,7 @@ end subroutine prt_fwd_FFTW_to_send subroutine prt_back_FFTW_from_recv & & (sph_rtp, comm_rtp, ncomp_bwd, n_WR, WR, X_rtp, FFTW_f) ! + use copy_field_smp use set_comm_table_prt_FFTW use copy_rtp_data_to_FFTPACK ! @@ -274,7 +278,9 @@ subroutine prt_back_FFTW_from_recv & ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+3) ntot = sph_rtp%nnod_rtp * ncomp_bwd - call copy_FFTPACK_to_prt_comp(ntot, FFTW_f%X(1), X_rtp(1,1)) +!$omp parallel + call copy_nod_scalar_smp(ntot, FFTW_f%X(1), X_rtp(1,1)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+3) ! end subroutine prt_back_FFTW_from_recv diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTPACK5.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTPACK5.f90 index 54fa58e0..7b30924a 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTPACK5.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTPACK5.f90 @@ -149,6 +149,7 @@ end subroutine verify_prt_domain_FFTPACK5 subroutine prt_domain_RFFTMF_to_send & & (sph_rtp, ncomp_fwd, n_WS, X_rtp, WS, fftpack_d) ! + use copy_field_smp use copy_rtp_data_to_FFTPACK use set_comm_table_prt_FFTPACK ! @@ -168,8 +169,10 @@ subroutine prt_domain_RFFTMF_to_send & ! do nd = 1, ncomp_fwd if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+4) - call copy_FFTPACK_to_prt_comp & +!$omp parallel + call copy_nod_scalar_smp & & (sph_rtp%nnod_rtp, X_rtp(1,nd), fftpack_d%X(1)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+4) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+5) @@ -200,6 +203,7 @@ end subroutine prt_domain_RFFTMF_to_send subroutine prt_domain_RFFTMB_from_recv(sph_rtp, comm_rtp, & & ncomp_bwd, n_WR, WR, X_rtp, fftpack_d) ! + use copy_field_smp use copy_rtp_data_to_FFTPACK use set_comm_table_prt_FFTPACK ! @@ -241,8 +245,10 @@ subroutine prt_domain_RFFTMB_from_recv(sph_rtp, comm_rtp, & if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+2) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+3) - call copy_FFTPACK_to_prt_comp & +!$omp parallel + call copy_nod_scalar_smp & & (sph_rtp%nnod_rtp, fftpack_d%X(1), X_rtp(1,nd)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+3) end do ! diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTW.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTW.f90 index ca5fe624..2c32c94e 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTW.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/sph_prt_domain_FFTW.f90 @@ -173,6 +173,7 @@ end subroutine verify_prt_field_FFTW subroutine prt_field_fwd_FFTW_to_send & & (sph_rtp, comm_rtp, ncomp_fwd, n_WS, X_rtp, WS, FFTW_f) ! + use copy_field_smp use set_comm_table_prt_FFTW use copy_rtp_data_to_FFTPACK ! @@ -193,8 +194,10 @@ subroutine prt_field_fwd_FFTW_to_send & ! do nd = 1, ncomp_fwd if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+4) - call copy_FFTPACK_to_prt_comp & +!$omp parallel + call copy_nod_scalar_smp & & (sph_rtp%nnod_rtp, X_rtp(1,nd), FFTW_f%X(1)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+4) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+5) @@ -228,6 +231,7 @@ end subroutine prt_field_fwd_FFTW_to_send subroutine prt_field_back_FFTW_from_recv & & (sph_rtp, comm_rtp, ncomp_bwd, n_WR, WR, X_rtp, FFTW_f) ! + use copy_field_smp use set_comm_table_prt_FFTW use copy_rtp_data_to_FFTPACK ! @@ -267,8 +271,10 @@ subroutine prt_field_back_FFTW_from_recv & if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+2) ! if(iflag_FFT_time) call start_elapsed_time(ist_elapsed_FFT+3) - call copy_FFTPACK_to_prt_comp & +!$omp parallel + call copy_nod_scalar_smp & & (sph_rtp%nnod_rtp, FFTW_f%X(1), X_rtp(1,nd)) +!$omp end parallel if(iflag_FFT_time) call end_elapsed_time(ist_elapsed_FFT+3) end do !