Compare commits

...
29 Commits
Author SHA1 Message Date
sfilippone aa03a1cafd Add discretization domain size 2025-03-24 17:31:52 +01:00
sfilippone f3123f1acc Improve output of memory occupation 2025-03-24 17:23:42 +01:00
fdurastante ed8b3d5c9e Fixed Sample to use AS 2025-03-24 13:53:52 +01:00
sfilippone 787b99b320 Fix input files. 2025-03-24 10:25:05 +01:00
fdurastante c07dad642f Add options for KRM coarse solver in fileread
example.
2025-03-24 09:06:41 +01:00
sfilippone 75f768028c Fixes code and copyright for serial matching. 2025-03-23 12:11:47 +01:00
sfilippone afb5d9da76 Fix use of BIT64 in MatchBox 2025-03-22 20:29:44 +01:00
sfilippone b9cf9dca06 Merge branch 'serial-match' into development 2025-03-21 14:10:39 +01:00
sfilippone e922582aad Various fixes for PSB_ and SERIAL_MPI with matching 2025-03-21 14:07:44 +01:00
sfilippone 9ad88b1355 Take out MUMPS interface debug statement 2025-03-21 12:13:39 +01:00
sfilippone 0f425bdc06 Fix configure for MUMPS with INCLUDES instead of MODULES 2025-03-21 11:54:05 +01:00
sfilippone d925d39089 Take out OpenMP in samples generation for the time being 2025-03-20 10:14:49 +01:00
fdurastante 92eb261ee5 Exclude generated amg_config.h from tracking 2025-03-20 09:02:46 +01:00
fdurastante 5cf7d5b3c1 Added KRM options for coarse solver 2025-03-19 23:54:27 +01:00
sfilippone 31644c972a Fix usage of --enable-XXX 2025-03-19 14:33:32 +01:00
sfilippone cfd29707da New amg_config.h.in 2025-03-19 14:11:13 +01:00
sfilippone 9ded460701 Fix #defines 2025-03-18 14:11:33 +01:00
sfilippone da7a3be4e4 Fix AMG_prefix for some defines 2025-03-18 12:18:36 +01:00
sfilippone 0b9ca017c6 Merge branch 'development' of github.com:sfilippone/amg4psblas into development 2025-03-17 17:53:12 +01:00
sfilippone 6fa5b04387 Change and use #define with PSB_ and AMG_ prefixes 2025-03-17 17:52:25 +01:00
Salvatore Filippone 474f8e463e Update README.md 2025-03-12 14:29:00 +01:00
Salvatore Filippone ac7d7373e6 Update README.md 2025-03-12 11:14:28 +01:00
Salvatore Filippone f159f35eb2 Change Makefile for a better clean target 2025-03-02 11:18:48 +01:00
Salvatore Filippone 886d539ffc Change args to AR command 2025-03-02 11:18:07 +01:00
sfilippone 2910ac6537 Add names for Intel compilers ifx & friends 2025-03-01 12:49:35 +01:00
sfilippone 3b3a6c88a8 Silence more warnings/errors from INTEL 2025-03-01 12:48:52 +01:00
sfilippone f6afacd1ff Update docs for allocate/deallocate _wrk 2025-02-24 09:57:14 +01:00
sfilippone 02bf24efa3 Fix version in configure 2025-02-24 09:17:37 +01:00
sfilippone f6349d34d1 Provide alias deallocate_wrk for free_wrk. Document and use. 2025-02-23 10:46:45 +01:00
165 changed files with 235045 additions and 1060 deletions
+1
View File
@@ -5,6 +5,7 @@
# header files generated
cbind/*.h
amgprec/amg_config.h
# Make.inc generated
/Make.inc
+3 -3
View File
@@ -45,7 +45,7 @@ cleanlib:
(cd modules; /bin/rm -f *.a *$(.mod) *$(.fh))
distclean: clean samplesclean
/bin/rm -fr Make.inc
/bin/rm -fr Make.inc amgprec/amg_config.h
samplesclean: clean
(cd samples/simple/fileread && $(MAKE) clean)
@@ -57,5 +57,5 @@ check: all
make check -C samples/advanced/pdegen
clean: cleanlib
(cd amgprec && $(MAKE) clean)
(cd cbind && $(MAKE) clean)
(cd amgprec && $(MAKE) veryclean)
(cd cbind && $(MAKE) veryclean)
+1 -1
View File
@@ -66,7 +66,7 @@ LIBNAME=libamg_prec.a
all: objs impld
objs: $(OBJS)
/bin/cp -p amg_const.h $(INCDIR)
/bin/cp -p amg_const.h amg_config.h $(INCDIR)
/bin/cp -p *$(.mod) $(MODDIR)
impld: objs
-4
View File
@@ -55,10 +55,6 @@ module amg_base_ainv_mod
integer, parameter :: amg_ainv_llk_noth_ = amg_ainv_s_ft_llk_ + 1
integer, parameter :: amg_ainv_mlk_ = amg_ainv_llk_noth_ + 1
integer, parameter :: amg_ainv_lmx_ = amg_ainv_mlk_
#if defined(HAVE_TUMA_SAINV)
integer, parameter :: amg_ainv_s_tuma_ = amg_ainv_lmx_ + 1
integer, parameter :: amg_ainv_l_tuma_ = amg_ainv_s_tuma_ + 1
#endif
end module amg_base_ainv_mod
+2 -1
View File
@@ -302,7 +302,7 @@ contains
integer(psb_ipk_), intent(out) :: info
! Do nothing
info = psb_success_
return
end subroutine amg_c_base_aggregator_set_aggr_type
@@ -486,6 +486,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_base_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
+2 -1
View File
@@ -150,7 +150,7 @@ contains
class(amg_c_dec_aggregator_type), intent(inout) :: ag
type(amg_sml_parms), intent(in) :: parms
integer(psb_ipk_), intent(out) :: info
info = psb_success_
select case(parms%aggr_type)
case (amg_noalg_)
ag%soc_map_bld => null()
@@ -192,6 +192,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+11 -11
View File
@@ -52,10 +52,10 @@
!
module amg_c_mumps_solver
use amg_c_base_solver_mod
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
use cmumps_struc_def
#endif
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
include 'cmumps_struc.h'
#endif
@@ -68,7 +68,7 @@ module amg_c_mumps_solver
end type amg_c_mumps_rcntl_item
type, extends(amg_c_base_solver_type) :: amg_c_mumps_solver_type
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
type(cmumps_struc), allocatable :: id
#else
integer, allocatable :: id
@@ -189,7 +189,7 @@ contains
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
@@ -239,7 +239,7 @@ contains
character(len=20) :: name='c_mumps_solver_clear_data'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
if (allocated(sv%id)) then
if (sv%built) then
@@ -279,7 +279,7 @@ contains
character(len=20) :: name='c_mumps_solver_free'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
call sv%clear_data(info)
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
@@ -383,7 +383,7 @@ subroutine c_mumps_solver_csetc(sv,what,val,info,idx)
select case(psb_toupper(trim(what)))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
#endif
@@ -421,7 +421,7 @@ subroutine c_mumps_solver_cseti(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = val
case('MUMPS_PRINT_ERR')
@@ -467,7 +467,7 @@ subroutine c_mumps_solver_csetr(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_RPAR_ENTRY')
if(present(idx)) then
! Note: this will allocate %item
@@ -504,7 +504,7 @@ subroutine c_mumps_solver_default(sv)
info = psb_success_
call psb_erractionsave(err_act)
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
if (.not.allocated(sv%id)) then
allocate(sv%id,stat=info)
if (info /= psb_success_) then
@@ -561,7 +561,7 @@ function c_mumps_solver_sizeof(sv) result(val)
class(amg_c_mumps_solver_type), intent(in) :: sv
integer(psb_epk_) :: val
integer :: i
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
#else
val = 0
+1
View File
@@ -113,6 +113,7 @@ module amg_c_prec_type
procedure, pass(prec) :: free => amg_c_prec_free
procedure, pass(prec) :: allocate_wrk => amg_c_allocate_wrk
procedure, pass(prec) :: free_wrk => amg_c_free_wrk
procedure, pass(prec) :: deallocate_wrk => amg_c_free_wrk
procedure, pass(prec) :: is_allocated_wrk => amg_c_is_allocated_wrk
procedure, pass(prec) :: get_complexity => amg_c_get_compl
procedure, pass(prec) :: cmp_complexity => amg_c_cmp_compl
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_c_slu_solver
use iso_c_binding
use amg_c_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_c_base_solver_type) :: amg_c_slu_solver_type
+1 -1
View File
@@ -97,7 +97,7 @@ contains
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+17
View File
@@ -0,0 +1,17 @@
#ifndef AMG_CONFIG_H
#define AMG_CONFIG_H
#include "psb_config.h"
@CHAVEUMF@
@CHAVESLU@
@CSLUVERSION@
@CHAVESLUDIST@
@CSLUDISTVERSION@
@CHAVEMUMPS@
@CHAVEMUMPSMODULES@
@CHAVEMUMPSINCLUDES@
@CXXMATCHBOXBIT@
#endif
+2 -1
View File
@@ -302,7 +302,7 @@ contains
integer(psb_ipk_), intent(out) :: info
! Do nothing
info = psb_success_
return
end subroutine amg_d_base_aggregator_set_aggr_type
@@ -486,6 +486,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_base_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
+2 -1
View File
@@ -150,7 +150,7 @@ contains
class(amg_d_dec_aggregator_type), intent(inout) :: ag
type(amg_dml_parms), intent(in) :: parms
integer(psb_ipk_), intent(out) :: info
info = psb_success_
select case(parms%aggr_type)
case (amg_noalg_)
ag%soc_map_bld => null()
@@ -192,6 +192,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
@@ -73,6 +73,22 @@ module amg_d_matchboxp_mod
use iso_c_binding
use psb_base_cbind_mod
#if defined(PSB_SERIAL_MPI)
interface MatchingC
subroutine dMatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate) bind(c,name='dMatching')
use iso_c_binding
import :: psb_c_ipk_, psb_c_lpk_
implicit none
integer(psb_c_lpk_), value :: nlver,nledge
integer(psb_c_lpk_) :: verlocptr(*),verlocind(*), verdistance(*)
integer(psb_c_lpk_) :: mate(*)
real(c_double) :: edgelocweight(*)
end subroutine dMatchingC
end interface MatchingC
#else
interface MatchBoxPC
subroutine dMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, myrank, numprocs, icomm,&
@@ -93,7 +109,7 @@ module amg_d_matchboxp_mod
real(c_double) :: msgpercent(*)
end subroutine dMatchBoxPC
end interface MatchBoxPC
#endif
interface amg_i_aggr_assign
module procedure amg_i_d_aggr_assign
end interface amg_i_aggr_assign
@@ -1129,11 +1145,15 @@ contains
call psb_barrier(ictxt)
if (me == 0) write(0,*)' Calling MatchBoxP '
end if
#if defined(PSB_SERIAL_MPI)
call MatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate)
#else
call MatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, mrank, mnp, icomm,&
& msgindsent,msgactualsent,msgpercent,&
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card)
#endif
verlocptr(:) = verlocptr(:) + 1
verlocind(:) = verlocind(:) + 1
verdistance(:) = verdistance(:) + 1
+11 -11
View File
@@ -52,10 +52,10 @@
!
module amg_d_mumps_solver
use amg_d_base_solver_mod
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
use dmumps_struc_def
#endif
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
include 'dmumps_struc.h'
#endif
@@ -68,7 +68,7 @@ module amg_d_mumps_solver
end type amg_d_mumps_rcntl_item
type, extends(amg_d_base_solver_type) :: amg_d_mumps_solver_type
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
type(dmumps_struc), allocatable :: id
#else
integer, allocatable :: id
@@ -189,7 +189,7 @@ contains
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
@@ -239,7 +239,7 @@ contains
character(len=20) :: name='d_mumps_solver_clear_data'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
if (allocated(sv%id)) then
if (sv%built) then
@@ -279,7 +279,7 @@ contains
character(len=20) :: name='d_mumps_solver_free'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
call sv%clear_data(info)
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
@@ -383,7 +383,7 @@ subroutine d_mumps_solver_csetc(sv,what,val,info,idx)
select case(psb_toupper(trim(what)))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
#endif
@@ -421,7 +421,7 @@ subroutine d_mumps_solver_cseti(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = val
case('MUMPS_PRINT_ERR')
@@ -467,7 +467,7 @@ subroutine d_mumps_solver_csetr(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_RPAR_ENTRY')
if(present(idx)) then
! Note: this will allocate %item
@@ -504,7 +504,7 @@ subroutine d_mumps_solver_default(sv)
info = psb_success_
call psb_erractionsave(err_act)
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
if (.not.allocated(sv%id)) then
allocate(sv%id,stat=info)
if (info /= psb_success_) then
@@ -561,7 +561,7 @@ function d_mumps_solver_sizeof(sv) result(val)
class(amg_d_mumps_solver_type), intent(in) :: sv
integer(psb_epk_) :: val
integer :: i
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
#else
val = 0
+5 -12
View File
@@ -119,10 +119,6 @@
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
@@ -400,6 +396,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
@@ -451,6 +448,7 @@ contains
class(amg_d_base_aggregator_type), target, intent(inout) :: agnext
integer(psb_ipk_), intent(out) :: info
info = psb_success_
!
!
select type(agnext)
@@ -590,7 +588,7 @@ contains
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
integer(psb_ipk_), intent(out) :: info
info = 0
info = psb_success_
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
@@ -629,7 +627,7 @@ contains
class(amg_d_base_aggregator_type), allocatable, intent(inout) :: agnext
integer(psb_ipk_), intent(out) :: info
info = 0
info = psb_success_
if (allocated(agnext)) then
call agnext%free(info)
if (info == 0) deallocate(agnext,stat=info)
@@ -658,6 +656,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_parmatch_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
@@ -675,11 +674,6 @@ contains
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
@@ -687,5 +681,4 @@ contains
return
end subroutine amg_d_parmatch_aggregator_bld_map
#endif
end module amg_d_parmatch_aggregator_mod
+1
View File
@@ -113,6 +113,7 @@ module amg_d_prec_type
procedure, pass(prec) :: free => amg_d_prec_free
procedure, pass(prec) :: allocate_wrk => amg_d_allocate_wrk
procedure, pass(prec) :: free_wrk => amg_d_free_wrk
procedure, pass(prec) :: deallocate_wrk => amg_d_free_wrk
procedure, pass(prec) :: is_allocated_wrk => amg_d_is_allocated_wrk
procedure, pass(prec) :: get_complexity => amg_d_get_compl
procedure, pass(prec) :: cmp_complexity => amg_d_cmp_compl
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_d_slu_solver
use iso_c_binding
use amg_d_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_d_base_solver_type) :: amg_d_slu_solver_type
+1 -1
View File
@@ -52,7 +52,7 @@ module amg_d_sludist_solver
use iso_c_binding
use amg_d_base_solver_mod
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
#if (!defined(AMG_HAVE_SLUDIST)) || defined(PSB_IPK8)
type, extends(amg_d_base_solver_type) :: amg_d_sludist_solver_type
+1 -1
View File
@@ -97,7 +97,7 @@ contains
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_d_umf_solver
use iso_c_binding
use amg_d_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_d_base_solver_type) :: amg_d_umf_solver_type
end type amg_d_umf_solver_type
+2 -1
View File
@@ -302,7 +302,7 @@ contains
integer(psb_ipk_), intent(out) :: info
! Do nothing
info = psb_success_
return
end subroutine amg_s_base_aggregator_set_aggr_type
@@ -486,6 +486,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_base_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
+2 -1
View File
@@ -150,7 +150,7 @@ contains
class(amg_s_dec_aggregator_type), intent(inout) :: ag
type(amg_sml_parms), intent(in) :: parms
integer(psb_ipk_), intent(out) :: info
info = psb_success_
select case(parms%aggr_type)
case (amg_noalg_)
ag%soc_map_bld => null()
@@ -192,6 +192,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
@@ -73,6 +73,22 @@ module amg_s_matchboxp_mod
use iso_c_binding
use psb_base_cbind_mod
#if defined(PSB_SERIAL_MPI)
interface MatchingC
subroutine sMatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate) bind(c,name='sMatching')
use iso_c_binding
import :: psb_c_ipk_, psb_c_lpk_
implicit none
integer(psb_c_lpk_), value :: nlver,nledge
integer(psb_c_lpk_) :: verlocptr(*),verlocind(*), verdistance(*)
integer(psb_c_lpk_) :: mate(*)
real(c_float) :: edgelocweight(*)
end subroutine sMatchingC
end interface MatchingC
#else
interface MatchBoxPC
subroutine sMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, myrank, numprocs, icomm,&
@@ -93,7 +109,7 @@ module amg_s_matchboxp_mod
real(c_double) :: msgpercent(*)
end subroutine sMatchBoxPC
end interface MatchBoxPC
#endif
interface amg_i_aggr_assign
module procedure amg_i_s_aggr_assign
end interface amg_i_aggr_assign
@@ -1129,11 +1145,15 @@ contains
call psb_barrier(ictxt)
if (me == 0) write(0,*)' Calling MatchBoxP '
end if
#if defined(PSB_SERIAL_MPI)
call MatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate)
#else
call MatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, mrank, mnp, icomm,&
& msgindsent,msgactualsent,msgpercent,&
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card)
#endif
verlocptr(:) = verlocptr(:) + 1
verlocind(:) = verlocind(:) + 1
verdistance(:) = verdistance(:) + 1
+11 -11
View File
@@ -52,10 +52,10 @@
!
module amg_s_mumps_solver
use amg_s_base_solver_mod
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
use smumps_struc_def
#endif
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
include 'smumps_struc.h'
#endif
@@ -68,7 +68,7 @@ module amg_s_mumps_solver
end type amg_s_mumps_rcntl_item
type, extends(amg_s_base_solver_type) :: amg_s_mumps_solver_type
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
type(smumps_struc), allocatable :: id
#else
integer, allocatable :: id
@@ -189,7 +189,7 @@ contains
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
@@ -239,7 +239,7 @@ contains
character(len=20) :: name='s_mumps_solver_clear_data'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
if (allocated(sv%id)) then
if (sv%built) then
@@ -279,7 +279,7 @@ contains
character(len=20) :: name='s_mumps_solver_free'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
call sv%clear_data(info)
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
@@ -383,7 +383,7 @@ subroutine s_mumps_solver_csetc(sv,what,val,info,idx)
select case(psb_toupper(trim(what)))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
#endif
@@ -421,7 +421,7 @@ subroutine s_mumps_solver_cseti(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = val
case('MUMPS_PRINT_ERR')
@@ -467,7 +467,7 @@ subroutine s_mumps_solver_csetr(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_RPAR_ENTRY')
if(present(idx)) then
! Note: this will allocate %item
@@ -504,7 +504,7 @@ subroutine s_mumps_solver_default(sv)
info = psb_success_
call psb_erractionsave(err_act)
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
if (.not.allocated(sv%id)) then
allocate(sv%id,stat=info)
if (info /= psb_success_) then
@@ -561,7 +561,7 @@ function s_mumps_solver_sizeof(sv) result(val)
class(amg_s_mumps_solver_type), intent(in) :: sv
integer(psb_epk_) :: val
integer :: i
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
#else
val = 0
+5 -12
View File
@@ -119,10 +119,6 @@
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
@@ -400,6 +396,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
@@ -451,6 +448,7 @@ contains
class(amg_s_base_aggregator_type), target, intent(inout) :: agnext
integer(psb_ipk_), intent(out) :: info
info = psb_success_
!
!
select type(agnext)
@@ -590,7 +588,7 @@ contains
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
integer(psb_ipk_), intent(out) :: info
info = 0
info = psb_success_
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
@@ -629,7 +627,7 @@ contains
class(amg_s_base_aggregator_type), allocatable, intent(inout) :: agnext
integer(psb_ipk_), intent(out) :: info
info = 0
info = psb_success_
if (allocated(agnext)) then
call agnext%free(info)
if (info == 0) deallocate(agnext,stat=info)
@@ -658,6 +656,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_parmatch_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
@@ -675,11 +674,6 @@ contains
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
@@ -687,5 +681,4 @@ contains
return
end subroutine amg_s_parmatch_aggregator_bld_map
#endif
end module amg_s_parmatch_aggregator_mod
+1
View File
@@ -113,6 +113,7 @@ module amg_s_prec_type
procedure, pass(prec) :: free => amg_s_prec_free
procedure, pass(prec) :: allocate_wrk => amg_s_allocate_wrk
procedure, pass(prec) :: free_wrk => amg_s_free_wrk
procedure, pass(prec) :: deallocate_wrk => amg_s_free_wrk
procedure, pass(prec) :: is_allocated_wrk => amg_s_is_allocated_wrk
procedure, pass(prec) :: get_complexity => amg_s_get_compl
procedure, pass(prec) :: cmp_complexity => amg_s_cmp_compl
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_s_slu_solver
use iso_c_binding
use amg_s_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_s_base_solver_type) :: amg_s_slu_solver_type
+1 -1
View File
@@ -97,7 +97,7 @@ contains
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+2 -1
View File
@@ -302,7 +302,7 @@ contains
integer(psb_ipk_), intent(out) :: info
! Do nothing
info = psb_success_
return
end subroutine amg_z_base_aggregator_set_aggr_type
@@ -486,6 +486,7 @@ contains
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_base_aggregator_bld_map'
info = psb_success_
call psb_erractionsave(err_act)
!
! Copy the prolongation/restriction matrices into the descriptor map.
+2 -1
View File
@@ -150,7 +150,7 @@ contains
class(amg_z_dec_aggregator_type), intent(inout) :: ag
type(amg_dml_parms), intent(in) :: parms
integer(psb_ipk_), intent(out) :: info
info = psb_success_
select case(parms%aggr_type)
case (amg_noalg_)
ag%soc_map_bld => null()
@@ -192,6 +192,7 @@ contains
integer(psb_ipk_), intent(out) :: info
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+11 -11
View File
@@ -52,10 +52,10 @@
!
module amg_z_mumps_solver
use amg_z_base_solver_mod
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
use zmumps_struc_def
#endif
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
include 'zmumps_struc.h'
#endif
@@ -68,7 +68,7 @@ module amg_z_mumps_solver
end type amg_z_mumps_rcntl_item
type, extends(amg_z_base_solver_type) :: amg_z_mumps_solver_type
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
type(zmumps_struc), allocatable :: id
#else
integer, allocatable :: id
@@ -189,7 +189,7 @@ contains
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
@@ -239,7 +239,7 @@ contains
character(len=20) :: name='z_mumps_solver_clear_data'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
if (allocated(sv%id)) then
if (sv%built) then
@@ -279,7 +279,7 @@ contains
character(len=20) :: name='z_mumps_solver_free'
info = 0
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call psb_erractionsave(err_act)
call sv%clear_data(info)
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
@@ -383,7 +383,7 @@ subroutine z_mumps_solver_csetc(sv,what,val,info,idx)
select case(psb_toupper(trim(what)))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
#endif
@@ -421,7 +421,7 @@ subroutine z_mumps_solver_cseti(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_LOC_GLOB')
sv%ipar(1) = val
case('MUMPS_PRINT_ERR')
@@ -467,7 +467,7 @@ subroutine z_mumps_solver_csetr(sv,what,val,info,idx)
call psb_erractionsave(err_act)
select case(psb_toupper(what))
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
case('MUMPS_RPAR_ENTRY')
if(present(idx)) then
! Note: this will allocate %item
@@ -504,7 +504,7 @@ subroutine z_mumps_solver_default(sv)
info = psb_success_
call psb_erractionsave(err_act)
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
if (.not.allocated(sv%id)) then
allocate(sv%id,stat=info)
if (info /= psb_success_) then
@@ -561,7 +561,7 @@ function z_mumps_solver_sizeof(sv) result(val)
class(amg_z_mumps_solver_type), intent(in) :: sv
integer(psb_epk_) :: val
integer :: i
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
#else
val = 0
+1
View File
@@ -113,6 +113,7 @@ module amg_z_prec_type
procedure, pass(prec) :: free => amg_z_prec_free
procedure, pass(prec) :: allocate_wrk => amg_z_allocate_wrk
procedure, pass(prec) :: free_wrk => amg_z_free_wrk
procedure, pass(prec) :: deallocate_wrk => amg_z_free_wrk
procedure, pass(prec) :: is_allocated_wrk => amg_z_is_allocated_wrk
procedure, pass(prec) :: get_complexity => amg_z_get_compl
procedure, pass(prec) :: cmp_complexity => amg_z_cmp_compl
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_z_slu_solver
use iso_c_binding
use amg_z_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_z_base_solver_type) :: amg_z_slu_solver_type
+1 -1
View File
@@ -52,7 +52,7 @@ module amg_z_sludist_solver
use iso_c_binding
use amg_z_base_solver_mod
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
#if (!defined(AMG_HAVE_SLUDIST)) || defined(PSB_IPK8)
type, extends(amg_z_base_solver_type) :: amg_z_sludist_solver_type
+1 -1
View File
@@ -97,7 +97,7 @@ contains
character(len=*), intent(in), optional :: prefix
character(1024) :: prefix_
info = psb_success_
if (present(prefix)) then
prefix_ = prefix
else
+1 -1
View File
@@ -51,7 +51,7 @@ module amg_z_umf_solver
use iso_c_binding
use amg_z_base_solver_mod
#if defined(IPK8)
#if defined(PSB_IPK8)
type, extends(amg_z_base_solver_type) :: amg_z_umf_solver_type
end type amg_z_umf_solver_type
+1
View File
@@ -5,6 +5,7 @@ MODDIR=../../modules
HERE=..
FINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(PSBLAS_INCLUDES)
CINCLUDES=-I. -I.. -I$(PSBLAS_INCDIR)
+4 -2
View File
@@ -5,7 +5,8 @@ MODDIR=../../../modules
HERE=../..
FINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(PSBLAS_INCLUDES)
CXXINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/.
CXXINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/. -I$(PSBLAS_INCDIR)
CINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/. -I$(PSBLAS_INCDIR)
#CINCLUDES= -I${SUPERLU_INCDIR} -I${HSL_INCDIR} -I${SPRAL_INCDIR} -I/home/users/pasqua/Ambra/BootCMatch/include -lBCM -L/home/users/pasqua/Ambra/BootCMatch/lib -lm
@@ -61,7 +62,8 @@ amg_s_parmatch_unsmth_bld.o \
amg_s_parmatch_smth_bld.o \
amg_s_parmatch_spmm_bld_inner.o
MPCOBJS=MatchBoxPC.o \
MPCOBJS=Matching.o \
MatchBoxPC.o \
sendBundledMessages.o \
initialize.o \
extractUChunk.o \
+8 -8
View File
@@ -40,15 +40,17 @@
// ************************************************************************
#include <stdio.h>
#include <stdlib.h>
#if !defined(SERIAL_MPI)
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
#include <mpi.h>
#endif
#include "MatchBoxPC.h"
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(PSB_SERIAL_MPI)
void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt* verLocPtr, MilanLongInt* verLocInd, MilanReal* edgeLocWeight,
@@ -58,7 +60,6 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
#if !defined(SERIAL_MPI)
MPI_Comm C_comm=MPI_Comm_f2c(icomm);
#ifdef DEBUG
@@ -72,7 +73,7 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
double tmr = MPI_Wtime();
#endif
#if defined(OPENMP)
#if defined(PSB_OPENMP)
//fprintf(stderr,"Warning: using buggy OpenMP matching!\n");
dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge,
verLocPtr, verLocInd, edgeLocWeight,
@@ -97,7 +98,6 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
fprintf(stderr, "Elaboration time: %f for %ld nodes\n", tmr, NLVer);
#endif
#endif
}
void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
@@ -108,13 +108,12 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
#if !defined(SERIAL_MPI)
MPI_Comm C_comm=MPI_Comm_f2c(icomm);
#ifdef DEBUG
fprintf(stderr,"MatchBoxPC: rank %d nlver %ld nledge %ld [ %ld %ld ]\n",
myRank,NLVer, NLEdge,verDistance[0],verDistance[1]);
#endif
#if defined(OPENMP)
#if defined(PSB_OPENMP)
//fprintf(stderr,"Warning: using buggy OpenMP matching!\n");
salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge,
verLocPtr, verLocInd, edgeLocWeight,
@@ -132,9 +131,10 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
ph0_time, ph1_time, ph2_time,
ph1_card, ph2_card );
#endif
#endif
}
#endif
#ifdef __cplusplus
}
#endif
+8 -7
View File
@@ -59,7 +59,10 @@
#include <assert.h>
#include <map>
#include <vector>
#ifdef OPENMP
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#ifdef PSB_OPENMP
// OpenMP is included and used if and only if the OpenMP version of the matching
// is required
#include "omp.h"
@@ -82,7 +85,6 @@ const int BundleTag = 9; // Predefined tag
static vector<MilanLongInt> DEFAULT_VECTOR;
#if !defined(SERIAL_MPI)
// MPI type map
template <typename T>
@@ -95,14 +97,12 @@ template <>
inline MPI_Datatype TypeMap<double>() { return MPI_DOUBLE; }
template <>
inline MPI_Datatype TypeMap<float>() { return MPI_FLOAT; }
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#if !defined(SERIAL_MPI)
#define MilanMpiLongInt MPI_LONG_LONG
@@ -117,7 +117,7 @@ extern "C"
// Regular long integer:
#ifndef LONG_INT_H
#define LONG_INT_H
#ifdef BIT64
#ifdef AMG_MATCHBOXP_BIT64
typedef int64_t MilanLongInt;
typedef MPI_LONG MilanMpiLongInt;
#else
@@ -163,7 +163,7 @@ extern "C"
#define MilanIntMax INT32_MAX
#define MilanIntMin INT32_MIN
#ifdef BIT64
#ifdef AMG_MATCHBOXP_BIT64
#define MilanLongIntMax INT64_MAX
#define MilanLongIntMin -INT64_MAX
#else
@@ -630,8 +630,9 @@ is disabled there is no reason to actually compile or reference them. */
MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time,
MilanLongInt *ph1_card, MilanLongInt *ph2_card);
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif
+504
View File
@@ -0,0 +1,504 @@
/*
AMG4PSBLAS version 1.2
Algebraic Multigrid Package
based on PSBLAS (Parallel Sparse BLAS version 3.9)
(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.
Includes material from BootCMatch, see copyright below.
*/
/*
BootCMatch
Bootstrap AMG based on Compatible weighted Matching, version 0.9
(C) Copyright 2017
Pasqua D'Ambra IAC-CNR, IT
Panayot S. Vassilevski Portland State University, OR USA
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 BootCMatch 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 BootCMatch 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.
*/
#include "amg_config.h"
#if defined(PSB_SERIAL_MPI)
#include <stdlib.h>
#include "psb_types.h"
psb_l_t d_trymatch(psb_l_t rowindex, psb_l_t colindex,
psb_l_t nrows_W, psb_l_t *W_i, psb_l_t *W_j, psb_d_t *W_data,
psb_l_t *jrowindex, psb_l_t ljrowindex,
psb_l_t *jcolindex, psb_l_t ljcolindex, psb_l_t *rmatch)
{
psb_l_t tryrowmatch, trycolmatch;
psb_l_t i, j, k, nzrow_W, startj, kindex;
psb_d_t cweight, nweight;
// psb_l_t *W_i = bcm_CSRMatrixI(W);
// psb_l_t *W_j = bcm_CSRMatrixJ(W);
// psb_l_t nrows_W = bcm_CSRMatrixNumRows(W);
// psb_d_t *W_data=bcm_CSRMatrixData(W);
k=-1;
i=0;
while (i<ljrowindex && k ==-1)
{
if(jrowindex[i]==colindex) k=i;
i++;
}
if(k >= 0)
{
ljrowindex=ljrowindex-1;
for(i=k; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
}
k=-1;
i=0;
while(i<ljcolindex && k==-1)
{
if(jcolindex[i]==rowindex) k=i;
i++;
}
if(k >= 0)
{
ljcolindex=ljcolindex-1;
for(i=k; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
}
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
startj=W_i[rowindex];
kindex=-1;
k=0;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==colindex) kindex=startj+k;
k++;
}
cweight=W_data[kindex];
while((rmatch[rowindex]==-1 && rmatch[colindex]==-1)
&& (ljrowindex !=0 || ljcolindex !=0))
{
if (rmatch[rowindex] == -1 && ljrowindex !=0)
{
tryrowmatch=jrowindex[0];
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
startj=W_i[rowindex];
k=0;
kindex=-1;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==tryrowmatch) kindex=startj+k;
k++;
}
nweight=W_data[kindex];
ljrowindex=ljrowindex-1;
for(i=0; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
if(nweight > cweight && rmatch[tryrowmatch]==-1)
{
nzrow_W=W_i[tryrowmatch+1]-W_i[tryrowmatch];
psb_l_t *trymatchindexrow;
trymatchindexrow= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
startj=W_i[tryrowmatch];
for(k=0; k<nzrow_W; ++k) trymatchindexrow[k]=W_j[startj+k];
d_trymatch(rowindex,tryrowmatch,
nrows_W, W_i, W_j, W_data,
jrowindex,ljrowindex,
trymatchindexrow,nzrow_W,rmatch);
free(trymatchindexrow);
}
}
if(rmatch[colindex]==-1 && ljcolindex!=0)
{
trycolmatch=jcolindex[0];
nzrow_W=W_i[colindex+1]-W_i[colindex];
startj=W_i[colindex];
k=0;
kindex=-1;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==trycolmatch) kindex=startj+k;
k++;
}
nweight=W_data[kindex];
ljcolindex=ljcolindex-1;
for(i=0; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
if(nweight > cweight && rmatch[trycolmatch]==-1)
{
nzrow_W=W_i[trycolmatch+1]-W_i[trycolmatch];
psb_l_t *trymatchindexcol;
trymatchindexcol= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
startj=W_i[trycolmatch];
for(k=0; k<nzrow_W; ++k) trymatchindexcol[k]=W_j[startj+k];
d_trymatch(colindex,trycolmatch,
nrows_W, W_i, W_j, W_data,
jcolindex,ljcolindex,
trymatchindexcol,nzrow_W,rmatch);
free(trymatchindexcol);
}
}
}
if(rmatch[rowindex]==-1 & rmatch[colindex]==-1)
{
rmatch[rowindex]=colindex;
rmatch[colindex]=rowindex;
}
return 0;
}
psb_l_t *d_CSRMatrixHMatch( psb_l_t nrows_B, psb_l_t ncols_B,
psb_l_t nnz_B, psb_l_t *B_i,
psb_l_t *B_j, psb_d_t *B_data)
{
psb_l_t i, j, k, *rmatch;
psb_d_t *c, alpha;
psb_l_t jbp, nzrows_B;
psb_d_t tmp=0.0;
psb_l_t rno, cno, nzrows_cno, startj, ljrowindex, ljjrowindex;
psb_l_t *jrowindex, *jjrowindex;
#if 0
psb_l_t *B_i = bcm_CSRMatrixI(B);
psb_l_t *B_j = bcm_CSRMatrixJ(B);
psb_d_t *B_data = bcm_CSRMatrixData(B);
psb_l_t nrows_B = bcm_CSRMatrixNumRows(B);
psb_l_t ncols_B = bcm_CSRMatrixNumCols(B);
psb_l_t nnz_B = bcm_CSRMatrixNumNonzeros(B);
#endif
// assert(nrows_B==ncols_B);
rmatch = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
for(i=0; i<nrows_B; ++i) rmatch[i]=-1;
jrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
jjrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
jbp=0;
for(i=0; i< nrows_B; ++i)
{
nzrows_B=B_i[i+1]-B_i[i];
for(j=0; j<nzrows_B; ++j) jrowindex[j]=B_j[jbp+j];
for(j=0; j<nzrows_B; ++j)
{
rno=i;
cno=B_j[jbp+j];
startj=B_i[cno];
nzrows_cno=B_i[cno+1]-startj;
for(k=0; k<nzrows_cno; ++k) jjrowindex[k]=B_j[startj+k];
if(rmatch[rno] == -1 && rmatch[cno] == -1)
d_trymatch(rno,cno,nrows_B,B_i,B_j,B_data,
jrowindex,nzrows_B,jjrowindex,nzrows_cno,rmatch);
}
jbp=jbp+nzrows_B;
}
free(jrowindex);
free(jjrowindex);
return rmatch;
}
void dMatching(psb_l_t NLVer, psb_l_t NLEdge,
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_d_t *edgeLocWeight,
psb_l_t *verDistance, psb_l_t *Mate)
{
psb_l_t *lmate;
lmate = d_CSRMatrixHMatch( NLVer, NLVer, NLEdge,
verLocPtr, verLocInd,edgeLocWeight);
for (psb_l_t i=0; i<NLVer; i++){
Mate[i] = lmate[i];
}
free(lmate);
return;
}
psb_l_t s_trymatch(psb_l_t rowindex, psb_l_t colindex,
psb_l_t nrows_W, psb_l_t *W_i, psb_l_t *W_j, psb_s_t *W_data,
psb_l_t *jrowindex, psb_l_t ljrowindex,
psb_l_t *jcolindex, psb_l_t ljcolindex, psb_l_t *rmatch)
{
psb_l_t tryrowmatch, trycolmatch;
psb_l_t i, j, k, nzrow_W, startj, kindex;
psb_s_t cweight, nweight;
// psb_l_t *W_i = bcm_CSRMatrixI(W);
// psb_l_t *W_j = bcm_CSRMatrixJ(W);
// psb_l_t nrows_W = bcm_CSRMatrixNumRows(W);
// psb_s_t *W_data=bcm_CSRMatrixData(W);
k=-1;
i=0;
while (i<ljrowindex && k ==-1)
{
if(jrowindex[i]==colindex) k=i;
i++;
}
if(k >= 0)
{
ljrowindex=ljrowindex-1;
for(i=k; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
}
k=-1;
i=0;
while(i<ljcolindex && k==-1)
{
if(jcolindex[i]==rowindex) k=i;
i++;
}
if(k >= 0)
{
ljcolindex=ljcolindex-1;
for(i=k; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
}
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
startj=W_i[rowindex];
kindex=-1;
k=0;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==colindex) kindex=startj+k;
k++;
}
cweight=W_data[kindex];
while((rmatch[rowindex]==-1 && rmatch[colindex]==-1)
&& (ljrowindex !=0 || ljcolindex !=0))
{
if (rmatch[rowindex] == -1 && ljrowindex !=0)
{
tryrowmatch=jrowindex[0];
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
startj=W_i[rowindex];
k=0;
kindex=-1;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==tryrowmatch) kindex=startj+k;
k++;
}
nweight=W_data[kindex];
ljrowindex=ljrowindex-1;
for(i=0; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
if(nweight > cweight && rmatch[tryrowmatch]==-1)
{
nzrow_W=W_i[tryrowmatch+1]-W_i[tryrowmatch];
psb_l_t *trymatchindexrow;
trymatchindexrow= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
startj=W_i[tryrowmatch];
for(k=0; k<nzrow_W; ++k) trymatchindexrow[k]=W_j[startj+k];
s_trymatch(rowindex,tryrowmatch,
nrows_W, W_i, W_j, W_data,
jrowindex,ljrowindex,
trymatchindexrow,nzrow_W,rmatch);
free(trymatchindexrow);
}
}
if(rmatch[colindex]==-1 && ljcolindex!=0)
{
trycolmatch=jcolindex[0];
nzrow_W=W_i[colindex+1]-W_i[colindex];
startj=W_i[colindex];
k=0;
kindex=-1;
while(k<nzrow_W && kindex==-1)
{
if(W_j[startj+k]==trycolmatch) kindex=startj+k;
k++;
}
nweight=W_data[kindex];
ljcolindex=ljcolindex-1;
for(i=0; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
if(nweight > cweight && rmatch[trycolmatch]==-1)
{
nzrow_W=W_i[trycolmatch+1]-W_i[trycolmatch];
psb_l_t *trymatchindexcol;
trymatchindexcol= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
startj=W_i[trycolmatch];
for(k=0; k<nzrow_W; ++k) trymatchindexcol[k]=W_j[startj+k];
s_trymatch(colindex,trycolmatch,
nrows_W, W_i, W_j, W_data,
jcolindex,ljcolindex,
trymatchindexcol,nzrow_W,rmatch);
free(trymatchindexcol);
}
}
}
if(rmatch[rowindex]==-1 & rmatch[colindex]==-1)
{
rmatch[rowindex]=colindex;
rmatch[colindex]=rowindex;
}
return 0;
}
psb_l_t *s_CSRMatrixHMatch( psb_l_t nrows_B, psb_l_t ncols_B,
psb_l_t nnz_B, psb_l_t *B_i,
psb_l_t *B_j, psb_s_t *B_data)
{
psb_l_t i, j, k, *rmatch;
psb_s_t *c, alpha;
psb_l_t jbp, nzrows_B;
psb_s_t tmp=0.0;
psb_l_t rno, cno, nzrows_cno, startj, ljrowindex, ljjrowindex;
psb_l_t *jrowindex, *jjrowindex;
#if 0
psb_l_t *B_i = bcm_CSRMatrixI(B);
psb_l_t *B_j = bcm_CSRMatrixJ(B);
psb_s_t *B_data = bcm_CSRMatrixData(B);
psb_l_t nrows_B = bcm_CSRMatrixNumRows(B);
psb_l_t ncols_B = bcm_CSRMatrixNumCols(B);
psb_l_t nnz_B = bcm_CSRMatrixNumNonzeros(B);
#endif
// assert(nrows_B==ncols_B);
rmatch = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
for(i=0; i<nrows_B; ++i) rmatch[i]=-1;
jrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
jjrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
jbp=0;
for(i=0; i< nrows_B; ++i)
{
nzrows_B=B_i[i+1]-B_i[i];
for(j=0; j<nzrows_B; ++j) jrowindex[j]=B_j[jbp+j];
for(j=0; j<nzrows_B; ++j)
{
rno=i;
cno=B_j[jbp+j];
startj=B_i[cno];
nzrows_cno=B_i[cno+1]-startj;
for(k=0; k<nzrows_cno; ++k) jjrowindex[k]=B_j[startj+k];
if(rmatch[rno] == -1 && rmatch[cno] == -1)
s_trymatch(rno,cno,nrows_B,B_i,B_j,B_data,
jrowindex,nzrows_B,jjrowindex,nzrows_cno,rmatch);
}
jbp=jbp+nzrows_B;
}
free(jrowindex);
free(jjrowindex);
return rmatch;
}
void sMatching(psb_l_t NLVer, psb_l_t NLEdge,
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_s_t *edgeLocWeight,
psb_l_t *verDistance, psb_l_t *Mate)
{
psb_l_t *lmate;
lmate = s_CSRMatrixHMatch( NLVer, NLVer, NLEdge,
verLocPtr, verLocInd,edgeLocWeight);
for (psb_l_t i=0; i<NLVer; i++){
Mate[i] = lmate[i];
}
free(lmate);
return;
}
#endif
+81
View File
@@ -0,0 +1,81 @@
/*
AMG4PSBLAS version 1.2
Algebraic Multigrid Package
based on PSBLAS (Parallel Sparse BLAS version 3.9)
(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.
Includes material from BootCMatch, see copyright below.
*/
/*
BootCMatch
Bootstrap AMG based on Compatible weighted Matching, version 0.9
(C) Copyright 2017
Pasqua D'Ambra IAC-CNR, IT
Panayot S. Vassilevski Portland State University, OR USA
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 BootCMatch 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 BootCMatch 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.
*/
#include "amg_config.h"
#if defined(PSB_SERIAL_MPI)
#include "psb_types.h"
void dMatching(psb_l_t NLVer, psb_l_t NLEdge,
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_d_t *edgeLocWeight,
psb_l_t *verDistance, psb_l_t *Mate);
void sMatching(psb_l_t NLVer, psb_l_t NLEdge,
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_s_t *edgeLocWeight,
psb_l_t *verDistance, psb_l_t *Mate);
#endif
@@ -70,7 +70,7 @@
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
*/
#ifdef SERIAL_MPI
#ifdef PSB_SERIAL_MPI
#else
// DOUBLE PRECISION VERSION
@@ -86,7 +86,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
#ifdef PRINT_DEBUG_INFO_
cout<<"\n("<<myRank<<")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()"; fflush(stdout);
#endif
@@ -1313,7 +1313,7 @@ void salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
#ifdef PRINT_DEBUG_INFO_
cout<<"\n("<<myRank<<")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()"; fflush(stdout);
#endif
@@ -70,7 +70,7 @@
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
*/
//#define DEBUG_HANG_
#ifdef SERIAL_MPI
#ifdef PSB_SERIAL_MPI
#else
// DOUBLE PRECISION VERSION
@@ -102,7 +102,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
* i+1-th value is the position of the first element on the i+1-th row
*/
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
#ifdef PRINT_DEBUG_INFO_
cout << "\n(" << myRank << ")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()";
fflush(stdout);
@@ -583,7 +583,7 @@ void salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
* i+1-th value is the position of the first element on the i+1-th row
*/
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
#ifdef PRINT_DEBUG_INFO_
cout << "\n(" << myRank << ")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()";
fflush(stdout);
@@ -72,7 +72,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_c_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
implicit none
@@ -172,7 +172,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -71,7 +71,7 @@ subroutine amg_c_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_c_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
@@ -211,7 +211,7 @@ subroutine amg_c_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -98,11 +98,7 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
& ac,desc_ac, op_prol,op_restr,info)
use psb_base_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_inner_mat_asb
#endif
implicit none
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
type(amg_dml_parms), intent(inout) :: parms
@@ -133,8 +129,6 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
ictxt = desc_a%get_context()
call psb_info(ictxt,me,np)
#if !defined(SERIAL_MPI)
if (debug) write(0,*) me,' ',trim(name),' Start:',&
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
@@ -146,16 +140,17 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
case(amg_repl_mat_)
!
!
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
goto 9999
if (np>1) then
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
goto 9999
end if
case default
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
goto 9999
end select
#endif
call psb_erractionrestore(err_act)
return
@@ -98,11 +98,7 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
& ac,desc_ac, op_prol,op_restr,info)
use psb_base_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_mat_asb
#endif
implicit none
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
type(amg_dml_parms), intent(inout) :: parms
@@ -135,8 +131,6 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
return
end if
#if !defined(SERIAL_MPI)
if (debug) write(0,*) me,' ',trim(name),' Start:',&
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
@@ -199,7 +193,7 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
goto 9999
end select
#endif
call psb_erractionrestore(err_act)
return
@@ -135,11 +135,7 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
use psb_base_mod
use amg_d_inner_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_mat_bld
#endif
implicit none
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
@@ -176,7 +172,6 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
! algorithm specified by
!
#if !defined(SERIAL_MPI)
call clean_shortcuts(ag)
!
! When requesting smoothed aggregation we cannot use the
@@ -212,14 +207,12 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
call psb_errpush(psb_err_from_subroutine_,name,a_err='Inner aggrmat asb')
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
#if !defined(SERIAL_MPI)
contains
subroutine clean_shortcuts(ag)
@@ -248,5 +241,4 @@ contains
end if
end if
end subroutine clean_shortcuts
#endif
end subroutine amg_d_parmatch_aggregator_mat_bld
@@ -47,11 +47,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
use psb_base_mod
use amg_base_prec_type
use amg_d_inner_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_build_tprol
#endif
use iso_c_binding
implicit none
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
@@ -120,8 +116,6 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)
#if !defined(SERIAL_MPI)
match_algorithm = ag%matching_alg
n_sweeps = ag%n_sweeps
if (2**n_sweeps /= ag%orig_aggr_size) then
@@ -466,7 +460,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
call psb_errpush(psb_err_from_subroutine_,name,a_err='amg_bootCMatch_if')
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
@@ -110,11 +110,7 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
use amg_base_prec_type
use amg_d_inner_mod
use amg_d_base_aggregator_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_smth_bld
#endif
implicit none
! Arguments
@@ -194,8 +190,6 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
if (do_timings) call psb_tic(idx_phase1)
#if !defined(SERIAL_MPI)
naggr = nlaggr(me+1)
ntaggr = sum(nlaggr)
naggrm1 = sum(nlaggr(1:me))
@@ -403,7 +397,7 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done smooth_aggregate '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_d_inner_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld
#endif
implicit none
! Arguments
@@ -140,7 +136,6 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
#if !defined(SERIAL_MPI)
call a%cp_to(acsr)
call amg_d_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
@@ -154,7 +149,7 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done spmm_bld '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_d_inner_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld_inner
#endif
implicit none
! Arguments
@@ -139,7 +135,6 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
info=psb_success_
call psb_erractionsave(err_act)
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
debug_unit = psb_get_debug_unit()
@@ -163,7 +158,6 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
naggrm1 = sum(nlaggr(1:me))
naggrp1 = sum(nlaggr(1:me+1))
#if !defined(SERIAL_MPI)
!
! Here T_PROL should be arriving with GLOBAL indices on the cols
! and LOCAL indices on the rows.
@@ -203,11 +197,10 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
goto 9999
end if
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done smooth_aggregate '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_d_inner_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld_ov
#endif
implicit none
! Arguments
@@ -141,8 +137,6 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
#if !defined(SERIAL_MPI)
call a%mv_to(acsr)
call amg_d_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
@@ -158,7 +152,6 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done spmm_bld '
#endif
call psb_erractionrestore(err_act)
return
@@ -109,11 +109,7 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
use amg_base_prec_type
use amg_d_inner_mod
use amg_d_base_aggregator_mod
#if defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod
#else
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_unsmth_bld
#endif
implicit none
! Arguments
@@ -168,7 +164,6 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
goto 9999
end if
#if !defined(SERIAL_MPI)
nglob = desc_a%get_global_rows()
nrow = desc_a%get_local_rows()
ncol = desc_a%get_local_cols()
@@ -209,7 +204,8 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
call op_prol%mv_from(coo_prol)
if (debug) write(0,*) me,' ',trim(name),' After mv_from',psb_get_errstatus()
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),&
& ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
! write(0,*) me,' ',trim(name),' Final AC newstyle ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros()
if (debug) then
@@ -236,7 +232,6 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
@@ -72,7 +72,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_d_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
implicit none
@@ -172,7 +172,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -71,7 +71,7 @@ subroutine amg_d_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_d_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
@@ -211,7 +211,7 @@ subroutine amg_d_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -98,11 +98,7 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
& ac,desc_ac, op_prol,op_restr,info)
use psb_base_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_inner_mat_asb
#endif
implicit none
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
type(amg_sml_parms), intent(inout) :: parms
@@ -133,8 +129,6 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
ictxt = desc_a%get_context()
call psb_info(ictxt,me,np)
#if !defined(SERIAL_MPI)
if (debug) write(0,*) me,' ',trim(name),' Start:',&
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
@@ -146,16 +140,17 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
case(amg_repl_mat_)
!
!
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
goto 9999
if (np>1) then
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
goto 9999
end if
case default
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
goto 9999
end select
#endif
call psb_erractionrestore(err_act)
return
@@ -98,11 +98,7 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
& ac,desc_ac, op_prol,op_restr,info)
use psb_base_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_mat_asb
#endif
implicit none
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
type(amg_sml_parms), intent(inout) :: parms
@@ -135,8 +131,6 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
return
end if
#if !defined(SERIAL_MPI)
if (debug) write(0,*) me,' ',trim(name),' Start:',&
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
@@ -199,7 +193,7 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
goto 9999
end select
#endif
call psb_erractionrestore(err_act)
return
@@ -135,11 +135,7 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
use psb_base_mod
use amg_s_inner_mod
use amg_base_prec_type
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_mat_bld
#endif
implicit none
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
@@ -176,7 +172,6 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
! algorithm specified by
!
#if !defined(SERIAL_MPI)
call clean_shortcuts(ag)
!
! When requesting smoothed aggregation we cannot use the
@@ -212,14 +207,12 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
call psb_errpush(psb_err_from_subroutine_,name,a_err='Inner aggrmat asb')
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
#if !defined(SERIAL_MPI)
contains
subroutine clean_shortcuts(ag)
@@ -248,5 +241,4 @@ contains
end if
end if
end subroutine clean_shortcuts
#endif
end subroutine amg_s_parmatch_aggregator_mat_bld
@@ -47,11 +47,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
use psb_base_mod
use amg_base_prec_type
use amg_s_inner_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_build_tprol
#endif
use iso_c_binding
implicit none
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
@@ -120,8 +116,6 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)
#if !defined(SERIAL_MPI)
match_algorithm = ag%matching_alg
n_sweeps = ag%n_sweeps
if (2**n_sweeps /= ag%orig_aggr_size) then
@@ -466,7 +460,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
call psb_errpush(psb_err_from_subroutine_,name,a_err='amg_bootCMatch_if')
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
@@ -110,11 +110,7 @@ subroutine amg_s_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
use amg_base_prec_type
use amg_s_inner_mod
use amg_s_base_aggregator_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_smth_bld
#endif
implicit none
! Arguments
@@ -194,8 +190,6 @@ subroutine amg_s_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
if (do_timings) call psb_tic(idx_phase1)
#if !defined(SERIAL_MPI)
naggr = nlaggr(me+1)
ntaggr = sum(nlaggr)
naggrm1 = sum(nlaggr(1:me))
@@ -403,7 +397,7 @@ subroutine amg_s_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done smooth_aggregate '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_s_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_s_inner_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_spmm_bld
#endif
implicit none
! Arguments
@@ -140,7 +136,6 @@ subroutine amg_s_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
#if !defined(SERIAL_MPI)
call a%cp_to(acsr)
call amg_s_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
@@ -154,7 +149,7 @@ subroutine amg_s_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done spmm_bld '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_s_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_s_inner_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_spmm_bld_inner
#endif
implicit none
! Arguments
@@ -139,7 +135,6 @@ subroutine amg_s_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
info=psb_success_
call psb_erractionsave(err_act)
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
debug_unit = psb_get_debug_unit()
@@ -163,7 +158,6 @@ subroutine amg_s_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
naggrm1 = sum(nlaggr(1:me))
naggrp1 = sum(nlaggr(1:me+1))
#if !defined(SERIAL_MPI)
!
! Here T_PROL should be arriving with GLOBAL indices on the cols
! and LOCAL indices on the rows.
@@ -203,11 +197,10 @@ subroutine amg_s_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
goto 9999
end if
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done smooth_aggregate '
#endif
call psb_erractionrestore(err_act)
return
@@ -99,11 +99,7 @@ subroutine amg_s_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
& ac,desc_ac,op_prol,op_restr,t_prol,info)
use psb_base_mod
use amg_s_inner_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_spmm_bld_ov
#endif
implicit none
! Arguments
@@ -141,8 +137,6 @@ subroutine amg_s_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
#if !defined(SERIAL_MPI)
call a%mv_to(acsr)
call amg_s_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
@@ -158,7 +152,6 @@ subroutine amg_s_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Done spmm_bld '
#endif
call psb_erractionrestore(err_act)
return
@@ -109,11 +109,7 @@ subroutine amg_s_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
use amg_base_prec_type
use amg_s_inner_mod
use amg_s_base_aggregator_mod
#if defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod
#else
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_unsmth_bld
#endif
implicit none
! Arguments
@@ -168,7 +164,6 @@ subroutine amg_s_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
goto 9999
end if
#if !defined(SERIAL_MPI)
nglob = desc_a%get_global_rows()
nrow = desc_a%get_local_rows()
ncol = desc_a%get_local_cols()
@@ -209,7 +204,8 @@ subroutine amg_s_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
call op_prol%mv_from(coo_prol)
if (debug) write(0,*) me,' ',trim(name),' After mv_from',psb_get_errstatus()
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),&
& ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
! write(0,*) me,' ',trim(name),' Final AC newstyle ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros()
if (debug) then
@@ -236,7 +232,6 @@ subroutine amg_s_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
goto 9999
end if
#endif
call psb_erractionrestore(err_act)
return
@@ -72,7 +72,7 @@ subroutine amg_s_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_s_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
implicit none
@@ -172,7 +172,7 @@ subroutine amg_s_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -71,7 +71,7 @@ subroutine amg_s_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_s_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
@@ -211,7 +211,7 @@ subroutine amg_s_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -72,7 +72,7 @@ subroutine amg_z_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_z_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
implicit none
@@ -172,7 +172,7 @@ subroutine amg_z_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
@@ -71,7 +71,7 @@ subroutine amg_z_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
use psb_base_mod
use amg_base_prec_type
use amg_z_inner_mod
#if defined(OPENMP)
#if defined(PSB_OPENMP)
use omp_lib
#endif
@@ -211,7 +211,7 @@ subroutine amg_z_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
! Phase one: Start with disjoint groups.
!
naggr = 0
#if defined(OPENMP)
#if defined(PSB_OPENMP)
block
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
integer(psb_ipk_) :: myth,nths, kk
+1 -1
View File
@@ -1,6 +1,6 @@
#include "MatchBoxPC.h"
// TODO comment
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
void clean(MilanLongInt NLVer,
MilanInt myRank,
@@ -8,6 +8,7 @@
* @param edgeLocWeight
* @return
*/
#if !defined(PSB_SERIAL_MPI)
MilanLongInt firstComputeCandidateMateD(MilanLongInt adj1,
MilanLongInt adj2,
@@ -136,3 +137,4 @@ MilanLongInt computeCandidateMateS(MilanLongInt adj1,
return w;
}
#endif
+4
View File
@@ -41,7 +41,10 @@
#ifndef _static_Queue_
#define _static_Queue_
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "primitiveDataTypeDefinitions.h"
#include "preProcessorDirectives.h"
@@ -199,3 +202,4 @@ class staticQueue
};
#endif
#endif
@@ -1,4 +1,8 @@
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
void extractUChunk(
vector<MilanLongInt> &UChunkBeingProcessed,
vector<MilanLongInt> &U,
@@ -28,3 +32,4 @@ void extractUChunk(
} // End of critical U // End of critical U
}
#endif
@@ -1,4 +1,6 @@
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
/// Find the owner of a ghost node:
MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs)
@@ -26,3 +28,4 @@ MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
return Current;
} // End of findOwnerOfGhost()
#endif
+4
View File
@@ -1,4 +1,7 @@
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt StartIndex, MilanLongInt EndIndex,
MilanLongInt *numGhostEdges,
@@ -301,3 +304,4 @@ void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
} // End of single region
} // End of parallel region
}
#endif
@@ -1,4 +1,7 @@
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
/**
* //TODO documentation
* @param k
@@ -43,3 +46,4 @@ bool isAlreadyMatched(MilanLongInt node,
return val >= 0; // Already matched
}
#endif
@@ -1,4 +1,6 @@
#include "amg_config.h"
#include "MatchBoxPC.h"
#if !defined(PSB_SERIAL_MPI)
void PARALLEL_COMPUTE_CANDIDATE_MATE_BD(MilanLongInt NLVer,
MilanLongInt *verLocPtr,
@@ -53,4 +55,4 @@ void PARALLEL_COMPUTE_CANDIDATE_MATE_BS(MilanLongInt NLVer,
}
}
}
#endif
+4 -2
View File
@@ -41,6 +41,8 @@
#ifndef _preprocessor_Directives_
#define _preprocessor_Directives_
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
//I/O
#include <iostream>
@@ -72,10 +74,10 @@
#include <map>
//MPI:
#if !defined(SERIAL_MPI)
#if !defined(PSB_SERIAL_MPI)
#include "mpi.h"
#endif
#endif
#endif
+7 -5
View File
@@ -41,14 +41,16 @@
#ifndef _primitiveDataType_Definition_
#define _primitiveDataType_Definition_
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "preProcessorDirectives.h"
using namespace std;
//Comment out these if you do not need 64 bits.
//#ifndef BIT64
// #define BIT64
//#ifndef AMG_MATCHBOXP_BIT64
// #define AMG_MATCHBOXP_BIT64
//#endif
//Regular integer:
@@ -61,7 +63,7 @@ using namespace std;
//Regular long Integer:
#ifndef LONG_INT_H
#define LONG_INT_H
#ifdef BIT64
#ifdef AMG_MATCHBOXP_BIT64
typedef int64_t MilanLongInt;
// typedef MPI_LONG MilanMpiLongInt;
#else
@@ -106,7 +108,7 @@ using namespace std;
#define MilanIntMax INT_MAX
#define MilanIntMin INT_MIN
#ifdef BIT64
#ifdef AMG_MATCHBOXP_BIT64
#define MilanLongIntMax LONG_MAX
#define MilanLongIntMin -LONG_MAX
#else
@@ -152,5 +154,5 @@ const float FMINUS_INFINITY = -FPLUS_INFINITY;
#endif
#endif
#endif
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
void PROCESS_CROSS_EDGE(MilanLongInt *edge,
MilanLongInt *S)
@@ -21,3 +23,4 @@ void PROCESS_CROSS_EDGE(MilanLongInt *edge,
// End: PARALLEL_PROCESS_CROSS_EDGE_B
}
#endif
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
void PARALLEL_PROCESS_EXPOSED_VERTEX_BD(MilanLongInt NLVer,
MilanLongInt *candidateMate,
@@ -367,3 +369,4 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_BS(MilanLongInt NLVer,
} // End of parallel region
}
#endif
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
void processMatchedVerticesD(
MilanLongInt NLVer,
@@ -583,3 +585,4 @@ void processMatchedVerticesS(
} // End of parallel region
}
#endif
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
//#define DEBUG_HANG_
void processMatchedVerticesAndSendMessagesD(
@@ -589,3 +591,4 @@ void processMatchedVerticesAndSendMessagesS(
#endif
}
#endif
+2 -1
View File
@@ -1,6 +1,7 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
//#define DEBUG_HANG_
#if !defined(SERIAL_MPI)
void processMessagesD(
MilanLongInt NLVer,
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
void queuesTransfer(vector<MilanLongInt> &U,
vector<MilanLongInt> &privateU,
@@ -31,3 +33,4 @@ void queuesTransfer(vector<MilanLongInt> &U,
}
#endif
@@ -1,3 +1,5 @@
#include "amg_config.h"
#if !defined(PSB_SERIAL_MPI)
#include "MatchBoxPC.h"
void sendBundledMessages(MilanLongInt *numGhostEdges,
MilanInt *BufferSize,
@@ -154,7 +156,7 @@ void sendBundledMessages(MilanLongInt *numGhostEdges,
#pragma omp task depend(inout : OneMessageSize, *BufferSize) depend(out : numMessagesToSend) depend(in : *numGhostEdges)
{
#ifdef PRINT_DEBUG_INFO_
cout << "\n(" << myRank << ")Number of Ghost edges = " << *numGhostEdges;
cout << "\n(" << myRank << ")Total number of potential message X 2 = " << *numGhostEdges * 2;
@@ -206,3 +208,4 @@ void sendBundledMessages(MilanLongInt *numGhostEdges,
}
}
}
#endif
+4 -4
View File
@@ -127,9 +127,9 @@ subroutine amg_c_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Entering '
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
@@ -373,9 +373,9 @@ contains
info = psb_success_
ctxt = desc_a%get_context()
call psb_info(ctxt,me,np)
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
allocate(nlaggr(np),ilaggr(1))
+26 -26
View File
@@ -90,10 +90,10 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_c_ainv_solver
use amg_c_invk_solver
use amg_c_invt_solver
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_c_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_c_mumps_solver
#endif
@@ -329,10 +329,10 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_c_ainv_solver
use amg_c_invk_solver
use amg_c_invt_solver
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_c_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_c_mumps_solver
#endif
use amg_c_krm_solver, only : amg_c_krm_solver_type
@@ -480,9 +480,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -494,9 +494,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -506,14 +506,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -550,7 +550,7 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -566,14 +566,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -590,14 +590,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -709,9 +709,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(trim(string)))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -722,9 +722,9 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -734,14 +734,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -778,7 +778,7 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -794,14 +794,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -818,14 +818,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
+3 -3
View File
@@ -99,7 +99,7 @@ subroutine amg_cprecinit(ctxt,prec,ptype,info)
use amg_c_ilu_solver
use amg_c_gs_solver
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_c_slu_solver
#endif
@@ -230,9 +230,9 @@ subroutine amg_cprecinit(ctxt,prec,ptype,info)
end do
call prec%set('ML_CYCLE','VCYCLE',info)
call prec%set('SMOOTHER_TYPE','FBGS',info)
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call prec%set('COARSE_SOLVE','MUMPS',info)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call prec%set('COARSE_SOLVE','SLU',info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
+9 -9
View File
@@ -88,8 +88,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* October 15, 2003
*
*/
#ifdef Have_SLU_
#include "amg_config.h"
#ifdef AMG_HAVE_SLU
#include "slu_cdefs.h"
#define HANDLE_SIZE 8
@@ -111,7 +111,7 @@ typedef struct {
int amg_cslu_fact(int n, int nnz,
#ifdef HAVE_SLU_
#ifdef AMG_HAVE_SLU
complex *values,
#else
void *values,
@@ -128,7 +128,7 @@ int amg_cslu_fact(int n, int nnz,
*
*/
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
SuperMatrix A, AC;
SuperMatrix *L, *U;
int *perm_r; /* row permutations from partial pivoting */
@@ -177,10 +177,10 @@ int amg_cslu_fact(int n, int nnz,
panel_size = sp_ienv(1);
relax = sp_ienv(2);
#if defined(SLU_VERSION_5)
#if defined(AMG_SLU_VERSION_5)
cgstrf(&options, &AC, relax, panel_size, etree,
NULL, 0, perm_c, perm_r, L, U, &Glu, &stat, &info);
#elif defined(SLU_VERSION_4)
#elif defined(AMG_SLU_VERSION_4)
cgstrf(&options, &AC, relax, panel_size, etree,
NULL, 0, perm_c, perm_r, L, U, &stat, &info);
#else
@@ -229,7 +229,7 @@ int amg_cslu_fact(int n, int nnz,
int amg_cslu_solve(int itrans, int n, int nrhs,
#ifdef HAVE_SLU_
#ifdef AMG_HAVE_SLU
complex *b,
#else
void *b,
@@ -242,7 +242,7 @@ int amg_cslu_solve(int itrans, int n, int nrhs,
*
*/
int info;
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
SuperMatrix B;
SuperMatrix *L, *U;
int *perm_r; /* row permutations from partial pivoting */
@@ -304,7 +304,7 @@ int amg_cslu_free(void *f_factors)
* free all storage in the end
*
*/
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
factors_t *LUfactors;
/* Free the LU factors in the factors handle */
+4 -4
View File
@@ -127,9 +127,9 @@ subroutine amg_d_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Entering '
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
@@ -373,9 +373,9 @@ contains
info = psb_success_
ctxt = desc_a%get_context()
call psb_info(ctxt,me,np)
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
allocate(nlaggr(np),ilaggr(1))
+40 -40
View File
@@ -90,16 +90,16 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_d_ainv_solver
use amg_d_invk_solver
use amg_d_invt_solver
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
use amg_d_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
#if defined(AMG_HAVE_SLUDIST)
use amg_d_sludist_solver
#endif
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_d_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_d_mumps_solver
#endif
@@ -335,16 +335,16 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_d_ainv_solver
use amg_d_invk_solver
use amg_d_invt_solver
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
use amg_d_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
#if defined(AMG_HAVE_SLUDIST)
use amg_d_sludist_solver
#endif
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_d_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_d_mumps_solver
#endif
use amg_d_krm_solver, only : amg_d_krm_solver_type
@@ -492,11 +492,11 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -508,11 +508,11 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -522,14 +522,14 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -566,7 +566,7 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -582,21 +582,21 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -613,28 +613,28 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLUDIST_)
#if defined(AMG_HAVE_SLUDIST)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
#elif defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -746,11 +746,11 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(trim(string)))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -761,11 +761,11 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -775,14 +775,14 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -819,7 +819,7 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -835,21 +835,21 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -866,28 +866,28 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLUDIST_)
#if defined(AMG_HAVE_SLUDIST)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_sludist_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
#elif defined(AMG_HAVE_UMF)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
+5 -5
View File
@@ -100,10 +100,10 @@ subroutine amg_dprecinit(ctxt,prec,ptype,info)
use amg_d_gs_solver
use amg_d_poly_smoother
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
use amg_d_umf_solver
#endif
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_d_slu_solver
#endif
@@ -242,11 +242,11 @@ subroutine amg_dprecinit(ctxt,prec,ptype,info)
end do
call prec%set('ML_CYCLE','VCYCLE',info)
call prec%set('SMOOTHER_TYPE','FBGS',info)
#if defined(HAVE_UMF_)
#if defined(AMG_HAVE_UMF)
call prec%set('COARSE_SOLVE','UMF',info)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call prec%set('COARSE_SOLVE','MUMPS',info)
#elif defined(HAVE_SLU_)
#elif defined(AMG_HAVE_SLU)
call prec%set('COARSE_SOLVE','SLU',info)
#else
call prec%set('COARSE_SOLVE','ILU',info)
+7 -7
View File
@@ -87,8 +87,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* October 15, 2003
*
*/
#ifdef Have_SLU_
#include "amg_config.h"
#ifdef AMG_HAVE_SLU
#include "slu_ddefs.h"
#define HANDLE_SIZE 8
@@ -122,7 +122,7 @@ int amg_dslu_fact(int n, int nnz, double *values,
*
*/
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
SuperMatrix A, AC;
SuperMatrix *L, *U;
int *perm_r; /* row permutations from partial pivoting */
@@ -171,10 +171,10 @@ int amg_dslu_fact(int n, int nnz, double *values,
panel_size = sp_ienv(1);
relax = sp_ienv(2);
#if defined(SLU_VERSION_5)
#if defined(AMG_SLU_VERSION_5)
dgstrf(&options, &AC, relax, panel_size, etree,
NULL, 0, perm_c, perm_r, L, U, &Glu, &stat, &info);
#elif defined(SLU_VERSION_4)
#elif defined(AMG_SLU_VERSION_4)
dgstrf(&options, &AC, relax, panel_size, etree,
NULL, 0, perm_c, perm_r, L, U, &stat, &info);
#else
@@ -231,7 +231,7 @@ int amg_dslu_solve(int itrans, int n, int nrhs, double *b, int ldb,
*
*/
int info;
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
SuperMatrix B;
SuperMatrix *L, *U;
int *perm_r; /* row permutations from partial pivoting */
@@ -285,7 +285,7 @@ int amg_dslu_free(void *f_factors)
* free all storage in the end
*
*/
#ifdef Have_SLU_
#ifdef AMG_HAVE_SLU
factors_t *LUfactors;
/* Free the LU factors in the factors handle */
+20 -19
View File
@@ -88,13 +88,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef Have_SLUDist_
#include "amg_config.h"
#ifdef AMG_HAVE_SLUDIST
#include <math.h>
#include "superlu_ddefs.h"
#define HANDLE_SIZE 8
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
typedef struct {
SuperMatrix *A;
dLUstruct_t *LUstruct;
@@ -131,11 +132,11 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
*
*/
#ifdef Have_SLUDist_
#ifdef AMG_HAVE_SLUDIST
SuperMatrix *A;
NRformat_loc *Astore;
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
@@ -148,9 +149,9 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
int i, panel_size, permc_spec, relax, info;
trans_t trans;
double drop_tol = 0.0, b[1], berr[1];
#if (SLUD_VERSION_>=50)
#if (AMG_SLUD_VERSION>=50)
superlu_dist_options_t options;
#elif (SLUD_VERSION_>=30)
#elif (AMG_SLUD_VERSION>=30)
superlu_options_t options;
#else
choke_on_me;
@@ -174,7 +175,7 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
SLU_NR_loc, SLU_D, SLU_GE);
/* Initialize ScalePermstruct and LUstruct. */
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
ScalePermstruct = (dScalePermstruct_t *) SUPERLU_MALLOC(sizeof(dScalePermstruct_t));
LUstruct = (dLUstruct_t *) SUPERLU_MALLOC(sizeof(dLUstruct_t));
dScalePermstructInit(n,n, ScalePermstruct);
@@ -183,11 +184,11 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
ScalePermstructInit(n,n, ScalePermstruct);
#endif
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
dLUstructInit(n, LUstruct);
#elif (SLUD_VERSION_>=40)
#elif (AMG_SLUD_VERSION>=40)
LUstructInit(n, LUstruct);
#elif (SLUD_VERSION_>=30)
#elif (AMG_SLUD_VERSION>=30)
LUstructInit(n,n, LUstruct);
#else
choke_on_me;
@@ -243,9 +244,9 @@ int amg_dsludist_solve(int itrans, int n, int nrhs,
* performs triangular solve
*
*/
#ifdef Have_SLUDist_
#ifdef AMG_HAVE_SLUDIST
SuperMatrix *A;
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
@@ -259,9 +260,9 @@ int amg_dsludist_solve(int itrans, int n, int nrhs,
trans_t trans;
double drop_tol = 0.0;
double *berr;
#if (SLUD_VERSION_>=50)
#if (AMG_SLUD_VERSION>=50)
superlu_dist_options_t options;
#elif (SLUD_VERSION_>=30)
#elif (AMG_SLUD_VERSION>=30)
superlu_options_t options;
#else
choke_on_me;
@@ -329,9 +330,9 @@ int amg_dsludist_free(void *f_factors)
* free all storage in the end
*
*/
#ifdef Have_SLUDist_
#ifdef AMG_HAVE_SLUDIST
SuperMatrix *A;
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
dScalePermstruct_t *ScalePermstruct;
dLUstruct_t *LUstruct;
dSOLVEstruct_t SOLVEstruct;
@@ -345,9 +346,9 @@ int amg_dsludist_free(void *f_factors)
trans_t trans;
double drop_tol = 0.0;
double *berr;
#if (SLUD_VERSION_>=50)
#if (AMG_SLUD_VERSION>=50)
superlu_dist_options_t options;
#elif (SLUD_VERSION_>=30)
#elif (AMG_SLUD_VERSION>=30)
superlu_options_t options;
#else
choke_on_me;
@@ -368,7 +369,7 @@ int amg_dsludist_free(void *f_factors)
// we either have a leak or a segfault here.
// To be investigated further.
//Destroy_CompRowLoc_Matrix_dist(A);
#if (SLUD_VERSION_>=63)
#if (AMG_SLUD_VERSION>=63)
dScalePermstructFree(ScalePermstruct);
dLUstructFree(LUstruct);
#else
+5 -6
View File
@@ -73,10 +73,9 @@ Availability:
http://www.cise.ufl.edu/research/sparse/umfpack
*/
#include <stdio.h>
#ifdef Have_UMF_
#include "amg_config.h"
#ifdef AMG_HAVE_UMF
#include "umfpack.h"
#endif
@@ -88,7 +87,7 @@ int amg_dumf_fact(int n, int nnz,
{
#ifdef Have_UMF_
#ifdef AMG_HAVE_UMF
double Info [UMFPACK_INFO], Control [UMFPACK_CONTROL];
void *Symbolic, *Numeric ;
int i, info;
@@ -146,7 +145,7 @@ int amg_dumf_solve(int itrans, int n,
void *numptr)
{
#ifdef Have_UMF_
#ifdef AMG_HAVE_UMF
double Info [UMFPACK_INFO], Control [UMFPACK_CONTROL];
void *Symbolic, *Numeric ;
int i,trans, info;
@@ -178,7 +177,7 @@ int amg_dumf_solve(int itrans, int n,
int amg_dumf_free(void *symptr, void *numptr)
{
#ifdef Have_UMF_
#ifdef AMG_HAVE_UMF
void *Symbolic, *Numeric ;
Symbolic = symptr;
Numeric = numptr;
+4 -4
View File
@@ -127,9 +127,9 @@ subroutine amg_s_extprol_bld(a,desc_a,p,prolv,restrv,info,amold,vmold,imold)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& 'Entering '
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
@@ -373,9 +373,9 @@ contains
info = psb_success_
ctxt = desc_a%get_context()
call psb_info(ctxt,me,np)
#if defined(LPK8)
#if defined(PSB_LPK8)
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Need fix for LPK8')
call psb_errpush(info,name,a_err='Need fix for PSB_LPK8')
goto 9999
#else
allocate(nlaggr(np),ilaggr(1))
+26 -26
View File
@@ -90,10 +90,10 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use amg_s_ainv_solver
use amg_s_invk_solver
use amg_s_invt_solver
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_s_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_s_mumps_solver
#endif
@@ -329,10 +329,10 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use amg_s_ainv_solver
use amg_s_invk_solver
use amg_s_invt_solver
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
use amg_s_slu_solver
#endif
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
use amg_s_mumps_solver
#endif
use amg_s_krm_solver, only : amg_s_krm_solver_type
@@ -480,9 +480,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(string))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -494,9 +494,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -506,14 +506,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -550,7 +550,7 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -566,14 +566,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -590,14 +590,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -709,9 +709,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
select case (psb_toupper(trim(string)))
case('BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -722,9 +722,9 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('L1-BJAC')
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set('SUB_SOLVE',amg_ilu_n_,info,pos=pos)
@@ -734,14 +734,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_distr_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info)
case('SLU')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -778,7 +778,7 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
case('MUMPS')
#if defined(HAVE_MUMPS_)
#if defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -794,14 +794,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
#endif
case('UMF')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &
@@ -818,14 +818,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
#endif
case('SLUDIST')
#if defined(HAVE_SLU_)
#if defined(AMG_HAVE_SLU)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos)
if (hier_asb) &
& call amg_warn_coarse_mat(p%precv(nlev_)%parms%get_coarse_mat(),&
& amg_repl_mat_)
call p%precv(nlev_)%set('COARSE_MAT',amg_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
#elif defined(AMG_HAVE_MUMPS)
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos)
call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos)
if (hier_asb) &

Some files were not shown because too many files have changed in this diff Show More