mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-07 07:04:59 +00:00
Compare commits
185
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbed340405 | ||
|
|
e02df3725e | ||
|
|
ac42d7b1dd | ||
|
|
697f325df6 | ||
|
|
58d00b16c6 | ||
|
|
425743939c | ||
|
|
7e48a0a742 | ||
|
|
4f9254ebb0 | ||
|
|
90657b706f | ||
|
|
23a39a6c54 | ||
|
|
873f190961 | ||
|
|
87cdd76f8d | ||
|
|
45fabb5214 | ||
|
|
a9182021bb | ||
|
|
a8f4009cb1 | ||
|
|
794080e386 | ||
|
|
818f7a78a0 | ||
|
|
939d7c9a89 | ||
|
|
92f7cde375 | ||
|
|
af178daa84 | ||
|
|
49777a379b | ||
|
|
5768238f66 | ||
|
|
4c4b2b282e | ||
|
|
9d11a99ed4 | ||
|
|
9bc8b540b3 | ||
|
|
af75364c54 | ||
|
|
1270498170 | ||
|
|
51a9d16975 | ||
|
|
a04f7b4cf0 | ||
|
|
b387308455 | ||
|
|
aba9b29717 | ||
|
|
94ca610bff | ||
|
|
2542c0fda4 | ||
|
|
8482067b52 | ||
|
|
7319dab30f | ||
|
|
4bbba3ebd7 | ||
|
|
988021ff24 | ||
|
|
4e177ce926 | ||
|
|
1fa94d0372 | ||
|
|
0fcbdd74cd | ||
|
|
ba854379e4 | ||
|
|
a6cbd64e65 | ||
|
|
5c589dbf30 | ||
|
|
10e9c53e54 | ||
|
|
0332920a63 | ||
|
|
9b9dfbd198 | ||
|
|
5909e541b0 | ||
|
|
941ca6568a | ||
|
|
39a9c4e4ed | ||
|
|
41b4373494 | ||
|
|
4bf009a1ab | ||
|
|
e3d14dfb9e | ||
|
|
734724e407 | ||
|
|
a3a1dc52c5 | ||
|
|
6dddaaa77b | ||
|
|
12fc3ddc3d | ||
|
|
555d7433b7 | ||
|
|
b060787911 | ||
|
|
50951ef636 | ||
|
|
e1e1da18c6 | ||
|
|
47eba23460 | ||
|
|
f65e1ddaa1 | ||
|
|
02b46a0f85 | ||
|
|
636600f1c7 | ||
|
|
63aee06f6f | ||
|
|
7e4e2ed00e | ||
|
|
ee218171e7 | ||
|
|
8d3ebba561 | ||
|
|
09c72e8eed | ||
|
|
1541da5fbf | ||
|
|
257bf46e3b | ||
|
|
b53e0dd8b5 | ||
|
|
c23c4e2729 | ||
|
|
6f0f5feb34 | ||
|
|
27fafcd579 | ||
|
|
558bacfb0d | ||
|
|
bd6d4f3199 | ||
|
|
75d09c6349 | ||
|
|
bf59803015 | ||
|
|
5545078e0e | ||
|
|
c045b2af4a | ||
|
|
52f6900fc6 | ||
|
|
a71efa99fe | ||
|
|
c5a9d3a97d | ||
|
|
7b6eb0bd8d | ||
|
|
97fe836609 | ||
|
|
189a4170ec | ||
|
|
bfcb0b54e9 | ||
|
|
0153904ef2 | ||
|
|
ec52852bf5 | ||
|
|
01c7d09fdd | ||
|
|
b5c301eb05 | ||
|
|
ec9ab0da4d | ||
|
|
76eedf43bd | ||
|
|
094999a7f0 | ||
|
|
8bf1e30d66 | ||
|
|
90737f4ef6 | ||
|
|
21dcc11684 | ||
|
|
02ce9fc7ed | ||
|
|
a8c4129203 | ||
|
|
816c59d994 | ||
|
|
ee9ea93c2a | ||
|
|
eee6e596b1 | ||
|
|
537f9fec99 | ||
|
|
47acde313f | ||
|
|
97237e709b | ||
|
|
5aa3cfca1b | ||
|
|
a65f618a96 | ||
|
|
53747b8534 | ||
|
|
b4b96d9338 | ||
|
|
e5944b8af5 | ||
|
|
e9ba51c7b3 | ||
|
|
a42413223e | ||
|
|
cbb6b6183c | ||
|
|
de68e3f213 | ||
|
|
066002e864 | ||
|
|
f66238218d | ||
|
|
7b552ce0ba | ||
|
|
49f97711f6 | ||
|
|
2b60afe6c3 | ||
|
|
6bf1b33e4d | ||
|
|
6c3b687360 | ||
|
|
48fcdd744d | ||
|
|
cae178c7b2 | ||
|
|
b921f8ecbd | ||
|
|
b7eba989ad | ||
|
|
a67fec8662 | ||
|
|
65c23c5e0d | ||
|
|
8150483b70 | ||
|
|
594509cb00 | ||
|
|
ddbe050c1a | ||
|
|
debe35c477 | ||
|
|
1b72f31d50 | ||
|
|
9bb18b11ba | ||
|
|
019394c420 | ||
|
|
cc380f8e95 | ||
|
|
6b95ed7d9b | ||
|
|
5b2169672b | ||
|
|
64a65e3f6c | ||
|
|
baa4e78626 | ||
|
|
718b574519 | ||
|
|
859714ca70 | ||
|
|
867b7d37f4 | ||
|
|
76bb6b3c4a | ||
|
|
511aa802e5 | ||
|
|
871dea4348 | ||
|
|
434f1e2cc4 | ||
|
|
77fd14b89b | ||
|
|
1159659b4f | ||
|
|
274db9e4dc | ||
|
|
c51414f7ab | ||
|
|
eb6ba73525 | ||
|
|
f23df4cb48 | ||
|
|
44acd20726 | ||
|
|
51f1bf947a | ||
|
|
ea6411c730 | ||
|
|
d1447297c5 | ||
|
|
8b9a6c5f9a | ||
|
|
7af511a218 | ||
|
|
1188b6d9b3 | ||
|
|
54f56dac23 | ||
|
|
c42cd99d62 | ||
|
|
0bc626e1d3 | ||
|
|
3780cf1d98 | ||
|
|
7f2145a6d4 | ||
|
|
e786f26a05 | ||
|
|
8a84bfa2bf | ||
|
|
c119689ebc | ||
|
|
90bf65f117 | ||
|
|
3bfe62517b | ||
|
|
d644f8f76e | ||
|
|
6258d2398c | ||
|
|
4531532a07 | ||
|
|
ea6a260253 | ||
|
|
6541e3a95c | ||
|
|
7f378e445d | ||
|
|
6beaf49275 | ||
|
|
cbcb0507a2 | ||
|
|
f3614c9deb | ||
|
|
5a70bde74c | ||
|
|
9f55b2fec2 | ||
|
|
4d4c8e8ab9 | ||
|
|
bf71175d89 | ||
|
|
a96bbbc135 | ||
|
|
78a4f30951 |
@@ -4,7 +4,7 @@
|
|||||||
Algebraic Multigrid Package
|
Algebraic Multigrid Package
|
||||||
based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
|
|
||||||
(C) Copyright 2020
|
(C) Copyright 2021
|
||||||
|
|
||||||
Salvatore Filippone
|
Salvatore Filippone
|
||||||
Pasqua D'Ambra
|
Pasqua D'Ambra
|
||||||
|
|||||||
+10
-8
@@ -2,10 +2,10 @@
|
|||||||
.mod=@MODEXT@
|
.mod=@MODEXT@
|
||||||
.fh=.fh
|
.fh=.fh
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .f90 .F90 .f .F .c .o
|
.SUFFIXES: .f90 .F90 .f .F .c .cpp .o
|
||||||
##########################################################
|
##########################################################
|
||||||
# #
|
# #
|
||||||
# Note: directories external to the MLD2P4 subtree #
|
# Note: directories external to the AMG4PSBLAS subtree #
|
||||||
# must be specified here with absolute pathnames #
|
# must be specified here with absolute pathnames #
|
||||||
# #
|
# #
|
||||||
##########################################################
|
##########################################################
|
||||||
@@ -16,6 +16,7 @@ PSBLAS_LIBDIR=@PSBLAS_LIBDIR@
|
|||||||
@PSBLAS_INSTALL_MAKEINC@
|
@PSBLAS_INSTALL_MAKEINC@
|
||||||
PSBLAS_INCLUDES=@PSBLAS_INCLUDES@
|
PSBLAS_INCLUDES=@PSBLAS_INCLUDES@
|
||||||
PSBLAS_LIBS=@PSBLAS_LIBS@
|
PSBLAS_LIBS=@PSBLAS_LIBS@
|
||||||
|
PSBBASEMODNAME=psb_base_mod
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -69,15 +70,16 @@ EXTRALIBS=@EXTRA_LIBS@
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
MLDCDEFINES=$(MUMPSFLAGS) $(SLUFLAGS) $(UMFFLAGS) $(SLUDISTFLAGS) $(PSBCDEFINES)
|
AMGCDEFINES=$(MUMPSFLAGS) $(SLUFLAGS) $(UMFFLAGS) $(SLUDISTFLAGS) $(PSBCDEFINES)
|
||||||
MLDFDEFINES=@FDEFINES@ $(PSBFDEFINES)
|
CDEFINES=$(AMGCDEFINES)
|
||||||
|
AMGFDEFINES=@AMGFDEFINES@ $(PSBFDEFINES)
|
||||||
|
FDEFINES=$(AMGFDEFINES)
|
||||||
|
|
||||||
CDEFINES=$(MLDCDEFINES)
|
CXXDEFINES=@AMGCXXDEFINES@
|
||||||
FDEFINES=$(MLDFDEFINES)
|
|
||||||
|
|
||||||
@COMPILERULES@
|
@COMPILERULES@
|
||||||
|
|
||||||
|
|
||||||
MLDLDLIBS=$(MUMPSLIBS) $(SLULIBS) $(SLUDISTLIBS) $(UMFLIBS) $(EXTRALIBS) $(PSBLDLIBS)
|
AMGLDLIBS=$(MUMPSLIBS) $(SLULIBS) $(SLUDISTLIBS) $(UMFLIBS) $(EXTRALIBS) $(PSBLDLIBS) -lstdc++
|
||||||
LDLIBS=$(MLDLDLIBS)
|
LDLIBS=$(AMGLDLIBS)
|
||||||
|
|
||||||
|
|||||||
+120
@@ -0,0 +1,120 @@
|
|||||||
|
##########################################################
|
||||||
|
.mod=@MODEXT@
|
||||||
|
.fh=.fh
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .f90 .F90 .f .F .c .cpp .o
|
||||||
|
# The following ones are the variables used by the PSBLAS make scripts.
|
||||||
|
|
||||||
|
FC=@FC@
|
||||||
|
CC=@CC@
|
||||||
|
CXX=@CXX@
|
||||||
|
FCOPT=@FCOPT@
|
||||||
|
CCOPT=@CCOPT@
|
||||||
|
CXXOPT=@CXXOPT@
|
||||||
|
FMFLAG=@FMFLAG@
|
||||||
|
FIFLAG=@FIFLAG@
|
||||||
|
EXTRA_OPT=@EXTRA_OPT@
|
||||||
|
|
||||||
|
# These three should be always set!
|
||||||
|
MPFC=@MPIFC@
|
||||||
|
MPCC=@MPICC@
|
||||||
|
MPCXX=@MPICXX@
|
||||||
|
|
||||||
|
FLINK=@FLINK@
|
||||||
|
|
||||||
|
LIBS=@LIBS@
|
||||||
|
|
||||||
|
# BLAS, BLACS and METIS libraries.
|
||||||
|
BLAS=@BLAS_LIBS@
|
||||||
|
METIS_LIB=@METIS_LIBS@
|
||||||
|
LAPACK=@LAPACK_LIBS@
|
||||||
|
|
||||||
|
PSBFDEFINES=@FDEFINES@
|
||||||
|
PSBCDEFINES=@CDEFINES@
|
||||||
|
PSBCXXDEFINES=@CDEFINES@
|
||||||
|
AR=@AR@
|
||||||
|
RANLIB=@RANLIB@
|
||||||
|
|
||||||
|
##########################################################
|
||||||
|
# #
|
||||||
|
# Note: directories external to the AMG4PSBLAS subtree #
|
||||||
|
# must be specified here with absolute pathnames #
|
||||||
|
# #
|
||||||
|
##########################################################
|
||||||
|
PSBLASDIR=@PSBLAS_DIR@
|
||||||
|
PSBLAS_INCDIR=@PSBLAS_INCDIR@
|
||||||
|
PSBLAS_MODDIR=@PSBLAS_MODDIR@
|
||||||
|
PSBLAS_LIBDIR=@PSBLAS_LIBDIR@
|
||||||
|
PSBLAS_INCLUDES=@PSBLAS_INCLUDES@
|
||||||
|
PSBLAS_LIBS=@PSBLAS_LIBS@
|
||||||
|
PSBBASEMODNAME=psb_base_mod
|
||||||
|
PSBPRECMODNAME=psb_prec_mod
|
||||||
|
PSBMETHDMODNAME=psb_krylov_mod
|
||||||
|
PSBUTILMODNAME=psb_util_mod
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSTALL=@INSTALL@
|
||||||
|
INSTALL_DATA=@INSTALL_DATA@
|
||||||
|
INSTALL_DIR=@INSTALL_DIR@
|
||||||
|
INSTALL_LIBDIR=@INSTALL_LIBDIR@
|
||||||
|
INSTALL_INCLUDEDIR=@INSTALL_INCLUDEDIR@
|
||||||
|
INSTALL_MODULESDIR=@INSTALL_MODULESDIR@
|
||||||
|
INSTALL_DOCSDIR=@INSTALL_DOCSDIR@
|
||||||
|
INSTALL_SAMPLESDIR=@INSTALL_SAMPLESDIR@
|
||||||
|
|
||||||
|
|
||||||
|
##########################################################
|
||||||
|
# #
|
||||||
|
# Additional defines and libraries for multilevel #
|
||||||
|
# Note that these libraries should be compatible #
|
||||||
|
# (compiled with) the compilers specified in the #
|
||||||
|
# PSBLAS main Make.inc #
|
||||||
|
# #
|
||||||
|
# Examples: #
|
||||||
|
# MUMPSLIBS=-ldmumps -lmumps_common #
|
||||||
|
# -lpord -L/path/to/MUMPS/lib #
|
||||||
|
# MUMPSFLAGS=-DHave_MUMPS_ -I/path/to/MUMPS/include #
|
||||||
|
# #
|
||||||
|
# UMFLIBS=-lumfpack -lamd -L/path/to/UMFPACK #
|
||||||
|
# UMFFLAGS=-DHave_UMF_ -I/path/to/UMFPACK #
|
||||||
|
# #
|
||||||
|
# SLULIBS=-lslu -L/path/to/SuperLU #
|
||||||
|
# SLUFLAGS=-DHave_SLU_ -I/path/to/SuperLU #
|
||||||
|
# #
|
||||||
|
# SLUDISTLIBS=-lslud -L/path/to/SuperLUDist #
|
||||||
|
# SLUDISTFLAGS=-DHave_SLUDist_ -I/path/to/SuperLUDist #
|
||||||
|
# #
|
||||||
|
##########################################################
|
||||||
|
|
||||||
|
MUMPSLIBS=@MUMPS_LIBS@
|
||||||
|
MUMPSFLAGS=@MUMPS_FLAGS@
|
||||||
|
|
||||||
|
SLULIBS=@SLU_LIBS@
|
||||||
|
SLUFLAGS=@SLU_FLAGS@
|
||||||
|
|
||||||
|
SLUDISTLIBS=@SLUDIST_LIBS@
|
||||||
|
SLUDISTFLAGS=@SLUDIST_FLAGS@
|
||||||
|
|
||||||
|
UMFLIBS=@UMF_LIBS@
|
||||||
|
UMFFLAGS=@UMF_FLAGS@
|
||||||
|
|
||||||
|
EXTRALIBS=@EXTRA_LIBS@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@COMPILERULES@
|
||||||
|
|
||||||
|
#
|
||||||
|
AMGCDEFINES=$(MUMPSFLAGS) $(SLUFLAGS) $(UMFFLAGS) $(SLUDISTFLAGS) $(PSBCDEFINES)
|
||||||
|
CDEFINES=$(AMGCDEFINES)
|
||||||
|
AMGFDEFINES=@AMGFDEFINES@ $(PSBFDEFINES)
|
||||||
|
FDEFINES=$(AMGFDEFINES)
|
||||||
|
|
||||||
|
CXXDEFINES=@AMGCXXDEFINES@ $(PSBCXXDEFINES)
|
||||||
|
|
||||||
|
AMGLDLIBS=$(MUMPSLIBS) $(SLULIBS) $(SLUDISTLIBS) $(UMFLIBS) $(EXTRALIBS) $(PSBLDLIBS) -lstdc++
|
||||||
|
LDLIBS=$(AMGLDLIBS)
|
||||||
|
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ include Make.inc
|
|||||||
|
|
||||||
all: library
|
all: library
|
||||||
|
|
||||||
library: libdir amgp
|
library: libdir amgp cbnd
|
||||||
#cbnd
|
#cbnd
|
||||||
|
|
||||||
libdir:
|
libdir:
|
||||||
@@ -33,8 +33,8 @@ install: all
|
|||||||
mkdir -p $(INSTALL_SAMPLESDIR) && \
|
mkdir -p $(INSTALL_SAMPLESDIR) && \
|
||||||
mkdir -p $(INSTALL_SAMPLESDIR)/simple &&\
|
mkdir -p $(INSTALL_SAMPLESDIR)/simple &&\
|
||||||
mkdir -p $(INSTALL_SAMPLESDIR)/advanced && \
|
mkdir -p $(INSTALL_SAMPLESDIR)/advanced && \
|
||||||
(cd examples; /bin/cp -fr pdegen fileread $(INSTALL_SAMPLESDIR)/simple ) && \
|
(cd samples/simple; /bin/cp -fr pdegen fileread $(INSTALL_SAMPLESDIR)/simple ) && \
|
||||||
(cd tests; /bin/cp -fr pdegen fileread $(INSTALL_SAMPLESDIR)/advanced )
|
(cd samples/advanced; /bin/cp -fr pdegen fileread $(INSTALL_SAMPLESDIR)/advanced )
|
||||||
cleanlib:
|
cleanlib:
|
||||||
(cd lib; /bin/rm -f *.a *$(.mod) *$(.fh))
|
(cd lib; /bin/rm -f *.a *$(.mod) *$(.fh))
|
||||||
(cd include; /bin/rm -f *.a *$(.mod) *$(.fh))
|
(cd include; /bin/rm -f *.a *$(.mod) *$(.fh))
|
||||||
@@ -42,13 +42,13 @@ cleanlib:
|
|||||||
|
|
||||||
veryclean: cleanlib
|
veryclean: cleanlib
|
||||||
(cd amgprec; make veryclean)
|
(cd amgprec; make veryclean)
|
||||||
(cd examples/fileread; make clean)
|
(cd samples/simple/fileread; make clean)
|
||||||
(cd examples/pdegen; make clean)
|
(cd samples/simple/pdegen; make clean)
|
||||||
(cd tests/fileread; make clean)
|
(cd samples/advanced/fileread; make clean)
|
||||||
(cd tests/pdegen; make clean)
|
(cd samples/advanced/pdegen; make clean)
|
||||||
|
|
||||||
check: all
|
check: all
|
||||||
make check -C tests/pdegen
|
make check -C samples/advanced/pdegen
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
(cd amgprec; make clean)
|
(cd amgprec; make clean)
|
||||||
|
|||||||
+24
-12
@@ -15,8 +15,8 @@ DMODOBJS=amg_d_prec_type.o \
|
|||||||
amg_d_base_aggregator_mod.o \
|
amg_d_base_aggregator_mod.o \
|
||||||
amg_d_dec_aggregator_mod.o amg_d_symdec_aggregator_mod.o \
|
amg_d_dec_aggregator_mod.o amg_d_symdec_aggregator_mod.o \
|
||||||
amg_d_ainv_solver.o amg_d_base_ainv_mod.o \
|
amg_d_ainv_solver.o amg_d_base_ainv_mod.o \
|
||||||
amg_d_invk_solver.o amg_d_invt_solver.o
|
amg_d_invk_solver.o amg_d_invt_solver.o amg_d_krm_solver.o \
|
||||||
#amg_d_bcmatch_aggregator_mod.o
|
amg_d_matchboxp_mod.o amg_d_parmatch_aggregator_mod.o
|
||||||
|
|
||||||
SMODOBJS=amg_s_prec_type.o amg_s_ilu_fact_mod.o \
|
SMODOBJS=amg_s_prec_type.o amg_s_ilu_fact_mod.o \
|
||||||
amg_s_inner_mod.o amg_s_ilu_solver.o amg_s_diag_solver.o amg_s_jac_smoother.o amg_s_as_smoother.o \
|
amg_s_inner_mod.o amg_s_ilu_solver.o amg_s_diag_solver.o amg_s_jac_smoother.o amg_s_as_smoother.o \
|
||||||
@@ -26,7 +26,8 @@ SMODOBJS=amg_s_prec_type.o amg_s_ilu_fact_mod.o \
|
|||||||
amg_s_base_aggregator_mod.o \
|
amg_s_base_aggregator_mod.o \
|
||||||
amg_s_dec_aggregator_mod.o amg_s_symdec_aggregator_mod.o \
|
amg_s_dec_aggregator_mod.o amg_s_symdec_aggregator_mod.o \
|
||||||
amg_s_ainv_solver.o amg_s_base_ainv_mod.o \
|
amg_s_ainv_solver.o amg_s_base_ainv_mod.o \
|
||||||
amg_s_invk_solver.o amg_s_invt_solver.o
|
amg_s_invk_solver.o amg_s_invt_solver.o amg_s_krm_solver.o \
|
||||||
|
amg_s_matchboxp_mod.o amg_s_parmatch_aggregator_mod.o
|
||||||
|
|
||||||
ZMODOBJS=amg_z_prec_type.o amg_z_ilu_fact_mod.o \
|
ZMODOBJS=amg_z_prec_type.o amg_z_ilu_fact_mod.o \
|
||||||
amg_z_inner_mod.o amg_z_ilu_solver.o amg_z_diag_solver.o amg_z_jac_smoother.o amg_z_as_smoother.o \
|
amg_z_inner_mod.o amg_z_ilu_solver.o amg_z_diag_solver.o amg_z_jac_smoother.o amg_z_as_smoother.o \
|
||||||
@@ -36,7 +37,7 @@ ZMODOBJS=amg_z_prec_type.o amg_z_ilu_fact_mod.o \
|
|||||||
amg_z_base_aggregator_mod.o \
|
amg_z_base_aggregator_mod.o \
|
||||||
amg_z_dec_aggregator_mod.o amg_z_symdec_aggregator_mod.o \
|
amg_z_dec_aggregator_mod.o amg_z_symdec_aggregator_mod.o \
|
||||||
amg_z_ainv_solver.o amg_z_base_ainv_mod.o \
|
amg_z_ainv_solver.o amg_z_base_ainv_mod.o \
|
||||||
amg_z_invk_solver.o amg_z_invt_solver.o
|
amg_z_invk_solver.o amg_z_invt_solver.o amg_z_krm_solver.o
|
||||||
|
|
||||||
CMODOBJS=amg_c_prec_type.o amg_c_ilu_fact_mod.o \
|
CMODOBJS=amg_c_prec_type.o amg_c_ilu_fact_mod.o \
|
||||||
amg_c_inner_mod.o amg_c_ilu_solver.o amg_c_diag_solver.o amg_c_jac_smoother.o amg_c_as_smoother.o \
|
amg_c_inner_mod.o amg_c_ilu_solver.o amg_c_diag_solver.o amg_c_jac_smoother.o amg_c_as_smoother.o \
|
||||||
@@ -46,7 +47,7 @@ CMODOBJS=amg_c_prec_type.o amg_c_ilu_fact_mod.o \
|
|||||||
amg_c_base_aggregator_mod.o \
|
amg_c_base_aggregator_mod.o \
|
||||||
amg_c_dec_aggregator_mod.o amg_c_symdec_aggregator_mod.o \
|
amg_c_dec_aggregator_mod.o amg_c_symdec_aggregator_mod.o \
|
||||||
amg_c_ainv_solver.o amg_c_base_ainv_mod.o \
|
amg_c_ainv_solver.o amg_c_base_ainv_mod.o \
|
||||||
amg_c_invk_solver.o amg_c_invt_solver.o
|
amg_c_invk_solver.o amg_c_invt_solver.o amg_c_krm_solver.o
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -74,12 +75,21 @@ lib: $(OBJS) impld
|
|||||||
/bin/cp -p *$(.mod) $(MODDIR)
|
/bin/cp -p *$(.mod) $(MODDIR)
|
||||||
|
|
||||||
|
|
||||||
$(MODOBJS): $(PSBLAS_MODDIR)/$(BASEMODNAME)$(.mod)
|
$(MODOBJS): $(PSBLAS_MODDIR)/$(PSBBASEMODNAME)$(.mod)
|
||||||
|
|
||||||
amg_base_prec_type.o: amg_const.h
|
amg_base_prec_type.o: amg_const.h
|
||||||
amg_s_prec_type.o amg_d_prec_type.o amg_c_prec_type.o amg_z_prec_type.o : amg_base_prec_type.o
|
amg_s_prec_type.o amg_d_prec_type.o amg_c_prec_type.o amg_z_prec_type.o : amg_base_prec_type.o
|
||||||
amg_prec_type.o: amg_s_prec_type.o amg_d_prec_type.o amg_c_prec_type.o amg_z_prec_type.o
|
amg_prec_type.o: amg_s_prec_type.o amg_d_prec_type.o amg_c_prec_type.o amg_z_prec_type.o
|
||||||
amg_prec_mod.o: amg_prec_type.o amg_s_prec_mod.o amg_d_prec_mod.o amg_c_prec_mod.o amg_z_prec_mod.o
|
amg_prec_mod.o: amg_prec_type.o amg_s_prec_mod.o amg_d_prec_mod.o amg_c_prec_mod.o amg_z_prec_mod.o
|
||||||
|
amg_s_krm_solver.o: amg_s_prec_type.o amg_s_base_solver_mod.o
|
||||||
|
amg_d_krm_solver.o: amg_d_prec_type.o amg_d_base_solver_mod.o
|
||||||
|
amg_c_krm_solver.o: amg_c_prec_type.o amg_c_base_solver_mod.o
|
||||||
|
amg_z_krm_solver.o: amg_z_prec_type.o amg_z_base_solver_mod.o
|
||||||
|
|
||||||
|
amg_s_prec_mod.o: amg_s_krm_solver.o
|
||||||
|
amg_d_prec_mod.o: amg_d_krm_solver.o
|
||||||
|
amg_c_prec_mod.o: amg_c_krm_solver.o
|
||||||
|
amg_z_prec_mod.o: amg_z_krm_solver.o
|
||||||
|
|
||||||
$(SINNEROBJS) $(SOUTEROBJS): $(SMODOBJS)
|
$(SINNEROBJS) $(SOUTEROBJS): $(SMODOBJS)
|
||||||
$(DINNEROBJS) $(DOUTEROBJS): $(DMODOBJS)
|
$(DINNEROBJS) $(DOUTEROBJS): $(DMODOBJS)
|
||||||
@@ -102,25 +112,27 @@ amg_d_prec_type.o: amg_d_onelev_mod.o
|
|||||||
amg_c_prec_type.o: amg_c_onelev_mod.o
|
amg_c_prec_type.o: amg_c_onelev_mod.o
|
||||||
amg_z_prec_type.o: amg_z_onelev_mod.o
|
amg_z_prec_type.o: amg_z_onelev_mod.o
|
||||||
|
|
||||||
amg_s_onelev_mod.o: amg_s_base_smoother_mod.o amg_s_dec_aggregator_mod.o
|
amg_s_onelev_mod.o: amg_s_base_smoother_mod.o amg_s_dec_aggregator_mod.o amg_s_parmatch_aggregator_mod.o
|
||||||
amg_d_onelev_mod.o: amg_d_base_smoother_mod.o amg_d_dec_aggregator_mod.o
|
amg_d_onelev_mod.o: amg_d_base_smoother_mod.o amg_d_dec_aggregator_mod.o amg_d_parmatch_aggregator_mod.o
|
||||||
amg_c_onelev_mod.o: amg_c_base_smoother_mod.o amg_c_dec_aggregator_mod.o
|
amg_c_onelev_mod.o: amg_c_base_smoother_mod.o amg_c_dec_aggregator_mod.o
|
||||||
amg_z_onelev_mod.o: amg_z_base_smoother_mod.o amg_z_dec_aggregator_mod.o
|
amg_z_onelev_mod.o: amg_z_base_smoother_mod.o amg_z_dec_aggregator_mod.o
|
||||||
|
|
||||||
amg_s_base_aggregator_mod.o: amg_base_prec_type.o
|
amg_s_base_aggregator_mod.o: amg_base_prec_type.o
|
||||||
amg_s_dec_aggregator_mod.o: amg_s_base_aggregator_mod.o
|
amg_s_parmatch_aggregator_mod.o amg_s_dec_aggregator_mod.o: amg_s_base_aggregator_mod.o
|
||||||
amg_s_hybrid_aggregator_mod.o amg_s_symdec_aggregator_mod.o: amg_s_dec_aggregator_mod.o
|
amg_s_hybrid_aggregator_mod.o amg_s_symdec_aggregator_mod.o: amg_s_dec_aggregator_mod.o
|
||||||
|
amg_s_parmatch_aggregator_mod.o: amg_s_matchboxp_mod.o
|
||||||
|
|
||||||
amg_d_base_aggregator_mod.o: amg_base_prec_type.o
|
amg_d_base_aggregator_mod.o: amg_base_prec_type.o
|
||||||
amg_d_dec_aggregator_mod.o: amg_d_base_aggregator_mod.o
|
amg_d_parmatch_aggregator_mod.o amg_d_dec_aggregator_mod.o: amg_d_base_aggregator_mod.o
|
||||||
amg_d_hybrid_aggregator_mod.o amg_d_symdec_aggregator_mod.o: amg_d_dec_aggregator_mod.o
|
amg_d_hybrid_aggregator_mod.o amg_d_symdec_aggregator_mod.o: amg_d_dec_aggregator_mod.o
|
||||||
|
amg_d_parmatch_aggregator_mod.o: amg_d_matchboxp_mod.o
|
||||||
|
|
||||||
amg_c_base_aggregator_mod.o: amg_base_prec_type.o
|
amg_c_base_aggregator_mod.o: amg_base_prec_type.o
|
||||||
amg_c_dec_aggregator_mod.o: amg_c_base_aggregator_mod.o
|
amg_c_parmatch_aggregator_mod.o amg_c_dec_aggregator_mod.o: amg_c_base_aggregator_mod.o
|
||||||
amg_c_hybrid_aggregator_mod.o amg_c_symdec_aggregator_mod.o: amg_c_dec_aggregator_mod.o
|
amg_c_hybrid_aggregator_mod.o amg_c_symdec_aggregator_mod.o: amg_c_dec_aggregator_mod.o
|
||||||
|
|
||||||
amg_z_base_aggregator_mod.o: amg_base_prec_type.o
|
amg_z_base_aggregator_mod.o: amg_base_prec_type.o
|
||||||
amg_z_dec_aggregator_mod.o: amg_z_base_aggregator_mod.o
|
amg_z_parmatch_aggregator_mod.o amg_z_dec_aggregator_mod.o: amg_z_base_aggregator_mod.o
|
||||||
amg_z_hybrid_aggregator_mod.o amg_z_symdec_aggregator_mod.o: amg_z_dec_aggregator_mod.o
|
amg_z_hybrid_aggregator_mod.o amg_z_symdec_aggregator_mod.o: amg_z_dec_aggregator_mod.o
|
||||||
|
|
||||||
amg_s_base_smoother_mod.o: amg_s_base_solver_mod.o
|
amg_s_base_smoother_mod.o: amg_s_base_solver_mod.o
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
hn=mld_const.h
|
hn=amg_const.h
|
||||||
fn=mld_base_prec_type.F90
|
fn=amg_base_prec_type.F90
|
||||||
echo "/* This file was generated by a script using the $fn file as a basis. */" > $hn
|
echo "/* This file was generated by a script using the $fn file as a basis. */" > $hn
|
||||||
echo '#ifndef MLD_CONST_H_' >> $hn
|
echo '#ifndef AMG_CONST_H_' >> $hn
|
||||||
echo '#define MLD_CONST_H_' >> $hn
|
echo '#define AMG_CONST_H_' >> $hn
|
||||||
echo '#ifdef __cplusplus' >> $hn
|
echo '#ifdef __cplusplus' >> $hn
|
||||||
echo 'extern "C" { ' >> $hn
|
echo 'extern "C" { ' >> $hn
|
||||||
echo '#endif' >> $hn
|
echo '#endif' >> $hn
|
||||||
cat $fn | sed 's/=/= (/g;s/$/ )/g' | grep '\(^ *!\)\|parameter' | grep '_\>' | sed 's/^\s*//g;s/^.*:://g;s/\s*=\s*/ /g' | sed 's/,/\n/g;s/^ //g' | tr '[:lower:]' '[:upper:]' | grep ^MLD | sed 's/^/#define /g' >> $hn
|
cat $fn | sed 's/=/= (/g;s/$/ )/g' | grep '\(^ *!\)\|parameter' | grep '_\>' | sed 's/^\s*//g;s/^.*:://g;s/\s*=\s*/ /g' | sed 's/,/\n/g;s/^ //g' | tr '[:lower:]' '[:upper:]' | grep ^AMG | sed 's/^/#define /g' >> $hn
|
||||||
echo '#ifdef __cplusplus' >> $hn
|
echo '#ifdef __cplusplus' >> $hn
|
||||||
echo '}' >> $hn
|
echo '}' >> $hn
|
||||||
echo '#endif' >> $hn
|
echo '#endif' >> $hn
|
||||||
+200
-154
@@ -1,15 +1,15 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
! are met:
|
! are met:
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_base_prec_type.F90
|
! File: amg_base_prec_type.F90
|
||||||
!
|
!
|
||||||
! Module: amg_base_prec_type
|
! Module: amg_base_prec_type
|
||||||
@@ -50,16 +50,16 @@
|
|||||||
!
|
!
|
||||||
! It contains routines for
|
! It contains routines for
|
||||||
! - converting character constants defining the preconditioner into integer
|
! - converting character constants defining the preconditioner into integer
|
||||||
! constants;
|
! constants;
|
||||||
! - checking if the preconditioner is correctly defined;
|
! - checking if the preconditioner is correctly defined;
|
||||||
! - printing a description of the preconditioner;
|
! - printing a description of the preconditioner;
|
||||||
! - deallocating the preconditioner data structure.
|
! - deallocating the preconditioner data structure.
|
||||||
!
|
!
|
||||||
|
|
||||||
module amg_base_prec_type
|
module amg_base_prec_type
|
||||||
|
|
||||||
!
|
!
|
||||||
! This reduces the size of .mod file. Without the ONLY clause compilation
|
! This reduces the size of .mod file. Without the ONLY clause compilation
|
||||||
! blows up on some systems.
|
! blows up on some systems.
|
||||||
!
|
!
|
||||||
use psb_const_mod
|
use psb_const_mod
|
||||||
@@ -78,13 +78,13 @@ module amg_base_prec_type
|
|||||||
& psb_err_from_subroutine_, psb_err_missing_override_method_, &
|
& psb_err_from_subroutine_, psb_err_missing_override_method_, &
|
||||||
& psb_error_handler, psb_out_unit, psb_err_unit
|
& psb_error_handler, psb_out_unit, psb_err_unit
|
||||||
|
|
||||||
!
|
!
|
||||||
! Version numbers
|
! Version numbers
|
||||||
!
|
!
|
||||||
character(len=*), parameter :: amg_version_string_ = "1.0.0"
|
character(len=*), parameter :: amg_version_string_ = "1.0.1"
|
||||||
integer(psb_ipk_), parameter :: amg_version_major_ = 1
|
integer(psb_ipk_), parameter :: amg_version_major_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 0
|
integer(psb_ipk_), parameter :: amg_version_minor_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_patchlevel_ = 0
|
integer(psb_ipk_), parameter :: amg_patchlevel_ = 1
|
||||||
|
|
||||||
type amg_ml_parms
|
type amg_ml_parms
|
||||||
integer(psb_ipk_) :: sweeps_pre, sweeps_post
|
integer(psb_ipk_) :: sweeps_pre, sweeps_post
|
||||||
@@ -120,7 +120,9 @@ module amg_base_prec_type
|
|||||||
procedure, pass(pm) :: printout => d_ml_parms_printout
|
procedure, pass(pm) :: printout => d_ml_parms_printout
|
||||||
end type amg_dml_parms
|
end type amg_dml_parms
|
||||||
|
|
||||||
type amg_saggr_data
|
|
||||||
|
|
||||||
|
type amg_iaggr_data
|
||||||
!
|
!
|
||||||
! Aggregation data and defaults:
|
! Aggregation data and defaults:
|
||||||
!
|
!
|
||||||
@@ -129,42 +131,41 @@ module amg_base_prec_type
|
|||||||
! We are assuming that the coarse size fits in
|
! We are assuming that the coarse size fits in
|
||||||
! integer range of psb_ipk_, but this is
|
! integer range of psb_ipk_, but this is
|
||||||
! not very restrictive
|
! not very restrictive
|
||||||
integer(psb_ipk_) :: min_coarse_size = izero
|
integer(psb_ipk_) :: min_coarse_size = -ione
|
||||||
! 2. maximum number of levels. Defaults to 20
|
integer(psb_ipk_) :: min_coarse_size_per_process = -ione
|
||||||
|
integer(psb_lpk_) :: target_coarse_size
|
||||||
|
! 2. maximum number of levels. Defaults to 20
|
||||||
integer(psb_ipk_) :: max_levs = 20_psb_ipk_
|
integer(psb_ipk_) :: max_levs = 20_psb_ipk_
|
||||||
! 3. min_cr_ratio = 1.5
|
contains
|
||||||
|
procedure, pass(ag) :: default => i_ag_default
|
||||||
|
end type amg_iaggr_data
|
||||||
|
|
||||||
|
type, extends(amg_iaggr_data) :: amg_saggr_data
|
||||||
|
! 3. min_cr_ratio = 1.5
|
||||||
real(psb_spk_) :: min_cr_ratio = 1.5_psb_spk_
|
real(psb_spk_) :: min_cr_ratio = 1.5_psb_spk_
|
||||||
real(psb_spk_) :: op_complexity = szero
|
real(psb_spk_) :: op_complexity = szero
|
||||||
real(psb_spk_) :: avg_cr = szero
|
real(psb_spk_) :: avg_cr = szero
|
||||||
|
contains
|
||||||
|
procedure, pass(ag) :: default => s_ag_default
|
||||||
end type amg_saggr_data
|
end type amg_saggr_data
|
||||||
|
|
||||||
type amg_daggr_data
|
type, extends(amg_iaggr_data) :: amg_daggr_data
|
||||||
!
|
! 3. min_cr_ratio = 1.5
|
||||||
! Aggregation data and defaults:
|
|
||||||
!
|
|
||||||
!
|
|
||||||
! 1. min_coarse_size = 0 Default target size will be computed as
|
|
||||||
! 40*(N_fine)**(1./3.)
|
|
||||||
! We are assuming that the coarse size fits in
|
|
||||||
! integer range of psb_ipk_, but this is
|
|
||||||
! not very restrictive
|
|
||||||
integer(psb_ipk_) :: min_coarse_size = izero
|
|
||||||
! 2. maximum number of levels. Defaults to 20
|
|
||||||
integer(psb_ipk_) :: max_levs = 20_psb_ipk_
|
|
||||||
! 3. min_cr_ratio = 1.5
|
|
||||||
real(psb_dpk_) :: min_cr_ratio = 1.5_psb_dpk_
|
real(psb_dpk_) :: min_cr_ratio = 1.5_psb_dpk_
|
||||||
real(psb_dpk_) :: op_complexity = dzero
|
real(psb_dpk_) :: op_complexity = dzero
|
||||||
real(psb_dpk_) :: avg_cr = dzero
|
real(psb_dpk_) :: avg_cr = dzero
|
||||||
|
contains
|
||||||
|
procedure, pass(ag) :: default => d_ag_default
|
||||||
end type amg_daggr_data
|
end type amg_daggr_data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
! Entries in iprcparm
|
! Entries in iprcparm
|
||||||
!
|
!
|
||||||
! These are in baseprec
|
! These are in baseprec
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_smoother_type_ = 1
|
integer(psb_ipk_), parameter :: amg_smoother_type_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_sub_solve_ = 2
|
integer(psb_ipk_), parameter :: amg_sub_solve_ = 2
|
||||||
integer(psb_ipk_), parameter :: amg_sub_restr_ = 3
|
integer(psb_ipk_), parameter :: amg_sub_restr_ = 3
|
||||||
integer(psb_ipk_), parameter :: amg_sub_prol_ = 4
|
integer(psb_ipk_), parameter :: amg_sub_prol_ = 4
|
||||||
@@ -174,7 +175,7 @@ module amg_base_prec_type
|
|||||||
|
|
||||||
!
|
!
|
||||||
! These are in onelev
|
! These are in onelev
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_ml_cycle_ = 20
|
integer(psb_ipk_), parameter :: amg_ml_cycle_ = 20
|
||||||
integer(psb_ipk_), parameter :: amg_smoother_sweeps_pre_ = 21
|
integer(psb_ipk_), parameter :: amg_smoother_sweeps_pre_ = 21
|
||||||
integer(psb_ipk_), parameter :: amg_smoother_sweeps_post_ = 22
|
integer(psb_ipk_), parameter :: amg_smoother_sweeps_post_ = 22
|
||||||
@@ -186,7 +187,7 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_aggr_eig_ = 28
|
integer(psb_ipk_), parameter :: amg_aggr_eig_ = 28
|
||||||
integer(psb_ipk_), parameter :: amg_aggr_filter_ = 29
|
integer(psb_ipk_), parameter :: amg_aggr_filter_ = 29
|
||||||
integer(psb_ipk_), parameter :: amg_coarse_mat_ = 30
|
integer(psb_ipk_), parameter :: amg_coarse_mat_ = 30
|
||||||
integer(psb_ipk_), parameter :: amg_coarse_solve_ = 31
|
integer(psb_ipk_), parameter :: amg_coarse_solve_ = 31
|
||||||
integer(psb_ipk_), parameter :: amg_coarse_sweeps_ = 32
|
integer(psb_ipk_), parameter :: amg_coarse_sweeps_ = 32
|
||||||
integer(psb_ipk_), parameter :: amg_coarse_fillin_ = 33
|
integer(psb_ipk_), parameter :: amg_coarse_fillin_ = 33
|
||||||
integer(psb_ipk_), parameter :: amg_coarse_subsolve_ = 34
|
integer(psb_ipk_), parameter :: amg_coarse_subsolve_ = 34
|
||||||
@@ -201,7 +202,7 @@ module amg_base_prec_type
|
|||||||
|
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_smoother_type_
|
! Legal values for entry: amg_smoother_type_
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_min_prec_ = 0
|
integer(psb_ipk_), parameter :: amg_min_prec_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_noprec_ = 0
|
integer(psb_ipk_), parameter :: amg_noprec_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_base_smooth_ = 0
|
integer(psb_ipk_), parameter :: amg_base_smooth_ = 0
|
||||||
@@ -239,7 +240,8 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_sludist_ = amg_slv_delta_+9
|
integer(psb_ipk_), parameter :: amg_sludist_ = amg_slv_delta_+9
|
||||||
integer(psb_ipk_), parameter :: amg_mumps_ = amg_slv_delta_+10
|
integer(psb_ipk_), parameter :: amg_mumps_ = amg_slv_delta_+10
|
||||||
integer(psb_ipk_), parameter :: amg_bwgs_ = amg_slv_delta_+11
|
integer(psb_ipk_), parameter :: amg_bwgs_ = amg_slv_delta_+11
|
||||||
integer(psb_ipk_), parameter :: amg_max_sub_solve_ = amg_slv_delta_+11
|
integer(psb_ipk_), parameter :: amg_krm_ = amg_slv_delta_+12
|
||||||
|
integer(psb_ipk_), parameter :: amg_max_sub_solve_ = amg_slv_delta_+12
|
||||||
integer(psb_ipk_), parameter :: amg_min_sub_solve_ = amg_diag_scale_
|
integer(psb_ipk_), parameter :: amg_min_sub_solve_ = amg_diag_scale_
|
||||||
|
|
||||||
!
|
!
|
||||||
@@ -248,7 +250,7 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_none_ = 0
|
integer(psb_ipk_), parameter :: amg_ilu_scale_none_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_maxval_ = 1
|
integer(psb_ipk_), parameter :: amg_ilu_scale_maxval_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_diag_ = 2
|
integer(psb_ipk_), parameter :: amg_ilu_scale_diag_ = 2
|
||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_arwsum_ = 3
|
integer(psb_ipk_), parameter :: amg_ilu_scale_arwsum_ = 3
|
||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_aclsum_ = 4
|
integer(psb_ipk_), parameter :: amg_ilu_scale_aclsum_ = 4
|
||||||
integer(psb_ipk_), parameter :: amg_ilu_scale_arcsum_ = 5
|
integer(psb_ipk_), parameter :: amg_ilu_scale_arcsum_ = 5
|
||||||
! For the time being enable only maxval scale
|
! For the time being enable only maxval scale
|
||||||
@@ -266,19 +268,21 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_new_ml_prec_ = 7
|
integer(psb_ipk_), parameter :: amg_new_ml_prec_ = 7
|
||||||
integer(psb_ipk_), parameter :: amg_mult_dev_ml_ = 7
|
integer(psb_ipk_), parameter :: amg_mult_dev_ml_ = 7
|
||||||
integer(psb_ipk_), parameter :: amg_max_ml_cycle_ = 8
|
integer(psb_ipk_), parameter :: amg_max_ml_cycle_ = 8
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_par_aggr_alg_
|
! Legal values for entry: amg_par_aggr_alg_
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_dec_aggr_ = 0
|
integer(psb_ipk_), parameter :: amg_dec_aggr_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_sym_dec_aggr_ = 1
|
integer(psb_ipk_), parameter :: amg_sym_dec_aggr_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_ext_aggr_ = 2
|
integer(psb_ipk_), parameter :: amg_ext_aggr_ = 2
|
||||||
integer(psb_ipk_), parameter :: amg_max_par_aggr_alg_ = amg_ext_aggr_
|
integer(psb_ipk_), parameter :: amg_coupled_aggr_ = 3
|
||||||
|
integer(psb_ipk_), parameter :: amg_max_par_aggr_alg_ = amg_coupled_aggr_
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_aggr_type_
|
! Legal values for entry: amg_aggr_type_
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_noalg_ = 0
|
integer(psb_ipk_), parameter :: amg_noalg_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_soc1_ = 1
|
integer(psb_ipk_), parameter :: amg_soc1_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_soc2_ = 2
|
integer(psb_ipk_), parameter :: amg_soc2_ = 2
|
||||||
|
integer(psb_ipk_), parameter :: amg_matchboxp_ = 3
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_aggr_prol_
|
! Legal values for entry: amg_aggr_prol_
|
||||||
!
|
!
|
||||||
@@ -293,7 +297,7 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_no_filter_mat_ = 0
|
integer(psb_ipk_), parameter :: amg_no_filter_mat_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_filter_mat_ = 1
|
integer(psb_ipk_), parameter :: amg_filter_mat_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_max_filter_mat_ = amg_filter_mat_
|
integer(psb_ipk_), parameter :: amg_max_filter_mat_ = amg_filter_mat_
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_aggr_ord_
|
! Legal values for entry: amg_aggr_ord_
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_aggr_ord_nat_ = 0
|
integer(psb_ipk_), parameter :: amg_aggr_ord_nat_ = 0
|
||||||
@@ -313,7 +317,7 @@ module amg_base_prec_type
|
|||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_distr_mat_ = 0
|
integer(psb_ipk_), parameter :: amg_distr_mat_ = 0
|
||||||
integer(psb_ipk_), parameter :: amg_repl_mat_ = 1
|
integer(psb_ipk_), parameter :: amg_repl_mat_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_max_coarse_mat_ = amg_repl_mat_
|
integer(psb_ipk_), parameter :: amg_max_coarse_mat_ = amg_repl_mat_
|
||||||
!
|
!
|
||||||
! Legal values for entry: amg_prec_status_
|
! Legal values for entry: amg_prec_status_
|
||||||
!
|
!
|
||||||
@@ -343,7 +347,7 @@ module amg_base_prec_type
|
|||||||
|
|
||||||
!
|
!
|
||||||
! Fields for sparse matrices ensembles stored in av()
|
! Fields for sparse matrices ensembles stored in av()
|
||||||
!
|
!
|
||||||
integer(psb_ipk_), parameter :: amg_l_pr_ = 1
|
integer(psb_ipk_), parameter :: amg_l_pr_ = 1
|
||||||
integer(psb_ipk_), parameter :: amg_u_pr_ = 2
|
integer(psb_ipk_), parameter :: amg_u_pr_ = 2
|
||||||
integer(psb_ipk_), parameter :: amg_bp_ilu_avsz_ = 2
|
integer(psb_ipk_), parameter :: amg_bp_ilu_avsz_ = 2
|
||||||
@@ -352,7 +356,7 @@ module amg_base_prec_type
|
|||||||
integer(psb_ipk_), parameter :: amg_sm_pr_t_ = 5
|
integer(psb_ipk_), parameter :: amg_sm_pr_t_ = 5
|
||||||
integer(psb_ipk_), parameter :: amg_sm_pr_ = 6
|
integer(psb_ipk_), parameter :: amg_sm_pr_ = 6
|
||||||
integer(psb_ipk_), parameter :: amg_smth_avsz_ = 6
|
integer(psb_ipk_), parameter :: amg_smth_avsz_ = 6
|
||||||
integer(psb_ipk_), parameter :: amg_max_avsz_ = amg_smth_avsz_
|
integer(psb_ipk_), parameter :: amg_max_avsz_ = amg_smth_avsz_
|
||||||
|
|
||||||
!
|
!
|
||||||
! Character constants used by amg_file_prec_descr
|
! Character constants used by amg_file_prec_descr
|
||||||
@@ -367,12 +371,13 @@ module amg_base_prec_type
|
|||||||
character(len=15), parameter, private :: &
|
character(len=15), parameter, private :: &
|
||||||
& matrix_names(0:1)=(/'distributed ','replicated '/)
|
& matrix_names(0:1)=(/'distributed ','replicated '/)
|
||||||
character(len=18), parameter, private :: &
|
character(len=18), parameter, private :: &
|
||||||
& aggr_type_names(0:2)=(/'None ',&
|
& aggr_type_names(0:3)=(/'None ',&
|
||||||
& 'SOC measure 1 ', 'SOC Measure 2 '/)
|
& 'SOC measure 1 ', 'SOC Measure 2 ',&
|
||||||
|
& 'Parallel Matching '/)
|
||||||
character(len=18), parameter, private :: &
|
character(len=18), parameter, private :: &
|
||||||
& par_aggr_alg_names(0:2)=(/&
|
& par_aggr_alg_names(0:3)=(/&
|
||||||
& 'decoupled aggr. ', 'sym. dec. aggr. ',&
|
& 'decoupled aggr. ', 'sym. dec. aggr. ',&
|
||||||
& 'user defined aggr.'/)
|
& 'user defined aggr.', 'coupled aggr. '/)
|
||||||
character(len=18), parameter, private :: &
|
character(len=18), parameter, private :: &
|
||||||
& ord_names(0:1)=(/'Natural ordering ','Desc. degree ord. '/)
|
& ord_names(0:1)=(/'Natural ordering ','Desc. degree ord. '/)
|
||||||
character(len=6), parameter, private :: &
|
character(len=6), parameter, private :: &
|
||||||
@@ -394,13 +399,13 @@ module amg_base_prec_type
|
|||||||
& 'MILU(n) ','ILU(t,n) ',&
|
& 'MILU(n) ','ILU(t,n) ',&
|
||||||
& 'SuperLU ','UMFPACK LU ',&
|
& 'SuperLU ','UMFPACK LU ',&
|
||||||
& 'SuperLU_Dist ','MUMPS ',&
|
& 'SuperLU_Dist ','MUMPS ',&
|
||||||
& 'Backward GS '/)
|
& 'Backward GS ','Krylov Method '/)
|
||||||
|
|
||||||
interface amg_check_def
|
interface amg_check_def
|
||||||
module procedure amg_icheck_def, amg_scheck_def, amg_dcheck_def
|
module procedure amg_icheck_def, amg_scheck_def, amg_dcheck_def
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface psb_bcast
|
interface psb_bcast
|
||||||
module procedure amg_ml_bcast, amg_sml_bcast, amg_dml_bcast
|
module procedure amg_ml_bcast, amg_sml_bcast, amg_dml_bcast
|
||||||
end interface psb_bcast
|
end interface psb_bcast
|
||||||
|
|
||||||
@@ -413,9 +418,9 @@ module amg_base_prec_type
|
|||||||
! Will need a more sophisticated strategy.
|
! Will need a more sophisticated strategy.
|
||||||
!
|
!
|
||||||
logical, private, save :: do_remap=.false.
|
logical, private, save :: do_remap=.false.
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
function amg_get_do_remap() result(res)
|
function amg_get_do_remap() result(res)
|
||||||
implicit none
|
implicit none
|
||||||
logical :: res
|
logical :: res
|
||||||
@@ -429,7 +434,7 @@ contains
|
|||||||
|
|
||||||
do_remap = val
|
do_remap = val
|
||||||
end subroutine amg_set_do_remap
|
end subroutine amg_set_do_remap
|
||||||
|
|
||||||
!
|
!
|
||||||
! Function: amg_stringval
|
! Function: amg_stringval
|
||||||
!
|
!
|
||||||
@@ -444,10 +449,10 @@ contains
|
|||||||
!
|
!
|
||||||
function amg_stringval(string) result(val)
|
function amg_stringval(string) result(val)
|
||||||
use psb_prec_const_mod
|
use psb_prec_const_mod
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
character(len=*), intent(in) :: string
|
character(len=*), intent(in) :: string
|
||||||
integer(psb_ipk_) :: val
|
integer(psb_ipk_) :: val
|
||||||
character(len=*), parameter :: name='amg_stringval'
|
character(len=*), parameter :: name='amg_stringval'
|
||||||
! Local variable
|
! Local variable
|
||||||
integer :: index_tab
|
integer :: index_tab
|
||||||
@@ -455,14 +460,14 @@ contains
|
|||||||
index_tab=index(string,char(9))
|
index_tab=index(string,char(9))
|
||||||
if (index_tab.NE.0) then
|
if (index_tab.NE.0) then
|
||||||
string2=string(1:index_tab-1)
|
string2=string(1:index_tab-1)
|
||||||
else
|
else
|
||||||
string2=string
|
string2=string
|
||||||
endif
|
endif
|
||||||
select case(psb_toupper(trim(string2)))
|
select case(psb_toupper(trim(string2)))
|
||||||
case('NONE')
|
case('NONE')
|
||||||
val = 0
|
val = 0
|
||||||
case('HALO')
|
case('HALO')
|
||||||
val = psb_halo_
|
val = psb_halo_
|
||||||
case('SUM')
|
case('SUM')
|
||||||
val = psb_sum_
|
val = psb_sum_
|
||||||
case('AVG')
|
case('AVG')
|
||||||
@@ -511,7 +516,11 @@ contains
|
|||||||
val = amg_soc2_
|
val = amg_soc2_
|
||||||
case('SOC1')
|
case('SOC1')
|
||||||
val = amg_soc1_
|
val = amg_soc1_
|
||||||
case('DEC')
|
case('MATCHBOXP','PARMATCH')
|
||||||
|
val = amg_matchboxp_
|
||||||
|
case('COUPLED','COUP')
|
||||||
|
val = amg_coupled_aggr_
|
||||||
|
case('DEC','DECOUPLED')
|
||||||
val = amg_dec_aggr_
|
val = amg_dec_aggr_
|
||||||
case('SYMDEC')
|
case('SYMDEC')
|
||||||
val = amg_sym_dec_aggr_
|
val = amg_sym_dec_aggr_
|
||||||
@@ -543,6 +552,8 @@ contains
|
|||||||
val = amg_jac_
|
val = amg_jac_
|
||||||
case('L1-JACOBI')
|
case('L1-JACOBI')
|
||||||
val = amg_l1_jac_
|
val = amg_l1_jac_
|
||||||
|
case('KRM')
|
||||||
|
val = amg_krm_
|
||||||
case('AS')
|
case('AS')
|
||||||
val = amg_as_
|
val = amg_as_
|
||||||
case('A_NORMI')
|
case('A_NORMI')
|
||||||
@@ -558,56 +569,56 @@ contains
|
|||||||
case('OUTER_SWEEPS')
|
case('OUTER_SWEEPS')
|
||||||
val = amg_outer_sweeps_
|
val = amg_outer_sweeps_
|
||||||
case('LOCAL_SOLVER')
|
case('LOCAL_SOLVER')
|
||||||
val = amg_local_solver_
|
val = amg_local_solver_
|
||||||
case('GLOBAL_SOLVER')
|
case('GLOBAL_SOLVER')
|
||||||
val = amg_global_solver_
|
val = amg_global_solver_
|
||||||
case default
|
case default
|
||||||
val = -1
|
val = -1
|
||||||
end select
|
end select
|
||||||
end function amg_stringval
|
end function amg_stringval
|
||||||
|
|
||||||
subroutine ml_parms_get_coarse(pm,pmin)
|
subroutine ml_parms_get_coarse(pm,pmin)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_ml_parms), intent(inout) :: pm
|
class(amg_ml_parms), intent(inout) :: pm
|
||||||
class(amg_ml_parms), intent(in) :: pmin
|
class(amg_ml_parms), intent(in) :: pmin
|
||||||
pm%coarse_mat = pmin%coarse_mat
|
pm%coarse_mat = pmin%coarse_mat
|
||||||
pm%coarse_solve = pmin%coarse_solve
|
pm%coarse_solve = pmin%coarse_solve
|
||||||
end subroutine ml_parms_get_coarse
|
end subroutine ml_parms_get_coarse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
subroutine ml_parms_printout(pm,iout)
|
subroutine ml_parms_printout(pm,iout)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_ml_parms), intent(in) :: pm
|
class(amg_ml_parms), intent(in) :: pm
|
||||||
integer(psb_ipk_), intent(in) :: iout
|
integer(psb_ipk_), intent(in) :: iout
|
||||||
|
|
||||||
write(iout,*) 'ML : ',pm%ml_cycle
|
write(iout,*) 'ML : ',pm%ml_cycle
|
||||||
write(iout,*) 'Sweeps: ',pm%sweeps_pre,pm%sweeps_post
|
write(iout,*) 'Sweeps: ',pm%sweeps_pre,pm%sweeps_post
|
||||||
write(iout,*) 'AGGR : ',pm%par_aggr_alg,pm%aggr_prol, pm%aggr_ord
|
write(iout,*) 'AGGR : ',pm%par_aggr_alg,pm%aggr_prol, pm%aggr_ord
|
||||||
write(iout,*) ' : ',pm%aggr_omega_alg,pm%aggr_eig,pm%aggr_filter
|
write(iout,*) ' : ',pm%aggr_omega_alg,pm%aggr_eig,pm%aggr_filter
|
||||||
write(iout,*) 'COARSE: ',pm%coarse_mat,pm%coarse_solve
|
write(iout,*) 'COARSE: ',pm%coarse_mat,pm%coarse_solve
|
||||||
end subroutine ml_parms_printout
|
end subroutine ml_parms_printout
|
||||||
|
|
||||||
|
|
||||||
subroutine s_ml_parms_printout(pm,iout)
|
subroutine s_ml_parms_printout(pm,iout)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_sml_parms), intent(in) :: pm
|
class(amg_sml_parms), intent(in) :: pm
|
||||||
integer(psb_ipk_), intent(in) :: iout
|
integer(psb_ipk_), intent(in) :: iout
|
||||||
|
|
||||||
call pm%amg_ml_parms%printout(iout)
|
call pm%amg_ml_parms%printout(iout)
|
||||||
write(iout,*) 'REAL : ',pm%aggr_omega_val,pm%aggr_thresh
|
write(iout,*) 'REAL : ',pm%aggr_omega_val,pm%aggr_thresh
|
||||||
end subroutine s_ml_parms_printout
|
end subroutine s_ml_parms_printout
|
||||||
|
|
||||||
|
|
||||||
subroutine d_ml_parms_printout(pm,iout)
|
subroutine d_ml_parms_printout(pm,iout)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_dml_parms), intent(in) :: pm
|
class(amg_dml_parms), intent(in) :: pm
|
||||||
integer(psb_ipk_), intent(in) :: iout
|
integer(psb_ipk_), intent(in) :: iout
|
||||||
|
|
||||||
call pm%amg_ml_parms%printout(iout)
|
call pm%amg_ml_parms%printout(iout)
|
||||||
write(iout,*) 'REAL : ',pm%aggr_omega_val,pm%aggr_thresh
|
write(iout,*) 'REAL : ',pm%aggr_omega_val,pm%aggr_thresh
|
||||||
end subroutine d_ml_parms_printout
|
end subroutine d_ml_parms_printout
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
! Routines printing out a description of the preconditioner
|
! Routines printing out a description of the preconditioner
|
||||||
@@ -623,7 +634,7 @@ contains
|
|||||||
info = psb_success_
|
info = psb_success_
|
||||||
if ((pm%ml_cycle>=amg_no_ml_).and.(pm%ml_cycle<=amg_max_ml_cycle_)) then
|
if ((pm%ml_cycle>=amg_no_ml_).and.(pm%ml_cycle<=amg_max_ml_cycle_)) then
|
||||||
|
|
||||||
|
|
||||||
write(iout,*) ' Multilevel cycle: ',&
|
write(iout,*) ' Multilevel cycle: ',&
|
||||||
& ml_names(pm%ml_cycle)
|
& ml_names(pm%ml_cycle)
|
||||||
select case (pm%ml_cycle)
|
select case (pm%ml_cycle)
|
||||||
@@ -649,7 +660,7 @@ contains
|
|||||||
info = psb_success_
|
info = psb_success_
|
||||||
if ((pm%ml_cycle>=amg_no_ml_).and.(pm%ml_cycle<=amg_max_ml_cycle_)) then
|
if ((pm%ml_cycle>=amg_no_ml_).and.(pm%ml_cycle<=amg_max_ml_cycle_)) then
|
||||||
|
|
||||||
|
|
||||||
write(iout,*) ' Parallel aggregation algorithm: ',&
|
write(iout,*) ' Parallel aggregation algorithm: ',&
|
||||||
& par_aggr_alg_names(pm%par_aggr_alg)
|
& par_aggr_alg_names(pm%par_aggr_alg)
|
||||||
if (pm%aggr_type>0) write(iout,*) ' Aggregation type: ',&
|
if (pm%aggr_type>0) write(iout,*) ' Aggregation type: ',&
|
||||||
@@ -661,23 +672,23 @@ contains
|
|||||||
write(iout,*) ' Aggregation prolongator: ', &
|
write(iout,*) ' Aggregation prolongator: ', &
|
||||||
& aggr_prols(pm%aggr_prol)
|
& aggr_prols(pm%aggr_prol)
|
||||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||||
write(iout,*) ' with: ', aggr_filters(pm%aggr_filter)
|
write(iout,*) ' with: ', aggr_filters(pm%aggr_filter)
|
||||||
if (pm%aggr_omega_alg == amg_eig_est_) then
|
if (pm%aggr_omega_alg == amg_eig_est_) then
|
||||||
write(iout,*) ' Damping omega computation: spectral radius estimate'
|
write(iout,*) ' Damping omega computation: spectral radius estimate'
|
||||||
write(iout,*) ' Spectral radius estimate: ', &
|
write(iout,*) ' Spectral radius estimate: ', &
|
||||||
& eigen_estimates(pm%aggr_eig)
|
& eigen_estimates(pm%aggr_eig)
|
||||||
else if (pm%aggr_omega_alg == amg_user_choice_) then
|
else if (pm%aggr_omega_alg == amg_user_choice_) then
|
||||||
write(iout,*) ' Damping omega computation: user defined value.'
|
write(iout,*) ' Damping omega computation: user defined value.'
|
||||||
else
|
else
|
||||||
write(iout,*) ' Damping omega computation: unknown value in iprcparm!!'
|
write(iout,*) ' Damping omega computation: unknown value in iprcparm!!'
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
!end if
|
!end if
|
||||||
else
|
else
|
||||||
write(iout,*) ' Multilevel type: Unkonwn value. Something is amiss....',&
|
write(iout,*) ' Multilevel type: Unkonwn value. Something is amiss....',&
|
||||||
& pm%ml_cycle
|
& pm%ml_cycle
|
||||||
end if
|
end if
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine ml_parms_mldescr
|
end subroutine ml_parms_mldescr
|
||||||
@@ -694,13 +705,13 @@ contains
|
|||||||
logical :: coarse_
|
logical :: coarse_
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
if (present(coarse)) then
|
if (present(coarse)) then
|
||||||
coarse_ = coarse
|
coarse_ = coarse
|
||||||
else
|
else
|
||||||
coarse_ = .false.
|
coarse_ = .false.
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if (coarse_) then
|
if (coarse_) then
|
||||||
call pm%coarsedescr(iout,info)
|
call pm%coarsedescr(iout,info)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -723,12 +734,12 @@ contains
|
|||||||
write(iout,*) ' Coarse matrix: ',&
|
write(iout,*) ' Coarse matrix: ',&
|
||||||
& matrix_names(pm%coarse_mat)
|
& matrix_names(pm%coarse_mat)
|
||||||
select case(pm%coarse_solve)
|
select case(pm%coarse_solve)
|
||||||
case (amg_bjac_,amg_as_)
|
case (amg_bjac_,amg_as_)
|
||||||
write(iout,*) ' Number of sweeps : ',&
|
write(iout,*) ' Number of sweeps : ',&
|
||||||
& pm%sweeps_pre
|
& pm%sweeps_pre
|
||||||
write(iout,*) ' Coarse solver: ',&
|
write(iout,*) ' Coarse solver: ',&
|
||||||
& 'Block Jacobi'
|
& 'Block Jacobi'
|
||||||
case (amg_l1_bjac_)
|
case (amg_l1_bjac_)
|
||||||
write(iout,*) ' Number of sweeps : ',&
|
write(iout,*) ' Number of sweeps : ',&
|
||||||
& pm%sweeps_pre
|
& pm%sweeps_pre
|
||||||
write(iout,*) ' Coarse solver: ',&
|
write(iout,*) ' Coarse solver: ',&
|
||||||
@@ -795,7 +806,7 @@ contains
|
|||||||
!
|
!
|
||||||
|
|
||||||
function is_legal_base_prec(ip)
|
function is_legal_base_prec(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_base_prec
|
logical :: is_legal_base_prec
|
||||||
|
|
||||||
@@ -803,60 +814,68 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_base_prec
|
end function is_legal_base_prec
|
||||||
function is_int_non_negative(ip)
|
function is_int_non_negative(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_int_non_negative
|
logical :: is_int_non_negative
|
||||||
|
|
||||||
is_int_non_negative = (ip >= 0)
|
is_int_non_negative = (ip >= 0)
|
||||||
return
|
return
|
||||||
end function is_int_non_negative
|
end function is_int_non_negative
|
||||||
function is_legal_ilu_scale(ip)
|
function is_legal_ilu_scale(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ilu_scale
|
logical :: is_legal_ilu_scale
|
||||||
is_legal_ilu_scale = ((ip >= amg_ilu_scale_none_).and.(ip <= amg_max_ilu_scale_))
|
is_legal_ilu_scale = ((ip >= amg_ilu_scale_none_).and.(ip <= amg_max_ilu_scale_))
|
||||||
return
|
return
|
||||||
end function is_legal_ilu_scale
|
end function is_legal_ilu_scale
|
||||||
function is_int_positive(ip)
|
function is_int_positive(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_int_positive
|
logical :: is_int_positive
|
||||||
|
|
||||||
is_int_positive = (ip >= 1)
|
is_int_positive = (ip >= 1)
|
||||||
return
|
return
|
||||||
end function is_int_positive
|
end function is_int_positive
|
||||||
function is_legal_prolong(ip)
|
function is_legal_prolong(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_prolong
|
logical :: is_legal_prolong
|
||||||
is_legal_prolong = ((ip>=psb_none_).and.(ip<=psb_square_root_))
|
is_legal_prolong = ((ip>=psb_none_).and.(ip<=psb_square_root_))
|
||||||
return
|
return
|
||||||
end function is_legal_prolong
|
end function is_legal_prolong
|
||||||
function is_legal_restrict(ip)
|
function is_legal_restrict(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_restrict
|
logical :: is_legal_restrict
|
||||||
is_legal_restrict = ((ip == psb_nohalo_).or.(ip==psb_halo_))
|
is_legal_restrict = ((ip == psb_nohalo_).or.(ip==psb_halo_))
|
||||||
return
|
return
|
||||||
end function is_legal_restrict
|
end function is_legal_restrict
|
||||||
function is_legal_ml_cycle(ip)
|
function is_legal_ml_cycle(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_cycle
|
logical :: is_legal_ml_cycle
|
||||||
|
|
||||||
is_legal_ml_cycle = ((ip>=amg_no_ml_).and.(ip<=amg_max_ml_cycle_))
|
is_legal_ml_cycle = ((ip>=amg_no_ml_).and.(ip<=amg_max_ml_cycle_))
|
||||||
return
|
return
|
||||||
end function is_legal_ml_cycle
|
end function is_legal_ml_cycle
|
||||||
function is_legal_ml_par_aggr_alg(ip)
|
function is_legal_coupled_par_aggr_alg(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_par_aggr_alg
|
logical :: is_legal_coupled_par_aggr_alg
|
||||||
|
|
||||||
is_legal_ml_par_aggr_alg = ((ip>=amg_dec_aggr_).and.(ip<=amg_max_par_aggr_alg_))
|
is_legal_coupled_par_aggr_alg = (ip == amg_coupled_aggr_)
|
||||||
return
|
return
|
||||||
end function is_legal_ml_par_aggr_alg
|
end function is_legal_coupled_par_aggr_alg
|
||||||
|
function is_legal_decoupled_par_aggr_alg(ip)
|
||||||
|
implicit none
|
||||||
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
|
logical :: is_legal_decoupled_par_aggr_alg
|
||||||
|
|
||||||
|
is_legal_decoupled_par_aggr_alg = ((ip>=amg_dec_aggr_).and.(ip<=amg_max_par_aggr_alg_))
|
||||||
|
return
|
||||||
|
end function is_legal_decoupled_par_aggr_alg
|
||||||
function is_legal_ml_aggr_type(ip)
|
function is_legal_ml_aggr_type(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_aggr_type
|
logical :: is_legal_ml_aggr_type
|
||||||
|
|
||||||
@@ -864,7 +883,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_aggr_type
|
end function is_legal_ml_aggr_type
|
||||||
function is_legal_ml_aggr_ord(ip)
|
function is_legal_ml_aggr_ord(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_aggr_ord
|
logical :: is_legal_ml_aggr_ord
|
||||||
|
|
||||||
@@ -872,7 +891,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_aggr_ord
|
end function is_legal_ml_aggr_ord
|
||||||
function is_legal_ml_aggr_omega_alg(ip)
|
function is_legal_ml_aggr_omega_alg(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_aggr_omega_alg
|
logical :: is_legal_ml_aggr_omega_alg
|
||||||
|
|
||||||
@@ -880,7 +899,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_aggr_omega_alg
|
end function is_legal_ml_aggr_omega_alg
|
||||||
function is_legal_ml_aggr_eig(ip)
|
function is_legal_ml_aggr_eig(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_aggr_eig
|
logical :: is_legal_ml_aggr_eig
|
||||||
|
|
||||||
@@ -888,7 +907,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_aggr_eig
|
end function is_legal_ml_aggr_eig
|
||||||
function is_legal_ml_aggr_prol(ip)
|
function is_legal_ml_aggr_prol(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_aggr_prol
|
logical :: is_legal_ml_aggr_prol
|
||||||
|
|
||||||
@@ -896,7 +915,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_aggr_prol
|
end function is_legal_ml_aggr_prol
|
||||||
function is_legal_ml_coarse_mat(ip)
|
function is_legal_ml_coarse_mat(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_coarse_mat
|
logical :: is_legal_ml_coarse_mat
|
||||||
|
|
||||||
@@ -904,7 +923,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ml_coarse_mat
|
end function is_legal_ml_coarse_mat
|
||||||
function is_legal_aggr_filter(ip)
|
function is_legal_aggr_filter(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_aggr_filter
|
logical :: is_legal_aggr_filter
|
||||||
|
|
||||||
@@ -912,7 +931,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_aggr_filter
|
end function is_legal_aggr_filter
|
||||||
function is_distr_ml_coarse_mat(ip)
|
function is_distr_ml_coarse_mat(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_distr_ml_coarse_mat
|
logical :: is_distr_ml_coarse_mat
|
||||||
|
|
||||||
@@ -920,7 +939,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_distr_ml_coarse_mat
|
end function is_distr_ml_coarse_mat
|
||||||
function is_legal_ml_fact(ip)
|
function is_legal_ml_fact(ip)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ml_fact
|
logical :: is_legal_ml_fact
|
||||||
! Here the minimum is really 1, amg_fact_none_ is not acceptable.
|
! Here the minimum is really 1, amg_fact_none_ is not acceptable.
|
||||||
@@ -930,7 +949,7 @@ contains
|
|||||||
end function is_legal_ml_fact
|
end function is_legal_ml_fact
|
||||||
function is_legal_ilu_fact(ip)
|
function is_legal_ilu_fact(ip)
|
||||||
use psb_prec_const_mod
|
use psb_prec_const_mod
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(in) :: ip
|
integer(psb_ipk_), intent(in) :: ip
|
||||||
logical :: is_legal_ilu_fact
|
logical :: is_legal_ilu_fact
|
||||||
|
|
||||||
@@ -939,14 +958,14 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_ilu_fact
|
end function is_legal_ilu_fact
|
||||||
function is_legal_d_omega(ip)
|
function is_legal_d_omega(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_dpk_), intent(in) :: ip
|
real(psb_dpk_), intent(in) :: ip
|
||||||
logical :: is_legal_d_omega
|
logical :: is_legal_d_omega
|
||||||
is_legal_d_omega = ((ip>=0.0d0).and.(ip<=2.0d0))
|
is_legal_d_omega = ((ip>=0.0d0).and.(ip<=2.0d0))
|
||||||
return
|
return
|
||||||
end function is_legal_d_omega
|
end function is_legal_d_omega
|
||||||
function is_legal_d_fact_thrs(ip)
|
function is_legal_d_fact_thrs(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_dpk_), intent(in) :: ip
|
real(psb_dpk_), intent(in) :: ip
|
||||||
logical :: is_legal_d_fact_thrs
|
logical :: is_legal_d_fact_thrs
|
||||||
|
|
||||||
@@ -954,7 +973,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_d_fact_thrs
|
end function is_legal_d_fact_thrs
|
||||||
function is_legal_d_aggr_thrs(ip)
|
function is_legal_d_aggr_thrs(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_dpk_), intent(in) :: ip
|
real(psb_dpk_), intent(in) :: ip
|
||||||
logical :: is_legal_d_aggr_thrs
|
logical :: is_legal_d_aggr_thrs
|
||||||
|
|
||||||
@@ -963,14 +982,14 @@ contains
|
|||||||
end function is_legal_d_aggr_thrs
|
end function is_legal_d_aggr_thrs
|
||||||
|
|
||||||
function is_legal_s_omega(ip)
|
function is_legal_s_omega(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_spk_), intent(in) :: ip
|
real(psb_spk_), intent(in) :: ip
|
||||||
logical :: is_legal_s_omega
|
logical :: is_legal_s_omega
|
||||||
is_legal_s_omega = ((ip>=0.0).and.(ip<=2.0))
|
is_legal_s_omega = ((ip>=0.0).and.(ip<=2.0))
|
||||||
return
|
return
|
||||||
end function is_legal_s_omega
|
end function is_legal_s_omega
|
||||||
function is_legal_s_fact_thrs(ip)
|
function is_legal_s_fact_thrs(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_spk_), intent(in) :: ip
|
real(psb_spk_), intent(in) :: ip
|
||||||
logical :: is_legal_s_fact_thrs
|
logical :: is_legal_s_fact_thrs
|
||||||
|
|
||||||
@@ -978,7 +997,7 @@ contains
|
|||||||
return
|
return
|
||||||
end function is_legal_s_fact_thrs
|
end function is_legal_s_fact_thrs
|
||||||
function is_legal_s_aggr_thrs(ip)
|
function is_legal_s_aggr_thrs(ip)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_spk_), intent(in) :: ip
|
real(psb_spk_), intent(in) :: ip
|
||||||
logical :: is_legal_s_aggr_thrs
|
logical :: is_legal_s_aggr_thrs
|
||||||
|
|
||||||
@@ -988,11 +1007,11 @@ contains
|
|||||||
|
|
||||||
|
|
||||||
subroutine amg_icheck_def(ip,name,id,is_legal)
|
subroutine amg_icheck_def(ip,name,id,is_legal)
|
||||||
implicit none
|
implicit none
|
||||||
integer(psb_ipk_), intent(inout) :: ip
|
integer(psb_ipk_), intent(inout) :: ip
|
||||||
integer(psb_ipk_), intent(in) :: id
|
integer(psb_ipk_), intent(in) :: id
|
||||||
character(len=*), intent(in) :: name
|
character(len=*), intent(in) :: name
|
||||||
interface
|
interface
|
||||||
function is_legal(i)
|
function is_legal(i)
|
||||||
import :: psb_ipk_
|
import :: psb_ipk_
|
||||||
integer(psb_ipk_), intent(in) :: i
|
integer(psb_ipk_), intent(in) :: i
|
||||||
@@ -1001,7 +1020,7 @@ contains
|
|||||||
end interface
|
end interface
|
||||||
character(len=20), parameter :: rname='amg_check_def'
|
character(len=20), parameter :: rname='amg_check_def'
|
||||||
|
|
||||||
if (.not.is_legal(ip)) then
|
if (.not.is_legal(ip)) then
|
||||||
write(0,*)trim(rname),': Error: Illegal value for ',&
|
write(0,*)trim(rname),': Error: Illegal value for ',&
|
||||||
& name,' :',ip, '. defaulting to ',id
|
& name,' :',ip, '. defaulting to ',id
|
||||||
ip = id
|
ip = id
|
||||||
@@ -1009,11 +1028,11 @@ contains
|
|||||||
end subroutine amg_icheck_def
|
end subroutine amg_icheck_def
|
||||||
|
|
||||||
subroutine amg_scheck_def(ip,name,id,is_legal)
|
subroutine amg_scheck_def(ip,name,id,is_legal)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_spk_), intent(inout) :: ip
|
real(psb_spk_), intent(inout) :: ip
|
||||||
real(psb_spk_), intent(in) :: id
|
real(psb_spk_), intent(in) :: id
|
||||||
character(len=*), intent(in) :: name
|
character(len=*), intent(in) :: name
|
||||||
interface
|
interface
|
||||||
function is_legal(i)
|
function is_legal(i)
|
||||||
use psb_base_mod, only : psb_spk_
|
use psb_base_mod, only : psb_spk_
|
||||||
real(psb_spk_), intent(in) :: i
|
real(psb_spk_), intent(in) :: i
|
||||||
@@ -1022,7 +1041,7 @@ contains
|
|||||||
end interface
|
end interface
|
||||||
character(len=20), parameter :: rname='amg_check_def'
|
character(len=20), parameter :: rname='amg_check_def'
|
||||||
|
|
||||||
if (.not.is_legal(ip)) then
|
if (.not.is_legal(ip)) then
|
||||||
write(0,*)trim(rname),': Error: Illegal value for ',&
|
write(0,*)trim(rname),': Error: Illegal value for ',&
|
||||||
& name,' :',ip, '. defaulting to ',id
|
& name,' :',ip, '. defaulting to ',id
|
||||||
ip = id
|
ip = id
|
||||||
@@ -1030,11 +1049,11 @@ contains
|
|||||||
end subroutine amg_scheck_def
|
end subroutine amg_scheck_def
|
||||||
|
|
||||||
subroutine amg_dcheck_def(ip,name,id,is_legal)
|
subroutine amg_dcheck_def(ip,name,id,is_legal)
|
||||||
implicit none
|
implicit none
|
||||||
real(psb_dpk_), intent(inout) :: ip
|
real(psb_dpk_), intent(inout) :: ip
|
||||||
real(psb_dpk_), intent(in) :: id
|
real(psb_dpk_), intent(in) :: id
|
||||||
character(len=*), intent(in) :: name
|
character(len=*), intent(in) :: name
|
||||||
interface
|
interface
|
||||||
function is_legal(i)
|
function is_legal(i)
|
||||||
use psb_base_mod, only : psb_dpk_
|
use psb_base_mod, only : psb_dpk_
|
||||||
real(psb_dpk_), intent(in) :: i
|
real(psb_dpk_), intent(in) :: i
|
||||||
@@ -1043,7 +1062,7 @@ contains
|
|||||||
end interface
|
end interface
|
||||||
character(len=20), parameter :: rname='amg_check_def'
|
character(len=20), parameter :: rname='amg_check_def'
|
||||||
|
|
||||||
if (.not.is_legal(ip)) then
|
if (.not.is_legal(ip)) then
|
||||||
write(0,*)trim(rname),': Error: Illegal value for ',&
|
write(0,*)trim(rname),': Error: Illegal value for ',&
|
||||||
& name,' :',ip, '. defaulting to ',id
|
& name,' :',ip, '. defaulting to ',id
|
||||||
ip = id
|
ip = id
|
||||||
@@ -1052,7 +1071,7 @@ contains
|
|||||||
|
|
||||||
|
|
||||||
function pr_to_str(iprec)
|
function pr_to_str(iprec)
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer(psb_ipk_), intent(in) :: iprec
|
integer(psb_ipk_), intent(in) :: iprec
|
||||||
character(len=10) :: pr_to_str
|
character(len=10) :: pr_to_str
|
||||||
@@ -1060,11 +1079,11 @@ contains
|
|||||||
select case(iprec)
|
select case(iprec)
|
||||||
case(amg_noprec_)
|
case(amg_noprec_)
|
||||||
pr_to_str='NOPREC'
|
pr_to_str='NOPREC'
|
||||||
case(amg_jac_)
|
case(amg_jac_)
|
||||||
pr_to_str='JAC'
|
pr_to_str='JAC'
|
||||||
case(amg_bjac_)
|
case(amg_bjac_)
|
||||||
pr_to_str='BJAC'
|
pr_to_str='BJAC'
|
||||||
case(amg_as_)
|
case(amg_as_)
|
||||||
pr_to_str='AS'
|
pr_to_str='AS'
|
||||||
end select
|
end select
|
||||||
|
|
||||||
@@ -1072,7 +1091,7 @@ contains
|
|||||||
|
|
||||||
subroutine amg_ml_bcast(ctxt,dat,root)
|
subroutine amg_ml_bcast(ctxt,dat,root)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_ctxt_type), intent(in) :: ctxt
|
type(psb_ctxt_type), intent(in) :: ctxt
|
||||||
type(amg_ml_parms), intent(inout) :: dat
|
type(amg_ml_parms), intent(inout) :: dat
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
@@ -1094,7 +1113,7 @@ contains
|
|||||||
|
|
||||||
subroutine amg_sml_bcast(ctxt,dat,root)
|
subroutine amg_sml_bcast(ctxt,dat,root)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_ctxt_type), intent(in) :: ctxt
|
type(psb_ctxt_type), intent(in) :: ctxt
|
||||||
type(amg_sml_parms), intent(inout) :: dat
|
type(amg_sml_parms), intent(inout) :: dat
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
@@ -1105,7 +1124,7 @@ contains
|
|||||||
end subroutine amg_sml_bcast
|
end subroutine amg_sml_bcast
|
||||||
|
|
||||||
subroutine amg_dml_bcast(ctxt,dat,root)
|
subroutine amg_dml_bcast(ctxt,dat,root)
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_ctxt_type), intent(in) :: ctxt
|
type(psb_ctxt_type), intent(in) :: ctxt
|
||||||
type(amg_dml_parms), intent(inout) :: dat
|
type(amg_dml_parms), intent(inout) :: dat
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
@@ -1117,7 +1136,7 @@ contains
|
|||||||
|
|
||||||
subroutine ml_parms_clone(pm,pmout,info)
|
subroutine ml_parms_clone(pm,pmout,info)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_ml_parms), intent(inout) :: pm
|
class(amg_ml_parms), intent(inout) :: pm
|
||||||
class(amg_ml_parms), intent(out) :: pmout
|
class(amg_ml_parms), intent(out) :: pmout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -1137,19 +1156,19 @@ contains
|
|||||||
pmout%coarse_solve = pm%coarse_solve
|
pmout%coarse_solve = pm%coarse_solve
|
||||||
|
|
||||||
end subroutine ml_parms_clone
|
end subroutine ml_parms_clone
|
||||||
|
|
||||||
subroutine s_ml_parms_clone(pm,pmout,info)
|
subroutine s_ml_parms_clone(pm,pmout,info)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_sml_parms), intent(inout) :: pm
|
class(amg_sml_parms), intent(inout) :: pm
|
||||||
class(amg_ml_parms), intent(out) :: pmout
|
class(amg_ml_parms), intent(out) :: pmout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
integer(psb_ipk_) :: ierr(5)
|
integer(psb_ipk_) :: ierr(5)
|
||||||
character(len=20) :: name='clone'
|
character(len=20) :: name='clone'
|
||||||
|
|
||||||
info = 0
|
info = 0
|
||||||
select type(pout => pmout)
|
select type(pout => pmout)
|
||||||
class is (amg_sml_parms)
|
class is (amg_sml_parms)
|
||||||
@@ -1164,21 +1183,21 @@ contains
|
|||||||
call psb_get_erraction(err_act)
|
call psb_get_erraction(err_act)
|
||||||
call psb_error_handler(err_act)
|
call psb_error_handler(err_act)
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine s_ml_parms_clone
|
end subroutine s_ml_parms_clone
|
||||||
|
|
||||||
subroutine d_ml_parms_clone(pm,pmout,info)
|
subroutine d_ml_parms_clone(pm,pmout,info)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_dml_parms), intent(inout) :: pm
|
class(amg_dml_parms), intent(inout) :: pm
|
||||||
class(amg_ml_parms), intent(out) :: pmout
|
class(amg_ml_parms), intent(out) :: pmout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
integer(psb_ipk_) :: ierr(5)
|
integer(psb_ipk_) :: ierr(5)
|
||||||
character(len=20) :: name='clone'
|
character(len=20) :: name='clone'
|
||||||
|
|
||||||
info = 0
|
info = 0
|
||||||
select type(pout => pmout)
|
select type(pout => pmout)
|
||||||
class is (amg_dml_parms)
|
class is (amg_dml_parms)
|
||||||
@@ -1194,13 +1213,13 @@ contains
|
|||||||
call psb_error_handler(err_act)
|
call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine d_ml_parms_clone
|
end subroutine d_ml_parms_clone
|
||||||
|
|
||||||
function amg_s_equal_aggregation(parms1, parms2) result(val)
|
function amg_s_equal_aggregation(parms1, parms2) result(val)
|
||||||
type(amg_sml_parms), intent(in) :: parms1, parms2
|
type(amg_sml_parms), intent(in) :: parms1, parms2
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = (parms1%par_aggr_alg == parms2%par_aggr_alg ) .and. &
|
val = (parms1%par_aggr_alg == parms2%par_aggr_alg ) .and. &
|
||||||
& (parms1%aggr_type == parms2%aggr_type ) .and. &
|
& (parms1%aggr_type == parms2%aggr_type ) .and. &
|
||||||
& (parms1%aggr_ord == parms2%aggr_ord ) .and. &
|
& (parms1%aggr_ord == parms2%aggr_ord ) .and. &
|
||||||
@@ -1215,7 +1234,7 @@ contains
|
|||||||
function amg_d_equal_aggregation(parms1, parms2) result(val)
|
function amg_d_equal_aggregation(parms1, parms2) result(val)
|
||||||
type(amg_dml_parms), intent(in) :: parms1, parms2
|
type(amg_dml_parms), intent(in) :: parms1, parms2
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = (parms1%par_aggr_alg == parms2%par_aggr_alg ) .and. &
|
val = (parms1%par_aggr_alg == parms2%par_aggr_alg ) .and. &
|
||||||
& (parms1%aggr_type == parms2%aggr_type ) .and. &
|
& (parms1%aggr_type == parms2%aggr_type ) .and. &
|
||||||
& (parms1%aggr_ord == parms2%aggr_ord ) .and. &
|
& (parms1%aggr_ord == parms2%aggr_ord ) .and. &
|
||||||
@@ -1226,5 +1245,32 @@ contains
|
|||||||
& (parms1%aggr_omega_val == parms2%aggr_omega_val ) .and. &
|
& (parms1%aggr_omega_val == parms2%aggr_omega_val ) .and. &
|
||||||
& (parms1%aggr_thresh == parms2%aggr_thresh )
|
& (parms1%aggr_thresh == parms2%aggr_thresh )
|
||||||
end function amg_d_equal_aggregation
|
end function amg_d_equal_aggregation
|
||||||
|
|
||||||
|
subroutine i_ag_default(ag)
|
||||||
|
class(amg_iaggr_data), intent(inout) :: ag
|
||||||
|
|
||||||
|
ag%min_coarse_size = -ione
|
||||||
|
ag%min_coarse_size_per_process = -ione
|
||||||
|
ag%max_levs = 20_psb_ipk_
|
||||||
|
end subroutine i_ag_default
|
||||||
|
|
||||||
|
subroutine s_ag_default(ag)
|
||||||
|
class(amg_saggr_data), intent(inout) :: ag
|
||||||
|
|
||||||
|
call ag%amg_iaggr_data%default()
|
||||||
|
ag%min_cr_ratio = 1.5_psb_spk_
|
||||||
|
ag%op_complexity = szero
|
||||||
|
ag%avg_cr = szero
|
||||||
|
end subroutine s_ag_default
|
||||||
|
|
||||||
|
subroutine d_ag_default(ag)
|
||||||
|
class(amg_daggr_data), intent(inout) :: ag
|
||||||
|
|
||||||
|
call ag%amg_iaggr_data%default()
|
||||||
|
ag%min_cr_ratio = 1.5_psb_dpk_
|
||||||
|
ag%op_complexity = dzero
|
||||||
|
ag%avg_cr = dzero
|
||||||
|
end subroutine d_ag_default
|
||||||
|
|
||||||
|
|
||||||
end module amg_base_prec_type
|
end module amg_base_prec_type
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -58,10 +61,9 @@ module amg_c_ainv_solver
|
|||||||
procedure, pass(sv) :: cseti => amg_c_ainv_solver_cseti
|
procedure, pass(sv) :: cseti => amg_c_ainv_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => amg_c_ainv_solver_csetc
|
procedure, pass(sv) :: csetc => amg_c_ainv_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => amg_c_ainv_solver_csetr
|
procedure, pass(sv) :: csetr => amg_c_ainv_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_c_ainv_solver_seti
|
!!$ procedure, pass(sv) :: seti => amg_c_ainv_solver_seti
|
||||||
procedure, pass(sv) :: setc => amg_c_ainv_solver_setc
|
!!$ procedure, pass(sv) :: setc => amg_c_ainv_solver_setc
|
||||||
procedure, pass(sv) :: setr => amg_c_ainv_solver_setr
|
!!$ procedure, pass(sv) :: setr => amg_c_ainv_solver_setr
|
||||||
generic, public :: set => seti, setr, setc
|
|
||||||
procedure, pass(sv) :: descr => amg_c_ainv_solver_descr
|
procedure, pass(sv) :: descr => amg_c_ainv_solver_descr
|
||||||
procedure, pass(sv) :: default => c_ainv_solver_default
|
procedure, pass(sv) :: default => c_ainv_solver_default
|
||||||
procedure, nopass :: stringval => c_ainv_stringval
|
procedure, nopass :: stringval => c_ainv_stringval
|
||||||
@@ -159,41 +161,41 @@ module amg_c_ainv_solver
|
|||||||
end subroutine amg_c_ainv_solver_csetr
|
end subroutine amg_c_ainv_solver_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_c_ainv_solver_setc(sv,what,val,info)
|
!!$ subroutine amg_c_ainv_solver_setc(sv,what,val,info)
|
||||||
import :: amg_c_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_c_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_c_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_c_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
!!$ character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_c_ainv_solver_setc
|
!!$ end subroutine amg_c_ainv_solver_setc
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_c_ainv_solver_seti(sv,what,val,info)
|
!!$ subroutine amg_c_ainv_solver_seti(sv,what,val,info)
|
||||||
import :: amg_c_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_c_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_c_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_c_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
!!$ integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_c_ainv_solver_seti
|
!!$ end subroutine amg_c_ainv_solver_seti
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_c_ainv_solver_setr(sv,what,val,info)
|
!!$ subroutine amg_c_ainv_solver_setr(sv,what,val,info)
|
||||||
import :: amg_c_ainv_solver_type, psb_ipk_, psb_spk_
|
!!$ import :: amg_c_ainv_solver_type, psb_ipk_, psb_spk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_c_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_c_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
!!$ real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_c_ainv_solver_setr
|
!!$ end subroutine amg_c_ainv_solver_setr
|
||||||
end interface
|
!!$ end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_ainv_solver_descr(sv,info,iout,coarse)
|
subroutine amg_c_ainv_solver_descr(sv,info,iout,coarse)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -126,7 +126,7 @@ module amg_c_base_aggregator_mod
|
|||||||
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_sml_parms), intent(inout) :: parms
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
@@ -144,7 +144,7 @@ module amg_c_base_aggregator_mod
|
|||||||
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_sml_parms), intent(inout) :: parms
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
!
|
!
|
||||||
! Module: amg_inner_mod
|
! Module: amg_inner_mod
|
||||||
!
|
!
|
||||||
! This module defines the interfaces to inner MLD2P4 routines.
|
! This module defines the interfaces to inner AMG4PSBLAS routines.
|
||||||
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
||||||
!
|
!
|
||||||
module amg_c_inner_mod
|
module amg_c_inner_mod
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -51,8 +54,6 @@ module amg_c_invk_solver
|
|||||||
procedure, pass(sv) :: clone => amg_c_invk_solver_clone
|
procedure, pass(sv) :: clone => amg_c_invk_solver_clone
|
||||||
procedure, pass(sv) :: build => amg_c_invk_solver_bld
|
procedure, pass(sv) :: build => amg_c_invk_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_c_invk_solver_cseti
|
procedure, pass(sv) :: cseti => amg_c_invk_solver_cseti
|
||||||
procedure, pass(sv) :: seti => amg_c_invk_solver_seti
|
|
||||||
generic, public :: set => seti
|
|
||||||
procedure, pass(sv) :: descr => amg_c_invk_solver_descr
|
procedure, pass(sv) :: descr => amg_c_invk_solver_descr
|
||||||
procedure, pass(sv) :: default => c_invk_solver_default
|
procedure, pass(sv) :: default => c_invk_solver_default
|
||||||
end type amg_c_invk_solver_type
|
end type amg_c_invk_solver_type
|
||||||
@@ -136,18 +137,6 @@ module amg_c_invk_solver
|
|||||||
end subroutine amg_c_invk_solver_descr
|
end subroutine amg_c_invk_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_c_invk_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_c_invk_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_c_invk_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_c_invk_solver_seti
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine c_invk_solver_default(sv)
|
subroutine c_invk_solver_default(sv)
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -52,9 +55,6 @@ module amg_c_invt_solver
|
|||||||
procedure, pass(sv) :: build => amg_c_invt_solver_bld
|
procedure, pass(sv) :: build => amg_c_invt_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_c_invt_solver_cseti
|
procedure, pass(sv) :: cseti => amg_c_invt_solver_cseti
|
||||||
procedure, pass(sv) :: csetr => amg_c_invt_solver_csetr
|
procedure, pass(sv) :: csetr => amg_c_invt_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_c_invt_solver_seti
|
|
||||||
procedure, pass(sv) :: setr => amg_c_invt_solver_setr
|
|
||||||
generic, public :: set => seti, setr
|
|
||||||
procedure, pass(sv) :: descr => amg_c_invt_solver_descr
|
procedure, pass(sv) :: descr => amg_c_invt_solver_descr
|
||||||
procedure, pass(sv) :: default => c_invt_solver_default
|
procedure, pass(sv) :: default => c_invt_solver_default
|
||||||
end type amg_c_invt_solver_type
|
end type amg_c_invt_solver_type
|
||||||
@@ -148,30 +148,6 @@ module amg_c_invt_solver
|
|||||||
end subroutine amg_c_invt_solver_descr
|
end subroutine amg_c_invt_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_c_invt_solver_setr(sv,what,val,info)
|
|
||||||
import :: amg_c_invt_solver_type, psb_spk_, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_c_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
real(psb_spk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_c_invt_solver_setr
|
|
||||||
end interface
|
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_c_invt_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_c_invt_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_c_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine c_invt_solver_default(sv)
|
subroutine c_invt_solver_default(sv)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
@@ -52,14 +55,14 @@
|
|||||||
! 2. Redistributions in binary form must reproduce the above copyright
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
! notice, this list of conditions, and the following disclaimer in the
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
! documentation and/or other materials provided with the distribution.
|
! documentation and/or other materials provided with the distribution.
|
||||||
! 3. The name of the MLD2P4 group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
@@ -70,16 +73,16 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_c_rkr_solver_mod.f90
|
! File: amg_c_krm_solver_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_c_rkr_solver_mod
|
! Module: amg_c_krm_solver_mod
|
||||||
!
|
!
|
||||||
module amg_c_rkr_solver
|
module amg_c_krm_solver
|
||||||
|
|
||||||
use amg_c_base_solver_mod
|
use amg_c_base_solver_mod
|
||||||
use amg_c_prec_type
|
use amg_c_prec_type
|
||||||
|
|
||||||
type, extends(amg_c_base_solver_type) :: amg_c_rkr_solver_type
|
type, extends(amg_c_base_solver_type) :: amg_c_krm_solver_type
|
||||||
!
|
!
|
||||||
logical :: global
|
logical :: global
|
||||||
character(len=16) :: method, kprec, sub_solve
|
character(len=16) :: method, kprec, sub_solve
|
||||||
@@ -94,46 +97,46 @@ module amg_c_rkr_solver
|
|||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: dump => c_rkr_solver_dmp
|
procedure, pass(sv) :: dump => c_krm_solver_dmp
|
||||||
procedure, pass(sv) :: check => c_rkr_solver_check
|
procedure, pass(sv) :: check => c_krm_solver_check
|
||||||
procedure, pass(sv) :: clone => c_rkr_solver_clone
|
procedure, pass(sv) :: clone => c_krm_solver_clone
|
||||||
procedure, pass(sv) :: clone_settings => c_rkr_solver_clone_settings
|
procedure, pass(sv) :: clone_settings => c_krm_solver_clone_settings
|
||||||
procedure, pass(sv) :: cnv => c_rkr_solver_cnv
|
procedure, pass(sv) :: cnv => c_krm_solver_cnv
|
||||||
procedure, pass(sv) :: apply_v => amg_c_rkr_solver_apply_vect
|
procedure, pass(sv) :: apply_v => amg_c_krm_solver_apply_vect
|
||||||
procedure, pass(sv) :: apply_a => amg_c_rkr_solver_apply
|
procedure, pass(sv) :: apply_a => amg_c_krm_solver_apply
|
||||||
procedure, pass(sv) :: clear_data => c_rkr_solver_clear_data
|
procedure, pass(sv) :: clear_data => c_krm_solver_clear_data
|
||||||
procedure, pass(sv) :: free => c_rkr_solver_free
|
procedure, pass(sv) :: free => c_krm_solver_free
|
||||||
procedure, pass(sv) :: cseti => c_rkr_solver_cseti
|
procedure, pass(sv) :: cseti => c_krm_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => c_rkr_solver_csetc
|
procedure, pass(sv) :: csetc => c_krm_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => c_rkr_solver_csetr
|
procedure, pass(sv) :: csetr => c_krm_solver_csetr
|
||||||
procedure, pass(sv) :: sizeof => c_rkr_solver_sizeof
|
procedure, pass(sv) :: sizeof => c_krm_solver_sizeof
|
||||||
procedure, pass(sv) :: get_nzeros => c_rkr_solver_get_nzeros
|
procedure, pass(sv) :: get_nzeros => c_krm_solver_get_nzeros
|
||||||
!procedure, nopass :: get_id => c_rkr_solver_get_id
|
!procedure, nopass :: get_id => c_krm_solver_get_id
|
||||||
procedure, pass(sv) :: is_global => c_rkr_solver_is_global
|
procedure, pass(sv) :: is_global => c_krm_solver_is_global
|
||||||
procedure, nopass :: is_iterative => c_rkr_solver_is_iterative
|
procedure, nopass :: is_iterative => c_krm_solver_is_iterative
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
! These methods are specific for the new solver type
|
! These methods are specific for the new solver type
|
||||||
! and therefore need to be overridden
|
! and therefore need to be overridden
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: descr => c_rkr_solver_descr
|
procedure, pass(sv) :: descr => c_krm_solver_descr
|
||||||
procedure, pass(sv) :: default => c_rkr_solver_default
|
procedure, pass(sv) :: default => c_krm_solver_default
|
||||||
procedure, pass(sv) :: build => amg_c_rkr_solver_bld
|
procedure, pass(sv) :: build => amg_c_krm_solver_bld
|
||||||
procedure, nopass :: get_fmt => c_rkr_solver_get_fmt
|
procedure, nopass :: get_fmt => c_krm_solver_get_fmt
|
||||||
end type amg_c_rkr_solver_type
|
end type amg_c_krm_solver_type
|
||||||
|
|
||||||
|
|
||||||
private :: c_rkr_solver_get_fmt, c_rkr_solver_descr, c_rkr_solver_default
|
private :: c_krm_solver_get_fmt, c_krm_solver_descr, c_krm_solver_default
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_rkr_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_c_krm_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,wv,info,init,initu)
|
& trans,work,wv,info,init,initu)
|
||||||
import :: psb_desc_type, amg_c_rkr_solver_type, psb_c_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_c_krm_solver_type, psb_c_vect_type, psb_spk_, &
|
||||||
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type, psb_ipk_
|
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
type(psb_c_vect_type),intent(inout) :: x
|
type(psb_c_vect_type),intent(inout) :: x
|
||||||
type(psb_c_vect_type),intent(inout) :: y
|
type(psb_c_vect_type),intent(inout) :: y
|
||||||
complex(psb_spk_),intent(in) :: alpha,beta
|
complex(psb_spk_),intent(in) :: alpha,beta
|
||||||
@@ -143,17 +146,17 @@ module amg_c_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
type(psb_c_vect_type),intent(inout), optional :: initu
|
type(psb_c_vect_type),intent(inout), optional :: initu
|
||||||
end subroutine amg_c_rkr_solver_apply_vect
|
end subroutine amg_c_krm_solver_apply_vect
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_rkr_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_c_krm_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,info,init,initu)
|
& trans,work,info,init,initu)
|
||||||
import :: psb_desc_type, amg_c_rkr_solver_type, psb_c_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_c_krm_solver_type, psb_c_vect_type, psb_spk_, &
|
||||||
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type, psb_ipk_
|
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
complex(psb_spk_),intent(inout) :: x(:)
|
complex(psb_spk_),intent(inout) :: x(:)
|
||||||
complex(psb_spk_),intent(inout) :: y(:)
|
complex(psb_spk_),intent(inout) :: y(:)
|
||||||
complex(psb_spk_),intent(in) :: alpha,beta
|
complex(psb_spk_),intent(in) :: alpha,beta
|
||||||
@@ -162,24 +165,24 @@ module amg_c_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
complex(psb_spk_),intent(inout), optional :: initu(:)
|
complex(psb_spk_),intent(inout), optional :: initu(:)
|
||||||
end subroutine amg_c_rkr_solver_apply
|
end subroutine amg_c_krm_solver_apply
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_rkr_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
subroutine amg_c_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||||
import :: psb_desc_type, amg_c_rkr_solver_type, psb_c_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_c_krm_solver_type, psb_c_vect_type, psb_spk_, &
|
||||||
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type,&
|
& psb_cspmat_type, psb_c_base_sparse_mat, psb_c_base_vect_type,&
|
||||||
& psb_ipk_, psb_i_base_vect_type
|
& psb_ipk_, psb_i_base_vect_type
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_cspmat_type), intent(in), target :: a
|
type(psb_cspmat_type), intent(in), target :: a
|
||||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
type(psb_cspmat_type), intent(in), target, optional :: b
|
type(psb_cspmat_type), intent(in), target, optional :: b
|
||||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_c_rkr_solver_bld
|
end subroutine amg_c_krm_solver_bld
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
|
|
||||||
@@ -187,12 +190,12 @@ contains
|
|||||||
|
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
subroutine c_rkr_solver_default(sv)
|
subroutine c_krm_solver_default(sv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
|
|
||||||
sv%method = 'bicgstab'
|
sv%method = 'bicgstab'
|
||||||
sv%kprec = 'bjac'
|
sv%kprec = 'bjac'
|
||||||
@@ -207,42 +210,42 @@ contains
|
|||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_default
|
end subroutine c_krm_solver_default
|
||||||
|
|
||||||
function c_rkr_solver_get_nzeros(sv) result(val)
|
function c_krm_solver_get_nzeros(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(in) :: sv
|
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%get_nzeros()
|
val = sv%prec%get_nzeros()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function c_rkr_solver_get_nzeros
|
end function c_krm_solver_get_nzeros
|
||||||
|
|
||||||
function c_rkr_solver_sizeof(sv) result(val)
|
function c_krm_solver_sizeof(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(in) :: sv
|
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function c_rkr_solver_sizeof
|
end function c_krm_solver_sizeof
|
||||||
|
|
||||||
|
|
||||||
subroutine c_rkr_solver_check(sv,info)
|
subroutine c_krm_solver_check(sv,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='c_rkr_solver_check'
|
character(len=20) :: name='c_krm_solver_check'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -256,36 +259,36 @@ contains
|
|||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine c_rkr_solver_check
|
end subroutine c_krm_solver_check
|
||||||
|
|
||||||
subroutine c_rkr_solver_cseti(sv,what,val,info,idx)
|
subroutine c_krm_solver_cseti(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='c_rkr_solver_cseti'
|
character(len=20) :: name='c_krm_solver_cseti'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_IRST')
|
case('KRM_IRST')
|
||||||
sv%irst = val
|
sv%irst = val
|
||||||
case('RKR_ISTOPC')
|
case('KRM_ISTOPC')
|
||||||
sv%istopc = val
|
sv%istopc = val
|
||||||
case('RKR_ITMAX')
|
case('KRM_ITMAX')
|
||||||
sv%itmax = val
|
sv%itmax = val
|
||||||
case('RKR_ITRACE')
|
case('KRM_ITRACE')
|
||||||
sv%itrace = val
|
sv%itrace = val
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%i_sub_solve = val
|
sv%i_sub_solve = val
|
||||||
case('RKR_FILLIN')
|
case('KRM_FILLIN')
|
||||||
sv%fillin = val
|
sv%fillin = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_c_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_c_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -296,33 +299,33 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_cseti
|
end subroutine c_krm_solver_cseti
|
||||||
|
|
||||||
subroutine c_rkr_solver_csetc(sv,what,val,info,idx)
|
subroutine c_krm_solver_csetc(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act, ival
|
integer(psb_ipk_) :: err_act, ival
|
||||||
character(len=20) :: name='c_rkr_solver_csetc'
|
character(len=20) :: name='c_krm_solver_csetc'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_METHOD')
|
case('KRM_METHOD')
|
||||||
sv%method = psb_toupper(trim(val))
|
sv%method = psb_toupper(trim(val))
|
||||||
case('RKR_KPREC')
|
case('KRM_KPREC')
|
||||||
sv%kprec = psb_toupper(trim(val))
|
sv%kprec = psb_toupper(trim(val))
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%sub_solve = psb_toupper(trim(val))
|
sv%sub_solve = psb_toupper(trim(val))
|
||||||
case('RKR_GLOBAL')
|
case('KRM_GLOBAL')
|
||||||
select case(psb_toupper(trim(val)))
|
select case(psb_toupper(trim(val)))
|
||||||
case('LOCAL','FALSE')
|
case('LOCAL','FALSE')
|
||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
@@ -345,26 +348,26 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_csetc
|
end subroutine c_krm_solver_csetc
|
||||||
|
|
||||||
subroutine c_rkr_solver_csetr(sv,what,val,info,idx)
|
subroutine c_krm_solver_csetr(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='c_rkr_solver_csetr'
|
character(len=20) :: name='c_krm_solver_csetr'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select case(psb_toupper(what))
|
select case(psb_toupper(what))
|
||||||
case('RKR_EPS')
|
case('KRM_EPS')
|
||||||
sv%eps = val
|
sv%eps = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_c_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_c_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -375,18 +378,18 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_csetr
|
end subroutine c_krm_solver_csetr
|
||||||
|
|
||||||
subroutine c_rkr_solver_clear_data(sv,info)
|
subroutine c_krm_solver_clear_data(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='c_rkr_solver_free'
|
character(len=20) :: name='c_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -403,19 +406,19 @@ contains
|
|||||||
nullify(sv%a)
|
nullify(sv%a)
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_clear_data
|
end subroutine c_krm_solver_clear_data
|
||||||
|
|
||||||
|
|
||||||
subroutine c_rkr_solver_free(sv,info)
|
subroutine c_krm_solver_free(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='c_rkr_solver_free'
|
character(len=20) :: name='c_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -424,28 +427,28 @@ contains
|
|||||||
|
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_free
|
end subroutine c_krm_solver_free
|
||||||
|
|
||||||
function c_rkr_solver_get_fmt() result(val)
|
function c_krm_solver_get_fmt() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
character(len=32) :: val
|
character(len=32) :: val
|
||||||
|
|
||||||
val = "RKR solver"
|
val = "KRM solver"
|
||||||
end function c_rkr_solver_get_fmt
|
end function c_krm_solver_get_fmt
|
||||||
|
|
||||||
subroutine c_rkr_solver_descr(sv,info,iout,coarse)
|
subroutine c_krm_solver_descr(sv,info,iout,coarse)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(in) :: sv
|
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
logical, intent(in), optional :: coarse
|
logical, intent(in), optional :: coarse
|
||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20), parameter :: name='amg_c_rkr_solver_descr'
|
character(len=20), parameter :: name='amg_c_krm_solver_descr'
|
||||||
integer(psb_ipk_) :: iout_
|
integer(psb_ipk_) :: iout_
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
@@ -457,9 +460,9 @@ contains
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if (sv%global) then
|
if (sv%global) then
|
||||||
write(iout_,*) ' Recursive Krylov solver (global)'
|
write(iout_,*) ' Krylov solver (global)'
|
||||||
else
|
else
|
||||||
write(iout_,*) ' Recursive Krylov solver (local) '
|
write(iout_,*) ' Krylov solver (local) '
|
||||||
end if
|
end if
|
||||||
write(iout_,*) ' method: ',sv%method
|
write(iout_,*) ' method: ',sv%method
|
||||||
write(iout_,*) ' kprec: ',sv%kprec
|
write(iout_,*) ' kprec: ',sv%kprec
|
||||||
@@ -478,11 +481,11 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine c_rkr_solver_descr
|
end subroutine c_krm_solver_descr
|
||||||
|
|
||||||
subroutine c_rkr_solver_cnv(sv,info,amold,vmold,imold)
|
subroutine c_krm_solver_cnv(sv,info,amold,vmold,imold)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
@@ -490,13 +493,13 @@ contains
|
|||||||
|
|
||||||
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||||
|
|
||||||
end subroutine c_rkr_solver_cnv
|
end subroutine c_krm_solver_cnv
|
||||||
|
|
||||||
subroutine c_rkr_solver_clone(sv,svout,info)
|
subroutine c_krm_solver_clone(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_c_base_solver_type), allocatable, intent(inout) :: svout
|
class(amg_c_base_solver_type), allocatable, intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
@@ -505,7 +508,7 @@ contains
|
|||||||
call svout%free(info)
|
call svout%free(info)
|
||||||
allocate(svout,stat=info,mold=sv)
|
allocate(svout,stat=info,mold=sv)
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_c_rkr_solver_type)
|
class is(amg_c_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -524,21 +527,21 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine c_rkr_solver_clone
|
end subroutine c_krm_solver_clone
|
||||||
|
|
||||||
|
|
||||||
subroutine c_rkr_solver_clone_settings(sv,svout,info)
|
subroutine c_krm_solver_clone_settings(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_rkr_solver_type), intent(inout) :: sv
|
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_c_base_solver_type), intent(inout) :: svout
|
class(amg_c_base_solver_type), intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_c_rkr_solver_type)
|
class is(amg_c_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -554,11 +557,11 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine c_rkr_solver_clone_settings
|
end subroutine c_krm_solver_clone_settings
|
||||||
|
|
||||||
subroutine c_rkr_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
subroutine c_krm_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_rkr_solver_type), intent(in) :: sv
|
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -568,23 +571,23 @@ contains
|
|||||||
|
|
||||||
call sv%prec%dump(info,prefix=prefix,head=head)
|
call sv%prec%dump(info,prefix=prefix,head=head)
|
||||||
|
|
||||||
end subroutine c_rkr_solver_dmp
|
end subroutine c_krm_solver_dmp
|
||||||
!
|
!
|
||||||
! Notify whether RKR is used as a global solver
|
! Notify whether KRM is used as a global solver
|
||||||
!
|
!
|
||||||
function c_rkr_solver_is_global(sv) result(val)
|
function c_krm_solver_is_global(sv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_rkr_solver_type), intent(in) :: sv
|
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = (sv%global)
|
val = (sv%global)
|
||||||
end function c_rkr_solver_is_global
|
end function c_krm_solver_is_global
|
||||||
!
|
!
|
||||||
function c_rkr_solver_is_iterative() result(val)
|
function c_krm_solver_is_iterative() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = .true.
|
val = .true.
|
||||||
end function c_rkr_solver_is_iterative
|
end function c_krm_solver_is_iterative
|
||||||
|
|
||||||
end module amg_c_rkr_solver
|
end module amg_c_krm_solver
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
+156
-154
@@ -1,15 +1,15 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
! are met:
|
! are met:
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
@@ -33,22 +33,22 @@
|
|||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_c_onelev_mod.f90
|
! File: amg_c_onelev_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_c_onelev_mod
|
! Module: amg_c_onelev_mod
|
||||||
!
|
!
|
||||||
! This module defines:
|
! This module defines:
|
||||||
! - the amg_c_onelev_type data structure containing one level
|
! - the amg_c_onelev_type data structure containing one level
|
||||||
! of a multilevel preconditioner and related
|
! of a multilevel preconditioner and related
|
||||||
! data structures;
|
! data structures;
|
||||||
!
|
!
|
||||||
! It contains routines for
|
! It contains routines for
|
||||||
! - Building and applying;
|
! - Building and applying;
|
||||||
! - checking if the preconditioner is correctly defined;
|
! - checking if the preconditioner is correctly defined;
|
||||||
! - printing a description of the preconditioner;
|
! - printing a description of the preconditioner;
|
||||||
! - deallocating the preconditioner data structure.
|
! - deallocating the preconditioner data structure.
|
||||||
!
|
!
|
||||||
|
|
||||||
module amg_c_onelev_mod
|
module amg_c_onelev_mod
|
||||||
@@ -56,6 +56,7 @@ module amg_c_onelev_mod
|
|||||||
use amg_base_prec_type
|
use amg_base_prec_type
|
||||||
use amg_c_base_smoother_mod
|
use amg_c_base_smoother_mod
|
||||||
use amg_c_dec_aggregator_mod
|
use amg_c_dec_aggregator_mod
|
||||||
|
|
||||||
use psb_base_mod, only : psb_cspmat_type, psb_c_vect_type, &
|
use psb_base_mod, only : psb_cspmat_type, psb_c_vect_type, &
|
||||||
& psb_c_base_vect_type, psb_lcspmat_type, psb_clinmap_type, psb_spk_, &
|
& psb_c_base_vect_type, psb_lcspmat_type, psb_clinmap_type, psb_spk_, &
|
||||||
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
||||||
@@ -73,16 +74,16 @@ module amg_c_onelev_mod
|
|||||||
! class(amg_c_base_smoother_type), pointer :: sm2 => null()
|
! class(amg_c_base_smoother_type), pointer :: sm2 => null()
|
||||||
! class(amg_cmlprec_wrk_type), allocatable :: wrk
|
! class(amg_cmlprec_wrk_type), allocatable :: wrk
|
||||||
! class(amg_c_base_aggregator_type), allocatable :: aggr
|
! class(amg_c_base_aggregator_type), allocatable :: aggr
|
||||||
! type(amg_sml_parms) :: parms
|
! type(amg_sml_parms) :: parms
|
||||||
! type(psb_cspmat_type) :: ac
|
! type(psb_cspmat_type) :: ac
|
||||||
! type(psb_cesc_type) :: desc_ac
|
! type(psb_cesc_type) :: desc_ac
|
||||||
! type(psb_cspmat_type), pointer :: base_a => null()
|
! type(psb_cspmat_type), pointer :: base_a => null()
|
||||||
! type(psb_desc_type), pointer :: base_desc => null()
|
! type(psb_desc_type), pointer :: base_desc => null()
|
||||||
! type(psb_clinmap_type) :: map
|
! type(psb_clinmap_type) :: map
|
||||||
! end type amg_conelev_type
|
! end type amg_conelev_type
|
||||||
!
|
!
|
||||||
! Note that s denotes the kind of the real data type to be chosen
|
! Note that s denotes the kind of the real data type to be chosen
|
||||||
! according to single/double precision version of MLD2P4.
|
! according to single/double precision version of AMG4PSBLAS.
|
||||||
!
|
!
|
||||||
! sm,sm2a - class(amg_c_base_smoother_type), allocatable
|
! sm,sm2a - class(amg_c_base_smoother_type), allocatable
|
||||||
! The current level pre- and post-smooother.
|
! The current level pre- and post-smooother.
|
||||||
@@ -93,7 +94,7 @@ module amg_c_onelev_mod
|
|||||||
! Workspace for application of preconditioner; may be
|
! Workspace for application of preconditioner; may be
|
||||||
! pre-allocated to save time in the application within a
|
! pre-allocated to save time in the application within a
|
||||||
! Krylov solver.
|
! Krylov solver.
|
||||||
! aggr - class(amg_c_base_aggregator_type), allocatable
|
! aggr - class(amg_c_base_aggregator_type), allocatable
|
||||||
! The aggregator object: holds the algorithmic choices and
|
! The aggregator object: holds the algorithmic choices and
|
||||||
! (possibly) additional data for building the aggregation.
|
! (possibly) additional data for building the aggregation.
|
||||||
! parms - type(amg_sml_parms)
|
! parms - type(amg_sml_parms)
|
||||||
@@ -104,7 +105,7 @@ module amg_c_onelev_mod
|
|||||||
! The communication descriptor associated to the matrix
|
! The communication descriptor associated to the matrix
|
||||||
! stored in ac.
|
! stored in ac.
|
||||||
! base_a - type(psb_cspmat_type), pointer.
|
! base_a - type(psb_cspmat_type), pointer.
|
||||||
! Pointer (really a pointer!) to the local part of the current
|
! Pointer (really a pointer!) to the local part of the current
|
||||||
! matrix (so we have a unified treatment of residuals).
|
! matrix (so we have a unified treatment of residuals).
|
||||||
! We need this to avoid passing explicitly the current matrix
|
! We need this to avoid passing explicitly the current matrix
|
||||||
! to the routine which applies the preconditioner.
|
! to the routine which applies the preconditioner.
|
||||||
@@ -115,13 +116,13 @@ module amg_c_onelev_mod
|
|||||||
! vector spaces associated to the index spaces of the previous
|
! vector spaces associated to the index spaces of the previous
|
||||||
! and current levels.
|
! and current levels.
|
||||||
!
|
!
|
||||||
! Methods:
|
! Methods:
|
||||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||||
! is appropriate for the current object, then call the corresponding method for
|
! is appropriate for the current object, then call the corresponding method for
|
||||||
! the contained object.
|
! the contained object.
|
||||||
! As an example: the descr() method prints out a description of the
|
! As an example: the descr() method prints out a description of the
|
||||||
! level. It starts by invoking the descr() method of the parms object,
|
! level. It starts by invoking the descr() method of the parms object,
|
||||||
! then calls the descr() method of the smoother object.
|
! then calls the descr() method of the smoother object.
|
||||||
!
|
!
|
||||||
! descr - Prints a description of the object.
|
! descr - Prints a description of the object.
|
||||||
! default - Set default values
|
! default - Set default values
|
||||||
@@ -130,14 +131,14 @@ module amg_c_onelev_mod
|
|||||||
! it is passed to the smoother object for further processing.
|
! it is passed to the smoother object for further processing.
|
||||||
! check - Sanity checks.
|
! check - Sanity checks.
|
||||||
! sizeof - Total memory occupation in bytes
|
! sizeof - Total memory occupation in bytes
|
||||||
! get_nzeros - Number of nonzeros
|
! get_nzeros - Number of nonzeros
|
||||||
! get_wrksz - How many workspace vector does apply_vect need
|
! get_wrksz - How many workspace vector does apply_vect need
|
||||||
! allocate_wrk - Allocate auxiliary workspace
|
! allocate_wrk - Allocate auxiliary workspace
|
||||||
! free_wrk - Free auxiliary workspace
|
! free_wrk - Free auxiliary workspace
|
||||||
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
||||||
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
||||||
|
!
|
||||||
!
|
!
|
||||||
!
|
|
||||||
type amg_cmlprec_wrk_type
|
type amg_cmlprec_wrk_type
|
||||||
complex(psb_spk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
complex(psb_spk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
||||||
type(psb_c_vect_type) :: vtx, vty, vx2l, vy2l
|
type(psb_c_vect_type) :: vtx, vty, vx2l, vy2l
|
||||||
@@ -148,10 +149,10 @@ module amg_c_onelev_mod
|
|||||||
procedure, pass(wk) :: clone => c_wrk_clone
|
procedure, pass(wk) :: clone => c_wrk_clone
|
||||||
procedure, pass(wk) :: move_alloc => c_wrk_move_alloc
|
procedure, pass(wk) :: move_alloc => c_wrk_move_alloc
|
||||||
procedure, pass(wk) :: cnv => c_wrk_cnv
|
procedure, pass(wk) :: cnv => c_wrk_cnv
|
||||||
procedure, pass(wk) :: sizeof => c_wrk_sizeof
|
procedure, pass(wk) :: sizeof => c_wrk_sizeof
|
||||||
end type amg_cmlprec_wrk_type
|
end type amg_cmlprec_wrk_type
|
||||||
private :: c_wrk_alloc, c_wrk_free, &
|
private :: c_wrk_alloc, c_wrk_free, &
|
||||||
& c_wrk_clone, c_wrk_move_alloc, c_wrk_cnv, c_wrk_sizeof
|
& c_wrk_clone, c_wrk_move_alloc, c_wrk_cnv, c_wrk_sizeof
|
||||||
|
|
||||||
type amg_c_remap_data_type
|
type amg_c_remap_data_type
|
||||||
type(psb_cspmat_type) :: ac_pre_remap
|
type(psb_cspmat_type) :: ac_pre_remap
|
||||||
@@ -161,19 +162,19 @@ module amg_c_onelev_mod
|
|||||||
contains
|
contains
|
||||||
procedure, pass(rmp) :: clone => c_remap_data_clone
|
procedure, pass(rmp) :: clone => c_remap_data_clone
|
||||||
end type amg_c_remap_data_type
|
end type amg_c_remap_data_type
|
||||||
|
|
||||||
type amg_c_onelev_type
|
type amg_c_onelev_type
|
||||||
class(amg_c_base_smoother_type), allocatable :: sm, sm2a
|
class(amg_c_base_smoother_type), allocatable :: sm, sm2a
|
||||||
class(amg_c_base_smoother_type), pointer :: sm2 => null()
|
class(amg_c_base_smoother_type), pointer :: sm2 => null()
|
||||||
class(amg_cmlprec_wrk_type), allocatable :: wrk
|
class(amg_cmlprec_wrk_type), allocatable :: wrk
|
||||||
class(amg_c_base_aggregator_type), allocatable :: aggr
|
class(amg_c_base_aggregator_type), allocatable :: aggr
|
||||||
type(amg_sml_parms) :: parms
|
type(amg_sml_parms) :: parms
|
||||||
type(psb_cspmat_type) :: ac
|
type(psb_cspmat_type) :: ac
|
||||||
integer(psb_ipk_) :: ac_nz_loc
|
integer(psb_ipk_) :: ac_nz_loc
|
||||||
integer(psb_lpk_) :: ac_nz_tot
|
integer(psb_lpk_) :: ac_nz_tot
|
||||||
type(psb_desc_type) :: desc_ac
|
type(psb_desc_type) :: desc_ac
|
||||||
type(psb_cspmat_type), pointer :: base_a => null()
|
type(psb_cspmat_type), pointer :: base_a => null()
|
||||||
type(psb_desc_type), pointer :: base_desc => null()
|
type(psb_desc_type), pointer :: base_desc => null()
|
||||||
type(psb_lcspmat_type) :: tprol
|
type(psb_lcspmat_type) :: tprol
|
||||||
type(psb_clinmap_type) :: linmap
|
type(psb_clinmap_type) :: linmap
|
||||||
type(amg_c_remap_data_type) :: remap_data
|
type(amg_c_remap_data_type) :: remap_data
|
||||||
@@ -197,7 +198,7 @@ module amg_c_onelev_mod
|
|||||||
procedure, pass(lv) :: setsm => amg_c_base_onelev_setsm
|
procedure, pass(lv) :: setsm => amg_c_base_onelev_setsm
|
||||||
procedure, pass(lv) :: setsv => amg_c_base_onelev_setsv
|
procedure, pass(lv) :: setsv => amg_c_base_onelev_setsv
|
||||||
procedure, pass(lv) :: setag => amg_c_base_onelev_setag
|
procedure, pass(lv) :: setag => amg_c_base_onelev_setag
|
||||||
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
||||||
procedure, pass(lv) :: sizeof => c_base_onelev_sizeof
|
procedure, pass(lv) :: sizeof => c_base_onelev_sizeof
|
||||||
procedure, pass(lv) :: get_nzeros => c_base_onelev_get_nzeros
|
procedure, pass(lv) :: get_nzeros => c_base_onelev_get_nzeros
|
||||||
procedure, pass(lv) :: get_wrksz => c_base_onelev_get_wrksize
|
procedure, pass(lv) :: get_wrksz => c_base_onelev_get_wrksize
|
||||||
@@ -205,8 +206,8 @@ module amg_c_onelev_mod
|
|||||||
procedure, pass(lv) :: free_wrk => c_base_onelev_free_wrk
|
procedure, pass(lv) :: free_wrk => c_base_onelev_free_wrk
|
||||||
procedure, nopass :: stringval => amg_stringval
|
procedure, nopass :: stringval => amg_stringval
|
||||||
procedure, pass(lv) :: move_alloc => c_base_onelev_move_alloc
|
procedure, pass(lv) :: move_alloc => c_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
procedure, pass(lv) :: map_rstr_a => amg_c_base_onelev_map_rstr_a
|
procedure, pass(lv) :: map_rstr_a => amg_c_base_onelev_map_rstr_a
|
||||||
procedure, pass(lv) :: map_prol_a => amg_c_base_onelev_map_prol_a
|
procedure, pass(lv) :: map_prol_a => amg_c_base_onelev_map_prol_a
|
||||||
procedure, pass(lv) :: map_rstr_v => amg_c_base_onelev_map_rstr_v
|
procedure, pass(lv) :: map_rstr_v => amg_c_base_onelev_map_rstr_v
|
||||||
@@ -226,11 +227,11 @@ module amg_c_onelev_mod
|
|||||||
& c_base_onelev_get_wrksize, c_base_onelev_allocate_wrk, &
|
& c_base_onelev_get_wrksize, c_base_onelev_allocate_wrk, &
|
||||||
& c_base_onelev_free_wrk
|
& c_base_onelev_free_wrk
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
subroutine amg_c_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
import :: psb_cspmat_type, psb_desc_type, psb_spk_, psb_ipk_, psb_lcspmat_type, psb_lpk_
|
import :: psb_cspmat_type, psb_desc_type, psb_spk_, psb_ipk_, psb_lcspmat_type, psb_lpk_
|
||||||
import :: amg_c_onelev_type
|
import :: amg_c_onelev_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), intent(inout), target :: lv
|
class(amg_c_onelev_type), intent(inout), target :: lv
|
||||||
type(psb_cspmat_type), intent(in) :: a
|
type(psb_cspmat_type), intent(in) :: a
|
||||||
type(psb_desc_type), intent(inout) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
@@ -255,141 +256,142 @@ module amg_c_onelev_mod
|
|||||||
end subroutine amg_c_base_onelev_build
|
end subroutine amg_c_base_onelev_build
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_descr(lv,il,nl,ilmin,info,iout)
|
subroutine amg_c_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), intent(in) :: lv
|
class(amg_c_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_c_base_onelev_descr
|
end subroutine amg_c_base_onelev_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_cnv(lv,info,amold,vmold,imold)
|
subroutine amg_c_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||||
import :: amg_c_onelev_type, psb_c_base_vect_type, psb_spk_, &
|
import :: amg_c_onelev_type, psb_c_base_vect_type, psb_spk_, &
|
||||||
& psb_c_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
& psb_c_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_c_base_onelev_cnv
|
end subroutine amg_c_base_onelev_cnv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_free(lv,info)
|
subroutine amg_c_base_onelev_free(lv,info)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_c_base_onelev_free
|
end subroutine amg_c_base_onelev_free
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_check(lv,info)
|
subroutine amg_c_base_onelev_check(lv,info)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_c_base_onelev_check
|
end subroutine amg_c_base_onelev_check
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_setsm(lv,val,info,pos)
|
subroutine amg_c_base_onelev_setsm(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_c_onelev_type, amg_c_base_smoother_type, &
|
import :: psb_spk_, amg_c_onelev_type, amg_c_base_smoother_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_c_base_smoother_type), intent(in) :: val
|
class(amg_c_base_smoother_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_c_base_onelev_setsm
|
end subroutine amg_c_base_onelev_setsm
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_setsv(lv,val,info,pos)
|
subroutine amg_c_base_onelev_setsv(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_c_onelev_type, amg_c_base_solver_type, &
|
import :: psb_spk_, amg_c_onelev_type, amg_c_base_solver_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_c_base_solver_type), intent(in) :: val
|
class(amg_c_base_solver_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_c_base_onelev_setsv
|
end subroutine amg_c_base_onelev_setsv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_setag(lv,val,info,pos)
|
subroutine amg_c_base_onelev_setag(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_c_onelev_type, amg_c_base_aggregator_type, &
|
import :: psb_spk_, amg_c_onelev_type, amg_c_base_aggregator_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_c_base_aggregator_type), intent(in) :: val
|
class(amg_c_base_aggregator_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_c_base_onelev_setag
|
end subroutine amg_c_base_onelev_setag
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_cseti(lv,what,val,info,pos,idx)
|
subroutine amg_c_base_onelev_cseti(lv,what,val,info,pos,idx)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_c_base_onelev_cseti
|
end subroutine amg_c_base_onelev_cseti
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
|
subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_c_base_onelev_csetc
|
end subroutine amg_c_base_onelev_csetc
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_csetr(lv,what,val,info,pos,idx)
|
subroutine amg_c_base_onelev_csetr(lv,what,val,info,pos,idx)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
@@ -397,13 +399,13 @@ interface
|
|||||||
end subroutine amg_c_base_onelev_csetr
|
end subroutine amg_c_base_onelev_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
||||||
& solver,tprol,global_num)
|
& solver,tprol,global_num)
|
||||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), intent(in) :: lv
|
class(amg_c_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -435,7 +437,7 @@ interface
|
|||||||
end subroutine amg_c_base_onelev_map_rstr_v
|
end subroutine amg_c_base_onelev_map_rstr_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_c_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
subroutine amg_c_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
||||||
import
|
import
|
||||||
implicit none
|
implicit none
|
||||||
@@ -458,15 +460,15 @@ interface
|
|||||||
type(psb_c_vect_type), optional, target, intent(inout) :: vtx,vty
|
type(psb_c_vect_type), optional, target, intent(inout) :: vtx,vty
|
||||||
end subroutine amg_c_base_onelev_map_prol_v
|
end subroutine amg_c_base_onelev_map_prol_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
! Function returning the size of the amg_prec_type data structure
|
! Function returning the size of the amg_prec_type data structure
|
||||||
! in bytes or in number of nonzeros of the operator(s) involved.
|
! in bytes or in number of nonzeros of the operator(s) involved.
|
||||||
!
|
!
|
||||||
|
|
||||||
function c_base_onelev_get_nzeros(lv) result(val)
|
function c_base_onelev_get_nzeros(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), intent(in) :: lv
|
class(amg_c_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -478,16 +480,16 @@ contains
|
|||||||
end function c_base_onelev_get_nzeros
|
end function c_base_onelev_get_nzeros
|
||||||
|
|
||||||
function c_base_onelev_sizeof(lv) result(val)
|
function c_base_onelev_sizeof(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), intent(in) :: lv
|
class(amg_c_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
val = psb_sizeof_ip+psb_sizeof_lp
|
val = psb_sizeof_ip+psb_sizeof_lp
|
||||||
val = val + lv%desc_ac%sizeof()
|
val = val + lv%desc_ac%sizeof()
|
||||||
val = val + lv%ac%sizeof()
|
val = val + lv%ac%sizeof()
|
||||||
val = val + lv%tprol%sizeof()
|
val = val + lv%tprol%sizeof()
|
||||||
val = val + lv%linmap%sizeof()
|
val = val + lv%linmap%sizeof()
|
||||||
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
||||||
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
||||||
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
||||||
@@ -496,19 +498,19 @@ contains
|
|||||||
|
|
||||||
|
|
||||||
subroutine c_base_onelev_nullify(lv)
|
subroutine c_base_onelev_nullify(lv)
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
|
|
||||||
nullify(lv%base_a)
|
nullify(lv%base_a)
|
||||||
nullify(lv%base_desc)
|
nullify(lv%base_desc)
|
||||||
nullify(lv%sm2)
|
nullify(lv%sm2)
|
||||||
end subroutine c_base_onelev_nullify
|
end subroutine c_base_onelev_nullify
|
||||||
|
|
||||||
!
|
!
|
||||||
! Multilevel defaults:
|
! Multilevel defaults:
|
||||||
! multiplicative vs. additive ML framework;
|
! multiplicative vs. additive ML framework;
|
||||||
! Smoothed decoupled aggregation with zero threshold;
|
! Smoothed decoupled aggregation with zero threshold;
|
||||||
! distributed coarse matrix;
|
! distributed coarse matrix;
|
||||||
! damping omega computed with the max-norm estimate of the
|
! damping omega computed with the max-norm estimate of the
|
||||||
! dominant eigenvalue;
|
! dominant eigenvalue;
|
||||||
@@ -518,10 +520,10 @@ contains
|
|||||||
subroutine c_base_onelev_default(lv)
|
subroutine c_base_onelev_default(lv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: info
|
integer(psb_ipk_) :: info
|
||||||
|
|
||||||
lv%parms%sweeps_pre = 1
|
lv%parms%sweeps_pre = 1
|
||||||
lv%parms%sweeps_post = 1
|
lv%parms%sweeps_post = 1
|
||||||
@@ -536,7 +538,7 @@ contains
|
|||||||
lv%parms%aggr_filter = amg_no_filter_mat_
|
lv%parms%aggr_filter = amg_no_filter_mat_
|
||||||
lv%parms%aggr_omega_val = szero
|
lv%parms%aggr_omega_val = szero
|
||||||
lv%parms%aggr_thresh = 0.01_psb_spk_
|
lv%parms%aggr_thresh = 0.01_psb_spk_
|
||||||
|
|
||||||
if (allocated(lv%sm)) call lv%sm%default()
|
if (allocated(lv%sm)) call lv%sm%default()
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm2a%default()
|
call lv%sm2a%default()
|
||||||
@@ -546,7 +548,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
if (.not.allocated(lv%aggr)) allocate(amg_c_dec_aggregator_type :: lv%aggr,stat=info)
|
if (.not.allocated(lv%aggr)) allocate(amg_c_dec_aggregator_type :: lv%aggr,stat=info)
|
||||||
if (allocated(lv%aggr)) call lv%aggr%default()
|
if (allocated(lv%aggr)) call lv%aggr%default()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine c_base_onelev_default
|
end subroutine c_base_onelev_default
|
||||||
@@ -561,9 +563,9 @@ contains
|
|||||||
type(psb_lcspmat_type), intent(out) :: t_prol
|
type(psb_lcspmat_type), intent(out) :: t_prol
|
||||||
type(amg_saggr_data), intent(in) :: ag_data
|
type(amg_saggr_data), intent(in) :: ag_data
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
|
|
||||||
end subroutine c_base_onelev_bld_tprol
|
end subroutine c_base_onelev_bld_tprol
|
||||||
|
|
||||||
|
|
||||||
@@ -573,7 +575,7 @@ contains
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%update_next(lvnext%aggr,info)
|
call lv%aggr%update_next(lvnext%aggr,info)
|
||||||
|
|
||||||
end subroutine c_base_onelev_update_aggr
|
end subroutine c_base_onelev_update_aggr
|
||||||
|
|
||||||
|
|
||||||
@@ -582,33 +584,33 @@ contains
|
|||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lvout
|
class(amg_c_onelev_type), target, intent(inout) :: lvout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
if (allocated(lv%sm)) then
|
if (allocated(lv%sm)) then
|
||||||
call lv%sm%clone(lvout%sm,info)
|
call lv%sm%clone(lvout%sm,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm)) then
|
if (allocated(lvout%sm)) then
|
||||||
call lvout%sm%free(info)
|
call lvout%sm%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm%clone(lvout%sm2a,info)
|
call lv%sm%clone(lvout%sm2a,info)
|
||||||
lvout%sm2 => lvout%sm2a
|
lvout%sm2 => lvout%sm2a
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm2a)) then
|
if (allocated(lvout%sm2a)) then
|
||||||
call lvout%sm2a%free(info)
|
call lvout%sm2a%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
||||||
end if
|
end if
|
||||||
lvout%sm2 => lvout%sm
|
lvout%sm2 => lvout%sm
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%aggr)) then
|
if (allocated(lv%aggr)) then
|
||||||
call lv%aggr%clone(lvout%aggr,info)
|
call lv%aggr%clone(lvout%aggr,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%aggr)) then
|
if (allocated(lvout%aggr)) then
|
||||||
call lvout%aggr%free(info)
|
call lvout%aggr%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
||||||
end if
|
end if
|
||||||
@@ -621,7 +623,7 @@ contains
|
|||||||
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
||||||
lvout%base_a => lv%base_a
|
lvout%base_a => lv%base_a
|
||||||
lvout%base_desc => lv%base_desc
|
lvout%base_desc => lv%base_desc
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine c_base_onelev_clone
|
end subroutine c_base_onelev_clone
|
||||||
@@ -630,12 +632,12 @@ contains
|
|||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv, b
|
class(amg_c_onelev_type), target, intent(inout) :: lv, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
b%parms = lv%parms
|
b%parms = lv%parms
|
||||||
b%szratio = lv%szratio
|
b%szratio = lv%szratio
|
||||||
if (associated(lv%sm2,lv%sm2a)) then
|
if (associated(lv%sm2,lv%sm2a)) then
|
||||||
call move_alloc(lv%sm,b%sm)
|
call move_alloc(lv%sm,b%sm)
|
||||||
call move_alloc(lv%sm2a,b%sm2a)
|
call move_alloc(lv%sm2a,b%sm2a)
|
||||||
b%sm2 =>b%sm2a
|
b%sm2 =>b%sm2a
|
||||||
@@ -646,18 +648,18 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
call move_alloc(lv%aggr,b%aggr)
|
call move_alloc(lv%aggr,b%aggr)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
||||||
b%base_a => lv%base_a
|
b%base_a => lv%base_a
|
||||||
b%base_desc => lv%base_desc
|
b%base_desc => lv%base_desc
|
||||||
|
|
||||||
end subroutine c_base_onelev_move_alloc
|
end subroutine c_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
function c_base_onelev_get_wrksize(lv) result(val)
|
function c_base_onelev_get_wrksize(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), intent(inout) :: lv
|
class(amg_c_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: val
|
integer(psb_ipk_) :: val
|
||||||
|
|
||||||
@@ -678,26 +680,26 @@ contains
|
|||||||
select case(lv%parms%ml_cycle)
|
select case(lv%parms%ml_cycle)
|
||||||
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
||||||
! We're good
|
! We're good
|
||||||
|
|
||||||
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
||||||
!
|
!
|
||||||
! We need 7 in inneritkcycle.
|
! We need 7 in inneritkcycle.
|
||||||
! Can we reuse vtx?
|
! Can we reuse vtx?
|
||||||
!
|
!
|
||||||
val = val + 7
|
val = val + 7
|
||||||
|
|
||||||
case default
|
case default
|
||||||
! Need a better error signaling ?
|
! Need a better error signaling ?
|
||||||
val = -1
|
val = -1
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end function c_base_onelev_get_wrksize
|
end function c_base_onelev_get_wrksize
|
||||||
|
|
||||||
subroutine c_base_onelev_allocate_wrk(lv,info,vmold)
|
subroutine c_base_onelev_allocate_wrk(lv,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv, i
|
integer(psb_ipk_) :: nwv, i
|
||||||
@@ -710,22 +712,22 @@ contains
|
|||||||
! Need to fix this, we need two different allocations
|
! Need to fix this, we need two different allocations
|
||||||
!
|
!
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
||||||
& desc2=lv%remap_data%desc_ac_pre_remap)
|
& desc2=lv%remap_data%desc_ac_pre_remap)
|
||||||
else
|
else
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine c_base_onelev_allocate_wrk
|
end subroutine c_base_onelev_allocate_wrk
|
||||||
|
|
||||||
|
|
||||||
subroutine c_base_onelev_free_wrk(lv,info)
|
subroutine c_base_onelev_free_wrk(lv,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_c_onelev_type), target, intent(inout) :: lv
|
class(amg_c_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv,i
|
integer(psb_ipk_) :: nwv,i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
if (allocated(lv%wrk)) then
|
if (allocated(lv%wrk)) then
|
||||||
@@ -733,17 +735,17 @@ contains
|
|||||||
if (info == 0) deallocate(lv%wrk,stat=info)
|
if (info == 0) deallocate(lv%wrk,stat=info)
|
||||||
end if
|
end if
|
||||||
end subroutine c_base_onelev_free_wrk
|
end subroutine c_base_onelev_free_wrk
|
||||||
|
|
||||||
subroutine c_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
subroutine c_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(in) :: nwv
|
integer(psb_ipk_), intent(in) :: nwv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
type(psb_desc_type), intent(in), optional :: desc2
|
type(psb_desc_type), intent(in), optional :: desc2
|
||||||
!
|
!
|
||||||
@@ -807,14 +809,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end subroutine c_wrk_alloc
|
end subroutine c_wrk_alloc
|
||||||
|
|
||||||
subroutine c_wrk_free(wk,info)
|
subroutine c_wrk_free(wk,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -835,7 +837,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine c_wrk_free
|
end subroutine c_wrk_free
|
||||||
|
|
||||||
subroutine c_wrk_clone(wk,wkout,info)
|
subroutine c_wrk_clone(wk,wkout,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
Implicit None
|
Implicit None
|
||||||
@@ -843,11 +845,11 @@ contains
|
|||||||
! Arguments
|
! Arguments
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wkout
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wkout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
||||||
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
||||||
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
||||||
@@ -869,12 +871,12 @@ contains
|
|||||||
return
|
return
|
||||||
|
|
||||||
end subroutine c_wrk_clone
|
end subroutine c_wrk_clone
|
||||||
|
|
||||||
subroutine c_wrk_move_alloc(wk, b,info)
|
subroutine c_wrk_move_alloc(wk, b,info)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk, b
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
call move_alloc(wk%tx,b%tx)
|
call move_alloc(wk%tx,b%tx)
|
||||||
call move_alloc(wk%ty,b%ty)
|
call move_alloc(wk%ty,b%ty)
|
||||||
@@ -887,17 +889,17 @@ contains
|
|||||||
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
||||||
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
||||||
call move_alloc(wk%wv,b%wv)
|
call move_alloc(wk%wv,b%wv)
|
||||||
|
|
||||||
end subroutine c_wrk_move_alloc
|
end subroutine c_wrk_move_alloc
|
||||||
|
|
||||||
subroutine c_wrk_cnv(wk,info,vmold)
|
subroutine c_wrk_cnv(wk,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_cmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -918,7 +920,7 @@ contains
|
|||||||
|
|
||||||
function c_wrk_sizeof(wk) result(val)
|
function c_wrk_sizeof(wk) result(val)
|
||||||
use psb_realloc_mod
|
use psb_realloc_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_cmlprec_wrk_type), intent(in) :: wk
|
class(amg_cmlprec_wrk_type), intent(in) :: wk
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer :: i
|
integer :: i
|
||||||
@@ -937,14 +939,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end function c_wrk_sizeof
|
end function c_wrk_sizeof
|
||||||
|
|
||||||
subroutine c_remap_data_clone(rmp, remap_out, info)
|
subroutine c_remap_data_clone(rmp, remap_out, info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_c_remap_data_type), target, intent(inout) :: rmp
|
class(amg_c_remap_data_type), target, intent(inout) :: rmp
|
||||||
class(amg_c_remap_data_type), target, intent(inout) :: remap_out
|
class(amg_c_remap_data_type), target, intent(inout) :: remap_out
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
@@ -955,7 +957,7 @@ contains
|
|||||||
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
||||||
remap_out%idest = rmp%idest
|
remap_out%idest = rmp%idest
|
||||||
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
||||||
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
||||||
end subroutine c_remap_data_clone
|
end subroutine c_remap_data_clone
|
||||||
|
|
||||||
end module amg_c_onelev_mod
|
end module amg_c_onelev_mod
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
! Module: amg_c_prec_mod
|
! Module: amg_c_prec_mod
|
||||||
!
|
!
|
||||||
! This module defines the user interfaces to the real/complex, single/double
|
! This module defines the user interfaces to the real/complex, single/double
|
||||||
! precision versions of the user-level MLD2P4 routines.
|
! precision versions of the user-level AMG4PSBLAS routines.
|
||||||
!
|
!
|
||||||
module amg_c_prec_mod
|
module amg_c_prec_mod
|
||||||
|
|
||||||
@@ -55,12 +55,7 @@ module amg_c_prec_mod
|
|||||||
use amg_c_ainv_solver
|
use amg_c_ainv_solver
|
||||||
use amg_c_invk_solver
|
use amg_c_invk_solver
|
||||||
use amg_c_invt_solver
|
use amg_c_invt_solver
|
||||||
|
use amg_c_krm_solver
|
||||||
interface amg_precset
|
|
||||||
module procedure amg_c_iprecsetsm, amg_c_iprecsetsv, &
|
|
||||||
& amg_c_cprecseti, amg_c_cprecsetc, amg_c_cprecsetr, &
|
|
||||||
& amg_c_iprecsetag
|
|
||||||
end interface amg_precset
|
|
||||||
|
|
||||||
interface amg_extprol_bld
|
interface amg_extprol_bld
|
||||||
subroutine amg_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
subroutine amg_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
||||||
@@ -82,61 +77,4 @@ module amg_c_prec_mod
|
|||||||
end subroutine amg_c_extprol_bld
|
end subroutine amg_c_extprol_bld
|
||||||
end interface amg_extprol_bld
|
end interface amg_extprol_bld
|
||||||
|
|
||||||
contains
|
|
||||||
|
|
||||||
subroutine amg_c_iprecsetsm(p,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
class(amg_c_base_smoother_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(val,info,pos=pos)
|
|
||||||
end subroutine amg_c_iprecsetsm
|
|
||||||
|
|
||||||
subroutine amg_c_iprecsetsv(p,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
class(amg_c_base_solver_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_c_iprecsetsv
|
|
||||||
|
|
||||||
subroutine amg_c_iprecsetag(p,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
class(amg_c_base_aggregator_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_c_iprecsetag
|
|
||||||
|
|
||||||
subroutine amg_c_cprecseti(p,what,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_c_cprecseti
|
|
||||||
|
|
||||||
subroutine amg_c_cprecsetr(p,what,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
real(psb_spk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_c_cprecsetr
|
|
||||||
|
|
||||||
subroutine amg_c_cprecsetc(p,what,val,info,pos)
|
|
||||||
type(amg_cprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
character(len=*), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_c_cprecsetc
|
|
||||||
|
|
||||||
end module amg_c_prec_mod
|
end module amg_c_prec_mod
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -66,7 +66,7 @@ module amg_c_prec_type
|
|||||||
!
|
!
|
||||||
! This is the data type containing all the information about the multilevel
|
! This is the data type containing all the information about the multilevel
|
||||||
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
||||||
! single/double precision version of MLD2P4).
|
! single/double precision version of AMG4PSBLAS).
|
||||||
! It consists of an array of 'one-level' intermediate data structures
|
! It consists of an array of 'one-level' intermediate data structures
|
||||||
! of type amg_conelev_type, each containing the information needed to apply
|
! of type amg_conelev_type, each containing the information needed to apply
|
||||||
! the smoothing and the coarse-space correction at a generic level. RT is the
|
! the smoothing and the coarse-space correction at a generic level. RT is the
|
||||||
@@ -155,13 +155,15 @@ module amg_c_prec_type
|
|||||||
|
|
||||||
|
|
||||||
interface amg_precdescr
|
interface amg_precdescr
|
||||||
subroutine amg_cfile_prec_descr(prec,iout,root)
|
subroutine amg_cfile_prec_descr(prec,info,iout,root,verbosity)
|
||||||
import :: amg_cprec_type, psb_ipk_
|
import :: amg_cprec_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_cprec_type), intent(in) :: prec
|
class(amg_cprec_type), intent(in) :: prec
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_cfile_prec_descr
|
end subroutine amg_cfile_prec_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
@@ -424,11 +426,22 @@ contains
|
|||||||
end if
|
end if
|
||||||
end function amg_c_get_nzeros
|
end function amg_c_get_nzeros
|
||||||
|
|
||||||
function amg_cprec_sizeof(prec) result(val)
|
function amg_cprec_sizeof(prec, global) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_cprec_type), intent(in) :: prec
|
class(amg_cprec_type), intent(in) :: prec
|
||||||
integer(psb_epk_) :: val
|
logical, intent(in), optional :: global
|
||||||
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
type(psb_ctxt_type) :: ctxt
|
||||||
|
|
||||||
|
logical :: global_
|
||||||
|
|
||||||
|
if (present(global)) then
|
||||||
|
global_ = global
|
||||||
|
else
|
||||||
|
global_ = .false.
|
||||||
|
end if
|
||||||
|
|
||||||
val = 0
|
val = 0
|
||||||
val = val + psb_sizeof_ip
|
val = val + psb_sizeof_ip
|
||||||
if (allocated(prec%precv)) then
|
if (allocated(prec%precv)) then
|
||||||
@@ -436,6 +449,11 @@ contains
|
|||||||
val = val + prec%precv(i)%sizeof()
|
val = val + prec%precv(i)%sizeof()
|
||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
|
if (global_) then
|
||||||
|
ctxt = prec%ctxt
|
||||||
|
call psb_sum(ctxt,val)
|
||||||
|
end if
|
||||||
|
|
||||||
end function amg_cprec_sizeof
|
end function amg_cprec_sizeof
|
||||||
|
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -58,10 +61,9 @@ module amg_d_ainv_solver
|
|||||||
procedure, pass(sv) :: cseti => amg_d_ainv_solver_cseti
|
procedure, pass(sv) :: cseti => amg_d_ainv_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => amg_d_ainv_solver_csetc
|
procedure, pass(sv) :: csetc => amg_d_ainv_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => amg_d_ainv_solver_csetr
|
procedure, pass(sv) :: csetr => amg_d_ainv_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_d_ainv_solver_seti
|
!!$ procedure, pass(sv) :: seti => amg_d_ainv_solver_seti
|
||||||
procedure, pass(sv) :: setc => amg_d_ainv_solver_setc
|
!!$ procedure, pass(sv) :: setc => amg_d_ainv_solver_setc
|
||||||
procedure, pass(sv) :: setr => amg_d_ainv_solver_setr
|
!!$ procedure, pass(sv) :: setr => amg_d_ainv_solver_setr
|
||||||
generic, public :: set => seti, setr, setc
|
|
||||||
procedure, pass(sv) :: descr => amg_d_ainv_solver_descr
|
procedure, pass(sv) :: descr => amg_d_ainv_solver_descr
|
||||||
procedure, pass(sv) :: default => d_ainv_solver_default
|
procedure, pass(sv) :: default => d_ainv_solver_default
|
||||||
procedure, nopass :: stringval => d_ainv_stringval
|
procedure, nopass :: stringval => d_ainv_stringval
|
||||||
@@ -159,41 +161,41 @@ module amg_d_ainv_solver
|
|||||||
end subroutine amg_d_ainv_solver_csetr
|
end subroutine amg_d_ainv_solver_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_d_ainv_solver_setc(sv,what,val,info)
|
!!$ subroutine amg_d_ainv_solver_setc(sv,what,val,info)
|
||||||
import :: amg_d_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_d_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_d_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_d_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
!!$ character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_d_ainv_solver_setc
|
!!$ end subroutine amg_d_ainv_solver_setc
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_d_ainv_solver_seti(sv,what,val,info)
|
!!$ subroutine amg_d_ainv_solver_seti(sv,what,val,info)
|
||||||
import :: amg_d_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_d_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_d_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_d_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
!!$ integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_d_ainv_solver_seti
|
!!$ end subroutine amg_d_ainv_solver_seti
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_d_ainv_solver_setr(sv,what,val,info)
|
!!$ subroutine amg_d_ainv_solver_setr(sv,what,val,info)
|
||||||
import :: amg_d_ainv_solver_type, psb_ipk_, psb_dpk_
|
!!$ import :: amg_d_ainv_solver_type, psb_ipk_, psb_dpk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_d_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_d_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
real(psb_dpk_), intent(in) :: val
|
!!$ real(psb_dpk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_d_ainv_solver_setr
|
!!$ end subroutine amg_d_ainv_solver_setr
|
||||||
end interface
|
!!$ end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_ainv_solver_descr(sv,info,iout,coarse)
|
subroutine amg_d_ainv_solver_descr(sv,info,iout,coarse)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -126,7 +126,7 @@ module amg_d_base_aggregator_mod
|
|||||||
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_dml_parms), intent(inout) :: parms
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
@@ -144,7 +144,7 @@ module amg_d_base_aggregator_mod
|
|||||||
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_dml_parms), intent(inout) :: parms
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
!
|
!
|
||||||
! Module: amg_inner_mod
|
! Module: amg_inner_mod
|
||||||
!
|
!
|
||||||
! This module defines the interfaces to inner MLD2P4 routines.
|
! This module defines the interfaces to inner AMG4PSBLAS routines.
|
||||||
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
||||||
!
|
!
|
||||||
module amg_d_inner_mod
|
module amg_d_inner_mod
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -51,8 +54,6 @@ module amg_d_invk_solver
|
|||||||
procedure, pass(sv) :: clone => amg_d_invk_solver_clone
|
procedure, pass(sv) :: clone => amg_d_invk_solver_clone
|
||||||
procedure, pass(sv) :: build => amg_d_invk_solver_bld
|
procedure, pass(sv) :: build => amg_d_invk_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_d_invk_solver_cseti
|
procedure, pass(sv) :: cseti => amg_d_invk_solver_cseti
|
||||||
procedure, pass(sv) :: seti => amg_d_invk_solver_seti
|
|
||||||
generic, public :: set => seti
|
|
||||||
procedure, pass(sv) :: descr => amg_d_invk_solver_descr
|
procedure, pass(sv) :: descr => amg_d_invk_solver_descr
|
||||||
procedure, pass(sv) :: default => d_invk_solver_default
|
procedure, pass(sv) :: default => d_invk_solver_default
|
||||||
end type amg_d_invk_solver_type
|
end type amg_d_invk_solver_type
|
||||||
@@ -136,18 +137,6 @@ module amg_d_invk_solver
|
|||||||
end subroutine amg_d_invk_solver_descr
|
end subroutine amg_d_invk_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_d_invk_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_d_invk_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_d_invk_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_d_invk_solver_seti
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine d_invk_solver_default(sv)
|
subroutine d_invk_solver_default(sv)
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -52,9 +55,6 @@ module amg_d_invt_solver
|
|||||||
procedure, pass(sv) :: build => amg_d_invt_solver_bld
|
procedure, pass(sv) :: build => amg_d_invt_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_d_invt_solver_cseti
|
procedure, pass(sv) :: cseti => amg_d_invt_solver_cseti
|
||||||
procedure, pass(sv) :: csetr => amg_d_invt_solver_csetr
|
procedure, pass(sv) :: csetr => amg_d_invt_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_d_invt_solver_seti
|
|
||||||
procedure, pass(sv) :: setr => amg_d_invt_solver_setr
|
|
||||||
generic, public :: set => seti, setr
|
|
||||||
procedure, pass(sv) :: descr => amg_d_invt_solver_descr
|
procedure, pass(sv) :: descr => amg_d_invt_solver_descr
|
||||||
procedure, pass(sv) :: default => d_invt_solver_default
|
procedure, pass(sv) :: default => d_invt_solver_default
|
||||||
end type amg_d_invt_solver_type
|
end type amg_d_invt_solver_type
|
||||||
@@ -148,30 +148,6 @@ module amg_d_invt_solver
|
|||||||
end subroutine amg_d_invt_solver_descr
|
end subroutine amg_d_invt_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_d_invt_solver_setr(sv,what,val,info)
|
|
||||||
import :: amg_d_invt_solver_type, psb_dpk_, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_d_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
real(psb_dpk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_d_invt_solver_setr
|
|
||||||
end interface
|
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_d_invt_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_d_invt_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_d_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine d_invt_solver_default(sv)
|
subroutine d_invt_solver_default(sv)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
@@ -52,14 +55,14 @@
|
|||||||
! 2. Redistributions in binary form must reproduce the above copyright
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
! notice, this list of conditions, and the following disclaimer in the
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
! documentation and/or other materials provided with the distribution.
|
! documentation and/or other materials provided with the distribution.
|
||||||
! 3. The name of the MLD2P4 group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
@@ -70,16 +73,16 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_d_rkr_solver_mod.f90
|
! File: amg_d_krm_solver_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_d_rkr_solver_mod
|
! Module: amg_d_krm_solver_mod
|
||||||
!
|
!
|
||||||
module amg_d_rkr_solver
|
module amg_d_krm_solver
|
||||||
|
|
||||||
use amg_d_base_solver_mod
|
use amg_d_base_solver_mod
|
||||||
use amg_d_prec_type
|
use amg_d_prec_type
|
||||||
|
|
||||||
type, extends(amg_d_base_solver_type) :: amg_d_rkr_solver_type
|
type, extends(amg_d_base_solver_type) :: amg_d_krm_solver_type
|
||||||
!
|
!
|
||||||
logical :: global
|
logical :: global
|
||||||
character(len=16) :: method, kprec, sub_solve
|
character(len=16) :: method, kprec, sub_solve
|
||||||
@@ -94,46 +97,46 @@ module amg_d_rkr_solver
|
|||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: dump => d_rkr_solver_dmp
|
procedure, pass(sv) :: dump => d_krm_solver_dmp
|
||||||
procedure, pass(sv) :: check => d_rkr_solver_check
|
procedure, pass(sv) :: check => d_krm_solver_check
|
||||||
procedure, pass(sv) :: clone => d_rkr_solver_clone
|
procedure, pass(sv) :: clone => d_krm_solver_clone
|
||||||
procedure, pass(sv) :: clone_settings => d_rkr_solver_clone_settings
|
procedure, pass(sv) :: clone_settings => d_krm_solver_clone_settings
|
||||||
procedure, pass(sv) :: cnv => d_rkr_solver_cnv
|
procedure, pass(sv) :: cnv => d_krm_solver_cnv
|
||||||
procedure, pass(sv) :: apply_v => amg_d_rkr_solver_apply_vect
|
procedure, pass(sv) :: apply_v => amg_d_krm_solver_apply_vect
|
||||||
procedure, pass(sv) :: apply_a => amg_d_rkr_solver_apply
|
procedure, pass(sv) :: apply_a => amg_d_krm_solver_apply
|
||||||
procedure, pass(sv) :: clear_data => d_rkr_solver_clear_data
|
procedure, pass(sv) :: clear_data => d_krm_solver_clear_data
|
||||||
procedure, pass(sv) :: free => d_rkr_solver_free
|
procedure, pass(sv) :: free => d_krm_solver_free
|
||||||
procedure, pass(sv) :: cseti => d_rkr_solver_cseti
|
procedure, pass(sv) :: cseti => d_krm_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => d_rkr_solver_csetc
|
procedure, pass(sv) :: csetc => d_krm_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => d_rkr_solver_csetr
|
procedure, pass(sv) :: csetr => d_krm_solver_csetr
|
||||||
procedure, pass(sv) :: sizeof => d_rkr_solver_sizeof
|
procedure, pass(sv) :: sizeof => d_krm_solver_sizeof
|
||||||
procedure, pass(sv) :: get_nzeros => d_rkr_solver_get_nzeros
|
procedure, pass(sv) :: get_nzeros => d_krm_solver_get_nzeros
|
||||||
!procedure, nopass :: get_id => d_rkr_solver_get_id
|
!procedure, nopass :: get_id => d_krm_solver_get_id
|
||||||
procedure, pass(sv) :: is_global => d_rkr_solver_is_global
|
procedure, pass(sv) :: is_global => d_krm_solver_is_global
|
||||||
procedure, nopass :: is_iterative => d_rkr_solver_is_iterative
|
procedure, nopass :: is_iterative => d_krm_solver_is_iterative
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
! These methods are specific for the new solver type
|
! These methods are specific for the new solver type
|
||||||
! and therefore need to be overridden
|
! and therefore need to be overridden
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: descr => d_rkr_solver_descr
|
procedure, pass(sv) :: descr => d_krm_solver_descr
|
||||||
procedure, pass(sv) :: default => d_rkr_solver_default
|
procedure, pass(sv) :: default => d_krm_solver_default
|
||||||
procedure, pass(sv) :: build => amg_d_rkr_solver_bld
|
procedure, pass(sv) :: build => amg_d_krm_solver_bld
|
||||||
procedure, nopass :: get_fmt => d_rkr_solver_get_fmt
|
procedure, nopass :: get_fmt => d_krm_solver_get_fmt
|
||||||
end type amg_d_rkr_solver_type
|
end type amg_d_krm_solver_type
|
||||||
|
|
||||||
|
|
||||||
private :: d_rkr_solver_get_fmt, d_rkr_solver_descr, d_rkr_solver_default
|
private :: d_krm_solver_get_fmt, d_krm_solver_descr, d_krm_solver_default
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_rkr_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_d_krm_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,wv,info,init,initu)
|
& trans,work,wv,info,init,initu)
|
||||||
import :: psb_desc_type, amg_d_rkr_solver_type, psb_d_vect_type, psb_dpk_, &
|
import :: psb_desc_type, amg_d_krm_solver_type, psb_d_vect_type, psb_dpk_, &
|
||||||
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type, psb_ipk_
|
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
type(psb_d_vect_type),intent(inout) :: x
|
type(psb_d_vect_type),intent(inout) :: x
|
||||||
type(psb_d_vect_type),intent(inout) :: y
|
type(psb_d_vect_type),intent(inout) :: y
|
||||||
real(psb_dpk_),intent(in) :: alpha,beta
|
real(psb_dpk_),intent(in) :: alpha,beta
|
||||||
@@ -143,17 +146,17 @@ module amg_d_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
type(psb_d_vect_type),intent(inout), optional :: initu
|
type(psb_d_vect_type),intent(inout), optional :: initu
|
||||||
end subroutine amg_d_rkr_solver_apply_vect
|
end subroutine amg_d_krm_solver_apply_vect
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_rkr_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_d_krm_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,info,init,initu)
|
& trans,work,info,init,initu)
|
||||||
import :: psb_desc_type, amg_d_rkr_solver_type, psb_d_vect_type, psb_dpk_, &
|
import :: psb_desc_type, amg_d_krm_solver_type, psb_d_vect_type, psb_dpk_, &
|
||||||
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type, psb_ipk_
|
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
real(psb_dpk_),intent(inout) :: x(:)
|
real(psb_dpk_),intent(inout) :: x(:)
|
||||||
real(psb_dpk_),intent(inout) :: y(:)
|
real(psb_dpk_),intent(inout) :: y(:)
|
||||||
real(psb_dpk_),intent(in) :: alpha,beta
|
real(psb_dpk_),intent(in) :: alpha,beta
|
||||||
@@ -162,24 +165,24 @@ module amg_d_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
real(psb_dpk_),intent(inout), optional :: initu(:)
|
real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||||
end subroutine amg_d_rkr_solver_apply
|
end subroutine amg_d_krm_solver_apply
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_rkr_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
subroutine amg_d_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||||
import :: psb_desc_type, amg_d_rkr_solver_type, psb_d_vect_type, psb_dpk_, &
|
import :: psb_desc_type, amg_d_krm_solver_type, psb_d_vect_type, psb_dpk_, &
|
||||||
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type,&
|
& psb_dspmat_type, psb_d_base_sparse_mat, psb_d_base_vect_type,&
|
||||||
& psb_ipk_, psb_i_base_vect_type
|
& psb_ipk_, psb_i_base_vect_type
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_dspmat_type), intent(in), target :: a
|
type(psb_dspmat_type), intent(in), target :: a
|
||||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_d_rkr_solver_bld
|
end subroutine amg_d_krm_solver_bld
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
|
|
||||||
@@ -187,12 +190,12 @@ contains
|
|||||||
|
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
subroutine d_rkr_solver_default(sv)
|
subroutine d_krm_solver_default(sv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
|
|
||||||
sv%method = 'bicgstab'
|
sv%method = 'bicgstab'
|
||||||
sv%kprec = 'bjac'
|
sv%kprec = 'bjac'
|
||||||
@@ -207,42 +210,42 @@ contains
|
|||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_default
|
end subroutine d_krm_solver_default
|
||||||
|
|
||||||
function d_rkr_solver_get_nzeros(sv) result(val)
|
function d_krm_solver_get_nzeros(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(in) :: sv
|
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%get_nzeros()
|
val = sv%prec%get_nzeros()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function d_rkr_solver_get_nzeros
|
end function d_krm_solver_get_nzeros
|
||||||
|
|
||||||
function d_rkr_solver_sizeof(sv) result(val)
|
function d_krm_solver_sizeof(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(in) :: sv
|
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function d_rkr_solver_sizeof
|
end function d_krm_solver_sizeof
|
||||||
|
|
||||||
|
|
||||||
subroutine d_rkr_solver_check(sv,info)
|
subroutine d_krm_solver_check(sv,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='d_rkr_solver_check'
|
character(len=20) :: name='d_krm_solver_check'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -256,36 +259,36 @@ contains
|
|||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine d_rkr_solver_check
|
end subroutine d_krm_solver_check
|
||||||
|
|
||||||
subroutine d_rkr_solver_cseti(sv,what,val,info,idx)
|
subroutine d_krm_solver_cseti(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='d_rkr_solver_cseti'
|
character(len=20) :: name='d_krm_solver_cseti'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_IRST')
|
case('KRM_IRST')
|
||||||
sv%irst = val
|
sv%irst = val
|
||||||
case('RKR_ISTOPC')
|
case('KRM_ISTOPC')
|
||||||
sv%istopc = val
|
sv%istopc = val
|
||||||
case('RKR_ITMAX')
|
case('KRM_ITMAX')
|
||||||
sv%itmax = val
|
sv%itmax = val
|
||||||
case('RKR_ITRACE')
|
case('KRM_ITRACE')
|
||||||
sv%itrace = val
|
sv%itrace = val
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%i_sub_solve = val
|
sv%i_sub_solve = val
|
||||||
case('RKR_FILLIN')
|
case('KRM_FILLIN')
|
||||||
sv%fillin = val
|
sv%fillin = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_d_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_d_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -296,33 +299,33 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_cseti
|
end subroutine d_krm_solver_cseti
|
||||||
|
|
||||||
subroutine d_rkr_solver_csetc(sv,what,val,info,idx)
|
subroutine d_krm_solver_csetc(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act, ival
|
integer(psb_ipk_) :: err_act, ival
|
||||||
character(len=20) :: name='d_rkr_solver_csetc'
|
character(len=20) :: name='d_krm_solver_csetc'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_METHOD')
|
case('KRM_METHOD')
|
||||||
sv%method = psb_toupper(trim(val))
|
sv%method = psb_toupper(trim(val))
|
||||||
case('RKR_KPREC')
|
case('KRM_KPREC')
|
||||||
sv%kprec = psb_toupper(trim(val))
|
sv%kprec = psb_toupper(trim(val))
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%sub_solve = psb_toupper(trim(val))
|
sv%sub_solve = psb_toupper(trim(val))
|
||||||
case('RKR_GLOBAL')
|
case('KRM_GLOBAL')
|
||||||
select case(psb_toupper(trim(val)))
|
select case(psb_toupper(trim(val)))
|
||||||
case('LOCAL','FALSE')
|
case('LOCAL','FALSE')
|
||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
@@ -345,26 +348,26 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_csetc
|
end subroutine d_krm_solver_csetc
|
||||||
|
|
||||||
subroutine d_rkr_solver_csetr(sv,what,val,info,idx)
|
subroutine d_krm_solver_csetr(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_dpk_), intent(in) :: val
|
real(psb_dpk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='d_rkr_solver_csetr'
|
character(len=20) :: name='d_krm_solver_csetr'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select case(psb_toupper(what))
|
select case(psb_toupper(what))
|
||||||
case('RKR_EPS')
|
case('KRM_EPS')
|
||||||
sv%eps = val
|
sv%eps = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_d_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_d_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -375,18 +378,18 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_csetr
|
end subroutine d_krm_solver_csetr
|
||||||
|
|
||||||
subroutine d_rkr_solver_clear_data(sv,info)
|
subroutine d_krm_solver_clear_data(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='d_rkr_solver_free'
|
character(len=20) :: name='d_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -403,19 +406,19 @@ contains
|
|||||||
nullify(sv%a)
|
nullify(sv%a)
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_clear_data
|
end subroutine d_krm_solver_clear_data
|
||||||
|
|
||||||
|
|
||||||
subroutine d_rkr_solver_free(sv,info)
|
subroutine d_krm_solver_free(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='d_rkr_solver_free'
|
character(len=20) :: name='d_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -424,28 +427,28 @@ contains
|
|||||||
|
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_free
|
end subroutine d_krm_solver_free
|
||||||
|
|
||||||
function d_rkr_solver_get_fmt() result(val)
|
function d_krm_solver_get_fmt() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
character(len=32) :: val
|
character(len=32) :: val
|
||||||
|
|
||||||
val = "RKR solver"
|
val = "KRM solver"
|
||||||
end function d_rkr_solver_get_fmt
|
end function d_krm_solver_get_fmt
|
||||||
|
|
||||||
subroutine d_rkr_solver_descr(sv,info,iout,coarse)
|
subroutine d_krm_solver_descr(sv,info,iout,coarse)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(in) :: sv
|
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
logical, intent(in), optional :: coarse
|
logical, intent(in), optional :: coarse
|
||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20), parameter :: name='amg_d_rkr_solver_descr'
|
character(len=20), parameter :: name='amg_d_krm_solver_descr'
|
||||||
integer(psb_ipk_) :: iout_
|
integer(psb_ipk_) :: iout_
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
@@ -457,9 +460,9 @@ contains
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if (sv%global) then
|
if (sv%global) then
|
||||||
write(iout_,*) ' Recursive Krylov solver (global)'
|
write(iout_,*) ' Krylov solver (global)'
|
||||||
else
|
else
|
||||||
write(iout_,*) ' Recursive Krylov solver (local) '
|
write(iout_,*) ' Krylov solver (local) '
|
||||||
end if
|
end if
|
||||||
write(iout_,*) ' method: ',sv%method
|
write(iout_,*) ' method: ',sv%method
|
||||||
write(iout_,*) ' kprec: ',sv%kprec
|
write(iout_,*) ' kprec: ',sv%kprec
|
||||||
@@ -478,11 +481,11 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine d_rkr_solver_descr
|
end subroutine d_krm_solver_descr
|
||||||
|
|
||||||
subroutine d_rkr_solver_cnv(sv,info,amold,vmold,imold)
|
subroutine d_krm_solver_cnv(sv,info,amold,vmold,imold)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
@@ -490,13 +493,13 @@ contains
|
|||||||
|
|
||||||
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||||
|
|
||||||
end subroutine d_rkr_solver_cnv
|
end subroutine d_krm_solver_cnv
|
||||||
|
|
||||||
subroutine d_rkr_solver_clone(sv,svout,info)
|
subroutine d_krm_solver_clone(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_d_base_solver_type), allocatable, intent(inout) :: svout
|
class(amg_d_base_solver_type), allocatable, intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
@@ -505,7 +508,7 @@ contains
|
|||||||
call svout%free(info)
|
call svout%free(info)
|
||||||
allocate(svout,stat=info,mold=sv)
|
allocate(svout,stat=info,mold=sv)
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_d_rkr_solver_type)
|
class is(amg_d_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -524,21 +527,21 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine d_rkr_solver_clone
|
end subroutine d_krm_solver_clone
|
||||||
|
|
||||||
|
|
||||||
subroutine d_rkr_solver_clone_settings(sv,svout,info)
|
subroutine d_krm_solver_clone_settings(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_rkr_solver_type), intent(inout) :: sv
|
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_d_base_solver_type), intent(inout) :: svout
|
class(amg_d_base_solver_type), intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_d_rkr_solver_type)
|
class is(amg_d_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -554,11 +557,11 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine d_rkr_solver_clone_settings
|
end subroutine d_krm_solver_clone_settings
|
||||||
|
|
||||||
subroutine d_rkr_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
subroutine d_krm_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_rkr_solver_type), intent(in) :: sv
|
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -568,23 +571,23 @@ contains
|
|||||||
|
|
||||||
call sv%prec%dump(info,prefix=prefix,head=head)
|
call sv%prec%dump(info,prefix=prefix,head=head)
|
||||||
|
|
||||||
end subroutine d_rkr_solver_dmp
|
end subroutine d_krm_solver_dmp
|
||||||
!
|
!
|
||||||
! Notify whether RKR is used as a global solver
|
! Notify whether KRM is used as a global solver
|
||||||
!
|
!
|
||||||
function d_rkr_solver_is_global(sv) result(val)
|
function d_krm_solver_is_global(sv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_rkr_solver_type), intent(in) :: sv
|
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = (sv%global)
|
val = (sv%global)
|
||||||
end function d_rkr_solver_is_global
|
end function d_krm_solver_is_global
|
||||||
!
|
!
|
||||||
function d_rkr_solver_is_iterative() result(val)
|
function d_krm_solver_is_iterative() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = .true.
|
val = .true.
|
||||||
end function d_rkr_solver_is_iterative
|
end function d_krm_solver_is_iterative
|
||||||
|
|
||||||
end module amg_d_rkr_solver
|
end module amg_d_krm_solver
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
+157
-154
@@ -1,15 +1,15 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
! are met:
|
! are met:
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
@@ -33,22 +33,22 @@
|
|||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_d_onelev_mod.f90
|
! File: amg_d_onelev_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_d_onelev_mod
|
! Module: amg_d_onelev_mod
|
||||||
!
|
!
|
||||||
! This module defines:
|
! This module defines:
|
||||||
! - the amg_d_onelev_type data structure containing one level
|
! - the amg_d_onelev_type data structure containing one level
|
||||||
! of a multilevel preconditioner and related
|
! of a multilevel preconditioner and related
|
||||||
! data structures;
|
! data structures;
|
||||||
!
|
!
|
||||||
! It contains routines for
|
! It contains routines for
|
||||||
! - Building and applying;
|
! - Building and applying;
|
||||||
! - checking if the preconditioner is correctly defined;
|
! - checking if the preconditioner is correctly defined;
|
||||||
! - printing a description of the preconditioner;
|
! - printing a description of the preconditioner;
|
||||||
! - deallocating the preconditioner data structure.
|
! - deallocating the preconditioner data structure.
|
||||||
!
|
!
|
||||||
|
|
||||||
module amg_d_onelev_mod
|
module amg_d_onelev_mod
|
||||||
@@ -56,6 +56,8 @@ module amg_d_onelev_mod
|
|||||||
use amg_base_prec_type
|
use amg_base_prec_type
|
||||||
use amg_d_base_smoother_mod
|
use amg_d_base_smoother_mod
|
||||||
use amg_d_dec_aggregator_mod
|
use amg_d_dec_aggregator_mod
|
||||||
|
use amg_d_parmatch_aggregator_mod
|
||||||
|
|
||||||
use psb_base_mod, only : psb_dspmat_type, psb_d_vect_type, &
|
use psb_base_mod, only : psb_dspmat_type, psb_d_vect_type, &
|
||||||
& psb_d_base_vect_type, psb_ldspmat_type, psb_dlinmap_type, psb_dpk_, &
|
& psb_d_base_vect_type, psb_ldspmat_type, psb_dlinmap_type, psb_dpk_, &
|
||||||
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
||||||
@@ -73,16 +75,16 @@ module amg_d_onelev_mod
|
|||||||
! class(amg_d_base_smoother_type), pointer :: sm2 => null()
|
! class(amg_d_base_smoother_type), pointer :: sm2 => null()
|
||||||
! class(amg_dmlprec_wrk_type), allocatable :: wrk
|
! class(amg_dmlprec_wrk_type), allocatable :: wrk
|
||||||
! class(amg_d_base_aggregator_type), allocatable :: aggr
|
! class(amg_d_base_aggregator_type), allocatable :: aggr
|
||||||
! type(amg_dml_parms) :: parms
|
! type(amg_dml_parms) :: parms
|
||||||
! type(psb_dspmat_type) :: ac
|
! type(psb_dspmat_type) :: ac
|
||||||
! type(psb_desc_type) :: desc_ac
|
! type(psb_desc_type) :: desc_ac
|
||||||
! type(psb_dspmat_type), pointer :: base_a => null()
|
! type(psb_dspmat_type), pointer :: base_a => null()
|
||||||
! type(psb_desc_type), pointer :: base_desc => null()
|
! type(psb_desc_type), pointer :: base_desc => null()
|
||||||
! type(psb_dlinmap_type) :: map
|
! type(psb_dlinmap_type) :: map
|
||||||
! end type amg_donelev_type
|
! end type amg_donelev_type
|
||||||
!
|
!
|
||||||
! Note that d denotes the kind of the real data type to be chosen
|
! Note that d denotes the kind of the real data type to be chosen
|
||||||
! according to single/double precision version of MLD2P4.
|
! according to single/double precision version of AMG4PSBLAS.
|
||||||
!
|
!
|
||||||
! sm,sm2a - class(amg_d_base_smoother_type), allocatable
|
! sm,sm2a - class(amg_d_base_smoother_type), allocatable
|
||||||
! The current level pre- and post-smooother.
|
! The current level pre- and post-smooother.
|
||||||
@@ -93,7 +95,7 @@ module amg_d_onelev_mod
|
|||||||
! Workspace for application of preconditioner; may be
|
! Workspace for application of preconditioner; may be
|
||||||
! pre-allocated to save time in the application within a
|
! pre-allocated to save time in the application within a
|
||||||
! Krylov solver.
|
! Krylov solver.
|
||||||
! aggr - class(amg_d_base_aggregator_type), allocatable
|
! aggr - class(amg_d_base_aggregator_type), allocatable
|
||||||
! The aggregator object: holds the algorithmic choices and
|
! The aggregator object: holds the algorithmic choices and
|
||||||
! (possibly) additional data for building the aggregation.
|
! (possibly) additional data for building the aggregation.
|
||||||
! parms - type(amg_dml_parms)
|
! parms - type(amg_dml_parms)
|
||||||
@@ -104,7 +106,7 @@ module amg_d_onelev_mod
|
|||||||
! The communication descriptor associated to the matrix
|
! The communication descriptor associated to the matrix
|
||||||
! stored in ac.
|
! stored in ac.
|
||||||
! base_a - type(psb_dspmat_type), pointer.
|
! base_a - type(psb_dspmat_type), pointer.
|
||||||
! Pointer (really a pointer!) to the local part of the current
|
! Pointer (really a pointer!) to the local part of the current
|
||||||
! matrix (so we have a unified treatment of residuals).
|
! matrix (so we have a unified treatment of residuals).
|
||||||
! We need this to avoid passing explicitly the current matrix
|
! We need this to avoid passing explicitly the current matrix
|
||||||
! to the routine which applies the preconditioner.
|
! to the routine which applies the preconditioner.
|
||||||
@@ -115,13 +117,13 @@ module amg_d_onelev_mod
|
|||||||
! vector spaces associated to the index spaces of the previous
|
! vector spaces associated to the index spaces of the previous
|
||||||
! and current levels.
|
! and current levels.
|
||||||
!
|
!
|
||||||
! Methods:
|
! Methods:
|
||||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||||
! is appropriate for the current object, then call the corresponding method for
|
! is appropriate for the current object, then call the corresponding method for
|
||||||
! the contained object.
|
! the contained object.
|
||||||
! As an example: the descr() method prints out a description of the
|
! As an example: the descr() method prints out a description of the
|
||||||
! level. It starts by invoking the descr() method of the parms object,
|
! level. It starts by invoking the descr() method of the parms object,
|
||||||
! then calls the descr() method of the smoother object.
|
! then calls the descr() method of the smoother object.
|
||||||
!
|
!
|
||||||
! descr - Prints a description of the object.
|
! descr - Prints a description of the object.
|
||||||
! default - Set default values
|
! default - Set default values
|
||||||
@@ -130,14 +132,14 @@ module amg_d_onelev_mod
|
|||||||
! it is passed to the smoother object for further processing.
|
! it is passed to the smoother object for further processing.
|
||||||
! check - Sanity checks.
|
! check - Sanity checks.
|
||||||
! sizeof - Total memory occupation in bytes
|
! sizeof - Total memory occupation in bytes
|
||||||
! get_nzeros - Number of nonzeros
|
! get_nzeros - Number of nonzeros
|
||||||
! get_wrksz - How many workspace vector does apply_vect need
|
! get_wrksz - How many workspace vector does apply_vect need
|
||||||
! allocate_wrk - Allocate auxiliary workspace
|
! allocate_wrk - Allocate auxiliary workspace
|
||||||
! free_wrk - Free auxiliary workspace
|
! free_wrk - Free auxiliary workspace
|
||||||
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
||||||
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
||||||
|
!
|
||||||
!
|
!
|
||||||
!
|
|
||||||
type amg_dmlprec_wrk_type
|
type amg_dmlprec_wrk_type
|
||||||
real(psb_dpk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
real(psb_dpk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
||||||
type(psb_d_vect_type) :: vtx, vty, vx2l, vy2l
|
type(psb_d_vect_type) :: vtx, vty, vx2l, vy2l
|
||||||
@@ -148,10 +150,10 @@ module amg_d_onelev_mod
|
|||||||
procedure, pass(wk) :: clone => d_wrk_clone
|
procedure, pass(wk) :: clone => d_wrk_clone
|
||||||
procedure, pass(wk) :: move_alloc => d_wrk_move_alloc
|
procedure, pass(wk) :: move_alloc => d_wrk_move_alloc
|
||||||
procedure, pass(wk) :: cnv => d_wrk_cnv
|
procedure, pass(wk) :: cnv => d_wrk_cnv
|
||||||
procedure, pass(wk) :: sizeof => d_wrk_sizeof
|
procedure, pass(wk) :: sizeof => d_wrk_sizeof
|
||||||
end type amg_dmlprec_wrk_type
|
end type amg_dmlprec_wrk_type
|
||||||
private :: d_wrk_alloc, d_wrk_free, &
|
private :: d_wrk_alloc, d_wrk_free, &
|
||||||
& d_wrk_clone, d_wrk_move_alloc, d_wrk_cnv, d_wrk_sizeof
|
& d_wrk_clone, d_wrk_move_alloc, d_wrk_cnv, d_wrk_sizeof
|
||||||
|
|
||||||
type amg_d_remap_data_type
|
type amg_d_remap_data_type
|
||||||
type(psb_dspmat_type) :: ac_pre_remap
|
type(psb_dspmat_type) :: ac_pre_remap
|
||||||
@@ -161,19 +163,19 @@ module amg_d_onelev_mod
|
|||||||
contains
|
contains
|
||||||
procedure, pass(rmp) :: clone => d_remap_data_clone
|
procedure, pass(rmp) :: clone => d_remap_data_clone
|
||||||
end type amg_d_remap_data_type
|
end type amg_d_remap_data_type
|
||||||
|
|
||||||
type amg_d_onelev_type
|
type amg_d_onelev_type
|
||||||
class(amg_d_base_smoother_type), allocatable :: sm, sm2a
|
class(amg_d_base_smoother_type), allocatable :: sm, sm2a
|
||||||
class(amg_d_base_smoother_type), pointer :: sm2 => null()
|
class(amg_d_base_smoother_type), pointer :: sm2 => null()
|
||||||
class(amg_dmlprec_wrk_type), allocatable :: wrk
|
class(amg_dmlprec_wrk_type), allocatable :: wrk
|
||||||
class(amg_d_base_aggregator_type), allocatable :: aggr
|
class(amg_d_base_aggregator_type), allocatable :: aggr
|
||||||
type(amg_dml_parms) :: parms
|
type(amg_dml_parms) :: parms
|
||||||
type(psb_dspmat_type) :: ac
|
type(psb_dspmat_type) :: ac
|
||||||
integer(psb_ipk_) :: ac_nz_loc
|
integer(psb_ipk_) :: ac_nz_loc
|
||||||
integer(psb_lpk_) :: ac_nz_tot
|
integer(psb_lpk_) :: ac_nz_tot
|
||||||
type(psb_desc_type) :: desc_ac
|
type(psb_desc_type) :: desc_ac
|
||||||
type(psb_dspmat_type), pointer :: base_a => null()
|
type(psb_dspmat_type), pointer :: base_a => null()
|
||||||
type(psb_desc_type), pointer :: base_desc => null()
|
type(psb_desc_type), pointer :: base_desc => null()
|
||||||
type(psb_ldspmat_type) :: tprol
|
type(psb_ldspmat_type) :: tprol
|
||||||
type(psb_dlinmap_type) :: linmap
|
type(psb_dlinmap_type) :: linmap
|
||||||
type(amg_d_remap_data_type) :: remap_data
|
type(amg_d_remap_data_type) :: remap_data
|
||||||
@@ -197,7 +199,7 @@ module amg_d_onelev_mod
|
|||||||
procedure, pass(lv) :: setsm => amg_d_base_onelev_setsm
|
procedure, pass(lv) :: setsm => amg_d_base_onelev_setsm
|
||||||
procedure, pass(lv) :: setsv => amg_d_base_onelev_setsv
|
procedure, pass(lv) :: setsv => amg_d_base_onelev_setsv
|
||||||
procedure, pass(lv) :: setag => amg_d_base_onelev_setag
|
procedure, pass(lv) :: setag => amg_d_base_onelev_setag
|
||||||
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
||||||
procedure, pass(lv) :: sizeof => d_base_onelev_sizeof
|
procedure, pass(lv) :: sizeof => d_base_onelev_sizeof
|
||||||
procedure, pass(lv) :: get_nzeros => d_base_onelev_get_nzeros
|
procedure, pass(lv) :: get_nzeros => d_base_onelev_get_nzeros
|
||||||
procedure, pass(lv) :: get_wrksz => d_base_onelev_get_wrksize
|
procedure, pass(lv) :: get_wrksz => d_base_onelev_get_wrksize
|
||||||
@@ -205,8 +207,8 @@ module amg_d_onelev_mod
|
|||||||
procedure, pass(lv) :: free_wrk => d_base_onelev_free_wrk
|
procedure, pass(lv) :: free_wrk => d_base_onelev_free_wrk
|
||||||
procedure, nopass :: stringval => amg_stringval
|
procedure, nopass :: stringval => amg_stringval
|
||||||
procedure, pass(lv) :: move_alloc => d_base_onelev_move_alloc
|
procedure, pass(lv) :: move_alloc => d_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
procedure, pass(lv) :: map_rstr_a => amg_d_base_onelev_map_rstr_a
|
procedure, pass(lv) :: map_rstr_a => amg_d_base_onelev_map_rstr_a
|
||||||
procedure, pass(lv) :: map_prol_a => amg_d_base_onelev_map_prol_a
|
procedure, pass(lv) :: map_prol_a => amg_d_base_onelev_map_prol_a
|
||||||
procedure, pass(lv) :: map_rstr_v => amg_d_base_onelev_map_rstr_v
|
procedure, pass(lv) :: map_rstr_v => amg_d_base_onelev_map_rstr_v
|
||||||
@@ -226,11 +228,11 @@ module amg_d_onelev_mod
|
|||||||
& d_base_onelev_get_wrksize, d_base_onelev_allocate_wrk, &
|
& d_base_onelev_get_wrksize, d_base_onelev_allocate_wrk, &
|
||||||
& d_base_onelev_free_wrk
|
& d_base_onelev_free_wrk
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
subroutine amg_d_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
import :: psb_dspmat_type, psb_desc_type, psb_dpk_, psb_ipk_, psb_ldspmat_type, psb_lpk_
|
import :: psb_dspmat_type, psb_desc_type, psb_dpk_, psb_ipk_, psb_ldspmat_type, psb_lpk_
|
||||||
import :: amg_d_onelev_type
|
import :: amg_d_onelev_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), intent(inout), target :: lv
|
class(amg_d_onelev_type), intent(inout), target :: lv
|
||||||
type(psb_dspmat_type), intent(in) :: a
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
type(psb_desc_type), intent(inout) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
@@ -255,141 +257,142 @@ module amg_d_onelev_mod
|
|||||||
end subroutine amg_d_base_onelev_build
|
end subroutine amg_d_base_onelev_build
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_descr(lv,il,nl,ilmin,info,iout)
|
subroutine amg_d_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), intent(in) :: lv
|
class(amg_d_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_d_base_onelev_descr
|
end subroutine amg_d_base_onelev_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_cnv(lv,info,amold,vmold,imold)
|
subroutine amg_d_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||||
import :: amg_d_onelev_type, psb_d_base_vect_type, psb_dpk_, &
|
import :: amg_d_onelev_type, psb_d_base_vect_type, psb_dpk_, &
|
||||||
& psb_d_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
& psb_d_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_d_base_onelev_cnv
|
end subroutine amg_d_base_onelev_cnv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_free(lv,info)
|
subroutine amg_d_base_onelev_free(lv,info)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_d_base_onelev_free
|
end subroutine amg_d_base_onelev_free
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_check(lv,info)
|
subroutine amg_d_base_onelev_check(lv,info)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_d_base_onelev_check
|
end subroutine amg_d_base_onelev_check
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_setsm(lv,val,info,pos)
|
subroutine amg_d_base_onelev_setsm(lv,val,info,pos)
|
||||||
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_smoother_type, &
|
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_smoother_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_d_base_smoother_type), intent(in) :: val
|
class(amg_d_base_smoother_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_d_base_onelev_setsm
|
end subroutine amg_d_base_onelev_setsm
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_setsv(lv,val,info,pos)
|
subroutine amg_d_base_onelev_setsv(lv,val,info,pos)
|
||||||
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_solver_type, &
|
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_solver_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_d_base_solver_type), intent(in) :: val
|
class(amg_d_base_solver_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_d_base_onelev_setsv
|
end subroutine amg_d_base_onelev_setsv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_setag(lv,val,info,pos)
|
subroutine amg_d_base_onelev_setag(lv,val,info,pos)
|
||||||
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_aggregator_type, &
|
import :: psb_dpk_, amg_d_onelev_type, amg_d_base_aggregator_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_d_base_aggregator_type), intent(in) :: val
|
class(amg_d_base_aggregator_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_d_base_onelev_setag
|
end subroutine amg_d_base_onelev_setag
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_cseti(lv,what,val,info,pos,idx)
|
subroutine amg_d_base_onelev_cseti(lv,what,val,info,pos,idx)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_d_base_onelev_cseti
|
end subroutine amg_d_base_onelev_cseti
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
|
subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_d_base_onelev_csetc
|
end subroutine amg_d_base_onelev_csetc
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_csetr(lv,what,val,info,pos,idx)
|
subroutine amg_d_base_onelev_csetr(lv,what,val,info,pos,idx)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_dpk_), intent(in) :: val
|
real(psb_dpk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
@@ -397,13 +400,13 @@ interface
|
|||||||
end subroutine amg_d_base_onelev_csetr
|
end subroutine amg_d_base_onelev_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
||||||
& solver,tprol,global_num)
|
& solver,tprol,global_num)
|
||||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), intent(in) :: lv
|
class(amg_d_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -435,7 +438,7 @@ interface
|
|||||||
end subroutine amg_d_base_onelev_map_rstr_v
|
end subroutine amg_d_base_onelev_map_rstr_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_d_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
subroutine amg_d_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
||||||
import
|
import
|
||||||
implicit none
|
implicit none
|
||||||
@@ -458,15 +461,15 @@ interface
|
|||||||
type(psb_d_vect_type), optional, target, intent(inout) :: vtx,vty
|
type(psb_d_vect_type), optional, target, intent(inout) :: vtx,vty
|
||||||
end subroutine amg_d_base_onelev_map_prol_v
|
end subroutine amg_d_base_onelev_map_prol_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
! Function returning the size of the amg_prec_type data structure
|
! Function returning the size of the amg_prec_type data structure
|
||||||
! in bytes or in number of nonzeros of the operator(s) involved.
|
! in bytes or in number of nonzeros of the operator(s) involved.
|
||||||
!
|
!
|
||||||
|
|
||||||
function d_base_onelev_get_nzeros(lv) result(val)
|
function d_base_onelev_get_nzeros(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), intent(in) :: lv
|
class(amg_d_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -478,16 +481,16 @@ contains
|
|||||||
end function d_base_onelev_get_nzeros
|
end function d_base_onelev_get_nzeros
|
||||||
|
|
||||||
function d_base_onelev_sizeof(lv) result(val)
|
function d_base_onelev_sizeof(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), intent(in) :: lv
|
class(amg_d_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
val = psb_sizeof_ip+psb_sizeof_lp
|
val = psb_sizeof_ip+psb_sizeof_lp
|
||||||
val = val + lv%desc_ac%sizeof()
|
val = val + lv%desc_ac%sizeof()
|
||||||
val = val + lv%ac%sizeof()
|
val = val + lv%ac%sizeof()
|
||||||
val = val + lv%tprol%sizeof()
|
val = val + lv%tprol%sizeof()
|
||||||
val = val + lv%linmap%sizeof()
|
val = val + lv%linmap%sizeof()
|
||||||
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
||||||
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
||||||
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
||||||
@@ -496,19 +499,19 @@ contains
|
|||||||
|
|
||||||
|
|
||||||
subroutine d_base_onelev_nullify(lv)
|
subroutine d_base_onelev_nullify(lv)
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
|
|
||||||
nullify(lv%base_a)
|
nullify(lv%base_a)
|
||||||
nullify(lv%base_desc)
|
nullify(lv%base_desc)
|
||||||
nullify(lv%sm2)
|
nullify(lv%sm2)
|
||||||
end subroutine d_base_onelev_nullify
|
end subroutine d_base_onelev_nullify
|
||||||
|
|
||||||
!
|
!
|
||||||
! Multilevel defaults:
|
! Multilevel defaults:
|
||||||
! multiplicative vs. additive ML framework;
|
! multiplicative vs. additive ML framework;
|
||||||
! Smoothed decoupled aggregation with zero threshold;
|
! Smoothed decoupled aggregation with zero threshold;
|
||||||
! distributed coarse matrix;
|
! distributed coarse matrix;
|
||||||
! damping omega computed with the max-norm estimate of the
|
! damping omega computed with the max-norm estimate of the
|
||||||
! dominant eigenvalue;
|
! dominant eigenvalue;
|
||||||
@@ -518,10 +521,10 @@ contains
|
|||||||
subroutine d_base_onelev_default(lv)
|
subroutine d_base_onelev_default(lv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: info
|
integer(psb_ipk_) :: info
|
||||||
|
|
||||||
lv%parms%sweeps_pre = 1
|
lv%parms%sweeps_pre = 1
|
||||||
lv%parms%sweeps_post = 1
|
lv%parms%sweeps_post = 1
|
||||||
@@ -536,7 +539,7 @@ contains
|
|||||||
lv%parms%aggr_filter = amg_no_filter_mat_
|
lv%parms%aggr_filter = amg_no_filter_mat_
|
||||||
lv%parms%aggr_omega_val = dzero
|
lv%parms%aggr_omega_val = dzero
|
||||||
lv%parms%aggr_thresh = 0.01_psb_dpk_
|
lv%parms%aggr_thresh = 0.01_psb_dpk_
|
||||||
|
|
||||||
if (allocated(lv%sm)) call lv%sm%default()
|
if (allocated(lv%sm)) call lv%sm%default()
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm2a%default()
|
call lv%sm2a%default()
|
||||||
@@ -546,7 +549,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
if (.not.allocated(lv%aggr)) allocate(amg_d_dec_aggregator_type :: lv%aggr,stat=info)
|
if (.not.allocated(lv%aggr)) allocate(amg_d_dec_aggregator_type :: lv%aggr,stat=info)
|
||||||
if (allocated(lv%aggr)) call lv%aggr%default()
|
if (allocated(lv%aggr)) call lv%aggr%default()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine d_base_onelev_default
|
end subroutine d_base_onelev_default
|
||||||
@@ -561,9 +564,9 @@ contains
|
|||||||
type(psb_ldspmat_type), intent(out) :: t_prol
|
type(psb_ldspmat_type), intent(out) :: t_prol
|
||||||
type(amg_daggr_data), intent(in) :: ag_data
|
type(amg_daggr_data), intent(in) :: ag_data
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
|
|
||||||
end subroutine d_base_onelev_bld_tprol
|
end subroutine d_base_onelev_bld_tprol
|
||||||
|
|
||||||
|
|
||||||
@@ -573,7 +576,7 @@ contains
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%update_next(lvnext%aggr,info)
|
call lv%aggr%update_next(lvnext%aggr,info)
|
||||||
|
|
||||||
end subroutine d_base_onelev_update_aggr
|
end subroutine d_base_onelev_update_aggr
|
||||||
|
|
||||||
|
|
||||||
@@ -582,33 +585,33 @@ contains
|
|||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lvout
|
class(amg_d_onelev_type), target, intent(inout) :: lvout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
if (allocated(lv%sm)) then
|
if (allocated(lv%sm)) then
|
||||||
call lv%sm%clone(lvout%sm,info)
|
call lv%sm%clone(lvout%sm,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm)) then
|
if (allocated(lvout%sm)) then
|
||||||
call lvout%sm%free(info)
|
call lvout%sm%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm%clone(lvout%sm2a,info)
|
call lv%sm%clone(lvout%sm2a,info)
|
||||||
lvout%sm2 => lvout%sm2a
|
lvout%sm2 => lvout%sm2a
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm2a)) then
|
if (allocated(lvout%sm2a)) then
|
||||||
call lvout%sm2a%free(info)
|
call lvout%sm2a%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
||||||
end if
|
end if
|
||||||
lvout%sm2 => lvout%sm
|
lvout%sm2 => lvout%sm
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%aggr)) then
|
if (allocated(lv%aggr)) then
|
||||||
call lv%aggr%clone(lvout%aggr,info)
|
call lv%aggr%clone(lvout%aggr,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%aggr)) then
|
if (allocated(lvout%aggr)) then
|
||||||
call lvout%aggr%free(info)
|
call lvout%aggr%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
||||||
end if
|
end if
|
||||||
@@ -621,7 +624,7 @@ contains
|
|||||||
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
||||||
lvout%base_a => lv%base_a
|
lvout%base_a => lv%base_a
|
||||||
lvout%base_desc => lv%base_desc
|
lvout%base_desc => lv%base_desc
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine d_base_onelev_clone
|
end subroutine d_base_onelev_clone
|
||||||
@@ -630,12 +633,12 @@ contains
|
|||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv, b
|
class(amg_d_onelev_type), target, intent(inout) :: lv, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
b%parms = lv%parms
|
b%parms = lv%parms
|
||||||
b%szratio = lv%szratio
|
b%szratio = lv%szratio
|
||||||
if (associated(lv%sm2,lv%sm2a)) then
|
if (associated(lv%sm2,lv%sm2a)) then
|
||||||
call move_alloc(lv%sm,b%sm)
|
call move_alloc(lv%sm,b%sm)
|
||||||
call move_alloc(lv%sm2a,b%sm2a)
|
call move_alloc(lv%sm2a,b%sm2a)
|
||||||
b%sm2 =>b%sm2a
|
b%sm2 =>b%sm2a
|
||||||
@@ -646,18 +649,18 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
call move_alloc(lv%aggr,b%aggr)
|
call move_alloc(lv%aggr,b%aggr)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
||||||
b%base_a => lv%base_a
|
b%base_a => lv%base_a
|
||||||
b%base_desc => lv%base_desc
|
b%base_desc => lv%base_desc
|
||||||
|
|
||||||
end subroutine d_base_onelev_move_alloc
|
end subroutine d_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
function d_base_onelev_get_wrksize(lv) result(val)
|
function d_base_onelev_get_wrksize(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), intent(inout) :: lv
|
class(amg_d_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: val
|
integer(psb_ipk_) :: val
|
||||||
|
|
||||||
@@ -678,26 +681,26 @@ contains
|
|||||||
select case(lv%parms%ml_cycle)
|
select case(lv%parms%ml_cycle)
|
||||||
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
||||||
! We're good
|
! We're good
|
||||||
|
|
||||||
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
||||||
!
|
!
|
||||||
! We need 7 in inneritkcycle.
|
! We need 7 in inneritkcycle.
|
||||||
! Can we reuse vtx?
|
! Can we reuse vtx?
|
||||||
!
|
!
|
||||||
val = val + 7
|
val = val + 7
|
||||||
|
|
||||||
case default
|
case default
|
||||||
! Need a better error signaling ?
|
! Need a better error signaling ?
|
||||||
val = -1
|
val = -1
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end function d_base_onelev_get_wrksize
|
end function d_base_onelev_get_wrksize
|
||||||
|
|
||||||
subroutine d_base_onelev_allocate_wrk(lv,info,vmold)
|
subroutine d_base_onelev_allocate_wrk(lv,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv, i
|
integer(psb_ipk_) :: nwv, i
|
||||||
@@ -710,22 +713,22 @@ contains
|
|||||||
! Need to fix this, we need two different allocations
|
! Need to fix this, we need two different allocations
|
||||||
!
|
!
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
||||||
& desc2=lv%remap_data%desc_ac_pre_remap)
|
& desc2=lv%remap_data%desc_ac_pre_remap)
|
||||||
else
|
else
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine d_base_onelev_allocate_wrk
|
end subroutine d_base_onelev_allocate_wrk
|
||||||
|
|
||||||
|
|
||||||
subroutine d_base_onelev_free_wrk(lv,info)
|
subroutine d_base_onelev_free_wrk(lv,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_d_onelev_type), target, intent(inout) :: lv
|
class(amg_d_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv,i
|
integer(psb_ipk_) :: nwv,i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
if (allocated(lv%wrk)) then
|
if (allocated(lv%wrk)) then
|
||||||
@@ -733,17 +736,17 @@ contains
|
|||||||
if (info == 0) deallocate(lv%wrk,stat=info)
|
if (info == 0) deallocate(lv%wrk,stat=info)
|
||||||
end if
|
end if
|
||||||
end subroutine d_base_onelev_free_wrk
|
end subroutine d_base_onelev_free_wrk
|
||||||
|
|
||||||
subroutine d_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
subroutine d_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(in) :: nwv
|
integer(psb_ipk_), intent(in) :: nwv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
type(psb_desc_type), intent(in), optional :: desc2
|
type(psb_desc_type), intent(in), optional :: desc2
|
||||||
!
|
!
|
||||||
@@ -807,14 +810,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end subroutine d_wrk_alloc
|
end subroutine d_wrk_alloc
|
||||||
|
|
||||||
subroutine d_wrk_free(wk,info)
|
subroutine d_wrk_free(wk,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -835,7 +838,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine d_wrk_free
|
end subroutine d_wrk_free
|
||||||
|
|
||||||
subroutine d_wrk_clone(wk,wkout,info)
|
subroutine d_wrk_clone(wk,wkout,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
Implicit None
|
Implicit None
|
||||||
@@ -843,11 +846,11 @@ contains
|
|||||||
! Arguments
|
! Arguments
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wkout
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wkout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
||||||
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
||||||
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
||||||
@@ -869,12 +872,12 @@ contains
|
|||||||
return
|
return
|
||||||
|
|
||||||
end subroutine d_wrk_clone
|
end subroutine d_wrk_clone
|
||||||
|
|
||||||
subroutine d_wrk_move_alloc(wk, b,info)
|
subroutine d_wrk_move_alloc(wk, b,info)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk, b
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
call move_alloc(wk%tx,b%tx)
|
call move_alloc(wk%tx,b%tx)
|
||||||
call move_alloc(wk%ty,b%ty)
|
call move_alloc(wk%ty,b%ty)
|
||||||
@@ -887,17 +890,17 @@ contains
|
|||||||
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
||||||
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
||||||
call move_alloc(wk%wv,b%wv)
|
call move_alloc(wk%wv,b%wv)
|
||||||
|
|
||||||
end subroutine d_wrk_move_alloc
|
end subroutine d_wrk_move_alloc
|
||||||
|
|
||||||
subroutine d_wrk_cnv(wk,info,vmold)
|
subroutine d_wrk_cnv(wk,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_dmlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -918,7 +921,7 @@ contains
|
|||||||
|
|
||||||
function d_wrk_sizeof(wk) result(val)
|
function d_wrk_sizeof(wk) result(val)
|
||||||
use psb_realloc_mod
|
use psb_realloc_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_dmlprec_wrk_type), intent(in) :: wk
|
class(amg_dmlprec_wrk_type), intent(in) :: wk
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer :: i
|
integer :: i
|
||||||
@@ -937,14 +940,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end function d_wrk_sizeof
|
end function d_wrk_sizeof
|
||||||
|
|
||||||
subroutine d_remap_data_clone(rmp, remap_out, info)
|
subroutine d_remap_data_clone(rmp, remap_out, info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_d_remap_data_type), target, intent(inout) :: rmp
|
class(amg_d_remap_data_type), target, intent(inout) :: rmp
|
||||||
class(amg_d_remap_data_type), target, intent(inout) :: remap_out
|
class(amg_d_remap_data_type), target, intent(inout) :: remap_out
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
@@ -955,7 +958,7 @@ contains
|
|||||||
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
||||||
remap_out%idest = rmp%idest
|
remap_out%idest = rmp%idest
|
||||||
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
||||||
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
||||||
end subroutine d_remap_data_clone
|
end subroutine d_remap_data_clone
|
||||||
|
|
||||||
end module amg_d_onelev_mod
|
end module amg_d_onelev_mod
|
||||||
|
|||||||
@@ -0,0 +1,682 @@
|
|||||||
|
!
|
||||||
|
!
|
||||||
|
! AMG4PSBLAS version 1.0
|
||||||
|
! Algebraic Multigrid Package
|
||||||
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
|
!
|
||||||
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
! moved here from amg4psblas-extension
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! AMG4PSBLAS Extensions
|
||||||
|
!
|
||||||
|
! (C) Copyright 2019
|
||||||
|
!
|
||||||
|
! Salvatore Filippone Cranfield University
|
||||||
|
! Pasqua D'Ambra IAC-CNR, Naples, IT
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! The aggregator object hosts the aggregation method for building
|
||||||
|
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||||
|
! presented in
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! sm - class(amg_T_base_smoother_type), allocatable
|
||||||
|
! The current level preconditioner (aka smoother).
|
||||||
|
! parms - type(amg_RTml_parms)
|
||||||
|
! The parameters defining the multilevel strategy.
|
||||||
|
! ac - The local part of the current-level matrix, built by
|
||||||
|
! coarsening the previous-level matrix.
|
||||||
|
! desc_ac - type(psb_desc_type).
|
||||||
|
! The communication descriptor associated to the matrix
|
||||||
|
! stored in ac.
|
||||||
|
! base_a - type(psb_Tspmat_type), pointer.
|
||||||
|
! Pointer (really a pointer!) to the local part of the current
|
||||||
|
! matrix (so we have a unified treatment of residuals).
|
||||||
|
! We need this to avoid passing explicitly the current matrix
|
||||||
|
! to the routine which applies the preconditioner.
|
||||||
|
! base_desc - type(psb_desc_type), pointer.
|
||||||
|
! Pointer to the communication descriptor associated to the
|
||||||
|
! matrix pointed by base_a.
|
||||||
|
! map - Stores the maps (restriction and prolongation) between the
|
||||||
|
! vector spaces associated to the index spaces of the previous
|
||||||
|
! and current levels.
|
||||||
|
!
|
||||||
|
! Methods:
|
||||||
|
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||||
|
! is appropriate for the current object, then call the corresponding method for
|
||||||
|
! the contained object.
|
||||||
|
! As an example: the descr() method prints out a description of the
|
||||||
|
! level. It starts by invoking the descr() method of the parms object,
|
||||||
|
! then calls the descr() method of the smoother object.
|
||||||
|
!
|
||||||
|
! descr - Prints a description of the object.
|
||||||
|
! default - Set default values
|
||||||
|
! dump - Dump to file object contents
|
||||||
|
! set - Sets various parameters; when a request is unknown
|
||||||
|
! it is passed to the smoother object for further processing.
|
||||||
|
! check - Sanity checks.
|
||||||
|
! sizeof - Total memory occupation in bytes
|
||||||
|
! get_nzeros - Number of nonzeros
|
||||||
|
!
|
||||||
|
!
|
||||||
|
|
||||||
|
module amg_d_parmatch_aggregator_mod
|
||||||
|
use amg_d_base_aggregator_mod
|
||||||
|
use amg_d_matchboxp_mod
|
||||||
|
#if defined(SERIAL_MPI)
|
||||||
|
type, extends(amg_d_base_aggregator_type) :: amg_d_parmatch_aggregator_type
|
||||||
|
end type amg_d_parmatch_aggregator_type
|
||||||
|
#else
|
||||||
|
type, extends(amg_d_base_aggregator_type) :: amg_d_parmatch_aggregator_type
|
||||||
|
integer(psb_ipk_) :: matching_alg
|
||||||
|
integer(psb_ipk_) :: n_sweeps ! When n_sweeps >1 we need an auxiliary descriptor
|
||||||
|
integer(psb_ipk_) :: orig_aggr_size
|
||||||
|
integer(psb_ipk_) :: jacobi_sweeps
|
||||||
|
real(psb_dpk_), allocatable :: w(:), w_nxt(:)
|
||||||
|
type(psb_dspmat_type), allocatable :: prol, restr
|
||||||
|
type(psb_dspmat_type), allocatable :: ac, base_a, rwa
|
||||||
|
type(psb_desc_type), allocatable :: desc_ac, desc_ax, base_desc, rwdesc
|
||||||
|
logical :: reproducible_matching = .false.
|
||||||
|
logical :: need_symmetrize = .false.
|
||||||
|
logical :: unsmoothed_hierarchy = .true.
|
||||||
|
contains
|
||||||
|
procedure, pass(ag) :: bld_tprol => amg_d_parmatch_aggregator_build_tprol
|
||||||
|
procedure, pass(ag) :: mat_bld => amg_d_parmatch_aggregator_mat_bld
|
||||||
|
procedure, pass(ag) :: mat_asb => amg_d_parmatch_aggregator_mat_asb
|
||||||
|
procedure, pass(ag) :: inner_mat_asb => amg_d_parmatch_aggregator_inner_mat_asb
|
||||||
|
procedure, pass(ag) :: bld_map => amg_d_parmatch_aggregator_bld_map
|
||||||
|
procedure, pass(ag) :: csetc => amg_d_parmatch_aggr_csetc
|
||||||
|
procedure, pass(ag) :: cseti => amg_d_parmatch_aggr_cseti
|
||||||
|
procedure, pass(ag) :: default => amg_d_parmatch_aggr_set_default
|
||||||
|
procedure, pass(ag) :: sizeof => amg_d_parmatch_aggregator_sizeof
|
||||||
|
procedure, pass(ag) :: update_next => amg_d_parmatch_aggregator_update_next
|
||||||
|
procedure, pass(ag) :: bld_wnxt => amg_d_parmatch_bld_wnxt
|
||||||
|
procedure, pass(ag) :: bld_default_w => amg_d_bld_default_w
|
||||||
|
procedure, pass(ag) :: set_c_default_w => amg_d_set_prm_c_default_w
|
||||||
|
procedure, pass(ag) :: descr => amg_d_parmatch_aggregator_descr
|
||||||
|
procedure, pass(ag) :: clone => amg_d_parmatch_aggregator_clone
|
||||||
|
procedure, pass(ag) :: free => amg_d_parmatch_aggregator_free
|
||||||
|
procedure, nopass :: fmt => amg_d_parmatch_aggregator_fmt
|
||||||
|
procedure, nopass :: xt_desc => amg_d_parmatch_aggregator_xt_desc
|
||||||
|
end type amg_d_parmatch_aggregator_type
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||||
|
& a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(amg_daggr_data), intent(in) :: ag_data
|
||||||
|
type(psb_dspmat_type), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||||
|
type(psb_ldspmat_type), intent(out) :: t_prol
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_aggregator_build_tprol
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_aggregator_mat_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||||
|
& ac,desc_ac, op_prol,op_restr,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_aggregator_mat_asb
|
||||||
|
end interface
|
||||||
|
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||||
|
& ac,desc_ac, op_prol,op_restr,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(in) :: desc_a
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,op_restr
|
||||||
|
type(psb_dspmat_type), intent(inout) :: ac
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_aggregator_inner_mat_asb
|
||||||
|
end interface
|
||||||
|
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(inout) :: ac, op_prol, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_spmm_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_unsmth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_unsmth_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_smth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_dspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_smth_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||||
|
implicit none
|
||||||
|
type(psb_dspmat_type), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_spmm_bld_ov
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_d_parmatch_spmm_bld_inner(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_d_parmatch_aggregator_type, psb_desc_type, psb_dspmat_type,&
|
||||||
|
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data,&
|
||||||
|
& psb_d_csr_sparse_mat, psb_ld_csr_sparse_mat
|
||||||
|
implicit none
|
||||||
|
type(psb_d_csr_sparse_mat), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
|
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_d_parmatch_spmm_bld_inner
|
||||||
|
end interface
|
||||||
|
|
||||||
|
private :: is_legal_malg, is_legal_csize, is_legal_nsweeps, is_legal_nlevels
|
||||||
|
|
||||||
|
contains
|
||||||
|
|
||||||
|
subroutine amg_d_bld_default_w(ag,nr)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_ipk_), intent(in) :: nr
|
||||||
|
integer(psb_ipk_) :: info
|
||||||
|
call psb_realloc(nr,ag%w,info)
|
||||||
|
if (info /= psb_success_) return
|
||||||
|
ag%w = done
|
||||||
|
!call ag%set_c_default_w()
|
||||||
|
end subroutine amg_d_bld_default_w
|
||||||
|
|
||||||
|
subroutine amg_d_set_prm_c_default_w(ag)
|
||||||
|
use psb_realloc_mod
|
||||||
|
use iso_c_binding
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_ipk_) :: info
|
||||||
|
|
||||||
|
!write(0,*) 'prm_c_deafult_w '
|
||||||
|
call psb_safe_ab_cpy(ag%w,ag%w_nxt,info)
|
||||||
|
|
||||||
|
end subroutine amg_d_set_prm_c_default_w
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_lpk_), intent(in) :: ilaggr(:)
|
||||||
|
real(psb_dpk_), intent(in) :: valaggr(:)
|
||||||
|
integer(psb_ipk_), intent(in) :: nx
|
||||||
|
|
||||||
|
integer(psb_ipk_) :: info,i,j
|
||||||
|
|
||||||
|
! The vector was already fixed in the call to BCMatch.
|
||||||
|
!write(0,*) 'Executing bld_wnxt ',nx
|
||||||
|
call psb_realloc(nx,ag%w_nxt,info)
|
||||||
|
|
||||||
|
end subroutine amg_d_parmatch_bld_wnxt
|
||||||
|
|
||||||
|
function amg_d_parmatch_aggregator_fmt() result(val)
|
||||||
|
implicit none
|
||||||
|
character(len=32) :: val
|
||||||
|
|
||||||
|
val = "Parallel Matching aggregation"
|
||||||
|
end function amg_d_parmatch_aggregator_fmt
|
||||||
|
|
||||||
|
function amg_d_parmatch_aggregator_xt_desc() result(val)
|
||||||
|
implicit none
|
||||||
|
logical :: val
|
||||||
|
|
||||||
|
val = .true.
|
||||||
|
end function amg_d_parmatch_aggregator_xt_desc
|
||||||
|
|
||||||
|
function amg_d_parmatch_aggregator_sizeof(ag) result(val)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(in) :: ag
|
||||||
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
|
val = 4
|
||||||
|
val = val + psb_size(ag%w) + psb_size(ag%w_nxt)
|
||||||
|
if (allocated(ag%ac)) val = val + ag%ac%sizeof()
|
||||||
|
if (allocated(ag%base_a)) val = val + ag%base_a%sizeof()
|
||||||
|
if (allocated(ag%prol)) val = val + ag%prol%sizeof()
|
||||||
|
if (allocated(ag%restr)) val = val + ag%restr%sizeof()
|
||||||
|
if (allocated(ag%desc_ac)) val = val + ag%desc_ac%sizeof()
|
||||||
|
if (allocated(ag%base_desc)) val = val + ag%base_desc%sizeof()
|
||||||
|
if (allocated(ag%desc_ax)) val = val + ag%desc_ax%sizeof()
|
||||||
|
|
||||||
|
end function amg_d_parmatch_aggregator_sizeof
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggregator_descr(ag,parms,iout,info)
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(in) :: ag
|
||||||
|
type(amg_dml_parms), intent(in) :: parms
|
||||||
|
integer(psb_ipk_), intent(in) :: iout
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
write(iout,*) 'Parallel Matching Aggregator'
|
||||||
|
write(iout,*) ' Number of matching sweeps: ',ag%n_sweeps
|
||||||
|
write(iout,*) ' Matching algorithm : MatchBoxP (PREIS)'
|
||||||
|
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||||
|
call parms%mldescr(iout,info)
|
||||||
|
|
||||||
|
return
|
||||||
|
end subroutine amg_d_parmatch_aggregator_descr
|
||||||
|
|
||||||
|
function is_legal_malg(alg) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: alg
|
||||||
|
|
||||||
|
val = (0==alg)
|
||||||
|
end function is_legal_malg
|
||||||
|
|
||||||
|
function is_legal_csize(csize) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: csize
|
||||||
|
|
||||||
|
val = ((-1==csize).or.(csize >0))
|
||||||
|
end function is_legal_csize
|
||||||
|
|
||||||
|
function is_legal_nsweeps(nsw) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: nsw
|
||||||
|
|
||||||
|
val = (1<=nsw)
|
||||||
|
end function is_legal_nsweeps
|
||||||
|
|
||||||
|
function is_legal_nlevels(nlv) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: nlv
|
||||||
|
|
||||||
|
val = (1<=nlv)
|
||||||
|
end function is_legal_nlevels
|
||||||
|
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggregator_update_next(ag,agnext,info)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
class(amg_d_base_aggregator_type), target, intent(inout) :: agnext
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
!
|
||||||
|
!
|
||||||
|
select type(agnext)
|
||||||
|
class is (amg_d_parmatch_aggregator_type)
|
||||||
|
if (.not.is_legal_malg(agnext%matching_alg)) &
|
||||||
|
& agnext%matching_alg = ag%matching_alg
|
||||||
|
if (.not.is_legal_nsweeps(agnext%n_sweeps))&
|
||||||
|
& agnext%n_sweeps = ag%n_sweeps
|
||||||
|
!!$ if (.not.is_legal_csize(agnext%max_csize))&
|
||||||
|
!!$ & agnext%max_csize = ag%max_csize
|
||||||
|
!!$ if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||||
|
!!$ & agnext%max_nlevels = ag%max_nlevels
|
||||||
|
! Is this going to generate shallow copies/memory leaks/double frees?
|
||||||
|
! To be investigated further.
|
||||||
|
call psb_safe_ab_cpy(ag%w_nxt,agnext%w,info)
|
||||||
|
call agnext%set_c_default_w()
|
||||||
|
if (ag%unsmoothed_hierarchy) then
|
||||||
|
agnext%unsmoothed_hierarchy = .true.
|
||||||
|
call move_alloc(ag%rwdesc,agnext%base_desc)
|
||||||
|
call move_alloc(ag%rwa,agnext%base_a)
|
||||||
|
end if
|
||||||
|
|
||||||
|
class default
|
||||||
|
! What should we do here?
|
||||||
|
end select
|
||||||
|
info = 0
|
||||||
|
end subroutine amg_d_parmatch_aggregator_update_next
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=*), intent(in) :: what
|
||||||
|
character(len=*), intent(in) :: val
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
|
integer(psb_ipk_) :: err_act, iwhat
|
||||||
|
character(len=20) :: name='d_parmatch_aggr_cseti'
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
! For now we ignore IDX
|
||||||
|
|
||||||
|
select case(psb_toupper(trim(what)))
|
||||||
|
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('F','FALSE')
|
||||||
|
ag%reproducible_matching = .false.
|
||||||
|
case('REPRODUCIBLE','TRUE','T')
|
||||||
|
ag%reproducible_matching =.true.
|
||||||
|
end select
|
||||||
|
case('PRMC_NEED_SYMMETRIZE')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('FALSE','F')
|
||||||
|
ag%need_symmetrize = .false.
|
||||||
|
case('SYMMETRIZE','TRUE','T')
|
||||||
|
ag%need_symmetrize =.true.
|
||||||
|
end select
|
||||||
|
case('PRMC_UNSMOOTHED_HIERARCHY')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('F','FALSE')
|
||||||
|
ag%unsmoothed_hierarchy = .false.
|
||||||
|
case('T','TRUE')
|
||||||
|
ag%unsmoothed_hierarchy =.true.
|
||||||
|
end select
|
||||||
|
case default
|
||||||
|
! Do nothing
|
||||||
|
end select
|
||||||
|
return
|
||||||
|
end subroutine amg_d_parmatch_aggr_csetc
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=*), intent(in) :: what
|
||||||
|
integer(psb_ipk_), intent(in) :: val
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
|
integer(psb_ipk_) :: err_act, iwhat
|
||||||
|
character(len=20) :: name='d_parmatch_aggr_cseti'
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
! For now we ignore IDX
|
||||||
|
|
||||||
|
select case(psb_toupper(trim(what)))
|
||||||
|
case('PRMC_MATCH_ALG')
|
||||||
|
ag%matching_alg=val
|
||||||
|
case('PRMC_SWEEPS')
|
||||||
|
ag%n_sweeps=val
|
||||||
|
case('AGGR_SIZE')
|
||||||
|
ag%orig_aggr_size = val
|
||||||
|
ag%n_sweeps=max(1,ceiling(log(val*1.0)/log(2.0)))
|
||||||
|
case('PRMC_W_SIZE')
|
||||||
|
call ag%bld_default_w(val)
|
||||||
|
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||||
|
ag%reproducible_matching = (val == 1)
|
||||||
|
case('PRMC_NEED_SYMMETRIZE')
|
||||||
|
ag%need_symmetrize = (val == 1)
|
||||||
|
case('PRMC_UNSMOOTHED_HIERARCHY')
|
||||||
|
ag%unsmoothed_hierarchy = (val == 1)
|
||||||
|
case default
|
||||||
|
! Do nothing
|
||||||
|
end select
|
||||||
|
return
|
||||||
|
end subroutine amg_d_parmatch_aggr_cseti
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggr_set_default(ag)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=20) :: name='d_parmatch_aggr_set_default'
|
||||||
|
call ag%amg_d_base_aggregator_type%default()
|
||||||
|
ag%matching_alg = 0
|
||||||
|
ag%n_sweeps = 1
|
||||||
|
ag%jacobi_sweeps = 0
|
||||||
|
!!$ ag%max_nlevels = 36
|
||||||
|
!!$ ag%max_csize = -1
|
||||||
|
!
|
||||||
|
! Apparently BootCMatch works better
|
||||||
|
! by keeping all entries
|
||||||
|
!
|
||||||
|
ag%do_clean_zeros = .false.
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
end subroutine amg_d_parmatch_aggr_set_default
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggregator_free(ag,info)
|
||||||
|
use iso_c_binding
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
info = 0
|
||||||
|
if ((info == 0).and.allocated(ag%w)) deallocate(ag%w,stat=info)
|
||||||
|
if ((info == 0).and.allocated(ag%w_nxt)) deallocate(ag%w_nxt,stat=info)
|
||||||
|
if ((info == 0).and.allocated(ag%prol)) then
|
||||||
|
call ag%prol%free(); deallocate(ag%prol,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%restr)) then
|
||||||
|
call ag%restr%free(); deallocate(ag%restr,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%ac)) then
|
||||||
|
call ag%ac%free(); deallocate(ag%ac,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%base_a)) then
|
||||||
|
call ag%base_a%free(); deallocate(ag%base_a,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%rwa)) then
|
||||||
|
call ag%rwa%free(); deallocate(ag%rwa,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%desc_ac)) then
|
||||||
|
call ag%desc_ac%free(info); deallocate(ag%desc_ac,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%desc_ax)) then
|
||||||
|
call ag%desc_ax%free(info); deallocate(ag%desc_ax,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%base_desc)) then
|
||||||
|
call ag%base_desc%free(info); deallocate(ag%base_desc,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%rwdesc)) then
|
||||||
|
call ag%rwdesc%free(info); deallocate(ag%rwdesc,stat=info)
|
||||||
|
end if
|
||||||
|
|
||||||
|
end subroutine amg_d_parmatch_aggregator_free
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggregator_clone(ag,agnext,info)
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
class(amg_d_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
info = 0
|
||||||
|
if (allocated(agnext)) then
|
||||||
|
call agnext%free(info)
|
||||||
|
if (info == 0) deallocate(agnext,stat=info)
|
||||||
|
end if
|
||||||
|
if (info /= 0) return
|
||||||
|
allocate(agnext,source=ag,stat=info)
|
||||||
|
select type(agnext)
|
||||||
|
class is (amg_d_parmatch_aggregator_type)
|
||||||
|
call agnext%set_c_default_w()
|
||||||
|
class default
|
||||||
|
! Should never ever get here
|
||||||
|
info = -1
|
||||||
|
end select
|
||||||
|
end subroutine amg_d_parmatch_aggregator_clone
|
||||||
|
|
||||||
|
subroutine amg_d_parmatch_aggregator_bld_map(ag,desc_a,desc_ac,ilaggr,nlaggr,&
|
||||||
|
& op_restr,op_prol,map,info)
|
||||||
|
use psb_base_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_desc_type), intent(in), target :: desc_a, desc_ac
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(psb_dspmat_type), intent(inout) :: op_prol, op_restr
|
||||||
|
type(psb_dlinmap_type), intent(out) :: map
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_) :: err_act
|
||||||
|
character(len=20) :: name='d_parmatch_aggregator_bld_map'
|
||||||
|
|
||||||
|
call psb_erractionsave(err_act)
|
||||||
|
!
|
||||||
|
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||||
|
! op_restr => PR^T i.e. restriction operator
|
||||||
|
! op_prol => PR i.e. prolongation operator
|
||||||
|
!
|
||||||
|
! For parmatch have an explicit copy of the descriptors
|
||||||
|
!
|
||||||
|
if (allocated(ag%desc_ax)) then
|
||||||
|
!!$ write(0,*) 'Building linmap with ag%desc_ax ',ag%desc_ax%get_local_rows(),ag%desc_ax%get_local_cols(),&
|
||||||
|
!!$ & desc_ac%get_local_rows(),desc_ac%get_local_cols()
|
||||||
|
map = psb_linmap(psb_map_gen_linear_,ag%desc_ax,&
|
||||||
|
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||||
|
else
|
||||||
|
map = psb_linmap(psb_map_gen_linear_,desc_a,&
|
||||||
|
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||||
|
end if
|
||||||
|
if(info /= psb_success_) then
|
||||||
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
|
||||||
|
call psb_erractionrestore(err_act)
|
||||||
|
return
|
||||||
|
|
||||||
|
9999 call psb_error_handler(err_act)
|
||||||
|
|
||||||
|
return
|
||||||
|
end subroutine amg_d_parmatch_aggregator_bld_map
|
||||||
|
#endif
|
||||||
|
end module amg_d_parmatch_aggregator_mod
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
! Module: amg_d_prec_mod
|
! Module: amg_d_prec_mod
|
||||||
!
|
!
|
||||||
! This module defines the user interfaces to the real/complex, single/double
|
! This module defines the user interfaces to the real/complex, single/double
|
||||||
! precision versions of the user-level MLD2P4 routines.
|
! precision versions of the user-level AMG4PSBLAS routines.
|
||||||
!
|
!
|
||||||
module amg_d_prec_mod
|
module amg_d_prec_mod
|
||||||
|
|
||||||
@@ -55,12 +55,7 @@ module amg_d_prec_mod
|
|||||||
use amg_d_ainv_solver
|
use amg_d_ainv_solver
|
||||||
use amg_d_invk_solver
|
use amg_d_invk_solver
|
||||||
use amg_d_invt_solver
|
use amg_d_invt_solver
|
||||||
|
use amg_d_krm_solver
|
||||||
interface amg_precset
|
|
||||||
module procedure amg_d_iprecsetsm, amg_d_iprecsetsv, &
|
|
||||||
& amg_d_cprecseti, amg_d_cprecsetc, amg_d_cprecsetr, &
|
|
||||||
& amg_d_iprecsetag
|
|
||||||
end interface amg_precset
|
|
||||||
|
|
||||||
interface amg_extprol_bld
|
interface amg_extprol_bld
|
||||||
subroutine amg_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
subroutine amg_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
||||||
@@ -82,61 +77,4 @@ module amg_d_prec_mod
|
|||||||
end subroutine amg_d_extprol_bld
|
end subroutine amg_d_extprol_bld
|
||||||
end interface amg_extprol_bld
|
end interface amg_extprol_bld
|
||||||
|
|
||||||
contains
|
|
||||||
|
|
||||||
subroutine amg_d_iprecsetsm(p,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
class(amg_d_base_smoother_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(val,info,pos=pos)
|
|
||||||
end subroutine amg_d_iprecsetsm
|
|
||||||
|
|
||||||
subroutine amg_d_iprecsetsv(p,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
class(amg_d_base_solver_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_d_iprecsetsv
|
|
||||||
|
|
||||||
subroutine amg_d_iprecsetag(p,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
class(amg_d_base_aggregator_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_d_iprecsetag
|
|
||||||
|
|
||||||
subroutine amg_d_cprecseti(p,what,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_d_cprecseti
|
|
||||||
|
|
||||||
subroutine amg_d_cprecsetr(p,what,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
real(psb_dpk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_d_cprecsetr
|
|
||||||
|
|
||||||
subroutine amg_d_cprecsetc(p,what,val,info,pos)
|
|
||||||
type(amg_dprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
character(len=*), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_d_cprecsetc
|
|
||||||
|
|
||||||
end module amg_d_prec_mod
|
end module amg_d_prec_mod
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -66,7 +66,7 @@ module amg_d_prec_type
|
|||||||
!
|
!
|
||||||
! This is the data type containing all the information about the multilevel
|
! This is the data type containing all the information about the multilevel
|
||||||
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
||||||
! single/double precision version of MLD2P4).
|
! single/double precision version of AMG4PSBLAS).
|
||||||
! It consists of an array of 'one-level' intermediate data structures
|
! It consists of an array of 'one-level' intermediate data structures
|
||||||
! of type amg_donelev_type, each containing the information needed to apply
|
! of type amg_donelev_type, each containing the information needed to apply
|
||||||
! the smoothing and the coarse-space correction at a generic level. RT is the
|
! the smoothing and the coarse-space correction at a generic level. RT is the
|
||||||
@@ -155,13 +155,15 @@ module amg_d_prec_type
|
|||||||
|
|
||||||
|
|
||||||
interface amg_precdescr
|
interface amg_precdescr
|
||||||
subroutine amg_dfile_prec_descr(prec,iout,root)
|
subroutine amg_dfile_prec_descr(prec,info,iout,root,verbosity)
|
||||||
import :: amg_dprec_type, psb_ipk_
|
import :: amg_dprec_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_dprec_type), intent(in) :: prec
|
class(amg_dprec_type), intent(in) :: prec
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_dfile_prec_descr
|
end subroutine amg_dfile_prec_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
@@ -424,11 +426,22 @@ contains
|
|||||||
end if
|
end if
|
||||||
end function amg_d_get_nzeros
|
end function amg_d_get_nzeros
|
||||||
|
|
||||||
function amg_dprec_sizeof(prec) result(val)
|
function amg_dprec_sizeof(prec, global) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_dprec_type), intent(in) :: prec
|
class(amg_dprec_type), intent(in) :: prec
|
||||||
integer(psb_epk_) :: val
|
logical, intent(in), optional :: global
|
||||||
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
type(psb_ctxt_type) :: ctxt
|
||||||
|
|
||||||
|
logical :: global_
|
||||||
|
|
||||||
|
if (present(global)) then
|
||||||
|
global_ = global
|
||||||
|
else
|
||||||
|
global_ = .false.
|
||||||
|
end if
|
||||||
|
|
||||||
val = 0
|
val = 0
|
||||||
val = val + psb_sizeof_ip
|
val = val + psb_sizeof_ip
|
||||||
if (allocated(prec%precv)) then
|
if (allocated(prec%precv)) then
|
||||||
@@ -436,6 +449,11 @@ contains
|
|||||||
val = val + prec%precv(i)%sizeof()
|
val = val + prec%precv(i)%sizeof()
|
||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
|
if (global_) then
|
||||||
|
ctxt = prec%ctxt
|
||||||
|
call psb_sum(ctxt,val)
|
||||||
|
end if
|
||||||
|
|
||||||
end function amg_dprec_sizeof
|
end function amg_dprec_sizeof
|
||||||
|
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -52,7 +52,7 @@ module amg_d_sludist_solver
|
|||||||
use iso_c_binding
|
use iso_c_binding
|
||||||
use amg_d_base_solver_mod
|
use amg_d_base_solver_mod
|
||||||
|
|
||||||
#if defined(LPK8)
|
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
|
||||||
|
|
||||||
type, extends(amg_d_base_solver_type) :: amg_d_sludist_solver_type
|
type, extends(amg_d_base_solver_type) :: amg_d_sludist_solver_type
|
||||||
|
|
||||||
@@ -270,11 +270,13 @@ contains
|
|||||||
! Local variables
|
! Local variables
|
||||||
type(psb_dspmat_type) :: atmp
|
type(psb_dspmat_type) :: atmp
|
||||||
type(psb_d_csr_sparse_mat) :: acsr
|
type(psb_d_csr_sparse_mat) :: acsr
|
||||||
integer :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
integer(psb_lpk_), allocatable :: gia(:), gja(:)
|
||||||
integer :: ifrst, ibcheck
|
|
||||||
type(psb_ctxt_type) :: ctxt
|
type(psb_ctxt_type) :: ctxt
|
||||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
integer(psb_lpk_) :: lfrst
|
||||||
character(len=20) :: name='d_sludist_solver_bld', ch_err
|
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
||||||
|
integer(psb_ipk_) :: ifrst, ibcheck
|
||||||
|
integer(psb_ipk_) :: np,me,i, err_act, debug_unit, debug_level
|
||||||
|
character(len=20) :: name='d_sludist_solver_bld', ch_err
|
||||||
|
|
||||||
info=psb_success_
|
info=psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
@@ -293,19 +295,37 @@ contains
|
|||||||
n_col = desc_a%get_local_cols()
|
n_col = desc_a%get_local_cols()
|
||||||
nglob = desc_a%get_global_rows()
|
nglob = desc_a%get_global_rows()
|
||||||
|
|
||||||
call a%cscnv(atmp,info,type='coo')
|
!
|
||||||
|
! Strategy here is as follows: because a call to SLUDIST
|
||||||
|
! as a gobal solver is mostly done at the coarsest level,
|
||||||
|
! even if we start from a problem requiring 8 bytes, chances
|
||||||
|
! are that the global size will be suitable for 4 bytes
|
||||||
|
! anyway, so we hope for the best, and throw an error
|
||||||
|
! if something goes wrong.
|
||||||
|
!
|
||||||
|
if (nglob > huge(1_psb_ipk_)) then
|
||||||
|
write(0,*) me,' ',trim(name),': Error: overflow of local indices '
|
||||||
|
info=psb_err_internal_error_
|
||||||
|
call psb_errpush(info,name)
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
|
||||||
|
call a%cscnv(atmp,info,type='csr')
|
||||||
|
! This in case we are dealing with AS
|
||||||
call psb_rwextd(n_row,atmp,info,b=b)
|
call psb_rwextd(n_row,atmp,info,b=b)
|
||||||
call atmp%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
|
||||||
call atmp%mv_to(acsr)
|
call atmp%mv_to(acsr)
|
||||||
nrow_a = acsr%get_nrows()
|
nrow_a = acsr%get_nrows()
|
||||||
nztota = acsr%get_nzeros()
|
nztota = acsr%get_nzeros()
|
||||||
|
call psb_loc_to_glob(ione,lfrst,desc_a,info)
|
||||||
|
|
||||||
! Fix the entries to call C-base SuperLU
|
! Fix the entries to call C-base SuperLU
|
||||||
call psb_loc_to_glob(1,ifrst,desc_a,info)
|
call psb_realloc(nztota,gja,info)
|
||||||
call psb_loc_to_glob(nrow_a,ibcheck,desc_a,info)
|
call psb_loc_to_glob(acsr%ja(1:nztota),gja(1:nztota), desc_a, info, iact='I')
|
||||||
call psb_loc_to_glob(acsr%ja(1:nztota),desc_a,info,iact='I')
|
acsr%ja(1:nztota) = gja(1:nztota)
|
||||||
acsr%ja(:) = acsr%ja(:) - 1
|
acsr%ja(:) = acsr%ja(:) - 1
|
||||||
acsr%irp(:) = acsr%irp(:) - 1
|
acsr%irp(:) = acsr%irp(:) - 1
|
||||||
ifrst = ifrst - 1
|
ifrst = lfrst - 1
|
||||||
|
|
||||||
info = amg_dsludist_fact(nglob,nrow_a,nztota,ifrst,&
|
info = amg_dsludist_fact(nglob,nrow_a,nztota,ifrst,&
|
||||||
& acsr%val,acsr%irp,acsr%ja,sv%lufactors,&
|
& acsr%val,acsr%irp,acsr%ja,sv%lufactors,&
|
||||||
& npr,npc)
|
& npr,npc)
|
||||||
@@ -318,7 +338,6 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
call acsr%free()
|
call acsr%free()
|
||||||
call atmp%free()
|
|
||||||
|
|
||||||
if (debug_level >= psb_debug_outer_) &
|
if (debug_level >= psb_debug_outer_) &
|
||||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
! Module: amg_prec_mod
|
! Module: amg_prec_mod
|
||||||
!
|
!
|
||||||
! This module defines the interfaces to the real/complex, single/double
|
! This module defines the interfaces to the real/complex, single/double
|
||||||
! precision versions of the user-level MLD2P4 routines.
|
! precision versions of the user-level AMG4PSBLAS routines.
|
||||||
!
|
!
|
||||||
module amg_prec_mod
|
module amg_prec_mod
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -58,10 +61,9 @@ module amg_s_ainv_solver
|
|||||||
procedure, pass(sv) :: cseti => amg_s_ainv_solver_cseti
|
procedure, pass(sv) :: cseti => amg_s_ainv_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => amg_s_ainv_solver_csetc
|
procedure, pass(sv) :: csetc => amg_s_ainv_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => amg_s_ainv_solver_csetr
|
procedure, pass(sv) :: csetr => amg_s_ainv_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_s_ainv_solver_seti
|
!!$ procedure, pass(sv) :: seti => amg_s_ainv_solver_seti
|
||||||
procedure, pass(sv) :: setc => amg_s_ainv_solver_setc
|
!!$ procedure, pass(sv) :: setc => amg_s_ainv_solver_setc
|
||||||
procedure, pass(sv) :: setr => amg_s_ainv_solver_setr
|
!!$ procedure, pass(sv) :: setr => amg_s_ainv_solver_setr
|
||||||
generic, public :: set => seti, setr, setc
|
|
||||||
procedure, pass(sv) :: descr => amg_s_ainv_solver_descr
|
procedure, pass(sv) :: descr => amg_s_ainv_solver_descr
|
||||||
procedure, pass(sv) :: default => s_ainv_solver_default
|
procedure, pass(sv) :: default => s_ainv_solver_default
|
||||||
procedure, nopass :: stringval => s_ainv_stringval
|
procedure, nopass :: stringval => s_ainv_stringval
|
||||||
@@ -159,41 +161,41 @@ module amg_s_ainv_solver
|
|||||||
end subroutine amg_s_ainv_solver_csetr
|
end subroutine amg_s_ainv_solver_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_s_ainv_solver_setc(sv,what,val,info)
|
!!$ subroutine amg_s_ainv_solver_setc(sv,what,val,info)
|
||||||
import :: amg_s_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_s_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_s_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_s_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
!!$ character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_s_ainv_solver_setc
|
!!$ end subroutine amg_s_ainv_solver_setc
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_s_ainv_solver_seti(sv,what,val,info)
|
!!$ subroutine amg_s_ainv_solver_seti(sv,what,val,info)
|
||||||
import :: amg_s_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_s_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_s_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_s_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
!!$ integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_s_ainv_solver_seti
|
!!$ end subroutine amg_s_ainv_solver_seti
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_s_ainv_solver_setr(sv,what,val,info)
|
!!$ subroutine amg_s_ainv_solver_setr(sv,what,val,info)
|
||||||
import :: amg_s_ainv_solver_type, psb_ipk_, psb_spk_
|
!!$ import :: amg_s_ainv_solver_type, psb_ipk_, psb_spk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_s_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_s_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
!!$ real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_s_ainv_solver_setr
|
!!$ end subroutine amg_s_ainv_solver_setr
|
||||||
end interface
|
!!$ end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_ainv_solver_descr(sv,info,iout,coarse)
|
subroutine amg_s_ainv_solver_descr(sv,info,iout,coarse)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -126,7 +126,7 @@ module amg_s_base_aggregator_mod
|
|||||||
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_sml_parms), intent(inout) :: parms
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
@@ -144,7 +144,7 @@ module amg_s_base_aggregator_mod
|
|||||||
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_sml_parms), intent(inout) :: parms
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
!
|
!
|
||||||
! Module: amg_inner_mod
|
! Module: amg_inner_mod
|
||||||
!
|
!
|
||||||
! This module defines the interfaces to inner MLD2P4 routines.
|
! This module defines the interfaces to inner AMG4PSBLAS routines.
|
||||||
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
! The interfaces of the user level routines are defined in amg_prec_mod.f90.
|
||||||
!
|
!
|
||||||
module amg_s_inner_mod
|
module amg_s_inner_mod
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -51,8 +54,6 @@ module amg_s_invk_solver
|
|||||||
procedure, pass(sv) :: clone => amg_s_invk_solver_clone
|
procedure, pass(sv) :: clone => amg_s_invk_solver_clone
|
||||||
procedure, pass(sv) :: build => amg_s_invk_solver_bld
|
procedure, pass(sv) :: build => amg_s_invk_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_s_invk_solver_cseti
|
procedure, pass(sv) :: cseti => amg_s_invk_solver_cseti
|
||||||
procedure, pass(sv) :: seti => amg_s_invk_solver_seti
|
|
||||||
generic, public :: set => seti
|
|
||||||
procedure, pass(sv) :: descr => amg_s_invk_solver_descr
|
procedure, pass(sv) :: descr => amg_s_invk_solver_descr
|
||||||
procedure, pass(sv) :: default => s_invk_solver_default
|
procedure, pass(sv) :: default => s_invk_solver_default
|
||||||
end type amg_s_invk_solver_type
|
end type amg_s_invk_solver_type
|
||||||
@@ -136,18 +137,6 @@ module amg_s_invk_solver
|
|||||||
end subroutine amg_s_invk_solver_descr
|
end subroutine amg_s_invk_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_s_invk_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_s_invk_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_s_invk_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_s_invk_solver_seti
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine s_invk_solver_default(sv)
|
subroutine s_invk_solver_default(sv)
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -52,9 +55,6 @@ module amg_s_invt_solver
|
|||||||
procedure, pass(sv) :: build => amg_s_invt_solver_bld
|
procedure, pass(sv) :: build => amg_s_invt_solver_bld
|
||||||
procedure, pass(sv) :: cseti => amg_s_invt_solver_cseti
|
procedure, pass(sv) :: cseti => amg_s_invt_solver_cseti
|
||||||
procedure, pass(sv) :: csetr => amg_s_invt_solver_csetr
|
procedure, pass(sv) :: csetr => amg_s_invt_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_s_invt_solver_seti
|
|
||||||
procedure, pass(sv) :: setr => amg_s_invt_solver_setr
|
|
||||||
generic, public :: set => seti, setr
|
|
||||||
procedure, pass(sv) :: descr => amg_s_invt_solver_descr
|
procedure, pass(sv) :: descr => amg_s_invt_solver_descr
|
||||||
procedure, pass(sv) :: default => s_invt_solver_default
|
procedure, pass(sv) :: default => s_invt_solver_default
|
||||||
end type amg_s_invt_solver_type
|
end type amg_s_invt_solver_type
|
||||||
@@ -148,30 +148,6 @@ module amg_s_invt_solver
|
|||||||
end subroutine amg_s_invt_solver_descr
|
end subroutine amg_s_invt_solver_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_s_invt_solver_setr(sv,what,val,info)
|
|
||||||
import :: amg_s_invt_solver_type, psb_spk_, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_s_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
real(psb_spk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine amg_s_invt_solver_setr
|
|
||||||
end interface
|
|
||||||
|
|
||||||
interface
|
|
||||||
subroutine amg_s_invt_solver_seti(sv,what,val,info)
|
|
||||||
import :: amg_s_invt_solver_type, psb_ipk_
|
|
||||||
Implicit none
|
|
||||||
! Arguments
|
|
||||||
class(amg_s_invt_solver_type), intent(inout) :: sv
|
|
||||||
integer(psb_ipk_), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
end subroutine
|
|
||||||
end interface
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
subroutine s_invt_solver_default(sv)
|
subroutine s_invt_solver_default(sv)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
@@ -52,14 +55,14 @@
|
|||||||
! 2. Redistributions in binary form must reproduce the above copyright
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
! notice, this list of conditions, and the following disclaimer in the
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
! documentation and/or other materials provided with the distribution.
|
! documentation and/or other materials provided with the distribution.
|
||||||
! 3. The name of the MLD2P4 group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
@@ -70,16 +73,16 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_s_rkr_solver_mod.f90
|
! File: amg_s_krm_solver_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_s_rkr_solver_mod
|
! Module: amg_s_krm_solver_mod
|
||||||
!
|
!
|
||||||
module amg_s_rkr_solver
|
module amg_s_krm_solver
|
||||||
|
|
||||||
use amg_s_base_solver_mod
|
use amg_s_base_solver_mod
|
||||||
use amg_s_prec_type
|
use amg_s_prec_type
|
||||||
|
|
||||||
type, extends(amg_s_base_solver_type) :: amg_s_rkr_solver_type
|
type, extends(amg_s_base_solver_type) :: amg_s_krm_solver_type
|
||||||
!
|
!
|
||||||
logical :: global
|
logical :: global
|
||||||
character(len=16) :: method, kprec, sub_solve
|
character(len=16) :: method, kprec, sub_solve
|
||||||
@@ -94,46 +97,46 @@ module amg_s_rkr_solver
|
|||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: dump => s_rkr_solver_dmp
|
procedure, pass(sv) :: dump => s_krm_solver_dmp
|
||||||
procedure, pass(sv) :: check => s_rkr_solver_check
|
procedure, pass(sv) :: check => s_krm_solver_check
|
||||||
procedure, pass(sv) :: clone => s_rkr_solver_clone
|
procedure, pass(sv) :: clone => s_krm_solver_clone
|
||||||
procedure, pass(sv) :: clone_settings => s_rkr_solver_clone_settings
|
procedure, pass(sv) :: clone_settings => s_krm_solver_clone_settings
|
||||||
procedure, pass(sv) :: cnv => s_rkr_solver_cnv
|
procedure, pass(sv) :: cnv => s_krm_solver_cnv
|
||||||
procedure, pass(sv) :: apply_v => amg_s_rkr_solver_apply_vect
|
procedure, pass(sv) :: apply_v => amg_s_krm_solver_apply_vect
|
||||||
procedure, pass(sv) :: apply_a => amg_s_rkr_solver_apply
|
procedure, pass(sv) :: apply_a => amg_s_krm_solver_apply
|
||||||
procedure, pass(sv) :: clear_data => s_rkr_solver_clear_data
|
procedure, pass(sv) :: clear_data => s_krm_solver_clear_data
|
||||||
procedure, pass(sv) :: free => s_rkr_solver_free
|
procedure, pass(sv) :: free => s_krm_solver_free
|
||||||
procedure, pass(sv) :: cseti => s_rkr_solver_cseti
|
procedure, pass(sv) :: cseti => s_krm_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => s_rkr_solver_csetc
|
procedure, pass(sv) :: csetc => s_krm_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => s_rkr_solver_csetr
|
procedure, pass(sv) :: csetr => s_krm_solver_csetr
|
||||||
procedure, pass(sv) :: sizeof => s_rkr_solver_sizeof
|
procedure, pass(sv) :: sizeof => s_krm_solver_sizeof
|
||||||
procedure, pass(sv) :: get_nzeros => s_rkr_solver_get_nzeros
|
procedure, pass(sv) :: get_nzeros => s_krm_solver_get_nzeros
|
||||||
!procedure, nopass :: get_id => s_rkr_solver_get_id
|
!procedure, nopass :: get_id => s_krm_solver_get_id
|
||||||
procedure, pass(sv) :: is_global => s_rkr_solver_is_global
|
procedure, pass(sv) :: is_global => s_krm_solver_is_global
|
||||||
procedure, nopass :: is_iterative => s_rkr_solver_is_iterative
|
procedure, nopass :: is_iterative => s_krm_solver_is_iterative
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
! These methods are specific for the new solver type
|
! These methods are specific for the new solver type
|
||||||
! and therefore need to be overridden
|
! and therefore need to be overridden
|
||||||
!
|
!
|
||||||
procedure, pass(sv) :: descr => s_rkr_solver_descr
|
procedure, pass(sv) :: descr => s_krm_solver_descr
|
||||||
procedure, pass(sv) :: default => s_rkr_solver_default
|
procedure, pass(sv) :: default => s_krm_solver_default
|
||||||
procedure, pass(sv) :: build => amg_s_rkr_solver_bld
|
procedure, pass(sv) :: build => amg_s_krm_solver_bld
|
||||||
procedure, nopass :: get_fmt => s_rkr_solver_get_fmt
|
procedure, nopass :: get_fmt => s_krm_solver_get_fmt
|
||||||
end type amg_s_rkr_solver_type
|
end type amg_s_krm_solver_type
|
||||||
|
|
||||||
|
|
||||||
private :: s_rkr_solver_get_fmt, s_rkr_solver_descr, s_rkr_solver_default
|
private :: s_krm_solver_get_fmt, s_krm_solver_descr, s_krm_solver_default
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_rkr_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_s_krm_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,wv,info,init,initu)
|
& trans,work,wv,info,init,initu)
|
||||||
import :: psb_desc_type, amg_s_rkr_solver_type, psb_s_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_s_krm_solver_type, psb_s_vect_type, psb_spk_, &
|
||||||
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type, psb_ipk_
|
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
type(psb_s_vect_type),intent(inout) :: x
|
type(psb_s_vect_type),intent(inout) :: x
|
||||||
type(psb_s_vect_type),intent(inout) :: y
|
type(psb_s_vect_type),intent(inout) :: y
|
||||||
real(psb_spk_),intent(in) :: alpha,beta
|
real(psb_spk_),intent(in) :: alpha,beta
|
||||||
@@ -143,17 +146,17 @@ module amg_s_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
type(psb_s_vect_type),intent(inout), optional :: initu
|
type(psb_s_vect_type),intent(inout), optional :: initu
|
||||||
end subroutine amg_s_rkr_solver_apply_vect
|
end subroutine amg_s_krm_solver_apply_vect
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_rkr_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
subroutine amg_s_krm_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||||
& trans,work,info,init,initu)
|
& trans,work,info,init,initu)
|
||||||
import :: psb_desc_type, amg_s_rkr_solver_type, psb_s_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_s_krm_solver_type, psb_s_vect_type, psb_spk_, &
|
||||||
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type, psb_ipk_
|
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_desc_type), intent(in) :: desc_data
|
type(psb_desc_type), intent(in) :: desc_data
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
real(psb_spk_),intent(inout) :: x(:)
|
real(psb_spk_),intent(inout) :: x(:)
|
||||||
real(psb_spk_),intent(inout) :: y(:)
|
real(psb_spk_),intent(inout) :: y(:)
|
||||||
real(psb_spk_),intent(in) :: alpha,beta
|
real(psb_spk_),intent(in) :: alpha,beta
|
||||||
@@ -162,24 +165,24 @@ module amg_s_rkr_solver
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character, intent(in), optional :: init
|
character, intent(in), optional :: init
|
||||||
real(psb_spk_),intent(inout), optional :: initu(:)
|
real(psb_spk_),intent(inout), optional :: initu(:)
|
||||||
end subroutine amg_s_rkr_solver_apply
|
end subroutine amg_s_krm_solver_apply
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_rkr_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
subroutine amg_s_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||||
import :: psb_desc_type, amg_s_rkr_solver_type, psb_s_vect_type, psb_spk_, &
|
import :: psb_desc_type, amg_s_krm_solver_type, psb_s_vect_type, psb_spk_, &
|
||||||
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type,&
|
& psb_sspmat_type, psb_s_base_sparse_mat, psb_s_base_vect_type,&
|
||||||
& psb_ipk_, psb_i_base_vect_type
|
& psb_ipk_, psb_i_base_vect_type
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_sspmat_type), intent(in), target :: a
|
type(psb_sspmat_type), intent(in), target :: a
|
||||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
type(psb_sspmat_type), intent(in), target, optional :: b
|
type(psb_sspmat_type), intent(in), target, optional :: b
|
||||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_s_rkr_solver_bld
|
end subroutine amg_s_krm_solver_bld
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
|
|
||||||
@@ -187,12 +190,12 @@ contains
|
|||||||
|
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
subroutine s_rkr_solver_default(sv)
|
subroutine s_krm_solver_default(sv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
|
|
||||||
sv%method = 'bicgstab'
|
sv%method = 'bicgstab'
|
||||||
sv%kprec = 'bjac'
|
sv%kprec = 'bjac'
|
||||||
@@ -207,42 +210,42 @@ contains
|
|||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_default
|
end subroutine s_krm_solver_default
|
||||||
|
|
||||||
function s_rkr_solver_get_nzeros(sv) result(val)
|
function s_krm_solver_get_nzeros(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(in) :: sv
|
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%get_nzeros()
|
val = sv%prec%get_nzeros()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function s_rkr_solver_get_nzeros
|
end function s_krm_solver_get_nzeros
|
||||||
|
|
||||||
function s_rkr_solver_sizeof(sv) result(val)
|
function s_krm_solver_sizeof(sv) result(val)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(in) :: sv
|
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
val = sv%prec%sizeof() + sv%desc_local%sizeof() + sv%a_local%sizeof()
|
||||||
|
|
||||||
return
|
return
|
||||||
end function s_rkr_solver_sizeof
|
end function s_krm_solver_sizeof
|
||||||
|
|
||||||
|
|
||||||
subroutine s_rkr_solver_check(sv,info)
|
subroutine s_krm_solver_check(sv,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='s_rkr_solver_check'
|
character(len=20) :: name='s_krm_solver_check'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -256,36 +259,36 @@ contains
|
|||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine s_rkr_solver_check
|
end subroutine s_krm_solver_check
|
||||||
|
|
||||||
subroutine s_rkr_solver_cseti(sv,what,val,info,idx)
|
subroutine s_krm_solver_cseti(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='s_rkr_solver_cseti'
|
character(len=20) :: name='s_krm_solver_cseti'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_IRST')
|
case('KRM_IRST')
|
||||||
sv%irst = val
|
sv%irst = val
|
||||||
case('RKR_ISTOPC')
|
case('KRM_ISTOPC')
|
||||||
sv%istopc = val
|
sv%istopc = val
|
||||||
case('RKR_ITMAX')
|
case('KRM_ITMAX')
|
||||||
sv%itmax = val
|
sv%itmax = val
|
||||||
case('RKR_ITRACE')
|
case('KRM_ITRACE')
|
||||||
sv%itrace = val
|
sv%itrace = val
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%i_sub_solve = val
|
sv%i_sub_solve = val
|
||||||
case('RKR_FILLIN')
|
case('KRM_FILLIN')
|
||||||
sv%fillin = val
|
sv%fillin = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_s_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_s_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -296,33 +299,33 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_cseti
|
end subroutine s_krm_solver_cseti
|
||||||
|
|
||||||
subroutine s_rkr_solver_csetc(sv,what,val,info,idx)
|
subroutine s_krm_solver_csetc(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act, ival
|
integer(psb_ipk_) :: err_act, ival
|
||||||
character(len=20) :: name='s_rkr_solver_csetc'
|
character(len=20) :: name='s_krm_solver_csetc'
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
|
|
||||||
|
|
||||||
select case(psb_toupper(trim(what)))
|
select case(psb_toupper(trim(what)))
|
||||||
case('RKR_METHOD')
|
case('KRM_METHOD')
|
||||||
sv%method = psb_toupper(trim(val))
|
sv%method = psb_toupper(trim(val))
|
||||||
case('RKR_KPREC')
|
case('KRM_KPREC')
|
||||||
sv%kprec = psb_toupper(trim(val))
|
sv%kprec = psb_toupper(trim(val))
|
||||||
case('RKR_SUB_SOLVE')
|
case('KRM_SUB_SOLVE')
|
||||||
sv%sub_solve = psb_toupper(trim(val))
|
sv%sub_solve = psb_toupper(trim(val))
|
||||||
case('RKR_GLOBAL')
|
case('KRM_GLOBAL')
|
||||||
select case(psb_toupper(trim(val)))
|
select case(psb_toupper(trim(val)))
|
||||||
case('LOCAL','FALSE')
|
case('LOCAL','FALSE')
|
||||||
sv%global = .false.
|
sv%global = .false.
|
||||||
@@ -345,26 +348,26 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_csetc
|
end subroutine s_krm_solver_csetc
|
||||||
|
|
||||||
subroutine s_rkr_solver_csetr(sv,what,val,info,idx)
|
subroutine s_krm_solver_csetr(sv,what,val,info,idx)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20) :: name='s_rkr_solver_csetr'
|
character(len=20) :: name='s_krm_solver_csetr'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select case(psb_toupper(what))
|
select case(psb_toupper(what))
|
||||||
case('RKR_EPS')
|
case('KRM_EPS')
|
||||||
sv%eps = val
|
sv%eps = val
|
||||||
case default
|
case default
|
||||||
call sv%amg_s_base_solver_type%set(what,val,info,idx=idx)
|
call sv%amg_s_base_solver_type%set(what,val,info,idx=idx)
|
||||||
@@ -375,18 +378,18 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_csetr
|
end subroutine s_krm_solver_csetr
|
||||||
|
|
||||||
subroutine s_rkr_solver_clear_data(sv,info)
|
subroutine s_krm_solver_clear_data(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='s_rkr_solver_free'
|
character(len=20) :: name='s_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -403,19 +406,19 @@ contains
|
|||||||
nullify(sv%a)
|
nullify(sv%a)
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_clear_data
|
end subroutine s_krm_solver_clear_data
|
||||||
|
|
||||||
|
|
||||||
subroutine s_rkr_solver_free(sv,info)
|
subroutine s_krm_solver_free(sv,info)
|
||||||
use psb_base_mod, only : psb_exit
|
use psb_base_mod, only : psb_exit
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
type(psb_ctxt_type) :: l_ctxt
|
type(psb_ctxt_type) :: l_ctxt
|
||||||
character(len=20) :: name='s_rkr_solver_free'
|
character(len=20) :: name='s_krm_solver_free'
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -424,28 +427,28 @@ contains
|
|||||||
|
|
||||||
call psb_erractionrestore(err_act)
|
call psb_erractionrestore(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_free
|
end subroutine s_krm_solver_free
|
||||||
|
|
||||||
function s_rkr_solver_get_fmt() result(val)
|
function s_krm_solver_get_fmt() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
character(len=32) :: val
|
character(len=32) :: val
|
||||||
|
|
||||||
val = "RKR solver"
|
val = "KRM solver"
|
||||||
end function s_rkr_solver_get_fmt
|
end function s_krm_solver_get_fmt
|
||||||
|
|
||||||
subroutine s_rkr_solver_descr(sv,info,iout,coarse)
|
subroutine s_krm_solver_descr(sv,info,iout,coarse)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(in) :: sv
|
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
logical, intent(in), optional :: coarse
|
logical, intent(in), optional :: coarse
|
||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
integer(psb_ipk_) :: err_act
|
integer(psb_ipk_) :: err_act
|
||||||
character(len=20), parameter :: name='amg_s_rkr_solver_descr'
|
character(len=20), parameter :: name='amg_s_krm_solver_descr'
|
||||||
integer(psb_ipk_) :: iout_
|
integer(psb_ipk_) :: iout_
|
||||||
|
|
||||||
call psb_erractionsave(err_act)
|
call psb_erractionsave(err_act)
|
||||||
@@ -457,9 +460,9 @@ contains
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if (sv%global) then
|
if (sv%global) then
|
||||||
write(iout_,*) ' Recursive Krylov solver (global)'
|
write(iout_,*) ' Krylov solver (global)'
|
||||||
else
|
else
|
||||||
write(iout_,*) ' Recursive Krylov solver (local) '
|
write(iout_,*) ' Krylov solver (local) '
|
||||||
end if
|
end if
|
||||||
write(iout_,*) ' method: ',sv%method
|
write(iout_,*) ' method: ',sv%method
|
||||||
write(iout_,*) ' kprec: ',sv%kprec
|
write(iout_,*) ' kprec: ',sv%kprec
|
||||||
@@ -478,11 +481,11 @@ contains
|
|||||||
|
|
||||||
9999 call psb_error_handler(err_act)
|
9999 call psb_error_handler(err_act)
|
||||||
return
|
return
|
||||||
end subroutine s_rkr_solver_descr
|
end subroutine s_krm_solver_descr
|
||||||
|
|
||||||
subroutine s_rkr_solver_cnv(sv,info,amold,vmold,imold)
|
subroutine s_krm_solver_cnv(sv,info,amold,vmold,imold)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
@@ -490,13 +493,13 @@ contains
|
|||||||
|
|
||||||
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
call sv%prec%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||||
|
|
||||||
end subroutine s_rkr_solver_cnv
|
end subroutine s_krm_solver_cnv
|
||||||
|
|
||||||
subroutine s_rkr_solver_clone(sv,svout,info)
|
subroutine s_krm_solver_clone(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_s_base_solver_type), allocatable, intent(inout) :: svout
|
class(amg_s_base_solver_type), allocatable, intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
@@ -505,7 +508,7 @@ contains
|
|||||||
call svout%free(info)
|
call svout%free(info)
|
||||||
allocate(svout,stat=info,mold=sv)
|
allocate(svout,stat=info,mold=sv)
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_s_rkr_solver_type)
|
class is(amg_s_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -524,21 +527,21 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine s_rkr_solver_clone
|
end subroutine s_krm_solver_clone
|
||||||
|
|
||||||
|
|
||||||
subroutine s_rkr_solver_clone_settings(sv,svout,info)
|
subroutine s_krm_solver_clone_settings(sv,svout,info)
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_rkr_solver_type), intent(inout) :: sv
|
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||||
class(amg_s_base_solver_type), intent(inout) :: svout
|
class(amg_s_base_solver_type), intent(inout) :: svout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
select type(so=>svout)
|
select type(so=>svout)
|
||||||
class is(amg_s_rkr_solver_type)
|
class is(amg_s_krm_solver_type)
|
||||||
so%method = sv%method
|
so%method = sv%method
|
||||||
so%kprec = sv%kprec
|
so%kprec = sv%kprec
|
||||||
so%sub_solve = sv%sub_solve
|
so%sub_solve = sv%sub_solve
|
||||||
@@ -554,11 +557,11 @@ contains
|
|||||||
info = psb_err_internal_error_
|
info = psb_err_internal_error_
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine s_rkr_solver_clone_settings
|
end subroutine s_krm_solver_clone_settings
|
||||||
|
|
||||||
subroutine s_rkr_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
subroutine s_krm_solver_dmp(sv,desc,level,info,prefix,head,solver,global_num)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_rkr_solver_type), intent(in) :: sv
|
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -568,23 +571,23 @@ contains
|
|||||||
|
|
||||||
call sv%prec%dump(info,prefix=prefix,head=head)
|
call sv%prec%dump(info,prefix=prefix,head=head)
|
||||||
|
|
||||||
end subroutine s_rkr_solver_dmp
|
end subroutine s_krm_solver_dmp
|
||||||
!
|
!
|
||||||
! Notify whether RKR is used as a global solver
|
! Notify whether KRM is used as a global solver
|
||||||
!
|
!
|
||||||
function s_rkr_solver_is_global(sv) result(val)
|
function s_krm_solver_is_global(sv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_rkr_solver_type), intent(in) :: sv
|
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = (sv%global)
|
val = (sv%global)
|
||||||
end function s_rkr_solver_is_global
|
end function s_krm_solver_is_global
|
||||||
!
|
!
|
||||||
function s_rkr_solver_is_iterative() result(val)
|
function s_krm_solver_is_iterative() result(val)
|
||||||
implicit none
|
implicit none
|
||||||
logical :: val
|
logical :: val
|
||||||
|
|
||||||
val = .true.
|
val = .true.
|
||||||
end function s_rkr_solver_is_iterative
|
end function s_krm_solver_is_iterative
|
||||||
|
|
||||||
end module amg_s_rkr_solver
|
end module amg_s_krm_solver
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
+157
-154
@@ -1,15 +1,15 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
! Fabio Durastante
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
! are met:
|
! are met:
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
! not be used to endorse or promote products derived from this
|
! not be used to endorse or promote products derived from this
|
||||||
! software without specific written permission.
|
! software without specific written permission.
|
||||||
!
|
!
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
@@ -33,22 +33,22 @@
|
|||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
!
|
!
|
||||||
!
|
!
|
||||||
! File: amg_s_onelev_mod.f90
|
! File: amg_s_onelev_mod.f90
|
||||||
!
|
!
|
||||||
! Module: amg_s_onelev_mod
|
! Module: amg_s_onelev_mod
|
||||||
!
|
!
|
||||||
! This module defines:
|
! This module defines:
|
||||||
! - the amg_s_onelev_type data structure containing one level
|
! - the amg_s_onelev_type data structure containing one level
|
||||||
! of a multilevel preconditioner and related
|
! of a multilevel preconditioner and related
|
||||||
! data structures;
|
! data structures;
|
||||||
!
|
!
|
||||||
! It contains routines for
|
! It contains routines for
|
||||||
! - Building and applying;
|
! - Building and applying;
|
||||||
! - checking if the preconditioner is correctly defined;
|
! - checking if the preconditioner is correctly defined;
|
||||||
! - printing a description of the preconditioner;
|
! - printing a description of the preconditioner;
|
||||||
! - deallocating the preconditioner data structure.
|
! - deallocating the preconditioner data structure.
|
||||||
!
|
!
|
||||||
|
|
||||||
module amg_s_onelev_mod
|
module amg_s_onelev_mod
|
||||||
@@ -56,6 +56,8 @@ module amg_s_onelev_mod
|
|||||||
use amg_base_prec_type
|
use amg_base_prec_type
|
||||||
use amg_s_base_smoother_mod
|
use amg_s_base_smoother_mod
|
||||||
use amg_s_dec_aggregator_mod
|
use amg_s_dec_aggregator_mod
|
||||||
|
use amg_s_parmatch_aggregator_mod
|
||||||
|
|
||||||
use psb_base_mod, only : psb_sspmat_type, psb_s_vect_type, &
|
use psb_base_mod, only : psb_sspmat_type, psb_s_vect_type, &
|
||||||
& psb_s_base_vect_type, psb_lsspmat_type, psb_slinmap_type, psb_spk_, &
|
& psb_s_base_vect_type, psb_lsspmat_type, psb_slinmap_type, psb_spk_, &
|
||||||
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
& psb_ipk_, psb_epk_, psb_lpk_, psb_desc_type, psb_i_base_vect_type, &
|
||||||
@@ -73,16 +75,16 @@ module amg_s_onelev_mod
|
|||||||
! class(amg_s_base_smoother_type), pointer :: sm2 => null()
|
! class(amg_s_base_smoother_type), pointer :: sm2 => null()
|
||||||
! class(amg_smlprec_wrk_type), allocatable :: wrk
|
! class(amg_smlprec_wrk_type), allocatable :: wrk
|
||||||
! class(amg_s_base_aggregator_type), allocatable :: aggr
|
! class(amg_s_base_aggregator_type), allocatable :: aggr
|
||||||
! type(amg_sml_parms) :: parms
|
! type(amg_sml_parms) :: parms
|
||||||
! type(psb_sspmat_type) :: ac
|
! type(psb_sspmat_type) :: ac
|
||||||
! type(psb_sesc_type) :: desc_ac
|
! type(psb_sesc_type) :: desc_ac
|
||||||
! type(psb_sspmat_type), pointer :: base_a => null()
|
! type(psb_sspmat_type), pointer :: base_a => null()
|
||||||
! type(psb_desc_type), pointer :: base_desc => null()
|
! type(psb_desc_type), pointer :: base_desc => null()
|
||||||
! type(psb_slinmap_type) :: map
|
! type(psb_slinmap_type) :: map
|
||||||
! end type amg_sonelev_type
|
! end type amg_sonelev_type
|
||||||
!
|
!
|
||||||
! Note that s denotes the kind of the real data type to be chosen
|
! Note that s denotes the kind of the real data type to be chosen
|
||||||
! according to single/double precision version of MLD2P4.
|
! according to single/double precision version of AMG4PSBLAS.
|
||||||
!
|
!
|
||||||
! sm,sm2a - class(amg_s_base_smoother_type), allocatable
|
! sm,sm2a - class(amg_s_base_smoother_type), allocatable
|
||||||
! The current level pre- and post-smooother.
|
! The current level pre- and post-smooother.
|
||||||
@@ -93,7 +95,7 @@ module amg_s_onelev_mod
|
|||||||
! Workspace for application of preconditioner; may be
|
! Workspace for application of preconditioner; may be
|
||||||
! pre-allocated to save time in the application within a
|
! pre-allocated to save time in the application within a
|
||||||
! Krylov solver.
|
! Krylov solver.
|
||||||
! aggr - class(amg_s_base_aggregator_type), allocatable
|
! aggr - class(amg_s_base_aggregator_type), allocatable
|
||||||
! The aggregator object: holds the algorithmic choices and
|
! The aggregator object: holds the algorithmic choices and
|
||||||
! (possibly) additional data for building the aggregation.
|
! (possibly) additional data for building the aggregation.
|
||||||
! parms - type(amg_sml_parms)
|
! parms - type(amg_sml_parms)
|
||||||
@@ -104,7 +106,7 @@ module amg_s_onelev_mod
|
|||||||
! The communication descriptor associated to the matrix
|
! The communication descriptor associated to the matrix
|
||||||
! stored in ac.
|
! stored in ac.
|
||||||
! base_a - type(psb_sspmat_type), pointer.
|
! base_a - type(psb_sspmat_type), pointer.
|
||||||
! Pointer (really a pointer!) to the local part of the current
|
! Pointer (really a pointer!) to the local part of the current
|
||||||
! matrix (so we have a unified treatment of residuals).
|
! matrix (so we have a unified treatment of residuals).
|
||||||
! We need this to avoid passing explicitly the current matrix
|
! We need this to avoid passing explicitly the current matrix
|
||||||
! to the routine which applies the preconditioner.
|
! to the routine which applies the preconditioner.
|
||||||
@@ -115,13 +117,13 @@ module amg_s_onelev_mod
|
|||||||
! vector spaces associated to the index spaces of the previous
|
! vector spaces associated to the index spaces of the previous
|
||||||
! and current levels.
|
! and current levels.
|
||||||
!
|
!
|
||||||
! Methods:
|
! Methods:
|
||||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||||
! is appropriate for the current object, then call the corresponding method for
|
! is appropriate for the current object, then call the corresponding method for
|
||||||
! the contained object.
|
! the contained object.
|
||||||
! As an example: the descr() method prints out a description of the
|
! As an example: the descr() method prints out a description of the
|
||||||
! level. It starts by invoking the descr() method of the parms object,
|
! level. It starts by invoking the descr() method of the parms object,
|
||||||
! then calls the descr() method of the smoother object.
|
! then calls the descr() method of the smoother object.
|
||||||
!
|
!
|
||||||
! descr - Prints a description of the object.
|
! descr - Prints a description of the object.
|
||||||
! default - Set default values
|
! default - Set default values
|
||||||
@@ -130,14 +132,14 @@ module amg_s_onelev_mod
|
|||||||
! it is passed to the smoother object for further processing.
|
! it is passed to the smoother object for further processing.
|
||||||
! check - Sanity checks.
|
! check - Sanity checks.
|
||||||
! sizeof - Total memory occupation in bytes
|
! sizeof - Total memory occupation in bytes
|
||||||
! get_nzeros - Number of nonzeros
|
! get_nzeros - Number of nonzeros
|
||||||
! get_wrksz - How many workspace vector does apply_vect need
|
! get_wrksz - How many workspace vector does apply_vect need
|
||||||
! allocate_wrk - Allocate auxiliary workspace
|
! allocate_wrk - Allocate auxiliary workspace
|
||||||
! free_wrk - Free auxiliary workspace
|
! free_wrk - Free auxiliary workspace
|
||||||
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
! bld_tprol - Invoke the aggr method to build the tentative prolongator
|
||||||
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
|
||||||
|
!
|
||||||
!
|
!
|
||||||
!
|
|
||||||
type amg_smlprec_wrk_type
|
type amg_smlprec_wrk_type
|
||||||
real(psb_spk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
real(psb_spk_), allocatable :: tx(:), ty(:), x2l(:), y2l(:)
|
||||||
type(psb_s_vect_type) :: vtx, vty, vx2l, vy2l
|
type(psb_s_vect_type) :: vtx, vty, vx2l, vy2l
|
||||||
@@ -148,10 +150,10 @@ module amg_s_onelev_mod
|
|||||||
procedure, pass(wk) :: clone => s_wrk_clone
|
procedure, pass(wk) :: clone => s_wrk_clone
|
||||||
procedure, pass(wk) :: move_alloc => s_wrk_move_alloc
|
procedure, pass(wk) :: move_alloc => s_wrk_move_alloc
|
||||||
procedure, pass(wk) :: cnv => s_wrk_cnv
|
procedure, pass(wk) :: cnv => s_wrk_cnv
|
||||||
procedure, pass(wk) :: sizeof => s_wrk_sizeof
|
procedure, pass(wk) :: sizeof => s_wrk_sizeof
|
||||||
end type amg_smlprec_wrk_type
|
end type amg_smlprec_wrk_type
|
||||||
private :: s_wrk_alloc, s_wrk_free, &
|
private :: s_wrk_alloc, s_wrk_free, &
|
||||||
& s_wrk_clone, s_wrk_move_alloc, s_wrk_cnv, s_wrk_sizeof
|
& s_wrk_clone, s_wrk_move_alloc, s_wrk_cnv, s_wrk_sizeof
|
||||||
|
|
||||||
type amg_s_remap_data_type
|
type amg_s_remap_data_type
|
||||||
type(psb_sspmat_type) :: ac_pre_remap
|
type(psb_sspmat_type) :: ac_pre_remap
|
||||||
@@ -161,19 +163,19 @@ module amg_s_onelev_mod
|
|||||||
contains
|
contains
|
||||||
procedure, pass(rmp) :: clone => s_remap_data_clone
|
procedure, pass(rmp) :: clone => s_remap_data_clone
|
||||||
end type amg_s_remap_data_type
|
end type amg_s_remap_data_type
|
||||||
|
|
||||||
type amg_s_onelev_type
|
type amg_s_onelev_type
|
||||||
class(amg_s_base_smoother_type), allocatable :: sm, sm2a
|
class(amg_s_base_smoother_type), allocatable :: sm, sm2a
|
||||||
class(amg_s_base_smoother_type), pointer :: sm2 => null()
|
class(amg_s_base_smoother_type), pointer :: sm2 => null()
|
||||||
class(amg_smlprec_wrk_type), allocatable :: wrk
|
class(amg_smlprec_wrk_type), allocatable :: wrk
|
||||||
class(amg_s_base_aggregator_type), allocatable :: aggr
|
class(amg_s_base_aggregator_type), allocatable :: aggr
|
||||||
type(amg_sml_parms) :: parms
|
type(amg_sml_parms) :: parms
|
||||||
type(psb_sspmat_type) :: ac
|
type(psb_sspmat_type) :: ac
|
||||||
integer(psb_ipk_) :: ac_nz_loc
|
integer(psb_ipk_) :: ac_nz_loc
|
||||||
integer(psb_lpk_) :: ac_nz_tot
|
integer(psb_lpk_) :: ac_nz_tot
|
||||||
type(psb_desc_type) :: desc_ac
|
type(psb_desc_type) :: desc_ac
|
||||||
type(psb_sspmat_type), pointer :: base_a => null()
|
type(psb_sspmat_type), pointer :: base_a => null()
|
||||||
type(psb_desc_type), pointer :: base_desc => null()
|
type(psb_desc_type), pointer :: base_desc => null()
|
||||||
type(psb_lsspmat_type) :: tprol
|
type(psb_lsspmat_type) :: tprol
|
||||||
type(psb_slinmap_type) :: linmap
|
type(psb_slinmap_type) :: linmap
|
||||||
type(amg_s_remap_data_type) :: remap_data
|
type(amg_s_remap_data_type) :: remap_data
|
||||||
@@ -197,7 +199,7 @@ module amg_s_onelev_mod
|
|||||||
procedure, pass(lv) :: setsm => amg_s_base_onelev_setsm
|
procedure, pass(lv) :: setsm => amg_s_base_onelev_setsm
|
||||||
procedure, pass(lv) :: setsv => amg_s_base_onelev_setsv
|
procedure, pass(lv) :: setsv => amg_s_base_onelev_setsv
|
||||||
procedure, pass(lv) :: setag => amg_s_base_onelev_setag
|
procedure, pass(lv) :: setag => amg_s_base_onelev_setag
|
||||||
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
generic, public :: set => cseti, csetr, csetc, setsm, setsv, setag
|
||||||
procedure, pass(lv) :: sizeof => s_base_onelev_sizeof
|
procedure, pass(lv) :: sizeof => s_base_onelev_sizeof
|
||||||
procedure, pass(lv) :: get_nzeros => s_base_onelev_get_nzeros
|
procedure, pass(lv) :: get_nzeros => s_base_onelev_get_nzeros
|
||||||
procedure, pass(lv) :: get_wrksz => s_base_onelev_get_wrksize
|
procedure, pass(lv) :: get_wrksz => s_base_onelev_get_wrksize
|
||||||
@@ -205,8 +207,8 @@ module amg_s_onelev_mod
|
|||||||
procedure, pass(lv) :: free_wrk => s_base_onelev_free_wrk
|
procedure, pass(lv) :: free_wrk => s_base_onelev_free_wrk
|
||||||
procedure, nopass :: stringval => amg_stringval
|
procedure, nopass :: stringval => amg_stringval
|
||||||
procedure, pass(lv) :: move_alloc => s_base_onelev_move_alloc
|
procedure, pass(lv) :: move_alloc => s_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
procedure, pass(lv) :: map_rstr_a => amg_s_base_onelev_map_rstr_a
|
procedure, pass(lv) :: map_rstr_a => amg_s_base_onelev_map_rstr_a
|
||||||
procedure, pass(lv) :: map_prol_a => amg_s_base_onelev_map_prol_a
|
procedure, pass(lv) :: map_prol_a => amg_s_base_onelev_map_prol_a
|
||||||
procedure, pass(lv) :: map_rstr_v => amg_s_base_onelev_map_rstr_v
|
procedure, pass(lv) :: map_rstr_v => amg_s_base_onelev_map_rstr_v
|
||||||
@@ -226,11 +228,11 @@ module amg_s_onelev_mod
|
|||||||
& s_base_onelev_get_wrksize, s_base_onelev_allocate_wrk, &
|
& s_base_onelev_get_wrksize, s_base_onelev_allocate_wrk, &
|
||||||
& s_base_onelev_free_wrk
|
& s_base_onelev_free_wrk
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
subroutine amg_s_base_onelev_mat_asb(lv,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
import :: psb_sspmat_type, psb_desc_type, psb_spk_, psb_ipk_, psb_lsspmat_type, psb_lpk_
|
import :: psb_sspmat_type, psb_desc_type, psb_spk_, psb_ipk_, psb_lsspmat_type, psb_lpk_
|
||||||
import :: amg_s_onelev_type
|
import :: amg_s_onelev_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), intent(inout), target :: lv
|
class(amg_s_onelev_type), intent(inout), target :: lv
|
||||||
type(psb_sspmat_type), intent(in) :: a
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
type(psb_desc_type), intent(inout) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
@@ -255,141 +257,142 @@ module amg_s_onelev_mod
|
|||||||
end subroutine amg_s_base_onelev_build
|
end subroutine amg_s_base_onelev_build
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_descr(lv,il,nl,ilmin,info,iout)
|
subroutine amg_s_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), intent(in) :: lv
|
class(amg_s_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
integer(psb_ipk_), intent(in) :: il,nl,ilmin
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_s_base_onelev_descr
|
end subroutine amg_s_base_onelev_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_cnv(lv,info,amold,vmold,imold)
|
subroutine amg_s_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||||
import :: amg_s_onelev_type, psb_s_base_vect_type, psb_spk_, &
|
import :: amg_s_onelev_type, psb_s_base_vect_type, psb_spk_, &
|
||||||
& psb_s_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
& psb_s_base_sparse_mat, psb_ipk_, psb_i_base_vect_type
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||||
end subroutine amg_s_base_onelev_cnv
|
end subroutine amg_s_base_onelev_cnv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_free(lv,info)
|
subroutine amg_s_base_onelev_free(lv,info)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_s_base_onelev_free
|
end subroutine amg_s_base_onelev_free
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_check(lv,info)
|
subroutine amg_s_base_onelev_check(lv,info)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_s_base_onelev_check
|
end subroutine amg_s_base_onelev_check
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_setsm(lv,val,info,pos)
|
subroutine amg_s_base_onelev_setsm(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_s_onelev_type, amg_s_base_smoother_type, &
|
import :: psb_spk_, amg_s_onelev_type, amg_s_base_smoother_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_s_base_smoother_type), intent(in) :: val
|
class(amg_s_base_smoother_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_s_base_onelev_setsm
|
end subroutine amg_s_base_onelev_setsm
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_setsv(lv,val,info,pos)
|
subroutine amg_s_base_onelev_setsv(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_s_onelev_type, amg_s_base_solver_type, &
|
import :: psb_spk_, amg_s_onelev_type, amg_s_base_solver_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_s_base_solver_type), intent(in) :: val
|
class(amg_s_base_solver_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_s_base_onelev_setsv
|
end subroutine amg_s_base_onelev_setsv
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_setag(lv,val,info,pos)
|
subroutine amg_s_base_onelev_setag(lv,val,info,pos)
|
||||||
import :: psb_spk_, amg_s_onelev_type, amg_s_base_aggregator_type, &
|
import :: psb_spk_, amg_s_onelev_type, amg_s_base_aggregator_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_s_base_aggregator_type), intent(in) :: val
|
class(amg_s_base_aggregator_type), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
end subroutine amg_s_base_onelev_setag
|
end subroutine amg_s_base_onelev_setag
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_cseti(lv,what,val,info,pos,idx)
|
subroutine amg_s_base_onelev_cseti(lv,what,val,info,pos,idx)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_s_base_onelev_cseti
|
end subroutine amg_s_base_onelev_cseti
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
|
subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
integer(psb_ipk_), intent(in), optional :: idx
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
end subroutine amg_s_base_onelev_csetc
|
end subroutine amg_s_base_onelev_csetc
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_csetr(lv,what,val,info,pos,idx)
|
subroutine amg_s_base_onelev_csetr(lv,what,val,info,pos,idx)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
character(len=*), intent(in) :: what
|
character(len=*), intent(in) :: what
|
||||||
real(psb_spk_), intent(in) :: val
|
real(psb_spk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
character(len=*), optional, intent(in) :: pos
|
character(len=*), optional, intent(in) :: pos
|
||||||
@@ -397,13 +400,13 @@ interface
|
|||||||
end subroutine amg_s_base_onelev_csetr
|
end subroutine amg_s_base_onelev_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,smoother,&
|
||||||
& solver,tprol,global_num)
|
& solver,tprol,global_num)
|
||||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||||
& psb_ipk_, psb_epk_, psb_desc_type
|
& psb_ipk_, psb_epk_, psb_desc_type
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), intent(in) :: lv
|
class(amg_s_onelev_type), intent(in) :: lv
|
||||||
integer(psb_ipk_), intent(in) :: level
|
integer(psb_ipk_), intent(in) :: level
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
@@ -435,7 +438,7 @@ interface
|
|||||||
end subroutine amg_s_base_onelev_map_rstr_v
|
end subroutine amg_s_base_onelev_map_rstr_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_s_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
subroutine amg_s_base_onelev_map_prol_a(lv,alpha,v,beta,u,info,work)
|
||||||
import
|
import
|
||||||
implicit none
|
implicit none
|
||||||
@@ -458,15 +461,15 @@ interface
|
|||||||
type(psb_s_vect_type), optional, target, intent(inout) :: vtx,vty
|
type(psb_s_vect_type), optional, target, intent(inout) :: vtx,vty
|
||||||
end subroutine amg_s_base_onelev_map_prol_v
|
end subroutine amg_s_base_onelev_map_prol_v
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
contains
|
contains
|
||||||
!
|
!
|
||||||
! Function returning the size of the amg_prec_type data structure
|
! Function returning the size of the amg_prec_type data structure
|
||||||
! in bytes or in number of nonzeros of the operator(s) involved.
|
! in bytes or in number of nonzeros of the operator(s) involved.
|
||||||
!
|
!
|
||||||
|
|
||||||
function s_base_onelev_get_nzeros(lv) result(val)
|
function s_base_onelev_get_nzeros(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), intent(in) :: lv
|
class(amg_s_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -478,16 +481,16 @@ contains
|
|||||||
end function s_base_onelev_get_nzeros
|
end function s_base_onelev_get_nzeros
|
||||||
|
|
||||||
function s_base_onelev_sizeof(lv) result(val)
|
function s_base_onelev_sizeof(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), intent(in) :: lv
|
class(amg_s_onelev_type), intent(in) :: lv
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
val = psb_sizeof_ip+psb_sizeof_lp
|
val = psb_sizeof_ip+psb_sizeof_lp
|
||||||
val = val + lv%desc_ac%sizeof()
|
val = val + lv%desc_ac%sizeof()
|
||||||
val = val + lv%ac%sizeof()
|
val = val + lv%ac%sizeof()
|
||||||
val = val + lv%tprol%sizeof()
|
val = val + lv%tprol%sizeof()
|
||||||
val = val + lv%linmap%sizeof()
|
val = val + lv%linmap%sizeof()
|
||||||
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
if (allocated(lv%sm)) val = val + lv%sm%sizeof()
|
||||||
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
if (allocated(lv%sm2a)) val = val + lv%sm2a%sizeof()
|
||||||
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
if (allocated(lv%aggr)) val = val + lv%aggr%sizeof()
|
||||||
@@ -496,19 +499,19 @@ contains
|
|||||||
|
|
||||||
|
|
||||||
subroutine s_base_onelev_nullify(lv)
|
subroutine s_base_onelev_nullify(lv)
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
|
|
||||||
nullify(lv%base_a)
|
nullify(lv%base_a)
|
||||||
nullify(lv%base_desc)
|
nullify(lv%base_desc)
|
||||||
nullify(lv%sm2)
|
nullify(lv%sm2)
|
||||||
end subroutine s_base_onelev_nullify
|
end subroutine s_base_onelev_nullify
|
||||||
|
|
||||||
!
|
!
|
||||||
! Multilevel defaults:
|
! Multilevel defaults:
|
||||||
! multiplicative vs. additive ML framework;
|
! multiplicative vs. additive ML framework;
|
||||||
! Smoothed decoupled aggregation with zero threshold;
|
! Smoothed decoupled aggregation with zero threshold;
|
||||||
! distributed coarse matrix;
|
! distributed coarse matrix;
|
||||||
! damping omega computed with the max-norm estimate of the
|
! damping omega computed with the max-norm estimate of the
|
||||||
! dominant eigenvalue;
|
! dominant eigenvalue;
|
||||||
@@ -518,10 +521,10 @@ contains
|
|||||||
subroutine s_base_onelev_default(lv)
|
subroutine s_base_onelev_default(lv)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: info
|
integer(psb_ipk_) :: info
|
||||||
|
|
||||||
lv%parms%sweeps_pre = 1
|
lv%parms%sweeps_pre = 1
|
||||||
lv%parms%sweeps_post = 1
|
lv%parms%sweeps_post = 1
|
||||||
@@ -536,7 +539,7 @@ contains
|
|||||||
lv%parms%aggr_filter = amg_no_filter_mat_
|
lv%parms%aggr_filter = amg_no_filter_mat_
|
||||||
lv%parms%aggr_omega_val = szero
|
lv%parms%aggr_omega_val = szero
|
||||||
lv%parms%aggr_thresh = 0.01_psb_spk_
|
lv%parms%aggr_thresh = 0.01_psb_spk_
|
||||||
|
|
||||||
if (allocated(lv%sm)) call lv%sm%default()
|
if (allocated(lv%sm)) call lv%sm%default()
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm2a%default()
|
call lv%sm2a%default()
|
||||||
@@ -546,7 +549,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
if (.not.allocated(lv%aggr)) allocate(amg_s_dec_aggregator_type :: lv%aggr,stat=info)
|
if (.not.allocated(lv%aggr)) allocate(amg_s_dec_aggregator_type :: lv%aggr,stat=info)
|
||||||
if (allocated(lv%aggr)) call lv%aggr%default()
|
if (allocated(lv%aggr)) call lv%aggr%default()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine s_base_onelev_default
|
end subroutine s_base_onelev_default
|
||||||
@@ -561,9 +564,9 @@ contains
|
|||||||
type(psb_lsspmat_type), intent(out) :: t_prol
|
type(psb_lsspmat_type), intent(out) :: t_prol
|
||||||
type(amg_saggr_data), intent(in) :: ag_data
|
type(amg_saggr_data), intent(in) :: ag_data
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
call lv%aggr%bld_tprol(lv%parms,ag_data,a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
|
|
||||||
end subroutine s_base_onelev_bld_tprol
|
end subroutine s_base_onelev_bld_tprol
|
||||||
|
|
||||||
|
|
||||||
@@ -573,7 +576,7 @@ contains
|
|||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call lv%aggr%update_next(lvnext%aggr,info)
|
call lv%aggr%update_next(lvnext%aggr,info)
|
||||||
|
|
||||||
end subroutine s_base_onelev_update_aggr
|
end subroutine s_base_onelev_update_aggr
|
||||||
|
|
||||||
|
|
||||||
@@ -582,33 +585,33 @@ contains
|
|||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lvout
|
class(amg_s_onelev_type), target, intent(inout) :: lvout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
if (allocated(lv%sm)) then
|
if (allocated(lv%sm)) then
|
||||||
call lv%sm%clone(lvout%sm,info)
|
call lv%sm%clone(lvout%sm,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm)) then
|
if (allocated(lvout%sm)) then
|
||||||
call lvout%sm%free(info)
|
call lvout%sm%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm,stat=info)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%sm2a)) then
|
if (allocated(lv%sm2a)) then
|
||||||
call lv%sm%clone(lvout%sm2a,info)
|
call lv%sm%clone(lvout%sm2a,info)
|
||||||
lvout%sm2 => lvout%sm2a
|
lvout%sm2 => lvout%sm2a
|
||||||
else
|
else
|
||||||
if (allocated(lvout%sm2a)) then
|
if (allocated(lvout%sm2a)) then
|
||||||
call lvout%sm2a%free(info)
|
call lvout%sm2a%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
if (info==psb_success_) deallocate(lvout%sm2a,stat=info)
|
||||||
end if
|
end if
|
||||||
lvout%sm2 => lvout%sm
|
lvout%sm2 => lvout%sm
|
||||||
end if
|
end if
|
||||||
if (allocated(lv%aggr)) then
|
if (allocated(lv%aggr)) then
|
||||||
call lv%aggr%clone(lvout%aggr,info)
|
call lv%aggr%clone(lvout%aggr,info)
|
||||||
else
|
else
|
||||||
if (allocated(lvout%aggr)) then
|
if (allocated(lvout%aggr)) then
|
||||||
call lvout%aggr%free(info)
|
call lvout%aggr%free(info)
|
||||||
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
if (info==psb_success_) deallocate(lvout%aggr,stat=info)
|
||||||
end if
|
end if
|
||||||
@@ -621,7 +624,7 @@ contains
|
|||||||
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
if (info == psb_success_) call lv%remap_data%clone(lvout%remap_data,info)
|
||||||
lvout%base_a => lv%base_a
|
lvout%base_a => lv%base_a
|
||||||
lvout%base_desc => lv%base_desc
|
lvout%base_desc => lv%base_desc
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end subroutine s_base_onelev_clone
|
end subroutine s_base_onelev_clone
|
||||||
@@ -630,12 +633,12 @@ contains
|
|||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv, b
|
class(amg_s_onelev_type), target, intent(inout) :: lv, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
b%parms = lv%parms
|
b%parms = lv%parms
|
||||||
b%szratio = lv%szratio
|
b%szratio = lv%szratio
|
||||||
if (associated(lv%sm2,lv%sm2a)) then
|
if (associated(lv%sm2,lv%sm2a)) then
|
||||||
call move_alloc(lv%sm,b%sm)
|
call move_alloc(lv%sm,b%sm)
|
||||||
call move_alloc(lv%sm2a,b%sm2a)
|
call move_alloc(lv%sm2a,b%sm2a)
|
||||||
b%sm2 =>b%sm2a
|
b%sm2 =>b%sm2a
|
||||||
@@ -646,18 +649,18 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
call move_alloc(lv%aggr,b%aggr)
|
call move_alloc(lv%aggr,b%aggr)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%ac,b%ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
if (info == psb_success_) call psb_move_alloc(lv%tprol,b%tprol,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
if (info == psb_success_) call psb_move_alloc(lv%desc_ac,b%desc_ac,info)
|
||||||
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
if (info == psb_success_) call psb_move_alloc(lv%linmap,b%linmap,info)
|
||||||
b%base_a => lv%base_a
|
b%base_a => lv%base_a
|
||||||
b%base_desc => lv%base_desc
|
b%base_desc => lv%base_desc
|
||||||
|
|
||||||
end subroutine s_base_onelev_move_alloc
|
end subroutine s_base_onelev_move_alloc
|
||||||
|
|
||||||
|
|
||||||
function s_base_onelev_get_wrksize(lv) result(val)
|
function s_base_onelev_get_wrksize(lv) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), intent(inout) :: lv
|
class(amg_s_onelev_type), intent(inout) :: lv
|
||||||
integer(psb_ipk_) :: val
|
integer(psb_ipk_) :: val
|
||||||
|
|
||||||
@@ -678,26 +681,26 @@ contains
|
|||||||
select case(lv%parms%ml_cycle)
|
select case(lv%parms%ml_cycle)
|
||||||
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
case(amg_add_ml_,amg_mult_ml_,amg_vcycle_ml_, amg_wcycle_ml_)
|
||||||
! We're good
|
! We're good
|
||||||
|
|
||||||
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
case(amg_kcycle_ml_, amg_kcyclesym_ml_)
|
||||||
!
|
!
|
||||||
! We need 7 in inneritkcycle.
|
! We need 7 in inneritkcycle.
|
||||||
! Can we reuse vtx?
|
! Can we reuse vtx?
|
||||||
!
|
!
|
||||||
val = val + 7
|
val = val + 7
|
||||||
|
|
||||||
case default
|
case default
|
||||||
! Need a better error signaling ?
|
! Need a better error signaling ?
|
||||||
val = -1
|
val = -1
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end function s_base_onelev_get_wrksize
|
end function s_base_onelev_get_wrksize
|
||||||
|
|
||||||
subroutine s_base_onelev_allocate_wrk(lv,info,vmold)
|
subroutine s_base_onelev_allocate_wrk(lv,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv, i
|
integer(psb_ipk_) :: nwv, i
|
||||||
@@ -710,22 +713,22 @@ contains
|
|||||||
! Need to fix this, we need two different allocations
|
! Need to fix this, we need two different allocations
|
||||||
!
|
!
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold,&
|
||||||
& desc2=lv%remap_data%desc_ac_pre_remap)
|
& desc2=lv%remap_data%desc_ac_pre_remap)
|
||||||
else
|
else
|
||||||
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
call lv%wrk%alloc(nwv,lv%base_desc,info,vmold=vmold)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine s_base_onelev_allocate_wrk
|
end subroutine s_base_onelev_allocate_wrk
|
||||||
|
|
||||||
|
|
||||||
subroutine s_base_onelev_free_wrk(lv,info)
|
subroutine s_base_onelev_free_wrk(lv,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_s_onelev_type), target, intent(inout) :: lv
|
class(amg_s_onelev_type), target, intent(inout) :: lv
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: nwv,i
|
integer(psb_ipk_) :: nwv,i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
if (allocated(lv%wrk)) then
|
if (allocated(lv%wrk)) then
|
||||||
@@ -733,17 +736,17 @@ contains
|
|||||||
if (info == 0) deallocate(lv%wrk,stat=info)
|
if (info == 0) deallocate(lv%wrk,stat=info)
|
||||||
end if
|
end if
|
||||||
end subroutine s_base_onelev_free_wrk
|
end subroutine s_base_onelev_free_wrk
|
||||||
|
|
||||||
subroutine s_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
subroutine s_wrk_alloc(wk,nwv,desc,info,vmold, desc2)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(in) :: nwv
|
integer(psb_ipk_), intent(in) :: nwv
|
||||||
type(psb_desc_type), intent(in) :: desc
|
type(psb_desc_type), intent(in) :: desc
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
type(psb_desc_type), intent(in), optional :: desc2
|
type(psb_desc_type), intent(in), optional :: desc2
|
||||||
!
|
!
|
||||||
@@ -807,14 +810,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end subroutine s_wrk_alloc
|
end subroutine s_wrk_alloc
|
||||||
|
|
||||||
subroutine s_wrk_free(wk,info)
|
subroutine s_wrk_free(wk,info)
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
@@ -835,7 +838,7 @@ contains
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
end subroutine s_wrk_free
|
end subroutine s_wrk_free
|
||||||
|
|
||||||
subroutine s_wrk_clone(wk,wkout,info)
|
subroutine s_wrk_clone(wk,wkout,info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
Implicit None
|
Implicit None
|
||||||
@@ -843,11 +846,11 @@ contains
|
|||||||
! Arguments
|
! Arguments
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wkout
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wkout
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
info = psb_success_
|
info = psb_success_
|
||||||
|
|
||||||
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
call psb_safe_ab_cpy(wk%tx,wkout%tx,info)
|
||||||
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
call psb_safe_ab_cpy(wk%ty,wkout%ty,info)
|
||||||
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
call psb_safe_ab_cpy(wk%x2l,wkout%x2l,info)
|
||||||
@@ -869,12 +872,12 @@ contains
|
|||||||
return
|
return
|
||||||
|
|
||||||
end subroutine s_wrk_clone
|
end subroutine s_wrk_clone
|
||||||
|
|
||||||
subroutine s_wrk_move_alloc(wk, b,info)
|
subroutine s_wrk_move_alloc(wk, b,info)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wk, b
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wk, b
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
call b%free(info)
|
call b%free(info)
|
||||||
call move_alloc(wk%tx,b%tx)
|
call move_alloc(wk%tx,b%tx)
|
||||||
call move_alloc(wk%ty,b%ty)
|
call move_alloc(wk%ty,b%ty)
|
||||||
@@ -887,17 +890,17 @@ contains
|
|||||||
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
call move_alloc(wk%vx2l%v,b%vx2l%v)
|
||||||
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
call move_alloc(wk%vy2l%v,b%vy2l%v)
|
||||||
call move_alloc(wk%wv,b%wv)
|
call move_alloc(wk%wv,b%wv)
|
||||||
|
|
||||||
end subroutine s_wrk_move_alloc
|
end subroutine s_wrk_move_alloc
|
||||||
|
|
||||||
subroutine s_wrk_cnv(wk,info,vmold)
|
subroutine s_wrk_cnv(wk,info,vmold)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
|
|
||||||
Implicit None
|
Implicit None
|
||||||
|
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
class(amg_smlprec_wrk_type), target, intent(inout) :: wk
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
@@ -918,7 +921,7 @@ contains
|
|||||||
|
|
||||||
function s_wrk_sizeof(wk) result(val)
|
function s_wrk_sizeof(wk) result(val)
|
||||||
use psb_realloc_mod
|
use psb_realloc_mod
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_smlprec_wrk_type), intent(in) :: wk
|
class(amg_smlprec_wrk_type), intent(in) :: wk
|
||||||
integer(psb_epk_) :: val
|
integer(psb_epk_) :: val
|
||||||
integer :: i
|
integer :: i
|
||||||
@@ -937,14 +940,14 @@ contains
|
|||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
end function s_wrk_sizeof
|
end function s_wrk_sizeof
|
||||||
|
|
||||||
subroutine s_remap_data_clone(rmp, remap_out, info)
|
subroutine s_remap_data_clone(rmp, remap_out, info)
|
||||||
use psb_base_mod
|
use psb_base_mod
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_s_remap_data_type), target, intent(inout) :: rmp
|
class(amg_s_remap_data_type), target, intent(inout) :: rmp
|
||||||
class(amg_s_remap_data_type), target, intent(inout) :: remap_out
|
class(amg_s_remap_data_type), target, intent(inout) :: remap_out
|
||||||
integer(psb_ipk_), intent(out) :: info
|
integer(psb_ipk_), intent(out) :: info
|
||||||
!
|
!
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
|
||||||
@@ -955,7 +958,7 @@ contains
|
|||||||
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
& call rmp%desc_ac_pre_remap%clone(remap_out%desc_ac_pre_remap,info)
|
||||||
remap_out%idest = rmp%idest
|
remap_out%idest = rmp%idest
|
||||||
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
call psb_safe_ab_cpy(rmp%isrc,remap_out%isrc,info)
|
||||||
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
call psb_safe_ab_cpy(rmp%nrsrc,remap_out%nrsrc,info)
|
||||||
end subroutine s_remap_data_clone
|
end subroutine s_remap_data_clone
|
||||||
|
|
||||||
end module amg_s_onelev_mod
|
end module amg_s_onelev_mod
|
||||||
|
|||||||
@@ -0,0 +1,682 @@
|
|||||||
|
!
|
||||||
|
!
|
||||||
|
! AMG4PSBLAS version 1.0
|
||||||
|
! Algebraic Multigrid Package
|
||||||
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
|
!
|
||||||
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
! moved here from amg4psblas-extension
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! AMG4PSBLAS Extensions
|
||||||
|
!
|
||||||
|
! (C) Copyright 2019
|
||||||
|
!
|
||||||
|
! Salvatore Filippone Cranfield University
|
||||||
|
! Pasqua D'Ambra IAC-CNR, Naples, IT
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! The aggregator object hosts the aggregation method for building
|
||||||
|
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||||
|
! presented in
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! sm - class(amg_T_base_smoother_type), allocatable
|
||||||
|
! The current level preconditioner (aka smoother).
|
||||||
|
! parms - type(amg_RTml_parms)
|
||||||
|
! The parameters defining the multilevel strategy.
|
||||||
|
! ac - The local part of the current-level matrix, built by
|
||||||
|
! coarsening the previous-level matrix.
|
||||||
|
! desc_ac - type(psb_desc_type).
|
||||||
|
! The communication descriptor associated to the matrix
|
||||||
|
! stored in ac.
|
||||||
|
! base_a - type(psb_Tspmat_type), pointer.
|
||||||
|
! Pointer (really a pointer!) to the local part of the current
|
||||||
|
! matrix (so we have a unified treatment of residuals).
|
||||||
|
! We need this to avoid passing explicitly the current matrix
|
||||||
|
! to the routine which applies the preconditioner.
|
||||||
|
! base_desc - type(psb_desc_type), pointer.
|
||||||
|
! Pointer to the communication descriptor associated to the
|
||||||
|
! matrix pointed by base_a.
|
||||||
|
! map - Stores the maps (restriction and prolongation) between the
|
||||||
|
! vector spaces associated to the index spaces of the previous
|
||||||
|
! and current levels.
|
||||||
|
!
|
||||||
|
! Methods:
|
||||||
|
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||||
|
! is appropriate for the current object, then call the corresponding method for
|
||||||
|
! the contained object.
|
||||||
|
! As an example: the descr() method prints out a description of the
|
||||||
|
! level. It starts by invoking the descr() method of the parms object,
|
||||||
|
! then calls the descr() method of the smoother object.
|
||||||
|
!
|
||||||
|
! descr - Prints a description of the object.
|
||||||
|
! default - Set default values
|
||||||
|
! dump - Dump to file object contents
|
||||||
|
! set - Sets various parameters; when a request is unknown
|
||||||
|
! it is passed to the smoother object for further processing.
|
||||||
|
! check - Sanity checks.
|
||||||
|
! sizeof - Total memory occupation in bytes
|
||||||
|
! get_nzeros - Number of nonzeros
|
||||||
|
!
|
||||||
|
!
|
||||||
|
|
||||||
|
module amg_s_parmatch_aggregator_mod
|
||||||
|
use amg_s_base_aggregator_mod
|
||||||
|
use amg_s_matchboxp_mod
|
||||||
|
#if defined(SERIAL_MPI)
|
||||||
|
type, extends(amg_s_base_aggregator_type) :: amg_s_parmatch_aggregator_type
|
||||||
|
end type amg_s_parmatch_aggregator_type
|
||||||
|
#else
|
||||||
|
type, extends(amg_s_base_aggregator_type) :: amg_s_parmatch_aggregator_type
|
||||||
|
integer(psb_ipk_) :: matching_alg
|
||||||
|
integer(psb_ipk_) :: n_sweeps ! When n_sweeps >1 we need an auxiliary descriptor
|
||||||
|
integer(psb_ipk_) :: orig_aggr_size
|
||||||
|
integer(psb_ipk_) :: jacobi_sweeps
|
||||||
|
real(psb_spk_), allocatable :: w(:), w_nxt(:)
|
||||||
|
type(psb_sspmat_type), allocatable :: prol, restr
|
||||||
|
type(psb_sspmat_type), allocatable :: ac, base_a, rwa
|
||||||
|
type(psb_desc_type), allocatable :: desc_ac, desc_ax, base_desc, rwdesc
|
||||||
|
logical :: reproducible_matching = .false.
|
||||||
|
logical :: need_symmetrize = .false.
|
||||||
|
logical :: unsmoothed_hierarchy = .true.
|
||||||
|
contains
|
||||||
|
procedure, pass(ag) :: bld_tprol => amg_s_parmatch_aggregator_build_tprol
|
||||||
|
procedure, pass(ag) :: mat_bld => amg_s_parmatch_aggregator_mat_bld
|
||||||
|
procedure, pass(ag) :: mat_asb => amg_s_parmatch_aggregator_mat_asb
|
||||||
|
procedure, pass(ag) :: inner_mat_asb => amg_s_parmatch_aggregator_inner_mat_asb
|
||||||
|
procedure, pass(ag) :: bld_map => amg_s_parmatch_aggregator_bld_map
|
||||||
|
procedure, pass(ag) :: csetc => amg_s_parmatch_aggr_csetc
|
||||||
|
procedure, pass(ag) :: cseti => amg_s_parmatch_aggr_cseti
|
||||||
|
procedure, pass(ag) :: default => amg_s_parmatch_aggr_set_default
|
||||||
|
procedure, pass(ag) :: sizeof => amg_s_parmatch_aggregator_sizeof
|
||||||
|
procedure, pass(ag) :: update_next => amg_s_parmatch_aggregator_update_next
|
||||||
|
procedure, pass(ag) :: bld_wnxt => amg_s_parmatch_bld_wnxt
|
||||||
|
procedure, pass(ag) :: bld_default_w => amg_s_bld_default_w
|
||||||
|
procedure, pass(ag) :: set_c_default_w => amg_s_set_prm_c_default_w
|
||||||
|
procedure, pass(ag) :: descr => amg_s_parmatch_aggregator_descr
|
||||||
|
procedure, pass(ag) :: clone => amg_s_parmatch_aggregator_clone
|
||||||
|
procedure, pass(ag) :: free => amg_s_parmatch_aggregator_free
|
||||||
|
procedure, nopass :: fmt => amg_s_parmatch_aggregator_fmt
|
||||||
|
procedure, nopass :: xt_desc => amg_s_parmatch_aggregator_xt_desc
|
||||||
|
end type amg_s_parmatch_aggregator_type
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||||
|
& a,desc_a,ilaggr,nlaggr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(amg_saggr_data), intent(in) :: ag_data
|
||||||
|
type(psb_sspmat_type), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||||
|
type(psb_lsspmat_type), intent(out) :: t_prol
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_aggregator_build_tprol
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_aggregator_mat_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||||
|
& ac,desc_ac, op_prol,op_restr,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_aggregator_mat_asb
|
||||||
|
end interface
|
||||||
|
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||||
|
& ac,desc_ac, op_prol,op_restr,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(in) :: desc_a
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,op_restr
|
||||||
|
type(psb_sspmat_type), intent(inout) :: ac
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_aggregator_inner_mat_asb
|
||||||
|
end interface
|
||||||
|
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(inout) :: ac, op_prol, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_spmm_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_unsmth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_unsmth_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_smth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_sspmat_type), intent(in) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_smth_bld
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||||
|
implicit none
|
||||||
|
type(psb_sspmat_type), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_spmm_bld_ov
|
||||||
|
end interface
|
||||||
|
|
||||||
|
interface
|
||||||
|
subroutine amg_s_parmatch_spmm_bld_inner(a,desc_a,ilaggr,nlaggr,parms,&
|
||||||
|
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||||
|
import :: amg_s_parmatch_aggregator_type, psb_desc_type, psb_sspmat_type,&
|
||||||
|
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data,&
|
||||||
|
& psb_s_csr_sparse_mat, psb_ls_csr_sparse_mat
|
||||||
|
implicit none
|
||||||
|
type(psb_s_csr_sparse_mat), intent(inout) :: a
|
||||||
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(amg_sml_parms), intent(inout) :: parms
|
||||||
|
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||||
|
type(psb_desc_type), intent(out) :: desc_ac
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
end subroutine amg_s_parmatch_spmm_bld_inner
|
||||||
|
end interface
|
||||||
|
|
||||||
|
private :: is_legal_malg, is_legal_csize, is_legal_nsweeps, is_legal_nlevels
|
||||||
|
|
||||||
|
contains
|
||||||
|
|
||||||
|
subroutine amg_s_bld_default_w(ag,nr)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_ipk_), intent(in) :: nr
|
||||||
|
integer(psb_ipk_) :: info
|
||||||
|
call psb_realloc(nr,ag%w,info)
|
||||||
|
if (info /= psb_success_) return
|
||||||
|
ag%w = done
|
||||||
|
!call ag%set_c_default_w()
|
||||||
|
end subroutine amg_s_bld_default_w
|
||||||
|
|
||||||
|
subroutine amg_s_set_prm_c_default_w(ag)
|
||||||
|
use psb_realloc_mod
|
||||||
|
use iso_c_binding
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_ipk_) :: info
|
||||||
|
|
||||||
|
!write(0,*) 'prm_c_deafult_w '
|
||||||
|
call psb_safe_ab_cpy(ag%w,ag%w_nxt,info)
|
||||||
|
|
||||||
|
end subroutine amg_s_set_prm_c_default_w
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
integer(psb_lpk_), intent(in) :: ilaggr(:)
|
||||||
|
real(psb_spk_), intent(in) :: valaggr(:)
|
||||||
|
integer(psb_ipk_), intent(in) :: nx
|
||||||
|
|
||||||
|
integer(psb_ipk_) :: info,i,j
|
||||||
|
|
||||||
|
! The vector was already fixed in the call to BCMatch.
|
||||||
|
!write(0,*) 'Executing bld_wnxt ',nx
|
||||||
|
call psb_realloc(nx,ag%w_nxt,info)
|
||||||
|
|
||||||
|
end subroutine amg_s_parmatch_bld_wnxt
|
||||||
|
|
||||||
|
function amg_s_parmatch_aggregator_fmt() result(val)
|
||||||
|
implicit none
|
||||||
|
character(len=32) :: val
|
||||||
|
|
||||||
|
val = "Parallel Matching aggregation"
|
||||||
|
end function amg_s_parmatch_aggregator_fmt
|
||||||
|
|
||||||
|
function amg_s_parmatch_aggregator_xt_desc() result(val)
|
||||||
|
implicit none
|
||||||
|
logical :: val
|
||||||
|
|
||||||
|
val = .true.
|
||||||
|
end function amg_s_parmatch_aggregator_xt_desc
|
||||||
|
|
||||||
|
function amg_s_parmatch_aggregator_sizeof(ag) result(val)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(in) :: ag
|
||||||
|
integer(psb_epk_) :: val
|
||||||
|
|
||||||
|
val = 4
|
||||||
|
val = val + psb_size(ag%w) + psb_size(ag%w_nxt)
|
||||||
|
if (allocated(ag%ac)) val = val + ag%ac%sizeof()
|
||||||
|
if (allocated(ag%base_a)) val = val + ag%base_a%sizeof()
|
||||||
|
if (allocated(ag%prol)) val = val + ag%prol%sizeof()
|
||||||
|
if (allocated(ag%restr)) val = val + ag%restr%sizeof()
|
||||||
|
if (allocated(ag%desc_ac)) val = val + ag%desc_ac%sizeof()
|
||||||
|
if (allocated(ag%base_desc)) val = val + ag%base_desc%sizeof()
|
||||||
|
if (allocated(ag%desc_ax)) val = val + ag%desc_ax%sizeof()
|
||||||
|
|
||||||
|
end function amg_s_parmatch_aggregator_sizeof
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggregator_descr(ag,parms,iout,info)
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(in) :: ag
|
||||||
|
type(amg_sml_parms), intent(in) :: parms
|
||||||
|
integer(psb_ipk_), intent(in) :: iout
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
write(iout,*) 'Parallel Matching Aggregator'
|
||||||
|
write(iout,*) ' Number of matching sweeps: ',ag%n_sweeps
|
||||||
|
write(iout,*) ' Matching algorithm : MatchBoxP (PREIS)'
|
||||||
|
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||||
|
call parms%mldescr(iout,info)
|
||||||
|
|
||||||
|
return
|
||||||
|
end subroutine amg_s_parmatch_aggregator_descr
|
||||||
|
|
||||||
|
function is_legal_malg(alg) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: alg
|
||||||
|
|
||||||
|
val = (0==alg)
|
||||||
|
end function is_legal_malg
|
||||||
|
|
||||||
|
function is_legal_csize(csize) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: csize
|
||||||
|
|
||||||
|
val = ((-1==csize).or.(csize >0))
|
||||||
|
end function is_legal_csize
|
||||||
|
|
||||||
|
function is_legal_nsweeps(nsw) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: nsw
|
||||||
|
|
||||||
|
val = (1<=nsw)
|
||||||
|
end function is_legal_nsweeps
|
||||||
|
|
||||||
|
function is_legal_nlevels(nlv) result(val)
|
||||||
|
logical :: val
|
||||||
|
integer(psb_ipk_) :: nlv
|
||||||
|
|
||||||
|
val = (1<=nlv)
|
||||||
|
end function is_legal_nlevels
|
||||||
|
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggregator_update_next(ag,agnext,info)
|
||||||
|
use psb_realloc_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
class(amg_s_base_aggregator_type), target, intent(inout) :: agnext
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
!
|
||||||
|
!
|
||||||
|
select type(agnext)
|
||||||
|
class is (amg_s_parmatch_aggregator_type)
|
||||||
|
if (.not.is_legal_malg(agnext%matching_alg)) &
|
||||||
|
& agnext%matching_alg = ag%matching_alg
|
||||||
|
if (.not.is_legal_nsweeps(agnext%n_sweeps))&
|
||||||
|
& agnext%n_sweeps = ag%n_sweeps
|
||||||
|
!!$ if (.not.is_legal_csize(agnext%max_csize))&
|
||||||
|
!!$ & agnext%max_csize = ag%max_csize
|
||||||
|
!!$ if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||||
|
!!$ & agnext%max_nlevels = ag%max_nlevels
|
||||||
|
! Is this going to generate shallow copies/memory leaks/double frees?
|
||||||
|
! To be investigated further.
|
||||||
|
call psb_safe_ab_cpy(ag%w_nxt,agnext%w,info)
|
||||||
|
call agnext%set_c_default_w()
|
||||||
|
if (ag%unsmoothed_hierarchy) then
|
||||||
|
agnext%unsmoothed_hierarchy = .true.
|
||||||
|
call move_alloc(ag%rwdesc,agnext%base_desc)
|
||||||
|
call move_alloc(ag%rwa,agnext%base_a)
|
||||||
|
end if
|
||||||
|
|
||||||
|
class default
|
||||||
|
! What should we do here?
|
||||||
|
end select
|
||||||
|
info = 0
|
||||||
|
end subroutine amg_s_parmatch_aggregator_update_next
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=*), intent(in) :: what
|
||||||
|
character(len=*), intent(in) :: val
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
|
integer(psb_ipk_) :: err_act, iwhat
|
||||||
|
character(len=20) :: name='s_parmatch_aggr_cseti'
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
! For now we ignore IDX
|
||||||
|
|
||||||
|
select case(psb_toupper(trim(what)))
|
||||||
|
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('F','FALSE')
|
||||||
|
ag%reproducible_matching = .false.
|
||||||
|
case('REPRODUCIBLE','TRUE','T')
|
||||||
|
ag%reproducible_matching =.true.
|
||||||
|
end select
|
||||||
|
case('PRMC_NEED_SYMMETRIZE')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('FALSE','F')
|
||||||
|
ag%need_symmetrize = .false.
|
||||||
|
case('SYMMETRIZE','TRUE','T')
|
||||||
|
ag%need_symmetrize =.true.
|
||||||
|
end select
|
||||||
|
case('PRMC_UNSMOOTHED_HIERARCHY')
|
||||||
|
select case(psb_toupper(trim(val)))
|
||||||
|
case('F','FALSE')
|
||||||
|
ag%unsmoothed_hierarchy = .false.
|
||||||
|
case('T','TRUE')
|
||||||
|
ag%unsmoothed_hierarchy =.true.
|
||||||
|
end select
|
||||||
|
case default
|
||||||
|
! Do nothing
|
||||||
|
end select
|
||||||
|
return
|
||||||
|
end subroutine amg_s_parmatch_aggr_csetc
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=*), intent(in) :: what
|
||||||
|
integer(psb_ipk_), intent(in) :: val
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_), intent(in), optional :: idx
|
||||||
|
integer(psb_ipk_) :: err_act, iwhat
|
||||||
|
character(len=20) :: name='s_parmatch_aggr_cseti'
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
! For now we ignore IDX
|
||||||
|
|
||||||
|
select case(psb_toupper(trim(what)))
|
||||||
|
case('PRMC_MATCH_ALG')
|
||||||
|
ag%matching_alg=val
|
||||||
|
case('PRMC_SWEEPS')
|
||||||
|
ag%n_sweeps=val
|
||||||
|
case('AGGR_SIZE')
|
||||||
|
ag%orig_aggr_size = val
|
||||||
|
ag%n_sweeps=max(1,ceiling(log(val*1.0)/log(2.0)))
|
||||||
|
case('PRMC_W_SIZE')
|
||||||
|
call ag%bld_default_w(val)
|
||||||
|
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||||
|
ag%reproducible_matching = (val == 1)
|
||||||
|
case('PRMC_NEED_SYMMETRIZE')
|
||||||
|
ag%need_symmetrize = (val == 1)
|
||||||
|
case('PRMC_UNSMOOTHED_HIERARCHY')
|
||||||
|
ag%unsmoothed_hierarchy = (val == 1)
|
||||||
|
case default
|
||||||
|
! Do nothing
|
||||||
|
end select
|
||||||
|
return
|
||||||
|
end subroutine amg_s_parmatch_aggr_cseti
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggr_set_default(ag)
|
||||||
|
|
||||||
|
Implicit None
|
||||||
|
|
||||||
|
! Arguments
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
character(len=20) :: name='s_parmatch_aggr_set_default'
|
||||||
|
call ag%amg_s_base_aggregator_type%default()
|
||||||
|
ag%matching_alg = 0
|
||||||
|
ag%n_sweeps = 1
|
||||||
|
ag%jacobi_sweeps = 0
|
||||||
|
!!$ ag%max_nlevels = 36
|
||||||
|
!!$ ag%max_csize = -1
|
||||||
|
!
|
||||||
|
! Apparently BootCMatch works better
|
||||||
|
! by keeping all entries
|
||||||
|
!
|
||||||
|
ag%do_clean_zeros = .false.
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
end subroutine amg_s_parmatch_aggr_set_default
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggregator_free(ag,info)
|
||||||
|
use iso_c_binding
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
info = 0
|
||||||
|
if ((info == 0).and.allocated(ag%w)) deallocate(ag%w,stat=info)
|
||||||
|
if ((info == 0).and.allocated(ag%w_nxt)) deallocate(ag%w_nxt,stat=info)
|
||||||
|
if ((info == 0).and.allocated(ag%prol)) then
|
||||||
|
call ag%prol%free(); deallocate(ag%prol,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%restr)) then
|
||||||
|
call ag%restr%free(); deallocate(ag%restr,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%ac)) then
|
||||||
|
call ag%ac%free(); deallocate(ag%ac,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%base_a)) then
|
||||||
|
call ag%base_a%free(); deallocate(ag%base_a,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%rwa)) then
|
||||||
|
call ag%rwa%free(); deallocate(ag%rwa,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%desc_ac)) then
|
||||||
|
call ag%desc_ac%free(info); deallocate(ag%desc_ac,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%desc_ax)) then
|
||||||
|
call ag%desc_ax%free(info); deallocate(ag%desc_ax,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%base_desc)) then
|
||||||
|
call ag%base_desc%free(info); deallocate(ag%base_desc,stat=info)
|
||||||
|
end if
|
||||||
|
if ((info == 0).and.allocated(ag%rwdesc)) then
|
||||||
|
call ag%rwdesc%free(info); deallocate(ag%rwdesc,stat=info)
|
||||||
|
end if
|
||||||
|
|
||||||
|
end subroutine amg_s_parmatch_aggregator_free
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggregator_clone(ag,agnext,info)
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||||
|
class(amg_s_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
info = 0
|
||||||
|
if (allocated(agnext)) then
|
||||||
|
call agnext%free(info)
|
||||||
|
if (info == 0) deallocate(agnext,stat=info)
|
||||||
|
end if
|
||||||
|
if (info /= 0) return
|
||||||
|
allocate(agnext,source=ag,stat=info)
|
||||||
|
select type(agnext)
|
||||||
|
class is (amg_s_parmatch_aggregator_type)
|
||||||
|
call agnext%set_c_default_w()
|
||||||
|
class default
|
||||||
|
! Should never ever get here
|
||||||
|
info = -1
|
||||||
|
end select
|
||||||
|
end subroutine amg_s_parmatch_aggregator_clone
|
||||||
|
|
||||||
|
subroutine amg_s_parmatch_aggregator_bld_map(ag,desc_a,desc_ac,ilaggr,nlaggr,&
|
||||||
|
& op_restr,op_prol,map,info)
|
||||||
|
use psb_base_mod
|
||||||
|
implicit none
|
||||||
|
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||||
|
type(psb_desc_type), intent(in), target :: desc_a, desc_ac
|
||||||
|
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||||
|
type(psb_sspmat_type), intent(inout) :: op_prol, op_restr
|
||||||
|
type(psb_slinmap_type), intent(out) :: map
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
integer(psb_ipk_) :: err_act
|
||||||
|
character(len=20) :: name='s_parmatch_aggregator_bld_map'
|
||||||
|
|
||||||
|
call psb_erractionsave(err_act)
|
||||||
|
!
|
||||||
|
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||||
|
! op_restr => PR^T i.e. restriction operator
|
||||||
|
! op_prol => PR i.e. prolongation operator
|
||||||
|
!
|
||||||
|
! For parmatch have an explicit copy of the descriptors
|
||||||
|
!
|
||||||
|
if (allocated(ag%desc_ax)) then
|
||||||
|
!!$ write(0,*) 'Building linmap with ag%desc_ax ',ag%desc_ax%get_local_rows(),ag%desc_ax%get_local_cols(),&
|
||||||
|
!!$ & desc_ac%get_local_rows(),desc_ac%get_local_cols()
|
||||||
|
map = psb_linmap(psb_map_gen_linear_,ag%desc_ax,&
|
||||||
|
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||||
|
else
|
||||||
|
map = psb_linmap(psb_map_gen_linear_,desc_a,&
|
||||||
|
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||||
|
end if
|
||||||
|
if(info /= psb_success_) then
|
||||||
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
|
||||||
|
call psb_erractionrestore(err_act)
|
||||||
|
return
|
||||||
|
|
||||||
|
9999 call psb_error_handler(err_act)
|
||||||
|
|
||||||
|
return
|
||||||
|
end subroutine amg_s_parmatch_aggregator_bld_map
|
||||||
|
#endif
|
||||||
|
end module amg_s_parmatch_aggregator_mod
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
! Module: amg_s_prec_mod
|
! Module: amg_s_prec_mod
|
||||||
!
|
!
|
||||||
! This module defines the user interfaces to the real/complex, single/double
|
! This module defines the user interfaces to the real/complex, single/double
|
||||||
! precision versions of the user-level MLD2P4 routines.
|
! precision versions of the user-level AMG4PSBLAS routines.
|
||||||
!
|
!
|
||||||
module amg_s_prec_mod
|
module amg_s_prec_mod
|
||||||
|
|
||||||
@@ -55,12 +55,7 @@ module amg_s_prec_mod
|
|||||||
use amg_s_ainv_solver
|
use amg_s_ainv_solver
|
||||||
use amg_s_invk_solver
|
use amg_s_invk_solver
|
||||||
use amg_s_invt_solver
|
use amg_s_invt_solver
|
||||||
|
use amg_s_krm_solver
|
||||||
interface amg_precset
|
|
||||||
module procedure amg_s_iprecsetsm, amg_s_iprecsetsv, &
|
|
||||||
& amg_s_cprecseti, amg_s_cprecsetc, amg_s_cprecsetr, &
|
|
||||||
& amg_s_iprecsetag
|
|
||||||
end interface amg_precset
|
|
||||||
|
|
||||||
interface amg_extprol_bld
|
interface amg_extprol_bld
|
||||||
subroutine amg_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
subroutine amg_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
|
||||||
@@ -82,61 +77,4 @@ module amg_s_prec_mod
|
|||||||
end subroutine amg_s_extprol_bld
|
end subroutine amg_s_extprol_bld
|
||||||
end interface amg_extprol_bld
|
end interface amg_extprol_bld
|
||||||
|
|
||||||
contains
|
|
||||||
|
|
||||||
subroutine amg_s_iprecsetsm(p,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
class(amg_s_base_smoother_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(val,info,pos=pos)
|
|
||||||
end subroutine amg_s_iprecsetsm
|
|
||||||
|
|
||||||
subroutine amg_s_iprecsetsv(p,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
class(amg_s_base_solver_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_s_iprecsetsv
|
|
||||||
|
|
||||||
subroutine amg_s_iprecsetag(p,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
class(amg_s_base_aggregator_type), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
call p%set(val,info, pos=pos)
|
|
||||||
end subroutine amg_s_iprecsetag
|
|
||||||
|
|
||||||
subroutine amg_s_cprecseti(p,what,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
integer(psb_ipk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_s_cprecseti
|
|
||||||
|
|
||||||
subroutine amg_s_cprecsetr(p,what,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
real(psb_spk_), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_s_cprecsetr
|
|
||||||
|
|
||||||
subroutine amg_s_cprecsetc(p,what,val,info,pos)
|
|
||||||
type(amg_sprec_type), intent(inout) :: p
|
|
||||||
character(len=*), intent(in) :: what
|
|
||||||
character(len=*), intent(in) :: val
|
|
||||||
integer(psb_ipk_), intent(out) :: info
|
|
||||||
character(len=*), optional, intent(in) :: pos
|
|
||||||
|
|
||||||
call p%set(what,val,info,pos=pos)
|
|
||||||
end subroutine amg_s_cprecsetc
|
|
||||||
|
|
||||||
end module amg_s_prec_mod
|
end module amg_s_prec_mod
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -66,7 +66,7 @@ module amg_s_prec_type
|
|||||||
!
|
!
|
||||||
! This is the data type containing all the information about the multilevel
|
! This is the data type containing all the information about the multilevel
|
||||||
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
! preconditioner ('d', 's', 'c' and 'z', according to the real/complex,
|
||||||
! single/double precision version of MLD2P4).
|
! single/double precision version of AMG4PSBLAS).
|
||||||
! It consists of an array of 'one-level' intermediate data structures
|
! It consists of an array of 'one-level' intermediate data structures
|
||||||
! of type amg_sonelev_type, each containing the information needed to apply
|
! of type amg_sonelev_type, each containing the information needed to apply
|
||||||
! the smoothing and the coarse-space correction at a generic level. RT is the
|
! the smoothing and the coarse-space correction at a generic level. RT is the
|
||||||
@@ -155,13 +155,15 @@ module amg_s_prec_type
|
|||||||
|
|
||||||
|
|
||||||
interface amg_precdescr
|
interface amg_precdescr
|
||||||
subroutine amg_sfile_prec_descr(prec,iout,root)
|
subroutine amg_sfile_prec_descr(prec,info,iout,root,verbosity)
|
||||||
import :: amg_sprec_type, psb_ipk_
|
import :: amg_sprec_type, psb_ipk_
|
||||||
implicit none
|
implicit none
|
||||||
! Arguments
|
! Arguments
|
||||||
class(amg_sprec_type), intent(in) :: prec
|
class(amg_sprec_type), intent(in) :: prec
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
integer(psb_ipk_), intent(in), optional :: iout
|
integer(psb_ipk_), intent(in), optional :: iout
|
||||||
integer(psb_ipk_), intent(in), optional :: root
|
integer(psb_ipk_), intent(in), optional :: root
|
||||||
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||||
end subroutine amg_sfile_prec_descr
|
end subroutine amg_sfile_prec_descr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
@@ -424,11 +426,22 @@ contains
|
|||||||
end if
|
end if
|
||||||
end function amg_s_get_nzeros
|
end function amg_s_get_nzeros
|
||||||
|
|
||||||
function amg_sprec_sizeof(prec) result(val)
|
function amg_sprec_sizeof(prec, global) result(val)
|
||||||
implicit none
|
implicit none
|
||||||
class(amg_sprec_type), intent(in) :: prec
|
class(amg_sprec_type), intent(in) :: prec
|
||||||
integer(psb_epk_) :: val
|
logical, intent(in), optional :: global
|
||||||
|
integer(psb_epk_) :: val
|
||||||
integer(psb_ipk_) :: i
|
integer(psb_ipk_) :: i
|
||||||
|
type(psb_ctxt_type) :: ctxt
|
||||||
|
|
||||||
|
logical :: global_
|
||||||
|
|
||||||
|
if (present(global)) then
|
||||||
|
global_ = global
|
||||||
|
else
|
||||||
|
global_ = .false.
|
||||||
|
end if
|
||||||
|
|
||||||
val = 0
|
val = 0
|
||||||
val = val + psb_sizeof_ip
|
val = val + psb_sizeof_ip
|
||||||
if (allocated(prec%precv)) then
|
if (allocated(prec%precv)) then
|
||||||
@@ -436,6 +449,11 @@ contains
|
|||||||
val = val + prec%precv(i)%sizeof()
|
val = val + prec%precv(i)%sizeof()
|
||||||
end do
|
end do
|
||||||
end if
|
end if
|
||||||
|
if (global_) then
|
||||||
|
ctxt = prec%ctxt
|
||||||
|
call psb_sum(ctxt,val)
|
||||||
|
end if
|
||||||
|
|
||||||
end function amg_sprec_sizeof
|
end function amg_sprec_sizeof
|
||||||
|
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
@@ -58,10 +61,9 @@ module amg_z_ainv_solver
|
|||||||
procedure, pass(sv) :: cseti => amg_z_ainv_solver_cseti
|
procedure, pass(sv) :: cseti => amg_z_ainv_solver_cseti
|
||||||
procedure, pass(sv) :: csetc => amg_z_ainv_solver_csetc
|
procedure, pass(sv) :: csetc => amg_z_ainv_solver_csetc
|
||||||
procedure, pass(sv) :: csetr => amg_z_ainv_solver_csetr
|
procedure, pass(sv) :: csetr => amg_z_ainv_solver_csetr
|
||||||
procedure, pass(sv) :: seti => amg_z_ainv_solver_seti
|
!!$ procedure, pass(sv) :: seti => amg_z_ainv_solver_seti
|
||||||
procedure, pass(sv) :: setc => amg_z_ainv_solver_setc
|
!!$ procedure, pass(sv) :: setc => amg_z_ainv_solver_setc
|
||||||
procedure, pass(sv) :: setr => amg_z_ainv_solver_setr
|
!!$ procedure, pass(sv) :: setr => amg_z_ainv_solver_setr
|
||||||
generic, public :: set => seti, setr, setc
|
|
||||||
procedure, pass(sv) :: descr => amg_z_ainv_solver_descr
|
procedure, pass(sv) :: descr => amg_z_ainv_solver_descr
|
||||||
procedure, pass(sv) :: default => z_ainv_solver_default
|
procedure, pass(sv) :: default => z_ainv_solver_default
|
||||||
procedure, nopass :: stringval => z_ainv_stringval
|
procedure, nopass :: stringval => z_ainv_stringval
|
||||||
@@ -159,41 +161,41 @@ module amg_z_ainv_solver
|
|||||||
end subroutine amg_z_ainv_solver_csetr
|
end subroutine amg_z_ainv_solver_csetr
|
||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_z_ainv_solver_setc(sv,what,val,info)
|
!!$ subroutine amg_z_ainv_solver_setc(sv,what,val,info)
|
||||||
import :: amg_z_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_z_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_z_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_z_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
character(len=*), intent(in) :: val
|
!!$ character(len=*), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_z_ainv_solver_setc
|
!!$ end subroutine amg_z_ainv_solver_setc
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_z_ainv_solver_seti(sv,what,val,info)
|
!!$ subroutine amg_z_ainv_solver_seti(sv,what,val,info)
|
||||||
import :: amg_z_ainv_solver_type, psb_ipk_
|
!!$ import :: amg_z_ainv_solver_type, psb_ipk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_z_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_z_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
integer(psb_ipk_), intent(in) :: val
|
!!$ integer(psb_ipk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_z_ainv_solver_seti
|
!!$ end subroutine amg_z_ainv_solver_seti
|
||||||
end interface
|
!!$ end interface
|
||||||
|
!!$
|
||||||
interface
|
!!$ interface
|
||||||
subroutine amg_z_ainv_solver_setr(sv,what,val,info)
|
!!$ subroutine amg_z_ainv_solver_setr(sv,what,val,info)
|
||||||
import :: amg_z_ainv_solver_type, psb_ipk_, psb_dpk_
|
!!$ import :: amg_z_ainv_solver_type, psb_ipk_, psb_dpk_
|
||||||
Implicit none
|
!!$ Implicit none
|
||||||
! Arguments
|
!!$ ! Arguments
|
||||||
class(amg_z_ainv_solver_type), intent(inout) :: sv
|
!!$ class(amg_z_ainv_solver_type), intent(inout) :: sv
|
||||||
integer(psb_ipk_), intent(in) :: what
|
!!$ integer(psb_ipk_), intent(in) :: what
|
||||||
real(psb_dpk_), intent(in) :: val
|
!!$ real(psb_dpk_), intent(in) :: val
|
||||||
integer(psb_ipk_), intent(out) :: info
|
!!$ integer(psb_ipk_), intent(out) :: info
|
||||||
end subroutine amg_z_ainv_solver_setr
|
!!$ end subroutine amg_z_ainv_solver_setr
|
||||||
end interface
|
!!$ end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine amg_z_ainv_solver_descr(sv,info,iout,coarse)
|
subroutine amg_z_ainv_solver_descr(sv,info,iout,coarse)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
@@ -126,7 +126,7 @@ module amg_z_base_aggregator_mod
|
|||||||
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_dml_parms), intent(inout) :: parms
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
@@ -144,7 +144,7 @@ module amg_z_base_aggregator_mod
|
|||||||
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||||
implicit none
|
implicit none
|
||||||
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
||||||
type(psb_desc_type), intent(in) :: desc_a
|
type(psb_desc_type), intent(inout) :: desc_a
|
||||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||||
type(amg_dml_parms), intent(inout) :: parms
|
type(amg_dml_parms), intent(inout) :: parms
|
||||||
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
!
|
!
|
||||||
!
|
!
|
||||||
! AMG-AINV: Approximate Inverse plugin for
|
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
!
|
! Algebraic Multigrid Package
|
||||||
! (C) Copyright 2020
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! Salvatore Filippone University of Rome Tor Vergata
|
! (C) Copyright 2021
|
||||||
|
!
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Pasqua D'Ambra
|
||||||
|
! Fabio Durastante
|
||||||
!
|
!
|
||||||
! Redistribution and use in source and binary forms, with or without
|
! Redistribution and use in source and binary forms, with or without
|
||||||
! modification, are permitted provided that the following conditions
|
! modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2020
|
||||||
!
|
!
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
!
|
!
|
||||||
! AMG4PSBLAS version 1.0
|
! AMG4PSBLAS version 1.0
|
||||||
! Algebraic Multigrid Package
|
! Algebraic Multigrid Package
|
||||||
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||||
!
|
!
|
||||||
! (C) Copyright 2020
|
! (C) Copyright 2021
|
||||||
!
|
!
|
||||||
! Salvatore Filippone
|
! Salvatore Filippone
|
||||||
! Pasqua D'Ambra
|
! Pasqua D'Ambra
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user