Fixes for krylov->linsolve. Test program to be completed.

repack-newsolve
sfilippone 1 month ago
parent 08a0c744b1
commit 07149a02ad

@ -264,7 +264,7 @@ contains
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_krylov_mod
use psb_linsolve_mod
use psb_prec_cbind_mod
use psb_dkrylov_cbind_mod
implicit none
@ -285,7 +285,7 @@ contains
& 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_linsolve_mod
use psb_objhandle_mod
use psb_prec_cbind_mod
use psb_base_string_cbind_mod

@ -264,7 +264,7 @@ contains
& ah,ph,bh,xh,cdh,options) bind(c) result(res)
use psb_base_mod
use psb_prec_mod
use psb_krylov_mod
use psb_linsolve_mod
use psb_prec_cbind_mod
use psb_zkrylov_cbind_mod
implicit none
@ -285,7 +285,7 @@ contains
& 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_linsolve_mod
use psb_objhandle_mod
use psb_prec_cbind_mod
use psb_base_string_cbind_mod

@ -9,8 +9,8 @@ HERE=.
FINCLUDES=$(FMFLAG). $(FMFLAG)$(LIBDIR) $(FMFLAG)$(PSBLAS_INCDIR)
#PSBLAS_LIBS= -L$(PSBLAS_LIBDIR) -L$(LIBDIR) $(CPSBLAS_LIB) $(PSBLAS_LIB)
# -lpsb_krylov_cbind -lpsb_prec_cbind -lpsb_base_cbind
PSBC_LIBS= -L$(PSBLAS_LIBDIR) -lpsb_cbind -lpsb_krylov -lpsb_prec
MLDC_LIBS=-L$(LIBDIR) -lmld_cbind -lmld_prec
PSBC_LIBS= -L$(PSBLAS_LIBDIR) -lpsb_cbind -lpsb_linsolve -lpsb_prec
AMGC_LIBS=-L$(LIBDIR) -lamg_cbind -lamg_prec
#
# Compilers and such
#
@ -23,15 +23,15 @@ EXEDIR=./runs
#UMFLIBS=-lumfpack -lamd -lcholmod -lcolamd -lcamd -lccolamd -L/usr/include/suitesparse
#UMFFLAGS=-DHave_UMF_ -I/usr/include/suitesparse
all: mldec
all: amgec
mldec: mldec.o
$(MPFC) mldec.o -o mldec $(MLDC_LIBS) $(PSBC_LIBS) $(PSBCLDLIBS) $(PSBLAS_LIBS) \
amgec: amgec.o
$(MPFC) amgec.o -o amgec $(AMGC_LIBS) $(PSBC_LIBS) $(PSBCLDLIBS) $(PSBLAS_LIBS) \
$(UMFLIBS) $(PSBLDLIBS) $(LDLIBS) -lm -lgfortran
# \
# -lifcore -lifcoremt -lguide -limf -lirc -lintlc -lcxaguard -L/opt/intel/fc/10.0.023/lib/ -lm
/bin/mv mldec $(EXEDIR)
/bin/mv amgec $(EXEDIR)
.f90.o:
$(MPFC) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $<
@ -40,13 +40,13 @@ mldec: mldec.o
clean:
/bin/rm -f mldec.o $(EXEDIR)/mldec
/bin/rm -f amgec.o $(EXEDIR)/amgec
verycleanlib:
(cd ../..; make veryclean)
lib:
(cd ../../; make library)
tests: all
cd runs ; ./mldec < mlde.inp
cd runs ; ./amgec < amge.inp

@ -77,7 +77,7 @@
#include <math.h>
#include "psb_base_cbind.h"
#include "mld_cbind.h"
#include "amg_cbind.h"
double a1(double x, double y, double z)
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
char methd[40], ptype[40], afmt[8];
psb_i_t nparms;
psb_i_t idim,info,istop,itmax,itrace,irst,iter,ret;
mld_c_dprec *ph;
amg_c_dprec *ph;
psb_c_dspmat *ah;
psb_c_dvector *bh, *xh, *rh;
psb_i_t nb,nlr, nl;
@ -343,16 +343,16 @@ int main(int argc, char *argv[])
}
psb_c_barrier(ictxt);
/* Set up the preconditioner */
ph = mld_c_dprec_new();
mld_c_dprecinit(ictxt,ph,ptype);
mld_c_dprecseti(ph,"SMOOTHER_SWEEPS",2);
mld_c_dprecseti(ph,"SUB_FILLIN",1);
mld_c_dprecsetc(ph,"COARSE_SOLVE","BJAC");
mld_c_dprecsetc(ph,"COARSE_SUBSOLVE","ILU");
mld_c_dprecseti(ph,"COARSE_FILLIN",0);
if ((ret=mld_c_dhierarchy_build(ah,cdh,ph))!=0)
ph = amg_c_dprec_new();
amg_c_dprecinit(ictxt,ph,ptype);
amg_c_dprecseti(ph,"SMOOTHER_SWEEPS",2);
amg_c_dprecseti(ph,"SUB_FILLIN",1);
amg_c_dprecsetc(ph,"COARSE_SOLVE","BJAC");
amg_c_dprecsetc(ph,"COARSE_SUBSOLVE","ILU");
amg_c_dprecseti(ph,"COARSE_FILLIN",0);
if ((ret=amg_c_dhierarchy_build(ah,cdh,ph))!=0)
fprintf(stderr,"From hierarchy_build: %d\n",ret);
if ((ret=mld_c_dsmoothers_build(ah,cdh,ph))!=0)
if ((ret=amg_c_dsmoothers_build(ah,cdh,ph))!=0)
fprintf(stderr,"From smoothers_build: %d\n",ret);
psb_c_barrier(ictxt);
@ -365,7 +365,7 @@ int main(int argc, char *argv[])
options.istop = istop;
psb_c_seterraction_ret();
t1=psb_c_wtime();
ret=mld_c_dkrylov(methd,ah,ph,bh,xh,cdh,&options);
ret=amg_c_dkrylov(methd,ah,ph,bh,xh,cdh,&options);
t2=psb_c_wtime();
iter = options.iter;
err = options.err;

Loading…
Cancel
Save