From 07149a02ad8ba1c941ac5f157965c5489a4f8c7d Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 11 Nov 2024 09:11:07 +0100 Subject: [PATCH] Fixes for krylov->linsolve. Test program to be completed. --- cbind/amgprec/amg_dprec_cbind_mod.F90 | 4 ++-- cbind/amgprec/amg_zprec_cbind_mod.F90 | 4 ++-- cbind/test/pargen/Makefile | 16 ++++++------- cbind/test/pargen/amgec.c | 24 +++++++++---------- cbind/test/pargen/runs/{mlde.inp => amge.inp} | 0 5 files changed, 24 insertions(+), 24 deletions(-) rename cbind/test/pargen/runs/{mlde.inp => amge.inp} (100%) diff --git a/cbind/amgprec/amg_dprec_cbind_mod.F90 b/cbind/amgprec/amg_dprec_cbind_mod.F90 index 29c514a9..f6db13c9 100644 --- a/cbind/amgprec/amg_dprec_cbind_mod.F90 +++ b/cbind/amgprec/amg_dprec_cbind_mod.F90 @@ -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 diff --git a/cbind/amgprec/amg_zprec_cbind_mod.F90 b/cbind/amgprec/amg_zprec_cbind_mod.F90 index 167509d9..8ae1c964 100644 --- a/cbind/amgprec/amg_zprec_cbind_mod.F90 +++ b/cbind/amgprec/amg_zprec_cbind_mod.F90 @@ -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 diff --git a/cbind/test/pargen/Makefile b/cbind/test/pargen/Makefile index 3a2921e8..f5bf13f3 100644 --- a/cbind/test/pargen/Makefile +++ b/cbind/test/pargen/Makefile @@ -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 diff --git a/cbind/test/pargen/amgec.c b/cbind/test/pargen/amgec.c index 9a2c42c0..09cf83c7 100644 --- a/cbind/test/pargen/amgec.c +++ b/cbind/test/pargen/amgec.c @@ -77,7 +77,7 @@ #include #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; diff --git a/cbind/test/pargen/runs/mlde.inp b/cbind/test/pargen/runs/amge.inp similarity index 100% rename from cbind/test/pargen/runs/mlde.inp rename to cbind/test/pargen/runs/amge.inp