From 032543d6253852f60f9928ee01ac7cec6579cb2c Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 11 Nov 2024 13:06:48 +0100 Subject: [PATCH] Adjusted CBIND test program. --- cbind/test/pargen/amgec.c | 63 ++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/cbind/test/pargen/amgec.c b/cbind/test/pargen/amgec.c index 09cf83c7..329b0649 100644 --- a/cbind/test/pargen/amgec.c +++ b/cbind/test/pargen/amgec.c @@ -123,7 +123,7 @@ double g(double x, double y, double z) #define NBMAX 20 -psb_i_t matgen(psb_i_t ictxt, psb_i_t nl, psb_i_t idim, psb_l_t vl[], +psb_i_t matgen(psb_c_ctxt cctxt, psb_i_t nl, psb_i_t idim, psb_l_t vl[], psb_c_dspmat *ah,psb_c_descriptor *cdh, psb_c_dvector *xh, psb_c_dvector *bh, psb_c_dvector *rh) { @@ -135,7 +135,7 @@ psb_i_t matgen(psb_i_t ictxt, psb_i_t nl, psb_i_t idim, psb_l_t vl[], psb_l_t irow[10*NBMAX], icol[10*NBMAX]; info = 0; - psb_c_info(ictxt,&iam,&np); + psb_c_info(cctxt,&iam,&np); deltah = (double) 1.0/(idim+1); sqdeltah = deltah*deltah; deltah2 = 2.0* deltah; @@ -253,7 +253,8 @@ void get_hparm(FILE *fp, char *val) int main(int argc, char *argv[]) { - psb_i_t ictxt, iam, np; + psb_c_ctxt *cctxt; + psb_i_t iam, np; char methd[40], ptype[40], afmt[8]; psb_i_t nparms; psb_i_t idim,info,istop,itmax,itrace,irst,iter,ret; @@ -269,12 +270,13 @@ int main(int argc, char *argv[]) psb_c_descriptor *cdh; FILE *vectfile; - ictxt = psb_c_init(); - psb_c_info(ictxt,&iam,&np); + cctxt = psb_c_new_ctxt(); + psb_c_init(cctxt); + psb_c_info(*cctxt,&iam,&np); fprintf(stdout,"Initialization: am %d of %d\n",iam,np); fflush(stdout); - psb_c_barrier(ictxt); + psb_c_barrier(*cctxt); if (iam == 0) { get_iparm(stdin,&nparms); get_hparm(stdin,methd); @@ -287,17 +289,17 @@ int main(int argc, char *argv[]) get_iparm(stdin,&irst); } /* Now broadcast the values, and check they're OK */ - psb_c_ibcast(ictxt,1,&nparms,0); - psb_c_hbcast(ictxt,methd,0); - psb_c_hbcast(ictxt,ptype,0); - psb_c_hbcast(ictxt,afmt,0); - psb_c_ibcast(ictxt,1,&idim,0); - psb_c_ibcast(ictxt,1,&istop,0); - psb_c_ibcast(ictxt,1,&itmax,0); - psb_c_ibcast(ictxt,1,&itrace,0); - psb_c_ibcast(ictxt,1,&irst,0); + psb_c_ibcast(*cctxt,1,&nparms,0); + psb_c_hbcast(*cctxt,methd,0); + psb_c_hbcast(*cctxt,ptype,0); + psb_c_hbcast(*cctxt,afmt,0); + psb_c_ibcast(*cctxt,1,&idim,0); + psb_c_ibcast(*cctxt,1,&istop,0); + psb_c_ibcast(*cctxt,1,&itmax,0); + psb_c_ibcast(*cctxt,1,&itrace,0); + psb_c_ibcast(*cctxt,1,&irst,0); - psb_c_barrier(ictxt); + psb_c_barrier(*cctxt); cdh=psb_c_new_descriptor(); psb_c_set_index_base(0); @@ -310,15 +312,15 @@ int main(int argc, char *argv[]) fprintf(stderr,"%d: Input data %d %ld %d %d\n",iam,idim,ng,nb, nl); if ((vl=malloc(nb*sizeof(psb_l_t)))==NULL) { fprintf(stderr,"On %d: malloc failure\n",iam); - psb_c_abort(ictxt); + psb_c_abort(*cctxt); } i = ((psb_l_t)iam) * nb; for (k=0; kdescriptor); @@ -440,6 +442,7 @@ int main(int argc, char *argv[]) if (iam == 0) fprintf(stderr,"program completed successfully\n"); - psb_c_barrier(ictxt); - psb_c_exit(ictxt); + psb_c_barrier(*cctxt); + psb_c_exit(*cctxt); + free(cctxt); }