Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PETSc integration without using pragma directives and MESON build system setup #39

Merged
merged 71 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
aef23e2
Adding meson build system setup to compile shyfem with main tools and…
CeliaLaurent Dec 21, 2020
334ce76
test (#36)
CeliaLaurent Mar 11, 2021
d24573a
bug fixes in box model
georgu Mar 24, 2021
c564785
diagnostic output in newbcl
georgu Mar 24, 2021
1f24054
enhancements to rstinf
georgu Mar 26, 2021
59b66e1
some more on restart
georgu Mar 27, 2021
9a86b68
more on restart
georgu Mar 27, 2021
0697254
hydro gis with header
georgu Mar 30, 2021
f06846c
more work on debug output
georgu Mar 30, 2021
ead822d
Removing mod_petsc.f and implementation in simsys_petsc.f of the dire…
CeliaLaurent Apr 2, 2021
7b9d6ca
Merge remote-tracking branch 'myfork/meson' into petsc_meson
CeliaLaurent Apr 2, 2021
ed46fb5
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 2, 2021
959d141
Removing unused MOD_PETSc from Makefile and fixing target requirement…
CeliaLaurent Apr 2, 2021
7bcb07c
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 2, 2021
6379765
Fixing type issue in fem3d/mod_shympi_node.f causing compilation erro…
CeliaLaurent Apr 2, 2021
09275cc
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 2, 2021
9245d40
1) updating meson.build doing substitution of mod_petsc.f with simsys…
CeliaLaurent Apr 2, 2021
a3dedb4
Fixing more issues in solver intercompatibility
CeliaLaurent Apr 2, 2021
fc74d0d
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 2, 2021
4ccfc27
Merge branch 'develop' into petsc_dev
CeliaLaurent Apr 2, 2021
ec86825
restart changes
georgu Apr 6, 2021
68b7f17
some mpi bug fixes
georgu Apr 9, 2021
dae43a4
more for boxes
georgu Apr 10, 2021
ba0b19c
diagnostics on T/S
georgu Apr 14, 2021
06abd39
bug fix (atime)
georgu Apr 14, 2021
96254aa
still on diagnostics
georgu Apr 14, 2021
e22e60f
ice module debugging
georgu Apr 16, 2021
e889df4
ice debugging
shyfem-cm Apr 17, 2021
7f6bbf8
write 2d shyfiles in mpi mode
georgu Apr 17, 2021
2fd02c3
some bux fixes
georgu Apr 17, 2021
9067a96
Merge branch 'develop' of https://github.com/SHYFEM-model/shyfem into…
georgu Apr 17, 2021
dc4c581
fix typo error in simsys_pard and remove debug messages from mod_shym…
CeliaLaurent Apr 19, 2021
e715184
Merge branch 'develop' into petsc
CeliaLaurent Apr 19, 2021
7aef602
Merge branch 'petsc' into petsc_dev
CeliaLaurent Apr 19, 2021
c9c9d6b
Remove undefined mod_turbulence from Makefile
CeliaLaurent Apr 19, 2021
f4849b9
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 19, 2021
9a9f6d0
Removing dependence to pragma directives in new3di.f by adding use_PE…
CeliaLaurent Apr 20, 2021
5e47506
Reintroducing branch prediction optimization
CeliaLaurent Apr 20, 2021
82d1047
Fix meson tests handling of .petscrc files
CeliaLaurent Apr 20, 2021
760bef5
replace mod_turbulence by mod_keps in meson.build
CeliaLaurent Apr 20, 2021
5dc807b
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 20, 2021
c506b58
Minor changes to adapt files to the petsc branch
CeliaLaurent Apr 20, 2021
25fc5b7
check on shy file writing
georgu Apr 20, 2021
ebbfa00
syncing for shy files introduced
georgu Apr 20, 2021
13c7602
Merge branch 'develop' of https://github.com/SHYFEM-model/shyfem into…
georgu Apr 20, 2021
866f67d
minor
georgu Apr 20, 2021
e947a1c
replacing use_AmgX pragma directive with a logical fortran variable
CeliaLaurent Apr 20, 2021
d58c521
Removing last calls to pragma directives in newnohydro.f and mod_pets…
CeliaLaurent Apr 20, 2021
42ea864
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 20, 2021
234615f
Removing use_PETSc/AngX/SPK pragma directives from meson.build and ad…
CeliaLaurent Apr 20, 2021
48dcc76
Adding dummy amgx wrapper file to use with PETSc when AmgX is not pre…
CeliaLaurent Apr 20, 2021
7536464
Merge branch 'petsc_dev' into petsc_meson
CeliaLaurent Apr 20, 2021
3f4aabb
Merge branch 'develop' into petsc
CeliaLaurent Apr 20, 2021
18dd048
Merge branch 'petsc' into petsc_meson
CeliaLaurent Apr 20, 2021
bce6434
calling compiler-specific file descriptor function for intel and gnu
CeliaLaurent Apr 21, 2021
9fbdf7b
adding revision log
CeliaLaurent Apr 21, 2021
bae9759
Merge branch 'petsc' into petsc_meson
CeliaLaurent Apr 21, 2021
c4e87d3
Resetting NORMAL compilation profile
CeliaLaurent Apr 21, 2021
07e98af
Removing -fimplicit-none flag incompatible con old fortran files
CeliaLaurent Apr 22, 2021
7cb2cdc
Adding missing test files IMPLICIT_PETSc_AMGX.000*.str
CeliaLaurent Apr 22, 2021
a78d33c
some errors fixed due to bounds check
georgu Apr 22, 2021
5c33fc9
populate_string added to utils
georgu Apr 22, 2021
efff040
check bounds resolved
georgu Apr 22, 2021
60a03c5
fixed problem with bounds check and shyparts_metis
georgu Apr 22, 2021
bab6a1c
Rules.make with new compiler options
georgu Apr 22, 2021
c947077
Merge branch 'develop' of github.com:SHYFEM-model/shyfem into develop
CeliaLaurent Apr 23, 2021
07270fa
Merge branch 'develop' into petsc
CeliaLaurent Apr 23, 2021
f72ee5f
Fixing Rules.make for PETSc
CeliaLaurent Apr 23, 2021
46bf818
Few fixes to clean version respect to actual develop branch and fix e…
CeliaLaurent Apr 23, 2021
f2508b2
Few small fixes and adding log messages
CeliaLaurent Apr 23, 2021
a11bee8
Removing unnecessary tests_meson .str files
CeliaLaurent Apr 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Few fixes to clean version respect to actual develop branch and fix e…
…rroneous version of mod_shympi_node.f
  • Loading branch information
CeliaLaurent committed Apr 23, 2021
commit 46bf81836991ba1fa93f93326b65df12a4dcc4b8
5 changes: 2 additions & 3 deletions Rules.make
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,11 @@ SOLVER = SPARSKIT

##############################################

#to use PETSc compile with make using the PETSc solver, modify as well file pragma_directives.h to undef _use_SPK, and define _use_PETSc
#SOLVER=PETSC_AmgX #to compile with make using the PETSc_AmgX solver, modify as well file pragma_directives.h to undef _use_SPK, and define both _use_PETSc and _use_AmgX
#PETSCDIR needed for both PETSc and PETSc_AmgX solvers
PETSCDIR=

# fill in next paths for PETSc_AmgX solver only
AMGXWRAPWRAPDIR=
AMGXWRAPWRAPDIR=../amgx-c-wrapper/amgx-c-wrapper
AMGXWRAPDIR=
AMGXDIR=
CUDADIR=
Expand Down
10 changes: 2 additions & 8 deletions fem3d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,8 @@ ifeq ($(SOLVER),SPARSKIT)
simsys_solver=simsys_spk.o
endif

ifeq ($(FORTRAN_COMPILER),INTEL)
PREPROC_FLAG = -fpp
else
PREPROC_FLAG = -cpp
endif

FFLAGS += -Iinclude/
FFLAGS += $(PREPROC_FLAG)
LIBG_PETSC =
INCL_PETSC =
LIBG_AmgX =
Expand All @@ -92,7 +86,7 @@ ifeq ($(SOLVER),PETSC)
endif
ifeq (${SOLVER},PETSC_AmgX)
LIBG_PETSC = -lstdc++ \
-L$(PETSCDIR)/lib -lpetsc $(PREPROC_FLAG)
-L$(PETSCDIR)/lib -lpetsc
LIBG_AmgX = -L$(AMGXWRAPDIR)/lib -L$(AMGXWRAPDIR)/lib64 -lAmgXWrapper \
-L$(AMGXDIR)/lib -L$(AMGXDIR)/lib64 -lamgx \
-L$(CUDADIR)/lib -L$(CUDADIR)/lib64 -lcusolver -lcusparse -lcublas -lcuda -lcudart
Expand Down Expand Up @@ -851,7 +845,7 @@ gotm3d.o: gotm3d.f gotmturb.i


#------------------------------------------------
amgx_c_wrapper.o: ../amgx-c-wrapper/amgx-c-wrapper/src/amgx_c_wrapper.cpp ../amgx-c-wrapper/amgx-c-wrapper/src/amgx_c_wrapper.h
amgx_c_wrapper.o: $(AMGXWRAPWRAPDIR)/src/amgx_c_wrapper.cpp ../amgx-c-wrapper/amgx-c-wrapper/src/amgx_c_wrapper.h
$(CXX) -c $(CXXFLAGS) $< -o $@
#------------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions fem3d/include/pragma_directives.h

This file was deleted.

107 changes: 49 additions & 58 deletions fem3d/mod_shympi_node.f
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
! 06.07.2018 ggu changed VERS_7_5_48
! 16.02.2019 ggu changed VERS_7_5_60
! 07.06.2020 ggu new routines, 3d exchange array still missing
! 13.03.2021 ggu in shympi_exchange_array_3d_r() dimensions inverted
! 13.03.2021 ggu shympi_exchange_array_3d_r() has been re-defined
! 09.04.2021 clr bug fix in shympi_bcast_array_r() -> real arg
! 17.04.2021 ggu new shympi_exchange_array_3(), check_external_numbers()
! 22.04.2021 ggu allocation of some arrays for bounds check
Expand Down Expand Up @@ -1555,10 +1553,6 @@ subroutine shympi_reduce_r(what,vals,val)

end subroutine shympi_reduce_r

!******************************************************************
!******************************************************************
!******************************************************************
! 2d get
!******************************************************************
!******************************************************************
!******************************************************************
Expand Down Expand Up @@ -1597,10 +1591,54 @@ end subroutine shympi_get_array_2d_i
!******************************************************************
!******************************************************************
!******************************************************************
! exchange arrays
!******************************************************************
!******************************************************************
!******************************************************************

subroutine shympi_exchange_array_3d_r_aux(vals,val_out)

real vals(:,:)
real val_out(:,:)

integer ni1,no1,ni2,no2

ni1 = size(vals,1)
no1 = size(val_out,1)
ni2 = size(vals,2)
no2 = size(val_out,2)

if( ni1 > no1 ) then
write(6,*) 'ni1,no1: ',ni1,no1
stop 'error stop exchange: first dimension'
end if

call shympi_exchange_array_internal_r(ni1,no1,ni2,no2
+ ,vals,val_out)

end subroutine shympi_exchange_array_3d_r_aux

!*******************************

subroutine shympi_exchange_array_3d_i(vals,val_out)

integer vals(:,:)
integer val_out(:,:)

integer ni1,no1,ni2,no2

ni1 = size(vals,1)
no1 = size(val_out,1)
ni2 = size(vals,2)
no2 = size(val_out,2)

if( ni1 > no1 ) then
write(6,*) 'ni1,no1: ',ni1,no1
stop 'error stop exchange: first dimension'
end if

call shympi_exchange_array_internal_i(ni1,no1,ni2,no2
+ ,vals,val_out)

end subroutine shympi_exchange_array_3d_i

!*******************************

subroutine shympi_exchange_array_2d_r(vals,val_out)

Expand Down Expand Up @@ -1667,30 +1705,6 @@ subroutine shympi_exchange_array_3d_r(vals,val_out)
real vals(:,:)
real val_out(:,:)

integer ni1,no1,ni2,no2

ni1 = size(vals,1)
no1 = size(val_out,1)
ni2 = size(vals,2)
no2 = size(val_out,2)

if( ni1 > no1 ) then
write(6,*) 'ni1,no1: ',ni1,no1
stop 'error stop exchange: first dimension'
end if

call shympi_exchange_array_internal_r(ni1,no1,ni2,no2
+ ,vals,val_out)

end subroutine shympi_exchange_array_3d_r

!*******************************

subroutine shympi_exchange_array_3d_rr(vals,val_out)

real vals(:,:)
real val_out(:,:)

integer noh,nov
real, allocatable :: val_domain(:,:,:)

Expand All @@ -1716,30 +1730,7 @@ subroutine shympi_exchange_array_3d_rr(vals,val_out)
stop 'error stop shympi_exchange_array_3d_r: (1)'
end if

end subroutine shympi_exchange_array_3d_rr

!*******************************

subroutine shympi_exchange_array_3d_i(vals,val_out)

integer vals(:,:)
integer val_out(:,:)

integer ni1,no1,ni2,no2

ni1 = size(vals,1)
no1 = size(val_out,1)
ni2 = size(vals,2)
no2 = size(val_out,2)

if( ni1 > no1 ) then
write(6,*) 'ni1,no1: ',ni1,no1
stop 'error stop exchange: first dimension'
end if
call shympi_exchange_array_internal_i(ni1,no1,ni2,no2
+ ,vals,val_out)

end subroutine shympi_exchange_array_3d_i
end subroutine shympi_exchange_array_3d_r

!*******************************

Expand Down
1 change: 0 additions & 1 deletion fem3d/mod_test_zeta.f
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module mod_test_zeta
!==================================================================

#include "pragma_directives.h"
implicit none

integer, private, save :: nn_step = 0
Expand Down
14 changes: 3 additions & 11 deletions fem3d/shyfem.f
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
c 09.04.2020 ggu run bfm through bfm_run()
c 21.05.2020 ggu better handle copyright notice
c 04.06.2020 ggu debug_output() substituted with shympi_debug_output()
c 13.03.2021 clr&ggu adapted for petsc solver
c 30.03.2021 ggu more on debug, call sp111(2) outside time loop
c 01.04.2021 ggu turbulence cleaned
c 23.04.2021 clr&ggu adapted for petsc solver
c
c*****************************************************************
c
Expand Down Expand Up @@ -234,7 +234,7 @@ program shyfem
real dt
double precision timer
double precision mpi_t_start,mpi_t_end,parallel_start
double precision mpi_t_solve,mpi_t_run,mpi_t_init_solver
double precision mpi_t_solve
double precision dtime,dtanf,dtend
double precision atime_start,atime_end
character*20 aline_start,aline_end
Expand Down Expand Up @@ -461,7 +461,6 @@ program shyfem
!call test_forcing(dtime,dtend)

call test_zeta_init
mpi_t_run = shympi_wtime()

c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c%%%%%%%%%%%%%%%%%%%%%%%%% time loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -582,11 +581,6 @@ program shyfem
write(6,*)'Parallel_TIME =',mpi_t_end-parallel_start,my_id
call shympi_time_get(1,mpi_t_solve)
write(6,*)'MPI_SOLVE_TIME =',mpi_t_solve,my_id
call shympi_time_get(2,mpi_t_init_solver)
write(6,*)'MPI_INI_TIME=',
+ mpi_t_run-mpi_t_start+mpi_t_init_solver,my_id
write(6,*)'MPI_RUN_TIME =',
+ mpi_t_end-mpi_t_run-mpi_t_init_solver,my_id

call get_real_time(atime_end,aline_end)

Expand All @@ -604,8 +598,7 @@ program shyfem
!call prifnm(15)

!call shympi_finalize
write(6,*)'shyfem program exiting normally'
call shympi_exit(0)
call shympi_exit(99)
call exit(99)

stop
Expand Down Expand Up @@ -661,7 +654,6 @@ subroutine shyfem_init(strfile,bdebug,bdebout,bmpirun)
call clo_add_option('debout',.false.
+ ,'writes debugging information to file')


call clo_parse_options

call clo_get_option('quiet',bquiet)
Expand Down