mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-07 07:04:57 +00:00
Merged changes from svn dev version.
This commit is contained in:
@@ -44,6 +44,7 @@ INSTALL_DATA=@INSTALL_DATA@
|
||||
INSTALL_DIR=@INSTALL_DIR@
|
||||
INSTALL_LIBDIR=@INSTALL_LIBDIR@
|
||||
INSTALL_INCLUDEDIR=@INSTALL_INCLUDEDIR@
|
||||
INSTALL_MODULESDIR=@INSTALL_MODULESDIR@
|
||||
INSTALL_DOCSDIR=@INSTALL_DOCSDIR@
|
||||
INSTALL_SAMPLESDIR=@INSTALL_SAMPLESDIR@
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ cbindd: precd kryld utild
|
||||
libd:
|
||||
(if test ! -d lib ; then mkdir lib; fi)
|
||||
(if test ! -d include ; then mkdir include; fi; $(INSTALL_DATA) Make.inc include/Make.inc.psblas)
|
||||
(if test ! -d modules ; then mkdir modules; fi;)
|
||||
based:
|
||||
cd base && $(MAKE) lib
|
||||
precd:
|
||||
@@ -29,14 +30,17 @@ install: all
|
||||
$(INSTALL_DATA) Make.inc $(INSTALL_INCLUDEDIR)/Make.inc.psblas)
|
||||
(./mkdir.sh $(INSTALL_LIBDIR) &&\
|
||||
$(INSTALL_DATA) lib/*.a $(INSTALL_LIBDIR))
|
||||
(./mkdir.sh $(INSTALL_MODULESDIR) && \
|
||||
$(INSTALL_DATA) modules/*$(.mod) $(INSTALL_MODULESDIR))
|
||||
(./mkdir.sh $(INSTALL_INCLUDEDIR) && \
|
||||
$(INSTALL_DATA) include/*$(.mod) $(INSTALL_INCLUDEDIR))
|
||||
$(INSTALL_DATA) include/*.h $(INSTALL_INCLUDEDIR))
|
||||
(./mkdir.sh $(INSTALL_DOCSDIR) && \
|
||||
/bin/cp -fr docs/*pdf docs/html $(INSTALL_DOCSDIR))
|
||||
(./mkdir.sh $(INSTALL_DOCSDIR) && \
|
||||
$(INSTALL_DATA) README LICENSE $(INSTALL_DOCSDIR))
|
||||
(./mkdir.sh $(INSTALL_SAMPLESDIR) && \
|
||||
/bin/cp -fr test/pargen test/fileread test/kernel $(INSTALL_SAMPLESDIR))
|
||||
/bin/cp -fr test/pargen test/fileread test/kernel $(INSTALL_SAMPLESDIR) && \
|
||||
./mkdir.sh $(INSTALL_SAMPLESDIR)/cbind && /bin/cp -fr cbind/test/pargen/* $(INSTALL_SAMPLESDIR)/cbind)
|
||||
clean:
|
||||
cd base && $(MAKE) clean
|
||||
cd prec && $(MAKE) clean
|
||||
@@ -50,6 +54,7 @@ check: all
|
||||
cleanlib:
|
||||
(cd lib; /bin/rm -f *.a *$(.mod) *$(.fh) *.h)
|
||||
(cd include; /bin/rm -f *.a *$(.mod) *$(.fh) *.h)
|
||||
(cd modules; /bin/rm -f *.a *$(.mod) *$(.fh) *.h)
|
||||
|
||||
veryclean: cleanlib
|
||||
cd base && $(MAKE) veryclean
|
||||
|
||||
+2
-1
@@ -3,11 +3,12 @@ include ../Make.inc
|
||||
HERE=.
|
||||
LIBDIR=../lib
|
||||
INCDIR=../include
|
||||
MODDIR=../modules
|
||||
LIBNAME=$(BASELIBNAME)
|
||||
|
||||
lib: mods sr cm in pb tl
|
||||
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
|
||||
|
||||
sr cm in pb tl: mods
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(MPFOBJS)
|
||||
|
||||
$(FOBJS) $(FBOJS2): $(MODDIR)/psi_mod.o
|
||||
mpfobjs:
|
||||
(make $(MPFOBJS) F90="$(MPF90)" FC="$(MPF90)" FCOPT="$(F90COPT)")
|
||||
(make $(MPFOBJS) F90="$(MPFC)" FC="$(MPFC)" FCOPT="$(FCOPT)")
|
||||
|
||||
clean:
|
||||
/bin/rm -f $(MPFOBJS) $(FOBJS) $(COBJS) $(FOBJS2) $(MPFOBJS2) *$(.mod)
|
||||
|
||||
+9
-3
@@ -3,11 +3,13 @@ include ../Make.inc
|
||||
HERE=.
|
||||
LIBDIR=../lib
|
||||
INCDIR=../include
|
||||
MODDIR=../modules/
|
||||
LIBNAME=$(CBINDLIBNAME)
|
||||
|
||||
lib: based precd
|
||||
lib: based precd krylovd
|
||||
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) *.h $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *.h $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
|
||||
|
||||
|
||||
|
||||
@@ -15,12 +17,16 @@ based:
|
||||
cd base && $(MAKE) lib LIBNAME=$(LIBNAME)
|
||||
precd: based
|
||||
cd prec && $(MAKE) lib LIBNAME=$(LIBNAME)
|
||||
krylovd: based precd
|
||||
cd krylov && $(MAKE) lib LIBNAME=$(LIBNAME)
|
||||
|
||||
|
||||
clean:
|
||||
cd base && $(MAKE) clean
|
||||
cd prec && $(MAKE) clean
|
||||
cd krylov && $(MAKE) clean
|
||||
|
||||
|
||||
veryclean: clean
|
||||
veryclean: clean
|
||||
cd test/pargen && $(MAKE) clean
|
||||
/bin/rm -f $(HERE)/$(LIBNAME) $(LIBMOD) *$(.mod) *.h
|
||||
|
||||
+2
-1
@@ -2,9 +2,10 @@ TOP=../..
|
||||
include $(TOP)/Make.inc
|
||||
LIBDIR=$(TOP)lib
|
||||
INCLUDEDIR=$(TOP)/include
|
||||
MODDIR=$(TOP)/modules
|
||||
HERE=..
|
||||
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(INCLUDEDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR)
|
||||
CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR)
|
||||
|
||||
FOBJS= psb_objhandle_mod.o psb_base_cbind_mod.o psb_cpenv_mod.o \
|
||||
|
||||
@@ -43,7 +43,7 @@ psb_i_t psb_c_cmat_get_ncols(psb_c_cspmat *mh);
|
||||
/* psb_i_t psb_c_cspasb_opt(psb_c_cspmat *mh, psb_c_descriptor *cdh, */
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
psb_i_t psb_c_csprn(psb_c_cspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||
/* psb_i_t psb_c_cspprint(psb_c_cspmat *mh); */
|
||||
psb_i_t psb_c_cmat_name_print(psb_c_cspmat *mh, char *name);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_c_t psb_c_cgedot(psb_c_cvector *xh, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -23,8 +23,9 @@ psb_d_t* psb_c_dvect_get_cpy(psb_c_dvector *xh)
|
||||
|
||||
if ((temp=(psb_d_t *)malloc(vsize*sizeof(psb_d_t)))!=NULL)
|
||||
psb_c_dvect_f_get_cpy(temp,xh);
|
||||
|
||||
return(temp);
|
||||
|
||||
fprintf(stderr,"dvect_get_cpy: %lf\n",temp[0]);
|
||||
return(temp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ psb_i_t psb_c_dmat_get_ncols(psb_c_dspmat *mh);
|
||||
/* psb_i_t psb_c_dspasb_opt(psb_c_dspmat *mh, psb_c_descriptor *cdh, */
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
psb_i_t psb_c_dsprn(psb_c_dspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||
/* psb_i_t psb_c_dspprint(psb_c_dspmat *mh); */
|
||||
psb_i_t psb_c_dmat_name_print(psb_c_dspmat *mh, char *name);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_d_t psb_c_dgedot(psb_c_dvector *xh, psb_c_dvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -43,7 +43,7 @@ psb_i_t psb_c_smat_get_ncols(psb_c_sspmat *mh);
|
||||
/* psb_i_t psb_c_sspasb_opt(psb_c_sspmat *mh, psb_c_descriptor *cdh, */
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
psb_i_t psb_c_ssprn(psb_c_sspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||
/* psb_i_t psb_c_sspprint(psb_c_sspmat *mh); */
|
||||
psb_i_t psb_c_smat_name_print(psb_c_sspmat *mh, char *name);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_s_t psb_c_sgedot(psb_c_svector *xh, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -130,7 +130,7 @@ contains
|
||||
call psb_geins(nz,irw(1:nz),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
else
|
||||
call psb_geins(nz,(irw(1:nz)-(1-ixb)),val(1:nz),&
|
||||
call psb_geins(nz,(irw(1:nz)+(1-ixb)),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
end if
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ psb_i_t psb_c_zmat_get_ncols(psb_c_zspmat *mh);
|
||||
/* psb_i_t psb_c_zspasb_opt(psb_c_zspmat *mh, psb_c_descriptor *cdh, */
|
||||
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||
psb_i_t psb_c_zsprn(psb_c_zspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||
/* psb_i_t psb_c_zspprint(psb_c_zspmat *mh); */
|
||||
psb_i_t psb_c_zmat_name_print(psb_c_zspmat *mh, char *name);
|
||||
|
||||
/* psblas computational routines */
|
||||
psb_z_t psb_c_zgedot(psb_c_zvector *xh, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||
|
||||
@@ -39,11 +39,13 @@ contains
|
||||
|
||||
res = -1
|
||||
|
||||
if (c_associated(xh%item)) then
|
||||
if (c_associated(xh%item)) then
|
||||
res = 0
|
||||
call c_f_pointer(xh%item,vp)
|
||||
fv = vp%get_vect()
|
||||
sz = size(fv)
|
||||
v(1:sz) = fv(1:sz)
|
||||
write(0,*) 'In dvect_f_get_cpy:',v(1),fv(1)
|
||||
end if
|
||||
|
||||
end function psb_c_dvect_f_get_cpy
|
||||
|
||||
@@ -130,7 +130,7 @@ contains
|
||||
call psb_geins(nz,irw(1:nz),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
else
|
||||
call psb_geins(nz,(irw(1:nz)-(1-ixb)),val(1:nz),&
|
||||
call psb_geins(nz,(irw(1:nz)+(1-ixb)),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
end if
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ contains
|
||||
call psb_geins(nz,irw(1:nz),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
else
|
||||
call psb_geins(nz,(irw(1:nz)-(1-ixb)),val(1:nz),&
|
||||
call psb_geins(nz,(irw(1:nz)+(1-ixb)),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
end if
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ contains
|
||||
call psb_geins(nz,irw(1:nz),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
else
|
||||
call psb_geins(nz,(irw(1:nz)-(1-ixb)),val(1:nz),&
|
||||
call psb_geins(nz,(irw(1:nz)+(1-ixb)),val(1:nz),&
|
||||
& xp,descp,info, dupl=psb_dupl_ovwrt_)
|
||||
end if
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
TOP=../..
|
||||
include $(TOP)/Make.inc
|
||||
LIBDIR=$(TOP)/lib
|
||||
INCLUDEDIR=$(TOP)/include
|
||||
MODDIR=$(TOP)/modules
|
||||
HERE=..
|
||||
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR)
|
||||
CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR)
|
||||
|
||||
OBJS=psb_base_krylov_cbind_mod.o \
|
||||
psb_skrylov_cbind_mod.o psb_dkrylov_cbind_mod.o psb_ckrylov_cbind_mod.o psb_zkrylov_cbind_mod.o
|
||||
CMOD=psb_krylov_cbind.h
|
||||
|
||||
|
||||
LIBMOD=psb_base_krylov_cbind_mod$(.mod) \
|
||||
psb_skrylov_cbind_mod$(.mod) psb_dkrylov_cbind_mod$(.mod) \
|
||||
psb_ckrylov_cbind_mod$(.mod) psb_zkrylov_cbind_mod$(.mod)
|
||||
|
||||
LOCAL_MODS=$(LIBMOD)
|
||||
LIBNAME=$(CKRYLOVLIBNAME)
|
||||
|
||||
|
||||
lib: $(OBJS) $(CMOD)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(LIBMOD) $(CMOD) $(HERE)
|
||||
|
||||
psb_skrylov_cbind_mod.o psb_dkrylov_cbind_mod.o psb_ckrylov_cbind_mod.o psb_zkrylov_cbind_mod.o: psb_base_krylov_cbind_mod.o
|
||||
veryclean: clean
|
||||
/bin/rm -f $(HERE)/$(LIBNAME)
|
||||
|
||||
clean:
|
||||
/bin/rm -f $(OBJS) $(LOCAL_MODS)
|
||||
|
||||
veryclean: clean
|
||||
@@ -0,0 +1,27 @@
|
||||
module psb_base_krylov_cbind_mod
|
||||
|
||||
use iso_c_binding
|
||||
type, bind(c) :: solveroptions
|
||||
integer(c_int) :: iter, itmax, itrace, irst, istop
|
||||
real(c_double) :: eps, err
|
||||
end type solveroptions
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_DefaultSolverOptions(options)&
|
||||
& bind(c,name='psb_c_DefaultSolverOptions') result(res)
|
||||
implicit none
|
||||
type(solveroptions) :: options
|
||||
integer(c_int) :: res
|
||||
|
||||
options%itmax = 1000
|
||||
options%itrace = 0
|
||||
options%istop = 2
|
||||
options%irst = 10
|
||||
options%eps = 1.d-6
|
||||
|
||||
res = 0
|
||||
end function psb_c_DefaultSolverOptions
|
||||
|
||||
|
||||
end module psb_base_krylov_cbind_mod
|
||||
@@ -0,0 +1,106 @@
|
||||
module psb_ckrylov_cbind_mod
|
||||
|
||||
use psb_base_krylov_cbind_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_ckrylov(methd,&
|
||||
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(c_int) :: res
|
||||
type(psb_c_cspmat) :: ah
|
||||
type(psb_c_descriptor) :: cdh
|
||||
type(psb_c_cprec) :: ph
|
||||
type(psb_c_cvector) :: bh,xh
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
|
||||
res= psb_c_ckrylov_opt(methd, ah, ph, bh, xh, options%eps,cdh, &
|
||||
& itmax=options%itmax, iter=options%iter,&
|
||||
& itrace=options%itrace, istop=options%istop,&
|
||||
& irst=options%irst, err=options%err)
|
||||
|
||||
end function psb_c_ckrylov
|
||||
|
||||
|
||||
function psb_c_ckrylov_opt(methd,&
|
||||
& ah,ph,bh,xh,eps,cdh,itmax,iter,err,itrace,irst,istop) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(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
|
||||
real(c_double), value :: eps
|
||||
integer(c_int) :: iter
|
||||
real(c_double) :: err
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_cspmat_type), pointer :: ap
|
||||
type(psb_cprec_type), pointer :: precp
|
||||
type(psb_c_vect_type), pointer :: xp, bp
|
||||
|
||||
integer :: info,fitmax,fitrace,first,fistop,fiter
|
||||
character(len=20) :: fmethd
|
||||
real(psb_spk_) :: feps,ferr
|
||||
|
||||
res = -1
|
||||
if (c_associated(cdh%item)) then
|
||||
call c_f_pointer(cdh%item,descp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(xh%item)) then
|
||||
call c_f_pointer(xh%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(bh%item)) then
|
||||
call c_f_pointer(bh%item,bp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ah%item)) then
|
||||
call c_f_pointer(ah%item,ap)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ph%item)) then
|
||||
call c_f_pointer(ph%item,precp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call stringc2f(methd,fmethd)
|
||||
feps = eps
|
||||
fitmax = itmax
|
||||
fitrace = itrace
|
||||
first = irst
|
||||
fistop = istop
|
||||
|
||||
call psb_krylov(fmethd, ap, precp, bp, xp, feps, &
|
||||
& descp, info,&
|
||||
& itmax=fitmax,iter=fiter,itrace=fitrace,istop=fistop,&
|
||||
& irst=first, err=ferr)
|
||||
iter = fiter
|
||||
err = ferr
|
||||
res = info
|
||||
|
||||
end function psb_c_ckrylov_opt
|
||||
|
||||
end module psb_ckrylov_cbind_mod
|
||||
@@ -0,0 +1,108 @@
|
||||
module psb_dkrylov_cbind_mod
|
||||
|
||||
use psb_base_krylov_cbind_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_dkrylov(methd,&
|
||||
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(c_int) :: res
|
||||
type(psb_c_dspmat) :: ah
|
||||
type(psb_c_descriptor) :: cdh
|
||||
type(psb_c_dprec) :: ph
|
||||
type(psb_c_dvector) :: bh,xh
|
||||
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,&
|
||||
& irst=options%irst, err=options%err)
|
||||
|
||||
end function psb_c_dkrylov
|
||||
|
||||
|
||||
function psb_c_dkrylov_opt(methd,&
|
||||
& ah,ph,bh,xh,eps,cdh,itmax,iter,err,itrace,irst,istop) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(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
|
||||
real(c_double), value :: eps
|
||||
integer(c_int) :: iter
|
||||
real(c_double) :: err
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_dspmat_type), pointer :: ap
|
||||
type(psb_dprec_type), pointer :: precp
|
||||
type(psb_d_vect_type), pointer :: xp, bp
|
||||
|
||||
integer :: info,fitmax,fitrace,first,fistop,fiter
|
||||
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)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(xh%item)) then
|
||||
call c_f_pointer(xh%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(bh%item)) then
|
||||
call c_f_pointer(bh%item,bp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ah%item)) then
|
||||
call c_f_pointer(ah%item,ap)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ph%item)) then
|
||||
call c_f_pointer(ph%item,precp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call stringc2f(methd,fmethd)
|
||||
feps = eps
|
||||
fitmax = itmax
|
||||
fitrace = itrace
|
||||
first = irst
|
||||
fistop = istop
|
||||
|
||||
call psb_krylov(fmethd, ap, precp, bp, xp, feps, &
|
||||
& descp, info,&
|
||||
& itmax=fitmax,iter=fiter,itrace=fitrace,istop=fistop,&
|
||||
& irst=first, err=ferr)
|
||||
iter = fiter
|
||||
err = ferr
|
||||
res = info
|
||||
|
||||
end function psb_c_dkrylov_opt
|
||||
|
||||
end module psb_dkrylov_cbind_mod
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef PSB_KRYL_CBIND_
|
||||
#define PSB_KRYL_CBIND_
|
||||
|
||||
#include "psb_base_cbind.h"
|
||||
#include "psb_prec_cbind.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Object handle related routines */
|
||||
/* No new handles for Krylov methods. */
|
||||
/* Here's a choice: define a struct to hold the options */
|
||||
/* Drawback: we end up defining defaults in two places */
|
||||
/* Note: must be interoperable */
|
||||
typedef struct psb_c_solveroptions {
|
||||
int iter; /* On exit how many iterations were performed */
|
||||
int itmax; /* On entry maximum number of iterations */
|
||||
int itrace; /* On entry print an info message every itrace iterations */
|
||||
int irst; /* Restart depth for RGMRES or BiCGSTAB(L) */
|
||||
int istop; /* Stopping criterion: 1:backward error 2: ||r||_2/||b||_2 */
|
||||
double eps; /* Stopping tolerance */
|
||||
double err; /* Convergence indicator on exit */
|
||||
} psb_c_SolverOptions;
|
||||
|
||||
int psb_c_DefaultSolverOptions(psb_c_SolverOptions *opt);
|
||||
|
||||
int psb_c_skrylov(const char *method, psb_c_sspmat *ah, psb_c_sprec *ph,
|
||||
psb_c_svector *bh, psb_c_svector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
int psb_c_dkrylov(const char *method, psb_c_dspmat *ah, psb_c_dprec *ph,
|
||||
psb_c_dvector *bh, psb_c_dvector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
int psb_c_ckrylov(const char *method, psb_c_cspmat *ah, psb_c_cprec *ph,
|
||||
psb_c_cvector *bh, psb_c_cvector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
int psb_c_zkrylov(const char *method, psb_c_zspmat *ah, psb_c_zprec *ph,
|
||||
psb_c_zvector *bh, psb_c_zvector *xh,
|
||||
psb_c_descriptor *cdh, psb_c_SolverOptions *opt);
|
||||
|
||||
#define PSB_VALID_KRYLOV_METHODS_STRINGS "CG","CGS","BICG","BICGSTAB","RGMRES","BICGSTABL","FCG","GCR"
|
||||
#define PSB_VALID_KRYLOV_METHODS_STRING "CG CGS BICG BICGSTAB RGMRES BICGSTABL FCG GCR"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
module psb_skrylov_cbind_mod
|
||||
|
||||
use psb_base_krylov_cbind_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_skrylov(methd,&
|
||||
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(c_int) :: res
|
||||
type(psb_c_sspmat) :: ah
|
||||
type(psb_c_descriptor) :: cdh
|
||||
type(psb_c_sprec) :: ph
|
||||
type(psb_c_svector) :: bh,xh
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
|
||||
res= psb_c_skrylov_opt(methd, ah, ph, bh, xh, options%eps,cdh, &
|
||||
& itmax=options%itmax, iter=options%iter,&
|
||||
& itrace=options%itrace, istop=options%istop,&
|
||||
& irst=options%irst, err=options%err)
|
||||
|
||||
end function psb_c_skrylov
|
||||
|
||||
|
||||
function psb_c_skrylov_opt(methd,&
|
||||
& ah,ph,bh,xh,eps,cdh,itmax,iter,err,itrace,irst,istop) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(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
|
||||
real(c_double), value :: eps
|
||||
integer(c_int) :: iter
|
||||
real(c_double) :: err
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_sspmat_type), pointer :: ap
|
||||
type(psb_sprec_type), pointer :: precp
|
||||
type(psb_s_vect_type), pointer :: xp, bp
|
||||
|
||||
integer :: info,fitmax,fitrace,first,fistop,fiter
|
||||
character(len=20) :: fmethd
|
||||
real(psb_spk_) :: feps,ferr
|
||||
|
||||
res = -1
|
||||
if (c_associated(cdh%item)) then
|
||||
call c_f_pointer(cdh%item,descp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(xh%item)) then
|
||||
call c_f_pointer(xh%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(bh%item)) then
|
||||
call c_f_pointer(bh%item,bp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ah%item)) then
|
||||
call c_f_pointer(ah%item,ap)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ph%item)) then
|
||||
call c_f_pointer(ph%item,precp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call stringc2f(methd,fmethd)
|
||||
feps = eps
|
||||
fitmax = itmax
|
||||
fitrace = itrace
|
||||
first = irst
|
||||
fistop = istop
|
||||
|
||||
call psb_krylov(fmethd, ap, precp, bp, xp, feps, &
|
||||
& descp, info,&
|
||||
& itmax=fitmax,iter=fiter,itrace=fitrace,istop=fistop,&
|
||||
& irst=first, err=ferr)
|
||||
iter = fiter
|
||||
err = ferr
|
||||
res = info
|
||||
|
||||
end function psb_c_skrylov_opt
|
||||
|
||||
end module psb_skrylov_cbind_mod
|
||||
@@ -0,0 +1,106 @@
|
||||
module psb_zkrylov_cbind_mod
|
||||
|
||||
use psb_base_krylov_cbind_mod
|
||||
|
||||
contains
|
||||
|
||||
function psb_c_zkrylov(methd,&
|
||||
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(c_int) :: res
|
||||
type(psb_c_zspmat) :: ah
|
||||
type(psb_c_descriptor) :: cdh
|
||||
type(psb_c_zprec) :: ph
|
||||
type(psb_c_zvector) :: bh,xh
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
|
||||
res= psb_c_zkrylov_opt(methd, ah, ph, bh, xh, options%eps,cdh, &
|
||||
& itmax=options%itmax, iter=options%iter,&
|
||||
& itrace=options%itrace, istop=options%istop,&
|
||||
& irst=options%irst, err=options%err)
|
||||
|
||||
end function psb_c_zkrylov
|
||||
|
||||
|
||||
function psb_c_zkrylov_opt(methd,&
|
||||
& ah,ph,bh,xh,eps,cdh,itmax,iter,err,itrace,irst,istop) bind(c) result(res)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_objhandle_mod
|
||||
use psb_prec_cbind_mod
|
||||
use psb_base_string_cbind_mod
|
||||
implicit none
|
||||
integer(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
|
||||
real(c_double), value :: eps
|
||||
integer(c_int) :: iter
|
||||
real(c_double) :: err
|
||||
character(c_char) :: methd(*)
|
||||
type(solveroptions) :: options
|
||||
type(psb_desc_type), pointer :: descp
|
||||
type(psb_zspmat_type), pointer :: ap
|
||||
type(psb_zprec_type), pointer :: precp
|
||||
type(psb_z_vect_type), pointer :: xp, bp
|
||||
|
||||
integer :: info,fitmax,fitrace,first,fistop,fiter
|
||||
character(len=20) :: fmethd
|
||||
real(psb_dpk_) :: feps,ferr
|
||||
|
||||
res = -1
|
||||
if (c_associated(cdh%item)) then
|
||||
call c_f_pointer(cdh%item,descp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(xh%item)) then
|
||||
call c_f_pointer(xh%item,xp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(bh%item)) then
|
||||
call c_f_pointer(bh%item,bp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ah%item)) then
|
||||
call c_f_pointer(ah%item,ap)
|
||||
else
|
||||
return
|
||||
end if
|
||||
if (c_associated(ph%item)) then
|
||||
call c_f_pointer(ph%item,precp)
|
||||
else
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call stringc2f(methd,fmethd)
|
||||
feps = eps
|
||||
fitmax = itmax
|
||||
fitrace = itrace
|
||||
first = irst
|
||||
fistop = istop
|
||||
|
||||
call psb_krylov(fmethd, ap, precp, bp, xp, feps, &
|
||||
& descp, info,&
|
||||
& itmax=fitmax,iter=fiter,itrace=fitrace,istop=fistop,&
|
||||
& irst=first, err=ferr)
|
||||
iter = fiter
|
||||
err = ferr
|
||||
res = info
|
||||
|
||||
end function psb_c_zkrylov_opt
|
||||
|
||||
end module psb_zkrylov_cbind_mod
|
||||
+4
-4
@@ -2,15 +2,16 @@ TOP=../..
|
||||
include $(TOP)/Make.inc
|
||||
LIBDIR=$(TOP)/lib
|
||||
INCLUDEDIR=$(TOP)/include
|
||||
MODDIR=$(TOP)/modules
|
||||
HERE=..
|
||||
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(INCLUDEDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR)
|
||||
CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR)
|
||||
|
||||
OBJS=psb_prec_cbind_mod.o \
|
||||
psb_sprec_cbind_mod.o psb_dprec_cbind_mod.o psb_cprec_cbind_mod.o psb_zprec_cbind_mod.o \
|
||||
psb_c_dprec.o
|
||||
CMOD=psb_prec_cbind.h psb_c_dprec.h
|
||||
psb_c_sprec.o psb_c_dprec.o psb_c_cprec.o psb_c_zprec.o
|
||||
CMOD=psb_prec_cbind.h psb_c_sprec.h psb_c_dprec.h psb_c_cprec.h psb_c_zprec.h
|
||||
|
||||
|
||||
LIBMOD=psb_prec_cbind_mod$(.mod) \
|
||||
@@ -26,7 +27,6 @@ lib: $(OBJS) $(CMOD)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(LIBMOD) $(CMOD) $(HERE)
|
||||
/bin/cp -p $(LIBMOD) $(CMOD) $(INCLUDEDIR)
|
||||
|
||||
psb_prec_cbind_mod.o: psb_sprec_cbind_mod.o psb_dprec_cbind_mod.o psb_cprec_cbind_mod.o psb_zprec_cbind_mod.o
|
||||
veryclean: clean
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include "psb_c_cprec.h"
|
||||
|
||||
psb_c_cprec* psb_c_new_cprec()
|
||||
{
|
||||
psb_c_cprec* temp;
|
||||
|
||||
temp=(psb_c_cprec *) malloc(sizeof(psb_c_cprec));
|
||||
temp->cprec=NULL;
|
||||
return(temp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef PSB_C_CPREC_
|
||||
#define PSB_C_CPREC_
|
||||
#include "psb_base_cbind.h"
|
||||
/* Object handle related routines */
|
||||
/* Note: psb_get_XXX_handle returns: <= 0 unsuccessful */
|
||||
/* >0 valid handle */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct PSB_C_CPREC {
|
||||
void *cprec;
|
||||
} 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_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
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include "psb_c_sprec.h"
|
||||
|
||||
psb_c_sprec* psb_c_new_sprec()
|
||||
{
|
||||
psb_c_sprec* temp;
|
||||
|
||||
temp=(psb_c_sprec *) malloc(sizeof(psb_c_sprec));
|
||||
temp->sprec=NULL;
|
||||
return(temp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef PSB_C_SPREC_
|
||||
#define PSB_C_SPREC_
|
||||
#include "psb_base_cbind.h"
|
||||
/* Object handle related routines */
|
||||
/* Note: psb_get_XXX_handle returns: <= 0 unsuccessful */
|
||||
/* >0 valid handle */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct PSB_C_SPREC {
|
||||
void *sprec;
|
||||
} 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_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
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include "psb_c_zprec.h"
|
||||
|
||||
psb_c_zprec* psb_c_new_zprec()
|
||||
{
|
||||
psb_c_zprec* temp;
|
||||
|
||||
temp=(psb_c_zprec *) malloc(sizeof(psb_c_zprec));
|
||||
temp->zprec=NULL;
|
||||
return(temp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef PSB_C_ZPREC_
|
||||
#define PSB_C_ZPREC_
|
||||
#include "psb_base_cbind.h"
|
||||
/* Object handle related routines */
|
||||
/* Note: psb_get_XXX_handle returns: <= 0 unsuccessful */
|
||||
/* >0 valid handle */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct PSB_C_ZPREC {
|
||||
void *zprec;
|
||||
} 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_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
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef PSB_PREC_CBIND_
|
||||
#define PSB_PREC_CBIND_
|
||||
|
||||
#include "psb_c_sprec.h"
|
||||
#include "psb_c_dprec.h"
|
||||
#include "psb_c_cprec.h"
|
||||
#include "psb_c_zprec.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,19 +2,20 @@ TOP=../../..
|
||||
include $(TOP)/Make.inc
|
||||
LIBDIR=$(TOP)/lib
|
||||
INCLUDEDIR=$(TOP)/include
|
||||
MODDIR=$(TOP)/modules/
|
||||
HERE=../..
|
||||
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(INCLUDEDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR)
|
||||
CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR)
|
||||
|
||||
PSBC_LIBS= -L$(LIBDIR) -lpsb_cbind
|
||||
PSB_LIBS=-lpsb_prec -lpsb_base -L$(LIBDIR)
|
||||
PSB_LIBS=-lpsb_krylov -lpsb_prec -lpsb_base -L$(LIBDIR)
|
||||
# -lpsb_krylov_cbind
|
||||
|
||||
#
|
||||
# Compilers and such
|
||||
#
|
||||
CCOPT= -g
|
||||
#CCOPT= -g
|
||||
#FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG).
|
||||
CINCLUDES=-I$(LIBDIR) $(FIFLAG)$(INCLUDEDIR) $(FIFLAG)$(PSBLAS_INCDIR)
|
||||
|
||||
|
||||
+80
-90
@@ -1,6 +1,6 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Parallel Sparse BLAS v2.2 */
|
||||
/* (C) Copyright 2007 Salvatore Filippone University of Rome Tor Vergata */
|
||||
/* Parallel Sparse BLAS v 3.5.0 */
|
||||
/* (C) Copyright 2017 Salvatore Filippone Cranfield University */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or without */
|
||||
/* modification, are permitted provided that the following conditions */
|
||||
@@ -62,12 +62,8 @@
|
||||
/* In this sample program the index space of the discretized */
|
||||
/* computational domain is first numbered sequentially in a standard way, */
|
||||
/* then the corresponding vector is distributed according to an HPF BLOCK */
|
||||
/* distribution directive. */
|
||||
/* */
|
||||
/* Boundary conditions are set in a very simple way, by adding */
|
||||
/* equations of the form */
|
||||
/* */
|
||||
/* u(x,y) = rhs(x,y) */
|
||||
/* distribution directive. The discretization ensures there are IDIM */
|
||||
/* *internal* points in each direction. */
|
||||
/* */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -78,144 +74,136 @@
|
||||
|
||||
#include "psb_base_cbind.h"
|
||||
#include "psb_prec_cbind.h"
|
||||
#include "psb_krylov_cbind.h"
|
||||
|
||||
#define LINEBUFSIZE 1024
|
||||
#define NBMAX 20
|
||||
#define DUMPMATRIX 0
|
||||
|
||||
double a1(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(1.0/80.0);
|
||||
}
|
||||
double a2(double x, double y, double z)
|
||||
{
|
||||
return(20.0*y);
|
||||
return(1.0/80.0);
|
||||
}
|
||||
double a3(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(1.0/80.0);
|
||||
}
|
||||
double a4(double x, double y, double z)
|
||||
double c(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(0.0);
|
||||
}
|
||||
double b1(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(1.0/sqrt(3.0));
|
||||
}
|
||||
double b2(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(1.0/sqrt(3.0));
|
||||
}
|
||||
double b3(double x, double y, double z)
|
||||
{
|
||||
return(1.0);
|
||||
return(1.0/sqrt(3.0));
|
||||
}
|
||||
|
||||
double g(double x, double y, double z)
|
||||
{
|
||||
if (x == 1.0) {
|
||||
return(1.0);
|
||||
} else if (x == 0.0) {
|
||||
return( exp(-y*y-z*z));
|
||||
} else {
|
||||
return(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
int matgen(int ictxt, int ng,int idim,int vg[],psb_c_dspmat *ah,psb_c_descriptor *cdh,
|
||||
psb_c_dvector *xh, psb_c_dvector *bh, psb_c_dvector *rh)
|
||||
{
|
||||
int iam, np;
|
||||
int x, y, z, el,glob_row,i,info,ret;
|
||||
double gx, gy, gz, deltah;
|
||||
int ix, iy, iz, el,glob_row,i,info,ret;
|
||||
double x, y, z, deltah, sqdeltah, deltah2;
|
||||
double val[10*NBMAX], zt[NBMAX];
|
||||
int irow[10*NBMAX], icol[10*NBMAX];
|
||||
|
||||
info = 0;
|
||||
psb_c_info(ictxt,&iam,&np);
|
||||
deltah = (double) 1.0/(idim-1);
|
||||
psb_c_set_index_base(1);
|
||||
for (glob_row=1; glob_row<=ng; glob_row++) {
|
||||
deltah = (double) 1.0/(idim+2);
|
||||
sqdeltah = deltah*deltah;
|
||||
deltah2 = 2.0* deltah;
|
||||
psb_c_set_index_base(0);
|
||||
for (glob_row=0; glob_row < ng; glob_row++) {
|
||||
|
||||
/* Check if I have to do something about this entry */
|
||||
if (vg[glob_row-1] == iam) {
|
||||
if (vg[glob_row] == iam) {
|
||||
el=0;
|
||||
if ( (glob_row%(idim*idim)) == 0) {
|
||||
x = glob_row/(idim*idim);
|
||||
} else {
|
||||
x = glob_row/(idim*idim)+1;
|
||||
}
|
||||
if (((glob_row-(x-1)*idim*idim)%idim) == 0) {
|
||||
y = (glob_row-(x-1)*idim*idim)/idim;
|
||||
} else {
|
||||
y = (glob_row-(x-1)*idim*idim)/idim+1;
|
||||
}
|
||||
z = glob_row-(x-1)*idim*idim-(y-1)*idim;
|
||||
gx=x*deltah;
|
||||
gy=y*deltah;
|
||||
gz=z*deltah;
|
||||
ix = glob_row/(idim*idim);
|
||||
iy = (glob_row-ix*idim*idim)/idim;
|
||||
iz = glob_row-ix*idim*idim-iy*idim;
|
||||
x=(ix+1)*deltah;
|
||||
y=(iy+1)*deltah;
|
||||
z=(iz+1)*deltah;
|
||||
zt[0] = 0.0;
|
||||
/* internal point: build discretization */
|
||||
/* term depending on (x-1,y,z) */
|
||||
|
||||
if (x==1) {
|
||||
val[el] = -b1(gx,gy,gz)-a1(gx,gy,gz);
|
||||
val[el] /= deltah*deltah;
|
||||
zt[0] = exp(-gy*gy-gz*gz)*(-val[el]);
|
||||
val[el] = -a1(x,y,z)/sqdeltah-b1(x,y,z)/deltah2;
|
||||
if (ix==0) {
|
||||
zt[0] += g(0.0,y,z)*(-val[el]);
|
||||
} else {
|
||||
val[el]=-b1(gx,gy,gz) -a1(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-2)*idim*idim+(y-1)*idim+(z);
|
||||
icol[el]=(ix-1)*idim*idim+(iy)*idim+(iz);
|
||||
el=el+1;
|
||||
}
|
||||
/* term depending on (x,y-1,z) */
|
||||
if (y==1) {
|
||||
val[el]=-b2(gx,gy,gz)-a2(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
zt[0] = exp(-gy*gy-gz*gz)*exp(-gx)*(-val[el]);
|
||||
/* term depending on (x,y-1,z) */
|
||||
val[el] = -a2(x,y,z)/sqdeltah-b2(x,y,z)/deltah2;
|
||||
if (iy==0) {
|
||||
zt[0] += g(x,0.0,z)*(-val[el]);
|
||||
} else {
|
||||
val[el]=-b2(gx,gy,gz)-a2(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-1)*idim*idim+(y-2)*idim+(z);
|
||||
icol[el]=(ix)*idim*idim+(iy-1)*idim+(iz);
|
||||
el=el+1;
|
||||
}
|
||||
/* term depending on (x,y,z-1)*/
|
||||
if (z==1) {
|
||||
val[el]=-b3(gx,gy,gz)-a3(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
zt[0] = exp(-gy*gy-gz*gz)*exp(-gx)*(-val[el]);
|
||||
val[el]=-a3(x,y,z)/sqdeltah-b3(x,y,z)/deltah2;
|
||||
if (iz==0) {
|
||||
zt[0] += g(x,y,0.0)*(-val[el]);
|
||||
} else {
|
||||
val[el]=-b3(gx,gy,gz)-a3(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-1)*idim*idim+(y-1)*idim+(z-1);
|
||||
icol[el]=(ix)*idim*idim+(iy)*idim+(iz-1);
|
||||
el=el+1;
|
||||
}
|
||||
/* term depending on (x,y,z)*/
|
||||
val[el]=2*b1(gx,gy,gz)+2*b2(gx,gy,gz)+2*b3(gx,gy,gz)
|
||||
+a1(gx,gy,gz)+a2(gx,gy,gz)+a3(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-1)*idim*idim+(y-1)*idim+(z);
|
||||
val[el]=2.0*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah + c(x,y,z);
|
||||
icol[el]=(ix)*idim*idim+(iy)*idim+(iz);
|
||||
el=el+1;
|
||||
/* term depending on (x,y,z+1) */
|
||||
if (z==idim) {
|
||||
val[el]=-b1(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
zt[0] = exp(-gy*gy-gz*gz)*exp(-gx)*(-val[el]);
|
||||
val[el] = -a3(x,y,z)/sqdeltah+b3(x,y,z)/deltah2;
|
||||
if (iz==idim-1) {
|
||||
zt[0] += g(x,y,1.0)*(-val[el]);
|
||||
} else {
|
||||
val[el]=-b1(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-1)*idim*idim+(y-1)*idim+(z+1);
|
||||
icol[el]=(ix)*idim*idim+(iy)*idim+(iz+1);
|
||||
el=el+1;
|
||||
}
|
||||
/* term depending on (x,y+1,z) */
|
||||
if (y==idim) {
|
||||
val[el]=-b2(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
zt[0] = exp(-gy*gy-gz*gz)*exp(-gx)*(-val[el]);
|
||||
val[el] = -a2(x,y,z)/sqdeltah+b2(x,y,z)/deltah2;
|
||||
if (iy==idim-1) {
|
||||
zt[0] += g(x,1.0,z)*(-val[el]);
|
||||
} else {
|
||||
val[el]=-b2(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x-1)*idim*idim+(y)*idim+(z);
|
||||
icol[el]=(ix)*idim*idim+(iy+1)*idim+(iz);
|
||||
el=el+1;
|
||||
}
|
||||
/* term depending on (x+1,y,z) */
|
||||
if (x<idim) {
|
||||
val[el]=-b3(gx,gy,gz);
|
||||
val[el] = val[el]/(deltah*deltah);
|
||||
icol[el]=(x)*idim*idim+(y-1)*idim+(z);
|
||||
val[el] = -a1(x,y,z)/sqdeltah+b1(x,y,z)/deltah2;
|
||||
if (ix==idim-1) {
|
||||
zt[0] += g(1.0,y,z)*(-val[el]);
|
||||
} else {
|
||||
icol[el]=(ix+1)*idim*idim+(iy)*idim+(iz);
|
||||
el=el+1;
|
||||
}
|
||||
for (i=0; i<el; i++) irow[i]=glob_row;
|
||||
if ((ret=psb_c_dspins(el,irow,icol,val,ah,cdh))!=0)
|
||||
fprintf(stderr,"From psb_c_dspins: %d\n",ret);
|
||||
fprintf(stderr,"From psb_c_dspins: %d\n",ret);
|
||||
irow[0] = glob_row;
|
||||
psb_c_dgeins(1,irow,zt,bh,cdh);
|
||||
zt[0]=0.0;
|
||||
psb_c_dgeins(1,irow,zt,xh,cdh);
|
||||
@@ -246,8 +234,9 @@ int main(int argc, char *argv[])
|
||||
double t1,t2,eps,err;
|
||||
double *xv, *bv, *rv;
|
||||
double one=1.0, zero=0.0, res2;
|
||||
/* psb_c_SolverOptions options; */
|
||||
psb_c_SolverOptions options;
|
||||
psb_c_descriptor *cdh;
|
||||
FILE *vectfile;
|
||||
|
||||
ictxt = psb_c_init();
|
||||
psb_c_info(ictxt,&iam,&np);
|
||||
@@ -328,14 +317,13 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr,"Error during matrix build loop\n");
|
||||
psb_c_abort(ictxt);
|
||||
}
|
||||
psb_c_dmat_name_print(ah,"cbindmat.mtx");
|
||||
psb_c_barrier(ictxt);
|
||||
/* Set up the preconditioner */
|
||||
ph = psb_c_new_dprec();
|
||||
psb_c_dprecinit(ph,ptype);
|
||||
ret=psb_c_dprecbld(ah,cdh,ph);
|
||||
fprintf(stderr,"From psb_c_dprecbld: %d\n",ret);
|
||||
#if 0
|
||||
|
||||
/* Set up the solver options */
|
||||
psb_c_DefaultSolverOptions(&options);
|
||||
options.eps = 1.e-9;
|
||||
@@ -354,7 +342,6 @@ int main(int argc, char *argv[])
|
||||
psb_c_print_errmsg();
|
||||
}
|
||||
fprintf(stderr,"After cleanup %d\n",psb_c_get_errstatus());
|
||||
#endif
|
||||
/* Check 2-norm of residual on exit */
|
||||
psb_c_dgeaxpby(one,bh,zero,rh,cdh);
|
||||
psb_c_dspmm(-one,ah,xh,one,rh,cdh);
|
||||
@@ -368,11 +355,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
bv = psb_c_dvect_get_cpy(bh);
|
||||
nlr=psb_c_cd_get_local_rows(cdh);
|
||||
#if DUMPATRIX
|
||||
psb_c_dmat_name_print(ah,"cbindmat.mtx");
|
||||
nlr = psb_c_cd_get_local_rows(cdh);
|
||||
bv = psb_c_dvect_get_cpy(bh);
|
||||
vectfile=fopen("cbindb.mtx","w");
|
||||
for (i=0;i<nlr; i++)
|
||||
fprintf(stdout,"RHS: %d %d %lf\n",iam,i,bv[i]);
|
||||
fprintf(vectfile,"%lf\n",bv[i]);
|
||||
fclose(vectfile);
|
||||
|
||||
|
||||
xv = psb_c_dvect_get_cpy(xh);
|
||||
|
||||
@@ -652,6 +652,7 @@ CINCLUDES
|
||||
METIS_LIBS
|
||||
AMD_LIBS
|
||||
BLAS_LIBS
|
||||
INSTALL_MODULESDIR
|
||||
INSTALL_SAMPLESDIR
|
||||
INSTALL_DOCSDIR
|
||||
INSTALL_INCLUDEDIR
|
||||
@@ -2129,8 +2130,9 @@ case $samplesdir in
|
||||
\/* ) eval "INSTALL_SAMPLESDIR=$samplesdir";;
|
||||
* ) eval "INSTALL_SAMPLESDIR=$INSTALL_DIR/samples";;
|
||||
esac
|
||||
{ $as_echo "$as_me:$LINENO: result: $INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&5
|
||||
$as_echo "$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&6; }
|
||||
INSTALL_MODULESDIR=$INSTALL_DIR/modules
|
||||
{ $as_echo "$as_me:$LINENO: result: $INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_MODULESDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&5
|
||||
$as_echo "$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_MODULESDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR" >&6; }
|
||||
|
||||
save_FCFLAGS="$FCFLAGS";
|
||||
ac_ext=${ac_fc_srcext-f}
|
||||
@@ -12130,6 +12132,7 @@ UTILLIBNAME=libpsb_util.a
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PSBLASRULES='
|
||||
|
||||
+3
-1
@@ -92,7 +92,8 @@ case $samplesdir in
|
||||
\/* ) eval "INSTALL_SAMPLESDIR=$samplesdir";;
|
||||
* ) eval "INSTALL_SAMPLESDIR=$INSTALL_DIR/samples";;
|
||||
esac
|
||||
AC_MSG_RESULT([$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR])
|
||||
INSTALL_MODULESDIR=$INSTALL_DIR/modules
|
||||
AC_MSG_RESULT([$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_MODULESDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR $INSTALL_SAMPLESDIR])
|
||||
|
||||
dnl
|
||||
dnl We set our own FC flags, ignore those from AC_PROG_FC but not those from the
|
||||
@@ -729,6 +730,7 @@ AC_SUBST(INSTALL_LIBDIR)
|
||||
AC_SUBST(INSTALL_INCLUDEDIR)
|
||||
AC_SUBST(INSTALL_DOCSDIR)
|
||||
AC_SUBST(INSTALL_SAMPLESDIR)
|
||||
AC_SUBST(INSTALL_MODULESDIR)
|
||||
|
||||
AC_SUBST(BLAS_LIBS)
|
||||
AC_SUBST(AMD_LIBS)
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
## $Id$
|
||||
## $Id: Makefile 10536 2017-04-09 19:15:54Z sfilippo $
|
||||
##---------------------------------------------------------------------------
|
||||
## LaTeX Makefile
|
||||
## Copyright (C) 1996-2001 Michael Forman Michael.Forman@Colorado.EDU
|
||||
@@ -254,7 +254,7 @@ define header
|
||||
@echo "#---------------------------------------------------------------------"
|
||||
@echo "MAKEFILE = LaTeX PDF Makefile"
|
||||
@echo "AUTHOR = Alfredo Buttari"
|
||||
@echo 'ID = $$Id$ '
|
||||
@echo 'ID = $$Id: Makefile 10536 2017-04-09 19:15:54Z sfilippo $ '
|
||||
@echo "#---------------------------------------------------------------------"
|
||||
@echo
|
||||
@echo "ACRO = $(ACRO) $(ACROFLAGS) $(PDF)"
|
||||
|
||||
+4
-3
@@ -4,6 +4,7 @@ include ../Make.inc
|
||||
HERE=.
|
||||
LIBDIR=../lib
|
||||
INCDIR=../include
|
||||
MODDIR=../modules
|
||||
|
||||
MODOBJS= psb_base_krylov_conv_mod.o \
|
||||
psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o \
|
||||
@@ -23,19 +24,19 @@ OBJS=$(F90OBJS) $(MODOBJS)
|
||||
LOCAL_MODS=$(MODOBJS:.o=$(.mod))
|
||||
LIBNAME=$(METHDLIBNAME)
|
||||
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
|
||||
|
||||
lib: $(OBJS)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
|
||||
|
||||
|
||||
psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o psb_d_krylov_conv_mod.o psb_z_krylov_conv_mod.o: psb_base_krylov_conv_mod.o
|
||||
psb_krylov_conv_mod.o: psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o psb_d_krylov_conv_mod.o psb_z_krylov_conv_mod.o
|
||||
$(F90OBJS): $(MODOBJS)
|
||||
$(OBJS): $(INCDIR)/$(PRECMODNAME)$(.mod) $(INCDIR)/$(BASEMODNAME)$(.mod)
|
||||
$(OBJS): $(MODDIR)/$(PRECMODNAME)$(.mod) $(MODDIR)/$(BASEMODNAME)$(.mod)
|
||||
|
||||
veryclean: clean
|
||||
/bin/rm -f $(HERE)/$(LIBNAME)
|
||||
|
||||
+4
-3
@@ -2,6 +2,7 @@ include ../Make.inc
|
||||
|
||||
LIBDIR=../lib
|
||||
INCDIR=../include
|
||||
MODDIR=../modules
|
||||
HERE=.
|
||||
MODOBJS=psb_prec_const_mod.o\
|
||||
psb_s_prec_type.o psb_d_prec_type.o psb_c_prec_type.o psb_z_prec_type.o \
|
||||
@@ -16,19 +17,19 @@ MODOBJS=psb_prec_const_mod.o\
|
||||
|
||||
LIBNAME=$(PRECLIBNAME)
|
||||
COBJS=
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
|
||||
OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS)
|
||||
|
||||
lib: $(OBJS) impld
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
|
||||
|
||||
impld: $(OBJS)
|
||||
cd impl && $(MAKE)
|
||||
|
||||
$(OBJS): $(INCDIR)/$(BASEMODNAME)$(.mod)
|
||||
$(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod)
|
||||
|
||||
|
||||
psb_s_base_prec_mod.o psb_d_base_prec_mod.o psb_c_base_prec_mod.o psb_z_base_prec_mod.o: psb_prec_const_mod.o
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ include ../../Make.inc
|
||||
|
||||
LIBDIR=../../lib
|
||||
INCDIR=../../include
|
||||
MODDIR=../../modules
|
||||
HERE=..
|
||||
OBJS=psb_s_prec_type_impl.o psb_d_prec_type_impl.o \
|
||||
psb_c_prec_type_impl.o psb_z_prec_type_impl.o \
|
||||
@@ -20,7 +21,7 @@ OBJS=psb_s_prec_type_impl.o psb_d_prec_type_impl.o \
|
||||
|
||||
LIBNAME=$(PRECLIBNAME)
|
||||
COBJS=
|
||||
FINCLUDES=$(FMFLAG).. $(FMFLAG)$(INCDIR)
|
||||
FINCLUDES=$(FMFLAG).. $(FMFLAG)$(MODDIR)
|
||||
|
||||
lib: $(OBJS)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
INSTALLDIR=../..
|
||||
INCDIR=$(INSTALLDIR)/include/
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
#
|
||||
# Libraries used
|
||||
@@ -8,7 +9,7 @@ LIBDIR=$(INSTALLDIR)/lib/
|
||||
PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
|
||||
LDLIBS=$(PSBLDLIBS)
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
SFOBJS=getp.o psb_sf_sample.o
|
||||
DFOBJS=getp.o psb_df_sample.o
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
BASEDIR=../..
|
||||
INCDIR=$(BASEDIR)/include
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
#
|
||||
# Libraries used
|
||||
@@ -10,7 +11,7 @@ LDLIBS=$(PSBLDLIBS)
|
||||
# Compilers and such
|
||||
#
|
||||
CCOPT= -g
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
|
||||
EXEDIR=./runs
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
#
|
||||
INSTALLDIR=../..
|
||||
INCDIR=$(INSTALLDIR)/include/
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
LIBDIR=$(INSTALLDIR)/lib/
|
||||
PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
|
||||
LDLIBS=$(PSBLDLIBS)
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
|
||||
DTOBJS=d_file_spmv.o
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
INSTALLDIR=../..
|
||||
INCDIR=$(INSTALLDIR)/include
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
#
|
||||
# Libraries used
|
||||
@@ -10,7 +11,7 @@ LDLIBS=$(PSBLDLIBS)
|
||||
# Compilers and such
|
||||
#
|
||||
CCOPT= -g
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
|
||||
EXEDIR=./runs
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
#
|
||||
BASEDIR=../..
|
||||
INCDIR=$(BASEDIR)/include/
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
LIBDIR=$(BASEDIR)/lib/
|
||||
PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
|
||||
LDLIBS=$(PSBLDLIBS)
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
|
||||
EXEDIR=./runs
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
BASEDIR=../..
|
||||
INCDIR=$(BASEDIR)/include/
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
LIBDIR=$(BASEDIR)/lib/
|
||||
PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
|
||||
LDLIBS=$(PSBLDLIBS)
|
||||
CCOPT= -g
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
PSBTOBJS=psbtf.o psb_mvsv_tester.o \
|
||||
psb_s_mvsv_tester.o psb_d_mvsv_tester.o psb_c_mvsv_tester.o \
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
BASEDIR=../..
|
||||
INCDIR=$(BASEDIR)/include/
|
||||
MODDIR=$(INSTALLDIR)/modules/
|
||||
include $(INCDIR)/Make.inc.psblas
|
||||
#
|
||||
# Libraries used
|
||||
@@ -8,7 +9,7 @@ LIBDIR=$(BASEDIR)/lib/
|
||||
PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
|
||||
LDLIBS=$(PSBLDLIBS)
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
|
||||
FINCLUDES=$(FMFLAG)$(MODDIR) $(FMFLAG).
|
||||
|
||||
ZH2MOBJS=zhb2mm.o
|
||||
DH2MOBJS=dhb2mm.o
|
||||
|
||||
+4
-3
@@ -3,6 +3,7 @@ include ../Make.inc
|
||||
|
||||
LIBDIR=../lib
|
||||
INCDIR=../include
|
||||
MODDIR=../modules
|
||||
|
||||
HERE=.
|
||||
|
||||
@@ -24,18 +25,18 @@ COBJS=metis_int.o psb_amd_order.o
|
||||
OBJS=$(COBJS) $(MODOBJS) $(IMPLOBJS)
|
||||
LOCAL_MODS=$(MODOBJS:.o=$(.mod))
|
||||
LIBNAME=$(UTILLIBNAME)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCDIR)
|
||||
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
|
||||
|
||||
|
||||
lib: $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(INCDIR)
|
||||
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
|
||||
|
||||
$(HERE)/$(LIBNAME): $(OBJS)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
|
||||
$(OBJS): $(INCDIR)/$(BASEMODNAME)$(.mod)
|
||||
$(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod)
|
||||
psb_util_mod.o: $(BASEOBJS)
|
||||
psb_metispart_mod.o: metis_int.o
|
||||
psb_mat_dist_mod.o: psb_s_mat_dist_mod.o psb_d_mat_dist_mod.o psb_c_mat_dist_mod.o psb_z_mat_dist_mod.o
|
||||
|
||||
Reference in New Issue
Block a user