From 1af482fe333b4ab81282c4b0d8913ce96b11060e Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 1 Oct 2019 13:58:57 +0100 Subject: [PATCH] Improve cbind makefile. First working version of test program. --- cbind/Makefile | 7 +++---- cbind/mlprec/Makefile | 14 ++++++++------ cbind/mlprec/mld_c_dprec.h | 2 +- cbind/test/pargen/mldec.c | 9 ++++++--- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cbind/Makefile b/cbind/Makefile index 95202fe9..8728e137 100644 --- a/cbind/Makefile +++ b/cbind/Makefile @@ -8,9 +8,9 @@ LIBNAME=$(CBINDLIBNAME) LIBNAME=libmld_cbind.a lib: mlprecd -# /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)# -# /bin/cp -p $(CPUPDFLAG) *.h $(INCDIR) -# /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) + /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) + /bin/cp -p $(CPUPDFLAG) *.h $(INCDIR) + /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) mlprecd: @@ -19,7 +19,6 @@ mlprecd: clean: cd mlprec && $(MAKE) clean - cd krylov && $(MAKE) clean veryclean: clean diff --git a/cbind/mlprec/Makefile b/cbind/mlprec/Makefile index d51a6316..6ddd7152 100644 --- a/cbind/mlprec/Makefile +++ b/cbind/mlprec/Makefile @@ -1,8 +1,10 @@ -include ../../Make.inc -LIBDIR=../../lib -INCDIR=../../include -MODDIR=../../modules +TOP=../.. +include $(TOP)/Make.inc +LIBDIR=$(TOP)/lib +INCDIR=$(TOP)/include +MODDIR=$(TOP)/modules HERE=. +DEST=../ CINCLUDES=-I. -I$(LIBDIR) -I$(PSBLAS_INCDIR) FINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)$(MODDIR) $(PSBLAS_INCLUDES) @@ -20,8 +22,8 @@ LOCAL_MODS=$(LIBMOD) lib: $(OBJS) $(CMOD) $(AR) $(HERE)/$(LIBNAME) $(OBJS) $(RANLIB) $(HERE)/$(LIBNAME) - /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) - /bin/cp -p $(LIBMOD) $(CMOD) $(INCDIR) + /bin/cp -p $(HERE)/$(LIBNAME) $(DEST) + /bin/cp -p $(LIBMOD) $(CMOD) $(DEST) mld_prec_cbind_mod.o: mld_dprec_cbind_mod.o #mld_prec_cbind_mod.o: psb_prec_cbind_mod.o diff --git a/cbind/mlprec/mld_c_dprec.h b/cbind/mlprec/mld_c_dprec.h index 9113f333..364cbde4 100644 --- a/cbind/mlprec/mld_c_dprec.h +++ b/cbind/mlprec/mld_c_dprec.h @@ -19,7 +19,7 @@ extern "C" { mld_c_dprec* mld_c_new_dprec(); psb_i_t mld_c_delete_dprec(mld_c_dprec* p); - psb_i_t mld_c_dprecinit(mld_c_dprec *ph, const char *ptype); + psb_i_t mld_c_dprecinit(psb_i_t ictxt, mld_c_dprec *ph, const char *ptype); psb_i_t mld_c_dprecseti(mld_c_dprec *ph, const char *what, psb_i_t val); psb_i_t mld_c_dprecsetc(mld_c_dprec *ph, const char *what, const char *val); psb_i_t mld_c_dprecsetr(mld_c_dprec *ph, const char *what, double val); diff --git a/cbind/test/pargen/mldec.c b/cbind/test/pargen/mldec.c index 26082584..4e4775e8 100644 --- a/cbind/test/pargen/mldec.c +++ b/cbind/test/pargen/mldec.c @@ -327,18 +327,21 @@ int main(int argc, char *argv[]) psb_c_barrier(ictxt); /* Set up the preconditioner */ ph = mld_c_new_dprec(); - mld_c_dprecinit(ph,ptype); + 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",1); - mld_c_dprecbld(ah,cdh,ph); + if ((ret=mld_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) + fprintf(stderr,"From smoothers_build: %d\n",ret); psb_c_barrier(ictxt); /* Set up the solver options */ psb_c_DefaultSolverOptions(&options); - options.eps = 1.e-9; + options.eps = 1.e-6; options.itmax = itmax; options.irst = irst; options.itrace = 1;