Commit 9f4b30e5 authored by Serhiy Mochalskyy's avatar Serhiy Mochalskyy
Browse files

Add new file s_ww_inverse; corrected dependency

parent 68fc15c5
Pipeline #1950 skipped
......@@ -5,7 +5,7 @@ use tri_p
use mpi_v
use sca
use coil2d
use time
!-----------------------------------------------------------------------
implicit none
include "mpif.h"
......
......@@ -56,7 +56,8 @@ F_MAIN_SRC = mod_icontr.f90\
a_ye_computing.f90\
d_ee_computing.f90\
mpi_and_scalapack_init.f90\
control_array_distribution.f90
control_array_distribution.f90\
computing_s_ww_inverse.f90
F_MAIN_OBJ = $(addprefix $(OBJ_DIR)/,$(F_MAIN_SRC:.f90=.o))
MAIN_OBJ = $(F_MAIN_OBJ)
......@@ -65,26 +66,38 @@ MAIN_OBJ = $(F_MAIN_OBJ)
# D E P E N D E N C I E S #
########################################################################
$(OBJ_DIR)/main.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_time.o
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/MPI_and_Scalapack_Init.o: \
$(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/.o: \
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/input.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/control_boundary.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_gauss.o
$(OBJ_DIR)/mod_gauss.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/matrix_pp.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_solv.o \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_tri_p.o
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_tri_p.o\
$(OBJ_DIR)/mod_tri.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_wp.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_solv.o \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_tri.o $(OBJ_DIR)/mod_tri_b.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_ww.o: \
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_solv.o \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_tri.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_rw.o: \
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_cc.o: \
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_solv.o \
$(OBJ_DIR)/mod_icontr.o
......@@ -99,32 +112,39 @@ $(OBJ_DIR)/matrix_rc.o: \
$(OBJ_DIR)/matrix_pe.o: \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_p.o\
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_ep.o: \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_p.o\
$(OBJ_DIR)/mod_tri_w.o
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/matrix_ec.o: \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/matrix_ew.o: \
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_p.o\
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/solver.o: \
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_time.o
$(OBJ_DIR)/resistive_wall_response.o: \
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_tri_w.o $(OBJ_DIR)/mod_icontr.o\
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_time.o
$(OBJ_DIR)/mod_contr_su.o $(OBJ_DIR)/mod_time.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_resistive.o
$(OBJ_DIR)/tri_contr_surf.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_tri_p.o
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/surface_wall.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/ideal_wall_response.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_contr_su.o\
......@@ -132,4 +152,80 @@ $(OBJ_DIR)/ideal_wall_response.o: \
$(OBJ_DIR)/read_coil_data.o: \
$(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/simil_trafo.o: \
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/control_array_distribution.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_coil2d.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/a_pe_transpose_sca.o:\
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_solv.o\
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/cholesky_solver.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/a_pwe_s_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/a_ee_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/a_ew_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/a_we_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/matrix_multiplication.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_tri_p.o $(OBJ_DIR)/mod_mpi_v.o\
$(OBJ_DIR)/mod_sca.o $(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/sca_grid.o:\
$(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/a_ey_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_resistive.o
$(OBJ_DIR)/a_ye_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_resistive.o
$(OBJ_DIR)/d_ee_computing.o:\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_resistive.o
$(OBJ_DIR)/computing_s_ww_inverse.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_sca.o\
$(OBJ_DIR)/mod_resistive.o
......@@ -17,7 +17,7 @@ subroutine input
if(rank==0) write(outp,*) '-------------------------------------------'
if(rank==0) write(outp,*) 'STARWALL-JOREK vacuum response code'
if(rank==0) write(outp,*) ' version 2010-08-10 by P. Merkel'
if(rank==0) write(outp,*) 'Parallel version 216-06-01 by S. Mochalskyy'
if(rank==0) write(outp,*) 'Parallel version 2016-06-01 by S. Mochalskyy'
if(rank==0) write(outp,*) '-------------------------------------------'
! --- Preset and read input parameters
......
program starwall
program starwall
! ----------------------------------------------------------------------
use icontr
use mpi_v
use time
implicit none
include "mpif.h"
......@@ -19,8 +18,6 @@
! --- Generation of the control surface triangles
call tri_contr_surf
call MPI_BARRIER(MPI_COMM_WORLD,ier)
! --- Discretization of the wall (generate wall triangles manually)
if ((nwall .gt. 0) .and. (iwall .eq. 1)) then
call surface_wall
......
......@@ -27,7 +27,7 @@ real,dimension(: ),allocatable :: a_ep_arr_s , a_ep_arr_tot
real,dimension(: ),allocatable :: a_ep_arr_s2, a_ep_arr_tot2
real,dimension(: ),allocatable :: a_ep_arr_s3, a_ep_arr_tot3
real,dimension(: ),allocatable :: a_ep_arr_s4, a_ep_arr_tot4
real,dimension(: ),allocatable :: a_ep_arr
integer, dimension(:), allocatable :: counts
integer, dimension(:), allocatable :: displ
......@@ -98,7 +98,6 @@ allocate(b_par_loc(nuv ,npot_p_loc_b_m1 : npot_p_loc_e), &
a_ep_arr_tot=0. ; a_ep_arr_s=0. ; a_ep_arr_tot2=0.; a_ep_arr_s2=0.
a_ep_arr_tot3=0.; a_ep_arr_s3=0.; a_ep_arr_tot4=0.; a_ep_arr_s4=0.
a_ep_arr= 0.
!==================================================================
!We need all this for MPI_ALLGATHERV subroutine
......
......@@ -10,7 +10,6 @@ use tri_w
use solv
use coil2d
use solv
use mpi_v
use sca
......
......@@ -27,7 +27,6 @@ if(INFO_B .NE. 0) then
endif
!a_ww
!Try with real size a_ew(nd_e,npot_w+ncoils) and wih a_ew(nd_e,npot_w)
CALL DESCINIT(DESCC,nd_w, nd_w, NB, NB, 0, 0, CONTEXT, LDA_ww, INFO_C )
if(INFO_B .NE. 0) then
write(6,*) "Something is wrong in matrix_multiplication.f90 CALL DESCINIT DESCC, INFO_C=",INFO_C
......
module mpi_v
implicit none
integer :: rank,numtasks,ERRORCODE,ier,request
integer :: sqrtnp,step,step2
integer :: ntri_p_loc_b,ntri_p_loc_e, ntri_w_loc_b,ntri_w_loc_e
end module mpi_v
module resistive
implicit none
real,dimension(:,:),allocatable :: S_ww_loc, a_ey_loc, a_ye_loc, d_ee_loc
real,dimension(:,:),allocatable :: S_ww_loc, a_ey_loc, a_ye_loc, d_ee_loc, s_ww_inv_loc
real,dimension( :),allocatable :: gamma
integer :: n_w
......
module sca
implicit none
implicit none
integer :: MYPNUM,NPROCS,CONTEXT,NPROW,NPCOL,MYCOL,MYROW,NB,MP_A,NQ_A,LDA_A
integer :: ipc,ipr
integer :: LDA_wp,LDA_pwe, LDA_pp,LDA_ep,LDA_ew, LDA_pwe_s,LDA_we,LDA_ee,LDA_ww,LDA_rw,LDA_sww
integer :: LDA_wp,LDA_pwe, LDA_pp,LDA_ep,LDA_ew, LDA_pwe_s,&
LDA_we,LDA_ee,LDA_ww,LDA_rw,LDA_sww, LDA_s_ww_inv
integer :: LDA_ey,LDA_ye,LDA_dee
integer :: DESCA(9),DESCB(9),DESCZ(9),DESCC(9)
integer :: INFO,INFO_A,INFO_B,INFO_Z,INFO_C
real :: ORFAC
integer :: lwork_cooficient
end module sca
......@@ -2,7 +2,7 @@ module time
implicit none
real :: time1,time2,time3,time4,time5,time6,time7,time8,time9,time10,time11,time12,time13,time14,time15,time16,time17
real :: time1,time2,time3,time4,time5,time6,time7,time8,time9,time10,time11,time12,time13,time14,time15,time16,time17,time18,time19
real :: time20, time21,time22,time23,time24,time25,time26,time27
real :: time1_max,time2_max,time3_max,time4_max, time5_max
real :: time6_max,time7_max,time8_max,time9_max
......
......@@ -34,16 +34,16 @@ if(rank==0) write(*,*) 'resistive_wall_response starts'
nd_bez = (nd_harm + nd_harm0)/2*n_dof_bnd
n_w = npot_w+ncoil
if(rank==0) write(*,*) 'resistive_wall_response nd_harm :',nd_harm
if(rank==0) write(*,*) 'resistive_wall_response nd_harm0 :',nd_harm0
if(rank==0) write(*,*) 'resistive_wall_response n_bnd :',n_bnd
if(rank==0) write(*,*) 'resistive_wall_response nd_bez :',nd_bez
if(rank==0) write(*,*) ' resistive_wall_response nd_harm :',nd_harm
if(rank==0) write(*,*) ' resistive_wall_response nd_harm0 :',nd_harm0
if(rank==0) write(*,*) ' resistive_wall_response n_bnd :',n_bnd
if(rank==0) write(*,*) ' resistive_wall_response nd_bez :',nd_bez
allocate(gamma(n_w),stat=ier)
gamma =0.
call SCA_GRID(n_w,n_w)
call SCA_GRID(n_w,n_w)
!allocate local matrix
allocate(S_ww_loc(MP_A,NQ_A), stat=ier)
IF (IER /= 0) THEN
......@@ -69,15 +69,11 @@ if(rank==0) write(80000+rank,*) sum(gamma)
call MPI_BARRIER(MPI_COMM_WORLD,ier)
!=================================================
call a_ye_computing
!=================================================
call MPI_BARRIER(MPI_COMM_WORLD,ier)
time16=MPI_WTIME()
if(rank==0)write(250+rank,*) time16-time15
......@@ -89,28 +85,12 @@ call a_ey_computing
!=================================================
call MPI_BARRIER(MPI_COMM_WORLD,ier)
time17=MPI_WTIME()
if(rank==0)write(260+rank,*) time17-time16
call MPI_BARRIER(MPI_COMM_WORLD,ier)
!test_sum=0
!CALL MPI_ALLREDUCE(sum(a_ey_loc), test_sum, 1, MPI_DOUBLE_PRECISION, MPI_SUM, MPI_COMM_WORLD, ier)
!if(rank==0) write(51000+rank,*) test_sum
!call MPI_BARRIER(MPI_COMM_WORLD,ier)
!test_sum=0
!CALL MPI_ALLREDUCE(sum(a_ye_loc), test_sum, 1, MPI_DOUBLE_PRECISION, MPI_SUM, MPI_COMM_WORLD, ier)
!if(rank==0) write(52000+rank,*) test_sum
!call MPI_BARRIER(MPI_COMM_WORLD,ier)
!=================================================
call d_ee_computing
!=================================================
......@@ -128,6 +108,37 @@ if(rank==0) write(50000+rank,*) test_sum
call MPI_BARRIER(MPI_COMM_WORLD,ier)
n_tor_jorek = 0
do i = 1, n_harm
if ( n_tor(i) == 0 ) then
n_tor_jorek = n_tor_jorek + 1
i_tor_jorek(n_tor_jorek) = 1
else
n_tor_jorek = n_tor_jorek + 2
i_tor_jorek(n_tor_jorek-1:n_tor_jorek) = n_tor(i)*2 + (/ 0, 1 /)
end if
end do
!=================================================
call computing_s_ww_inverse
!=================================================
time18=MPI_WTIME()
if(rank==0)write(280+rank,*) time18-time17
call MPI_BARRIER(MPI_COMM_WORLD,ier)
test_sum=0
CALL MPI_ALLREDUCE(sum(s_ww_inv_loc), test_sum, 1, MPI_DOUBLE_PRECISION, MPI_SUM, MPI_COMM_WORLD, ier)
if(rank==0) write(51000+rank,*) test_sum
call MPI_BARRIER(MPI_COMM_WORLD,ier)
! CALL DESCINIT(DESCC,nd_bez, nd_bez, NB, NB, 0, 0, CONTEXT, LDA_dee, INFO_C )
! if(INFO_C .NE. 0) then
! write(6,*) "Something is wrong in d_ee_computing CALL DESCINIT DESCC, INFO_C=",INFO_C
......
Markdown is supported
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