mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-07 07:04:59 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e08b8b7072 | ||
|
|
1faa0d57b3 | ||
|
|
64c1c9bbbd | ||
|
|
f660aa7cde | ||
|
|
d4e3d13a7d | ||
|
|
03c23d60ae | ||
|
|
c1fa595f0c | ||
|
|
463f5cc2eb | ||
|
|
d96e747578 | ||
|
|
cbf455411e | ||
|
|
62f630175a | ||
|
|
90b2f47d3e | ||
|
|
95a2784b69 | ||
|
|
dbd62f603f | ||
|
|
ecac67c1cf | ||
|
|
29c6ac416c | ||
|
|
aece94c0fd | ||
|
|
838eaa4d83 | ||
|
|
dd1f335d78 |
@@ -1,5 +1,4 @@
|
||||
$Format:%d%n%n$
|
||||
# Fall back version, probably last release:
|
||||
1.2.1
|
||||
|
||||
# AMG4PSBLAS version file.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
(C) Copyright 2025 Salvatore Filippone
|
||||
(C) Copyright 2025 Pasqua D'Ambra
|
||||
(C) Copyright 2025 Fabio Durastante
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
@@ -345,7 +345,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -636,6 +636,11 @@ contains
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free(info)
|
||||
if (psb_errstatus_fatal()) then
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
end do
|
||||
deallocate(prec%precv,stat=info)
|
||||
end if
|
||||
@@ -666,6 +671,10 @@ contains
|
||||
info = psb_err_internal_error_; goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! In the internals, do FREE on components,
|
||||
! but do not deallocate them
|
||||
!
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free_smoothers(info)
|
||||
|
||||
@@ -345,7 +345,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -279,7 +279,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -636,6 +636,11 @@ contains
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free(info)
|
||||
if (psb_errstatus_fatal()) then
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
end do
|
||||
deallocate(prec%precv,stat=info)
|
||||
end if
|
||||
@@ -666,6 +671,10 @@ contains
|
||||
info = psb_err_internal_error_; goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! In the internals, do FREE on components,
|
||||
! but do not deallocate them
|
||||
!
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free_smoothers(info)
|
||||
|
||||
@@ -345,7 +345,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -279,7 +279,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -636,6 +636,11 @@ contains
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free(info)
|
||||
if (psb_errstatus_fatal()) then
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
end do
|
||||
deallocate(prec%precv,stat=info)
|
||||
end if
|
||||
@@ -666,6 +671,10 @@ contains
|
||||
info = psb_err_internal_error_; goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! In the internals, do FREE on components,
|
||||
! but do not deallocate them
|
||||
!
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free_smoothers(info)
|
||||
|
||||
@@ -345,7 +345,6 @@ contains
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -636,6 +636,11 @@ contains
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free(info)
|
||||
if (psb_errstatus_fatal()) then
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
end do
|
||||
deallocate(prec%precv,stat=info)
|
||||
end if
|
||||
@@ -666,6 +671,10 @@ contains
|
||||
info = psb_err_internal_error_; goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! In the internals, do FREE on components,
|
||||
! but do not deallocate them
|
||||
!
|
||||
if (allocated(prec%precv)) then
|
||||
do i=1,size(prec%precv)
|
||||
call prec%precv(i)%free_smoothers(info)
|
||||
|
||||
@@ -53,7 +53,6 @@ subroutine amg_c_as_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -52,7 +52,6 @@ subroutine amg_c_base_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
end if
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
|
||||
@@ -53,7 +53,6 @@ subroutine amg_d_as_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -52,7 +52,6 @@ subroutine amg_d_base_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
end if
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
|
||||
@@ -53,7 +53,6 @@ subroutine amg_s_as_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -52,7 +52,6 @@ subroutine amg_s_base_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
end if
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
|
||||
@@ -53,7 +53,6 @@ subroutine amg_z_as_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
call psb_errpush(info,name)
|
||||
|
||||
@@ -52,7 +52,6 @@ subroutine amg_z_base_smoother_free(sm,info)
|
||||
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%free(info)
|
||||
if (info == psb_success_) deallocate(sm%sv,stat=info)
|
||||
end if
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_alloc_dealloc_
|
||||
|
||||
@@ -91,11 +91,7 @@ subroutine amg_c_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = cone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
@@ -176,11 +172,7 @@ subroutine amg_c_l1_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = cone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -100,7 +100,7 @@ subroutine amg_c_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = cone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -103,7 +103,7 @@ subroutine amg_c_l1_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = cone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -91,11 +91,7 @@ subroutine amg_d_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = done/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
@@ -176,11 +172,7 @@ subroutine amg_d_l1_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = done/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -100,7 +100,7 @@ subroutine amg_d_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = done/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -103,7 +103,7 @@ subroutine amg_d_l1_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = done/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -91,11 +91,7 @@ subroutine amg_s_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = sone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
@@ -176,11 +172,7 @@ subroutine amg_s_l1_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = sone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -100,7 +100,7 @@ subroutine amg_s_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = sone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -103,7 +103,7 @@ subroutine amg_s_l1_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = sone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -91,11 +91,7 @@ subroutine amg_z_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = zone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
@@ -176,11 +172,7 @@ subroutine amg_z_l1_diag_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = zone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
if (allocated(sv%dv)) then
|
||||
call sv%dv%free(info)
|
||||
deallocate(sv%dv)
|
||||
end if
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -100,7 +100,7 @@ subroutine amg_z_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = zone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -103,7 +103,7 @@ subroutine amg_z_l1_jac_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
sv%d(i) = zone/sv%d(i)
|
||||
end if
|
||||
end do
|
||||
allocate(sv%dv,stat=info)
|
||||
if (.not.allocated(sv%dv)) allocate(sv%dv,stat=info)
|
||||
if (info == psb_success_) then
|
||||
call sv%dv%bld(sv%d)
|
||||
if (present(vmold)) call sv%dv%cnv(vmold)
|
||||
|
||||
@@ -11,7 +11,7 @@ amg_c_dprec* amg_c_dprec_new()
|
||||
}
|
||||
|
||||
|
||||
psb_i_t amg_c_dprec_delete(amg_c_dprec* p)
|
||||
psb_c_i_t amg_c_dprec_delete(amg_c_dprec* p)
|
||||
{
|
||||
int iret;
|
||||
iret=amg_c_dprecfree(p);
|
||||
|
||||
+16
-16
@@ -17,25 +17,25 @@ extern "C" {
|
||||
} amg_c_dprec;
|
||||
|
||||
amg_c_dprec* amg_c_dprec_new();
|
||||
psb_i_t amg_c_dprec_delete(amg_c_dprec* p);
|
||||
psb_c_i_t amg_c_dprec_delete(amg_c_dprec* p);
|
||||
|
||||
psb_i_t amg_c_dprecinit(psb_c_ctxt cctxt, amg_c_dprec *ph, const char *ptype);
|
||||
psb_i_t amg_c_dprecseti(amg_c_dprec *ph, const char *what, psb_i_t val);
|
||||
psb_i_t amg_c_dprecsetc(amg_c_dprec *ph, const char *what, const char *val);
|
||||
psb_i_t amg_c_dprecsetr(amg_c_dprec *ph, const char *what, double val);
|
||||
psb_i_t amg_c_dprecbld(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_i_t amg_c_dhierarchy_build(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_i_t amg_c_dsmoothers_build(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_i_t amg_c_dsmoothers_build_opt(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph, const char *afmt, const char *chfmt);
|
||||
psb_i_t amg_c_dprecapply(amg_c_dprec *ph, psb_c_dvector *bh, psb_c_dvector *xh, psb_c_descriptor *cdh);
|
||||
psb_i_t amg_c_dprecapply_opt(amg_c_dprec *ph, psb_c_dvector *bh, psb_c_dvector *xh, psb_c_descriptor *cdh, const char *ctrans);
|
||||
psb_i_t amg_c_dprecfree(amg_c_dprec *ph);
|
||||
psb_i_t amg_c_dprecbld_opt(psb_c_dspmat *ah, psb_c_descriptor *cdh,
|
||||
psb_c_i_t amg_c_dprecinit(psb_c_ctxt cctxt, amg_c_dprec *ph, const char *ptype);
|
||||
psb_c_i_t amg_c_dprecseti(amg_c_dprec *ph, const char *what, psb_c_i_t val);
|
||||
psb_c_i_t amg_c_dprecsetc(amg_c_dprec *ph, const char *what, const char *val);
|
||||
psb_c_i_t amg_c_dprecsetr(amg_c_dprec *ph, const char *what, double val);
|
||||
psb_c_i_t amg_c_dprecbld(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_c_i_t amg_c_dhierarchy_build(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_c_i_t amg_c_dsmoothers_build(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph);
|
||||
psb_c_i_t amg_c_dsmoothers_build_opt(psb_c_dspmat *ah, psb_c_descriptor *cdh, amg_c_dprec *ph, const char *afmt, const char *chfmt);
|
||||
psb_c_i_t amg_c_dprecapply(amg_c_dprec *ph, psb_c_dvector *bh, psb_c_dvector *xh, psb_c_descriptor *cdh);
|
||||
psb_c_i_t amg_c_dprecapply_opt(amg_c_dprec *ph, psb_c_dvector *bh, psb_c_dvector *xh, psb_c_descriptor *cdh, const char *ctrans);
|
||||
psb_c_i_t amg_c_dprecfree(amg_c_dprec *ph);
|
||||
psb_c_i_t amg_c_dprecbld_opt(psb_c_dspmat *ah, psb_c_descriptor *cdh,
|
||||
amg_c_dprec *ph, const char *afmt);
|
||||
psb_i_t amg_c_ddescr(amg_c_dprec *ph);
|
||||
psb_i_t amg_c_dallocate_wrk(amg_c_dprec *ph, const char *chfmt);
|
||||
psb_c_i_t amg_c_ddescr(amg_c_dprec *ph);
|
||||
psb_c_i_t amg_c_dallocate_wrk(amg_c_dprec *ph, const char *chfmt);
|
||||
|
||||
psb_i_t amg_c_dkrylov(const char *method, psb_c_dspmat *ah, amg_c_dprec *ph,
|
||||
psb_c_i_t amg_c_dkrylov(const char *method, psb_c_dspmat *ah, amg_c_dprec *ph,
|
||||
psb_c_dvector *bh, psb_c_dvector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ amg_c_zprec* amg_c_new_zprec()
|
||||
}
|
||||
|
||||
|
||||
psb_i_t amg_c_delete_zprec(amg_c_zprec* p)
|
||||
psb_c_i_t amg_c_delete_zprec(amg_c_zprec* p)
|
||||
{
|
||||
int iret;
|
||||
iret=amg_c_zprecfree(p);
|
||||
|
||||
+16
-16
@@ -19,26 +19,26 @@ extern "C"
|
||||
} amg_c_zprec;
|
||||
|
||||
amg_c_zprec *amg_c_zprec_new();
|
||||
psb_i_t amg_c_zprec_delete(amg_c_zprec *p);
|
||||
psb_c_i_t amg_c_zprec_delete(amg_c_zprec *p);
|
||||
|
||||
psb_i_t amg_c_zprecinit(psb_c_ctxt cctxt, amg_c_zprec *ph, const char *ptype);
|
||||
psb_i_t amg_c_zprecseti(amg_c_zprec *ph, const char *what, psb_i_t val);
|
||||
psb_i_t amg_c_zprecsetc(amg_c_zprec *ph, const char *what, const char *val);
|
||||
psb_i_t amg_c_zprecsetr(amg_c_zprec *ph, const char *what, double val);
|
||||
psb_i_t amg_c_zprecbld(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_i_t amg_c_zhierarchy_build(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_i_t amg_c_zsmoothers_build(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_i_t amg_c_zsmoothers_build_opt(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph, const char *afmt, const char *chfmt);
|
||||
psb_i_t amg_c_zprecapply(amg_c_zprec *ph, psb_c_zvector *bh, psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||
psb_i_t amg_c_zprecapply_opt(amg_c_zprec *ph, psb_c_zvector *bh, psb_c_zvector *xh, psb_c_descriptor *cdh, const char *ctrans);
|
||||
psb_i_t amg_c_zprecfree(amg_c_zprec *ph);
|
||||
psb_i_t amg_c_zprecbld_opt(psb_c_zspmat *ah, psb_c_descriptor *cdh,
|
||||
psb_c_i_t amg_c_zprecinit(psb_c_ctxt cctxt, amg_c_zprec *ph, const char *ptype);
|
||||
psb_c_i_t amg_c_zprecseti(amg_c_zprec *ph, const char *what, psb_c_i_t val);
|
||||
psb_c_i_t amg_c_zprecsetc(amg_c_zprec *ph, const char *what, const char *val);
|
||||
psb_c_i_t amg_c_zprecsetr(amg_c_zprec *ph, const char *what, double val);
|
||||
psb_c_i_t amg_c_zprecbld(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_c_i_t amg_c_zhierarchy_build(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_c_i_t amg_c_zsmoothers_build(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph);
|
||||
psb_c_i_t amg_c_zsmoothers_build_opt(psb_c_zspmat *ah, psb_c_descriptor *cdh, amg_c_zprec *ph, const char *afmt, const char *chfmt);
|
||||
psb_c_i_t amg_c_zprecapply(amg_c_zprec *ph, psb_c_zvector *bh, psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||
psb_c_i_t amg_c_zprecapply_opt(amg_c_zprec *ph, psb_c_zvector *bh, psb_c_zvector *xh, psb_c_descriptor *cdh, const char *ctrans);
|
||||
psb_c_i_t amg_c_zprecfree(amg_c_zprec *ph);
|
||||
psb_c_i_t amg_c_zprecbld_opt(psb_c_zspmat *ah, psb_c_descriptor *cdh,
|
||||
amg_c_zprec *ph, const char *afmt);
|
||||
|
||||
psb_i_t amg_c_zdescr(amg_c_zprec *ph);
|
||||
psb_i_t amg_c_zallocate_wrk(amg_c_zprec *ph, const char *chfmt);
|
||||
psb_c_i_t amg_c_zdescr(amg_c_zprec *ph);
|
||||
psb_c_i_t amg_c_zallocate_wrk(amg_c_zprec *ph, const char *chfmt);
|
||||
|
||||
psb_i_t amg_c_zkrylov(const char *method, psb_c_zspmat *ah, amg_c_zprec *ph,
|
||||
psb_c_i_t amg_c_zkrylov(const char *method, psb_c_zspmat *ah, amg_c_zprec *ph,
|
||||
psb_c_zvector *bh, psb_c_zvector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
|
||||
@@ -172,15 +172,17 @@ contains
|
||||
end function amg_c_dprecbld
|
||||
|
||||
function amg_c_dhierarchy_build(ah,cdh,ph) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_c_ipk_) :: res
|
||||
type(psb_c_object_type) :: ph,ah,cdh
|
||||
integer(psb_ipk_) :: iret
|
||||
type(amg_dprec_type), pointer :: precp
|
||||
type(psb_dspmat_type), pointer :: ap
|
||||
type(psb_desc_type), pointer :: descp
|
||||
character(len=80) :: fptype
|
||||
integer(psb_ipk_) :: iret, act
|
||||
|
||||
|
||||
res = -1
|
||||
|
||||
@@ -204,11 +206,16 @@ contains
|
||||
|
||||
res = AMGC_ERR_FILTER(iret)
|
||||
AMGC_ERR_HANDLE(res)
|
||||
|
||||
|
||||
if (res /=0) then
|
||||
act = psb_act_abort_
|
||||
call psb_error_handler(act)
|
||||
end if
|
||||
return
|
||||
end function amg_c_dhierarchy_build
|
||||
|
||||
function amg_c_dsmoothers_build(ah,cdh,ph) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_c_ipk_) :: res
|
||||
@@ -217,7 +224,7 @@ contains
|
||||
type(psb_dspmat_type), pointer :: ap
|
||||
type(psb_desc_type), pointer :: descp
|
||||
character(len=80) :: fptype
|
||||
integer(psb_ipk_) :: iret
|
||||
integer(psb_ipk_) :: iret, act
|
||||
|
||||
res = -1
|
||||
|
||||
@@ -241,7 +248,10 @@ contains
|
||||
|
||||
res = AMGC_ERR_FILTER(iret)
|
||||
AMGC_ERR_HANDLE(res)
|
||||
|
||||
if (res /=0) then
|
||||
act = psb_act_abort_
|
||||
call psb_error_handler(act)
|
||||
end if
|
||||
return
|
||||
end function amg_c_dsmoothers_build
|
||||
|
||||
@@ -371,7 +381,7 @@ contains
|
||||
type(psb_c_object_type) :: ah,cdh,ph,bh,xh
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
|
||||
|
||||
res= amg_c_dkrylov_opt(methd, ah, ph, bh, xh, options%eps,cdh, &
|
||||
& itmax=options%itmax, iter=options%iter,&
|
||||
& itrace=options%itrace, istop=options%istop,&
|
||||
|
||||
@@ -140,11 +140,11 @@ contains
|
||||
|
||||
integer(psb_c_ipk_) :: res
|
||||
type(psb_c_object_type) :: ph,ah,cdh
|
||||
integer(psb_ipk_) :: iret
|
||||
type(amg_zprec_type), pointer :: precp
|
||||
type(psb_zspmat_type), pointer :: ap
|
||||
type(psb_desc_type), pointer :: descp
|
||||
character(len=80) :: fptype
|
||||
integer(psb_ipk_) :: iret
|
||||
|
||||
res = -1
|
||||
|
||||
@@ -173,15 +173,17 @@ contains
|
||||
end function amg_c_zprecbld
|
||||
|
||||
function amg_c_zhierarchy_build(ah,cdh,ph) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_c_ipk_) :: res
|
||||
type(psb_c_object_type) :: ph,ah,cdh
|
||||
integer(psb_ipk_) :: iret
|
||||
type(amg_zprec_type), pointer :: precp
|
||||
type(psb_zspmat_type), pointer :: ap
|
||||
type(psb_desc_type), pointer :: descp
|
||||
character(len=80) :: fptype
|
||||
integer(psb_ipk_) :: iret, act
|
||||
|
||||
|
||||
res = -1
|
||||
|
||||
@@ -206,19 +208,24 @@ contains
|
||||
res = AMGC_ERR_FILTER(iret)
|
||||
AMGC_ERR_HANDLE(res)
|
||||
|
||||
if (res /=0) then
|
||||
act = psb_act_abort_
|
||||
call psb_error_handler(act)
|
||||
end if
|
||||
return
|
||||
end function amg_c_zhierarchy_build
|
||||
|
||||
function amg_c_zsmoothers_build(ah,cdh,ph) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_c_ipk_) :: res
|
||||
type(psb_c_object_type) :: ph,ah,cdh
|
||||
integer(psb_ipk_) :: iret
|
||||
type(amg_zprec_type), pointer :: precp
|
||||
type(psb_zspmat_type), pointer :: ap
|
||||
type(psb_desc_type), pointer :: descp
|
||||
character(len=80) :: fptype
|
||||
integer(psb_ipk_) :: iret, act
|
||||
|
||||
res = -1
|
||||
|
||||
@@ -243,6 +250,11 @@ contains
|
||||
res = AMGC_ERR_FILTER(iret)
|
||||
AMGC_ERR_HANDLE(res)
|
||||
|
||||
if (res /=0) then
|
||||
act = psb_act_abort_
|
||||
call psb_error_handler(act)
|
||||
end if
|
||||
|
||||
return
|
||||
end function amg_c_zsmoothers_build
|
||||
|
||||
|
||||
+13
-13
@@ -123,16 +123,16 @@ double g(double x, double y, double z)
|
||||
|
||||
#define NBMAX 20
|
||||
|
||||
psb_i_t matgen(psb_c_ctxt cctxt, psb_i_t nl, psb_i_t idim, psb_l_t vl[],
|
||||
psb_c_i_t matgen(psb_c_ctxt cctxt, psb_c_i_t nl, psb_c_i_t idim, psb_c_l_t vl[],
|
||||
psb_c_dspmat *ah,psb_c_descriptor *cdh,
|
||||
psb_c_dvector *xh, psb_c_dvector *bh, psb_c_dvector *rh)
|
||||
{
|
||||
psb_i_t iam, np;
|
||||
psb_l_t ix, iy, iz, el,glob_row;
|
||||
psb_i_t i, k, info,ret;
|
||||
psb_c_i_t iam, np;
|
||||
psb_c_l_t ix, iy, iz, el,glob_row;
|
||||
psb_c_i_t i, k, info,ret;
|
||||
double x, y, z, deltah, sqdeltah, deltah2;
|
||||
double val[10*NBMAX], zt[NBMAX];
|
||||
psb_l_t irow[10*NBMAX], icol[10*NBMAX];
|
||||
psb_c_l_t irow[10*NBMAX], icol[10*NBMAX];
|
||||
|
||||
info = 0;
|
||||
psb_c_info(cctxt,&iam,&np);
|
||||
@@ -254,15 +254,15 @@ void get_hparm(FILE *fp, char *val)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
psb_c_ctxt *cctxt;
|
||||
psb_i_t iam, np;
|
||||
psb_c_i_t iam, np;
|
||||
char methd[40], ptype[40], afmt[8];
|
||||
psb_i_t nparms;
|
||||
psb_i_t idim,info,istop,itmax,itrace,irst,iter,ret;
|
||||
psb_c_i_t nparms;
|
||||
psb_c_i_t idim,info,istop,itmax,itrace,irst,iter,ret;
|
||||
amg_c_dprec *ph;
|
||||
psb_c_dspmat *ah;
|
||||
psb_c_dvector *bh, *xh, *rh;
|
||||
psb_i_t nb,nlr, nl;
|
||||
psb_l_t i,ng, *vl, k;
|
||||
psb_c_i_t nb,nlr, nl;
|
||||
psb_c_l_t i,ng, *vl, k;
|
||||
double t1,t2,eps,err;
|
||||
double *xv, *bv, *rv;
|
||||
double one=1.0, zero=0.0, res2;
|
||||
@@ -305,16 +305,16 @@ int main(int argc, char *argv[])
|
||||
psb_c_set_index_base(0);
|
||||
|
||||
/* Simple minded BLOCK data distribution */
|
||||
ng = ((psb_l_t) idim)*idim*idim;
|
||||
ng = ((psb_c_l_t) idim)*idim*idim;
|
||||
nb = (ng+np-1)/np;
|
||||
nl = nb;
|
||||
if ( (ng -iam*nb) < nl) nl = ng -iam*nb;
|
||||
fprintf(stderr,"%d: Input data %d %ld %d %d\n",iam,idim,ng,nb, nl);
|
||||
if ((vl=malloc(nb*sizeof(psb_l_t)))==NULL) {
|
||||
if ((vl=malloc(nb*sizeof(psb_c_l_t)))==NULL) {
|
||||
fprintf(stderr,"On %d: malloc failure\n",iam);
|
||||
psb_c_abort(*cctxt);
|
||||
}
|
||||
i = ((psb_l_t)iam) * nb;
|
||||
i = ((psb_c_l_t)iam) * nb;
|
||||
for (k=0; k<nl; k++)
|
||||
vl[k] = i+k;
|
||||
|
||||
|
||||
@@ -126,17 +126,17 @@ double g(double x, double y, double z)
|
||||
|
||||
#define NBMAX 20
|
||||
|
||||
psb_i_t matgen(psb_c_ctxt cctxt, psb_i_t nl, psb_i_t idim, psb_l_t vl[],
|
||||
psb_c_i_t matgen(psb_c_ctxt cctxt, psb_c_i_t nl, psb_c_i_t idim, psb_c_l_t vl[],
|
||||
psb_c_dspmat *ah, const char *afmt,
|
||||
psb_c_descriptor *cdh, const char *cdfmt,
|
||||
psb_c_dvector *xh, psb_c_dvector *bh, psb_c_dvector *rh)
|
||||
{
|
||||
psb_i_t iam, np;
|
||||
psb_l_t ix, iy, iz, el, glob_row;
|
||||
psb_i_t i, k, info, ret;
|
||||
psb_c_i_t iam, np;
|
||||
psb_c_l_t ix, iy, iz, el, glob_row;
|
||||
psb_c_i_t i, k, info, ret;
|
||||
double x, y, z, deltah, sqdeltah, deltah2;
|
||||
double val[10 * NBMAX], zt[NBMAX];
|
||||
psb_l_t irow[10 * NBMAX], icol[10 * NBMAX];
|
||||
psb_c_l_t irow[10 * NBMAX], icol[10 * NBMAX];
|
||||
|
||||
info = 0;
|
||||
psb_c_info(cctxt, &iam, &np);
|
||||
@@ -360,15 +360,15 @@ void get_hparm(FILE *fp, char *val)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
psb_c_ctxt *cctxt;
|
||||
psb_i_t iam, np;
|
||||
psb_c_i_t iam, np;
|
||||
char methd[40], ptype[40], afmt[8], cdfmt[8];
|
||||
psb_i_t nparms;
|
||||
psb_i_t idim, info, istop, itmax, itrace, irst, iter, ret;
|
||||
psb_c_i_t nparms;
|
||||
psb_c_i_t idim, info, istop, itmax, itrace, irst, iter, ret;
|
||||
amg_c_dprec *ph;
|
||||
psb_c_dspmat *ah;
|
||||
psb_c_dvector *bh, *xh, *rh;
|
||||
psb_i_t nb, nlr, nl;
|
||||
psb_l_t i, ng, *vl, k;
|
||||
psb_c_i_t nb, nlr, nl;
|
||||
psb_c_l_t i, ng, *vl, k;
|
||||
double t1, t2, eps, err;
|
||||
double *xv, *bv, *rv;
|
||||
double one = 1.0, zero = 0.0, res2;
|
||||
@@ -439,18 +439,18 @@ int main(int argc, char *argv[])
|
||||
psb_c_set_index_base(0);
|
||||
|
||||
/* Simple minded BLOCK data distribution */
|
||||
ng = ((psb_l_t)idim) * idim * idim;
|
||||
ng = ((psb_c_l_t)idim) * idim * idim;
|
||||
nb = (ng + np - 1) / np;
|
||||
nl = nb;
|
||||
if ((ng - iam * nb) < nl)
|
||||
nl = ng - iam * nb;
|
||||
fprintf(stderr, "%d: Input data %d %ld %d %d\n", iam, idim, ng, nb, nl);
|
||||
if ((vl = malloc(nb * sizeof(psb_l_t))) == NULL)
|
||||
if ((vl = malloc(nb * sizeof(psb_c_l_t))) == NULL)
|
||||
{
|
||||
fprintf(stderr, "On %d: malloc failure\n", iam);
|
||||
psb_c_abort(*cctxt);
|
||||
}
|
||||
i = ((psb_l_t)iam) * nb;
|
||||
i = ((psb_c_l_t)iam) * nb;
|
||||
for (k = 0; k < nl; k++)
|
||||
vl[k] = i + k;
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ contains
|
||||
else
|
||||
partition_ = 3
|
||||
end if
|
||||
deltah = done/(idim+2)
|
||||
deltah = done/(idim+1)
|
||||
sqdeltah = deltah*deltah
|
||||
deltah2 = 2.0_psb_dpk_* deltah
|
||||
|
||||
@@ -412,9 +412,9 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
|
||||
! x, y, z coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
z = (iz-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
z = (iz)*deltah
|
||||
zt(k) = f_(x,y,z)
|
||||
! internal point: build discretization
|
||||
!
|
||||
@@ -643,7 +643,7 @@ contains
|
||||
f_ => d_null_func_2d
|
||||
end if
|
||||
|
||||
deltah = done/(idim+2)
|
||||
deltah = done/(idim+1)
|
||||
sqdeltah = deltah*deltah
|
||||
deltah2 = 2.0_psb_dpk_* deltah
|
||||
|
||||
@@ -875,8 +875,8 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,glob_row,idim,idim)
|
||||
! x, y coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
|
||||
zt(k) = f_(x,y)
|
||||
! internal point: build discretization
|
||||
|
||||
@@ -176,7 +176,7 @@ contains
|
||||
else
|
||||
partition_ = 3
|
||||
end if
|
||||
deltah = sone/(idim+2)
|
||||
deltah = sone/(idim+1)
|
||||
sqdeltah = deltah*deltah
|
||||
deltah2 = 2.0_psb_spk_* deltah
|
||||
|
||||
@@ -412,9 +412,9 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
|
||||
! x, y, z coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
z = (iz-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
z = (iz)*deltah
|
||||
zt(k) = f_(x,y,z)
|
||||
! internal point: build discretization
|
||||
!
|
||||
@@ -643,7 +643,7 @@ contains
|
||||
f_ => s_null_func_2d
|
||||
end if
|
||||
|
||||
deltah = sone/(idim+2)
|
||||
deltah = sone/(idim+1)
|
||||
sqdeltah = deltah*deltah
|
||||
deltah2 = 2.0_psb_spk_* deltah
|
||||
|
||||
@@ -875,8 +875,8 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,glob_row,idim,idim)
|
||||
! x, y coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
|
||||
zt(k) = f_(x,y)
|
||||
! internal point: build discretization
|
||||
|
||||
@@ -369,9 +369,9 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
|
||||
! x, y, z coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
z = (iz-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
z = (iz)*deltah
|
||||
zt(k) = f_(x,y,z)
|
||||
! internal point: build discretization
|
||||
!
|
||||
|
||||
@@ -369,9 +369,9 @@ contains
|
||||
! compute gridpoint coordinates
|
||||
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
|
||||
! x, y, z coordinates
|
||||
x = (ix-1)*deltah
|
||||
y = (iy-1)*deltah
|
||||
z = (iz-1)*deltah
|
||||
x = (ix)*deltah
|
||||
y = (iy)*deltah
|
||||
z = (iz)*deltah
|
||||
zt(k) = f_(x,y,z)
|
||||
! internal point: build discretization
|
||||
!
|
||||
|
||||
Reference in New Issue
Block a user