Merge branch 'precinit' of https://github.com/sfilippone/psblas3 into precinit

MixedI8
Salvatore Filippone 6 years ago
commit 814ddce711

@ -1,3 +1,4 @@
#ifndef PSB_C_BASE__
#define PSB_C_BASE__
#ifdef __cplusplus

@ -13,7 +13,7 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_cspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_cprec) :: ph
@ -38,14 +38,14 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_cspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_cprec) :: ph
type(psb_c_cvector) :: bh,xh
integer(c_int), value :: itmax,itrace,irst,istop
integer(psb_c_int), value :: itmax,itrace,irst,istop
real(c_double), value :: eps
integer(c_int) :: iter
integer(psb_c_int) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options

@ -13,7 +13,7 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_dprec) :: ph
@ -21,7 +21,6 @@ contains
character(c_char) :: methd(*)
type(solveroptions) :: options
write(0,*) 'psb_c_dkrylov options ', options%eps
res= psb_c_dkrylov_opt(methd, ah, ph, bh, xh, options%eps,cdh, &
& itmax=options%itmax, iter=options%iter,&
& itrace=options%itrace, istop=options%istop,&
@ -39,14 +38,14 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_dprec) :: ph
type(psb_c_dvector) :: bh,xh
integer(c_int), value :: itmax,itrace,irst,istop
integer(psb_c_int), value :: itmax,itrace,irst,istop
real(c_double), value :: eps
integer(c_int) :: iter
integer(psb_c_int) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options
@ -59,7 +58,6 @@ contains
character(len=20) :: fmethd
real(psb_dpk_) :: feps,ferr
write(0,*) 'psb_c_dkrylov_opt options ', eps
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)

@ -13,7 +13,7 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_sspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_sprec) :: ph
@ -38,14 +38,14 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_sspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_sprec) :: ph
type(psb_c_svector) :: bh,xh
integer(c_int), value :: itmax,itrace,irst,istop
integer(psb_c_int), value :: itmax,itrace,irst,istop
real(c_double), value :: eps
integer(c_int) :: iter
integer(psb_c_int) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options

@ -13,7 +13,7 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_zspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_zprec) :: ph
@ -38,14 +38,14 @@ contains
use psb_prec_cbind_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_zspmat) :: ah
type(psb_c_descriptor) :: cdh
type(psb_c_zprec) :: ph
type(psb_c_zvector) :: bh,xh
integer(c_int), value :: itmax,itrace,irst,istop
integer(psb_c_int), value :: itmax,itrace,irst,istop
real(c_double), value :: eps
integer(c_int) :: iter
integer(psb_c_int) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options

@ -14,7 +14,7 @@ typedef struct PSB_C_CPREC {
psb_c_cprec* psb_c_new_cprec();
psb_i_t psb_c_cprecinit(psb_c_cprec *ph, const char *ptype);
psb_i_t psb_c_cprecinit(psb_i_t ictxt,psb_c_cprec *ph, const char *ptype);
psb_i_t psb_c_cprecbld(psb_c_cspmat *ah, psb_c_descriptor *cdh, psb_c_cprec *ph);
psb_i_t psb_c_cprecfree(psb_c_cprec *ph);
#ifdef __cplusplus

@ -14,7 +14,7 @@ typedef struct PSB_C_DPREC {
psb_c_dprec* psb_c_new_dprec();
psb_i_t psb_c_dprecinit(psb_c_dprec *ph, const char *ptype);
psb_i_t psb_c_dprecinit(psb_i_t ictxt, psb_c_dprec *ph, const char *ptype);
psb_i_t psb_c_dprecbld(psb_c_dspmat *ah, psb_c_descriptor *cdh, psb_c_dprec *ph);
psb_i_t psb_c_dprecfree(psb_c_dprec *ph);
#ifdef __cplusplus

@ -14,7 +14,7 @@ typedef struct PSB_C_SPREC {
psb_c_sprec* psb_c_new_sprec();
psb_i_t psb_c_sprecinit(psb_c_sprec *ph, const char *ptype);
psb_i_t psb_c_sprecinit(psb_i_t ictxt, psb_c_sprec *ph, const char *ptype);
psb_i_t psb_c_sprecbld(psb_c_sspmat *ah, psb_c_descriptor *cdh, psb_c_sprec *ph);
psb_i_t psb_c_sprecfree(psb_c_sprec *ph);
#ifdef __cplusplus

@ -14,7 +14,7 @@ typedef struct PSB_C_ZPREC {
psb_c_zprec* psb_c_new_zprec();
psb_i_t psb_c_zprecinit(psb_c_zprec *ph, const char *ptype);
psb_i_t psb_c_zprecinit(psb_i_t ictxt, psb_c_zprec *ph, const char *ptype);
psb_i_t psb_c_zprecbld(psb_c_zspmat *ah, psb_c_descriptor *cdh, psb_c_zprec *ph);
psb_i_t psb_c_zprecfree(psb_c_zprec *ph);
#ifdef __cplusplus

@ -13,12 +13,13 @@ module psb_cprec_cbind_mod
contains
function psb_c_cprecinit(ph,ptype) bind(c) result(res)
function psb_c_cprecinit(ictxt,ph,ptype) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int), value :: ictxt
integer(psb_c_int) :: res
type(psb_c_cprec) :: ph
character(c_char) :: ptype(*)
type(psb_cprec_type), pointer :: precp
@ -36,7 +37,7 @@ contains
call stringc2f(ptype,fptype)
call psb_precinit(precp,fptype,info)
call psb_precinit(ictxt,precp,fptype,info)
res = min(0,info)
return
@ -51,7 +52,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_cspmat) :: ah
type(psb_c_cprec) :: ph
type(psb_c_descriptor) :: cdh
@ -94,7 +95,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_cprec) :: ph
type(psb_cprec_type), pointer :: precp

@ -13,12 +13,13 @@ module psb_dprec_cbind_mod
contains
function psb_c_dprecinit(ph,ptype) bind(c) result(res)
function psb_c_dprecinit(ictxt,ph,ptype) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int), value :: ictxt
integer(psb_c_int) :: res
type(psb_c_dprec) :: ph
character(c_char) :: ptype(*)
type(psb_dprec_type), pointer :: precp
@ -36,7 +37,7 @@ contains
call stringc2f(ptype,fptype)
call psb_precinit(precp,fptype,info)
call psb_precinit(ictxt,precp,fptype,info)
res = min(0,info)
return
@ -51,7 +52,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dspmat) :: ah
type(psb_c_dprec) :: ph
type(psb_c_descriptor) :: cdh
@ -94,7 +95,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_dprec) :: ph
type(psb_dprec_type), pointer :: precp

@ -13,12 +13,13 @@ module psb_sprec_cbind_mod
contains
function psb_c_sprecinit(ph,ptype) bind(c) result(res)
function psb_c_sprecinit(ictxt,ph,ptype) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int), value :: ictxt
integer(psb_c_int) :: res
type(psb_c_sprec) :: ph
character(c_char) :: ptype(*)
type(psb_sprec_type), pointer :: precp
@ -36,7 +37,7 @@ contains
call stringc2f(ptype,fptype)
call psb_precinit(precp,fptype,info)
call psb_precinit(ictxt,precp,fptype,info)
res = min(0,info)
return
@ -51,7 +52,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_sspmat) :: ah
type(psb_c_sprec) :: ph
type(psb_c_descriptor) :: cdh
@ -94,7 +95,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_sprec) :: ph
type(psb_sprec_type), pointer :: precp

@ -13,12 +13,13 @@ module psb_zprec_cbind_mod
contains
function psb_c_zprecinit(ph,ptype) bind(c) result(res)
function psb_c_zprecinit(ictxt,ph,ptype) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int), value :: ictxt
integer(psb_c_int) :: res
type(psb_c_zprec) :: ph
character(c_char) :: ptype(*)
type(psb_zprec_type), pointer :: precp
@ -36,7 +37,7 @@ contains
call stringc2f(ptype,fptype)
call psb_precinit(precp,fptype,info)
call psb_precinit(ictxt,precp,fptype,info)
res = min(0,info)
return
@ -51,7 +52,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_zspmat) :: ah
type(psb_c_zprec) :: ph
type(psb_c_descriptor) :: cdh
@ -94,7 +95,7 @@ contains
use psb_base_string_cbind_mod
implicit none
integer(c_int) :: res
integer(psb_c_int) :: res
type(psb_c_zprec) :: ph
type(psb_zprec_type), pointer :: precp

@ -320,7 +320,7 @@ int main(int argc, char *argv[])
psb_c_barrier(ictxt);
/* Set up the preconditioner */
ph = psb_c_new_dprec();
psb_c_dprecinit(ph,ptype);
psb_c_dprecinit(ictxt,ph,ptype);
ret=psb_c_dprecbld(ah,cdh,ph);
fprintf(stderr,"From psb_c_dprecbld: %d\n",ret);

Loading…
Cancel
Save