[cig-commits] [commit] rajesh-petsc-schur: corrected the signatures of return_elementwise_horiz_ave, global_tdot_d, global_tdot (9ec861b)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:14:48 PST 2014


Repository : https://github.com/geodynamics/citcoms

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd

>---------------------------------------------------------------

commit 9ec861b786cef4cd1445b8d708230890f5430ed5
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Thu Sep 25 14:46:39 2014 -0700

    corrected the signatures of return_elementwise_horiz_ave, global_tdot_d, global_tdot


>---------------------------------------------------------------

9ec861b786cef4cd1445b8d708230890f5430ed5
 lib/Construct_arrays.c           |  2 +-
 lib/Full_boundary_conditions.c   |  2 +-
 lib/Full_parallel_related.c      | 26 +++++++++++++-------------
 lib/Full_read_input_from_files.c |  2 +-
 lib/Full_version_dependent.c     |  8 ++++----
 lib/Global_operations.c          | 12 ++++++------
 lib/prototypes.h                 |  6 +++---
 7 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/lib/Construct_arrays.c b/lib/Construct_arrays.c
index 5880344..d541485 100644
--- a/lib/Construct_arrays.c
+++ b/lib/Construct_arrays.c
@@ -296,7 +296,7 @@ void construct_node_maps(E)
        E->mesh.matrix_size[lev] = matrix;
 
        if(E->control.verbose) {
-           fprintf(E->fp_out, "output Node_map lev=%d m=%d\n", lev, CPPR);
+           fprintf(E->fp_out, "output Node_map lev=%d\n", lev);
            fprintf(E->fp_out, "neq=%d nno=%d max_eqn=%d matrix=%d\n", neq, nno, max_eqn, matrix);
            for(i=0;i<matrix;i++)
                fprintf(E->fp_out, "%d %d\n", i, E->Node_map[lev][i]);
diff --git a/lib/Full_boundary_conditions.c b/lib/Full_boundary_conditions.c
index f2df75a..f0513bf 100644
--- a/lib/Full_boundary_conditions.c
+++ b/lib/Full_boundary_conditions.c
@@ -101,7 +101,7 @@ void full_velocity_boundary_conditions(E)
 				     be easiest to call only once and
 				     have routines deal with multigrid
 				  */
-	  if((lv == E->mesh.gridmin) && (CPPR == E->sphere.caps_per_proc))
+	  if(lv == E->mesh.gridmin)
 	     read_velocity_boundary_from_file(E);
 	}
       }
diff --git a/lib/Full_parallel_related.c b/lib/Full_parallel_related.c
index 043268a..6f957cc 100644
--- a/lib/Full_parallel_related.c
+++ b/lib/Full_parallel_related.c
@@ -72,7 +72,7 @@ void full_parallel_processor_setup(struct All_variables *E)
     parallel_process_termination();
     }
 
-  E->sphere.caps_per_proc = CPPR;//max(1,E->sphere.caps*E->parallel.nprocz/E->parallel.nproc);
+  E->sphere.caps_per_proc = 1;
 
   if (E->sphere.caps_per_proc > 1) {
     if (E->parallel.me==0) fprintf(stderr,"!!!! # caps per proc > 1 is not supported.\n \n");
@@ -109,8 +109,8 @@ oordinate and F-B
   pid_surf = me/proc_per_cap; /* cap number (0~11) */
   i = cases[E->sphere.caps_per_proc]; /* 1 for more than 12 processors */
 
-    temp = pid_surf*E->sphere.caps_per_proc + CPPR-1; /* cap number (out of 12) */
-    E->sphere.capid[CPPR] = incases1[i].links[temp]; /* id (1~12) of the current cap */
+    temp = pid_surf*E->sphere.caps_per_proc; /* cap number (out of 12) */
+    E->sphere.capid[1] = incases1[i].links[temp]; /* id (1~12) of the current cap */
 
   /* determine which caps are linked with each of 12 caps  */
   /* if the 12 caps are broken, set these up instead */
@@ -145,7 +145,7 @@ oordinate and F-B
 
   if (E->control.verbose) {
     fprintf(E->fp_out,"me=%d loc1=%d loc2=%d loc3=%d\n",me,E->parallel.me_loc[1],E->parallel.me_loc[2],E->parallel.me_loc[3]);
-      fprintf(E->fp_out,"capid[%d]=%d \n",CPPR,E->sphere.capid[CPPR]);
+      fprintf(E->fp_out,"capid[1]=%d \n",E->sphere.capid[1]);
     for (m=0;m<E->sphere.caps;m++)
       for (j=0;j<E->parallel.nprocy;j++)
 	for (i=0;i<E->parallel.nprocx;i++)
@@ -434,7 +434,7 @@ void full_parallel_domain_boundary_nodes(E)
          add them back here */
 
       /* north pole is at the front left proc. of 1st cap */
-      if (E->sphere.capid[CPPR] == 1 &&
+      if (E->sphere.capid[1] == 1 &&
           E->parallel.me_loc[1] == 0 &&
           E->parallel.me_loc[2] == 0)
           for(j=1;j<=noz;j++) {
@@ -443,7 +443,7 @@ void full_parallel_domain_boundary_nodes(E)
           }
 
       /* south pole is at the back right proc. of final cap */
-      if (E->sphere.capid[CPPR] == E->sphere.caps &&
+      if (E->sphere.capid[1] == E->sphere.caps &&
           E->parallel.me_loc[1] == E->parallel.nprocx-1 &&
           E->parallel.me_loc[2] == E->parallel.nprocy-1)
           for(j=1;j<=noz;j++) {
@@ -465,7 +465,7 @@ void full_parallel_domain_boundary_nodes(E)
 if (E->control.verbose) {
  fprintf(E->fp_out,"output_shared_nodes %d \n",E->parallel.me);
  for(lev=E->mesh.gridmax;lev>=E->mesh.gridmin;lev--)
-    fprintf(E->fp_out,"lev=%d  me=%d capid=%d m=%d \n",lev,E->parallel.me,E->sphere.capid[CPPR],CPPR);
+    fprintf(E->fp_out,"lev=%d  me=%d capid=%d\n",lev,E->parallel.me,E->sphere.capid[1]);
     for (ii=1;ii<=6;ii++)
       for (i=1;i<=E->parallel.NUM_NNO[lev].bound[ii];i++)
         fprintf(E->fp_out,"ii=%d   %d %d \n",ii,i,E->parallel.NODE[lev][i].bound[ii]);
@@ -517,7 +517,7 @@ void full_parallel_communication_routs_v(E)
     noz = E->lmesh.NOZ[lev];
     noy = E->lmesh.NOY[lev];
 
-      cap = E->sphere.capid[CPPR] - 1;  /* which cap I am in (0~11) */
+      cap = E->sphere.capid[1] - 1;  /* which cap I am in (0~11) */
 
       /* -X face */
       npass = ii = 1;
@@ -675,7 +675,7 @@ void full_parallel_communication_routs_v(E)
 	E->parallel.NUM_NODEz[lev].pass[kkk] = 0;
 	E->parallel.NUM_NEQz[lev].pass[kkk] = 0;
 
-	  cap = E->sphere.capid[CPPR] - 1;  /* which cap I am in (0~11) */
+	  cap = E->sphere.capid[1] - 1;  /* which cap I am in (0~11) */
 	  E->parallel.PROCESSORz[lev].pass[kkk] =
 	    E->parallel.loc2proc_map[cap][lx][ly][lz+((ii==5)?-1:1)];
 
@@ -703,7 +703,7 @@ void full_parallel_communication_routs_v(E)
   if(E->control.verbose) {
     for(lev=E->mesh.gridmax;lev>=E->mesh.gridmin;lev--) {
       fprintf(E->fp_out,"output_communication route surface for lev=%d \n",lev);
-	fprintf(E->fp_out,"  me= %d cap=%d pass  %d \n",E->parallel.me,E->sphere.capid[CPPR],E->parallel.TNUM_PASS[lev]);
+	fprintf(E->fp_out,"  me= %d cap=%d pass  %d \n",E->parallel.me,E->sphere.capid[1],E->parallel.TNUM_PASS[lev]);
 	for (k=1;k<=E->parallel.TNUM_PASS[lev];k++)   {
 	  fprintf(E->fp_out,"proc %d and pass  %d to proc %d with %d eqn and %d node\n",E->parallel.me,k,E->parallel.PROCESSOR[lev].pass[k],E->parallel.NUM_NEQ[lev].pass[k],E->parallel.NUM_NODE[lev].pass[k]);
 	  fprintf(E->fp_out,"Eqn:\n");  
@@ -719,7 +719,7 @@ void full_parallel_communication_routs_v(E)
       for (k=1;k<=E->parallel.TNUM_PASSz[lev];k++)   {
 	kkkp = k + E->sphere.max_connections;
 	fprintf(E->fp_out,"proc %d and pass  %d to proc %d\n",E->parallel.me,k,E->parallel.PROCESSORz[lev].pass[k]);
-	  fprintf(E->fp_out,"cap=%d eqn=%d node=%d\n",E->sphere.capid[CPPR],E->parallel.NUM_NEQ[lev].pass[kkkp],E->parallel.NUM_NODE[lev].pass[kkkp]);
+	  fprintf(E->fp_out,"cap=%d eqn=%d node=%d\n",E->sphere.capid[1],E->parallel.NUM_NEQ[lev].pass[kkkp],E->parallel.NUM_NODE[lev].pass[kkkp]);
 	  for (ii=1;ii<=E->parallel.NUM_NEQ[lev].pass[kkkp];ii++) 
 	    fprintf(E->fp_out,"%d %d\n",ii,E->parallel.EXCHANGE_ID[lev][ii].pass[kkkp]); 
 	  for (ii=1;ii<=E->parallel.NUM_NODE[lev].pass[kkkp];ii++) 
@@ -757,7 +757,7 @@ void full_parallel_communication_routs_s(E)
     noz = E->lmesh.NOZ[lev];
     noy = E->lmesh.NOY[lev];
 
-      j = E->sphere.capid[CPPR];
+      j = E->sphere.capid[1];
 
       for (kkk=1;kkk<=E->parallel.TNUM_PASS[lev];kkk++) {
         if (kkk<=4) {  /* first 4 communications are for XZ and YZ planes */
@@ -788,7 +788,7 @@ void full_parallel_communication_routs_s(E)
   if(E->control.verbose) {
     for(lev=E->mesh.gridmax;lev>=E->mesh.gridmin;lev--) {
       fprintf(E->fp_out,"output_communication route surface for lev=%d \n",lev);
-	fprintf(E->fp_out,"  me= %d cap=%d pass  %d \n",E->parallel.me,E->sphere.capid[CPPR],E->parallel.TNUM_PASS[lev]);
+	fprintf(E->fp_out,"  me= %d cap=%d pass  %d \n",E->parallel.me,E->sphere.capid[1],E->parallel.TNUM_PASS[lev]);
 	for (k=1;k<=E->parallel.TNUM_PASS[lev];k++) {
 	  fprintf(E->fp_out,"proc %d and pass  %d to proc %d with %d node\n",E->parallel.me,k,E->parallel.PROCESSOR[lev].pass[k],E->parallel.NUM_sNODE[lev].pass[k]);
 	  fprintf(E->fp_out,"Node:\n");
diff --git a/lib/Full_read_input_from_files.c b/lib/Full_read_input_from_files.c
index 376a63d..4e3833a 100644
--- a/lib/Full_read_input_from_files.c
+++ b/lib/Full_read_input_from_files.c
@@ -90,7 +90,7 @@ void full_read_input_files_for_timesteps(E,action,output)
       pos_age = 1;
     }
 
-      cap = E->sphere.capid[CPPR] - 1;  /* capid: 1-12 */
+      cap = E->sphere.capid[1] - 1;  /* capid: 0-11 */
 
       switch (action) { /* set up files to open */
 
diff --git a/lib/Full_version_dependent.c b/lib/Full_version_dependent.c
index 81c039e..6c7d717 100644
--- a/lib/Full_version_dependent.c
+++ b/lib/Full_version_dependent.c
@@ -160,7 +160,7 @@ void full_node_locations(E)
   free ((void *) rr);
   free ((void *) RR);
 
-   ii = E->sphere.capid[CPPR];
+   ii = E->sphere.capid[1];
    full_coord_of_cap(E,ii);
 
   if (E->control.verbose) {
@@ -168,7 +168,7 @@ void full_node_locations(E)
           fprintf(E->fp_out,"output_coordinates before rotation %d \n",lev);
               for (i=1;i<=E->lmesh.NNO[lev];i++)
                   if(i%E->lmesh.NOZ[lev]==1)
-                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
+                      fprintf(E->fp_out,"%d %g %g %g\n",i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
       }
       fflush(E->fp_out);
   }
@@ -188,7 +188,7 @@ void full_node_locations(E)
   dircos[3][2] = sin(ro)*sin(fo);
   dircos[3][3] = cos(ro);
 
-     ii = E->sphere.capid[CPPR];
+     ii = E->sphere.capid[1];
      full_rotate_mesh(E,dircos,ii);
 
   if (E->control.verbose) {
@@ -196,7 +196,7 @@ void full_node_locations(E)
           fprintf(E->fp_out,"output_coordinates after rotation %d \n",lev);
               for (i=1;i<=E->lmesh.NNO[lev];i++)
                   if(i%E->lmesh.NOZ[lev]==1)
-                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
+                      fprintf(E->fp_out,"%d %g %g %g\n",i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
       }
       fflush(E->fp_out);
   }
diff --git a/lib/Global_operations.c b/lib/Global_operations.c
index 12ffc2a..5ea607b 100644
--- a/lib/Global_operations.c
+++ b/lib/Global_operations.c
@@ -244,7 +244,7 @@ void return_horiz_ave_f(E,X,H)
 
 void return_elementwise_horiz_ave(E,X,H)
      struct All_variables *E;
-     double **X, *H;
+     double *X, *H;
 {
 
   int m,i,j,k,d,noz,noy,el,elz,elx,ely,nproc;
@@ -276,7 +276,7 @@ void return_elementwise_horiz_ave(E,X,H)
       for (j=1;j<=elx;j++)
       {
         el = i + (j-1)*elz + (k-1)*elx*elz;
-        temp[i] += X[CPPR][el]*E->ECO[E->mesh.levmax][el].area;
+        temp[i] += X[el]*E->ECO[E->mesh.levmax][el].area;
         temp[i+elz] += E->ECO[E->mesh.levmax][el].area;
       }
     }
@@ -634,7 +634,7 @@ double global_div_norm2(struct All_variables *E,  double *A)
 
 double global_tdot_d(E,A,B,lev)
    struct All_variables *E;
-   double **A,**B;
+   double *A,*B;
    int lev;
 
 {
@@ -648,7 +648,7 @@ double global_tdot_d(E,A,B,lev)
   nno=E->lmesh.NNO[lev];
   for (i=1;i<=nno;i++)
     if (!(E->NODE[lev][i] & SKIP))
-      temp += A[CPPR][i];
+      temp += A[i];
 
   MPI_Allreduce(&temp, &prod,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
 
@@ -657,7 +657,7 @@ double global_tdot_d(E,A,B,lev)
 
 float global_tdot(E,A,B,lev)
    struct All_variables *E;
-   float **A,**B;
+   float *A,*B;
    int lev;
 
 {
@@ -670,7 +670,7 @@ float global_tdot(E,A,B,lev)
   nno=E->lmesh.NNO[lev];
   for (i=1;i<=nno;i++)
     if (!(E->NODE[lev][i] & SKIP))
-      temp += A[CPPR][i]*B[CPPR][i];
+      temp += A[i]*B[i];
 
   MPI_Allreduce(&temp, &prod,1,MPI_FLOAT,MPI_SUM,E->parallel.world);
 
diff --git a/lib/prototypes.h b/lib/prototypes.h
index c9a76bb..951c7ee 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -194,7 +194,7 @@ void remove_horiz_ave(struct All_variables *, double *, double *, int);
 void remove_horiz_ave2(struct All_variables *, double *);
 void return_horiz_ave(struct All_variables *, double *, double *);
 void return_horiz_ave_f(struct All_variables *, float *, float *);
-void return_elementwise_horiz_ave(struct All_variables *, double **, double *);
+void return_elementwise_horiz_ave(struct All_variables *, double *, double *);
 float return_bulk_value(struct All_variables *, float *, int);
 double return_bulk_value_d(struct All_variables *, double *, int);
 float find_max_horizontal(struct All_variables *, double);
@@ -207,8 +207,8 @@ double global_pdot(struct All_variables *, double *, double *, int);
 double global_v_norm2(struct All_variables *, double *);
 double global_p_norm2(struct All_variables *, double *);
 double global_div_norm2(struct All_variables *, double *);
-double global_tdot_d(struct All_variables *, double **, double **, int);
-float global_tdot(struct All_variables *, float **, float **, int);
+double global_tdot_d(struct All_variables *, double *, double *, int);
+float global_tdot(struct All_variables *, float *, float *, int);
 float global_fmin(struct All_variables *, double);
 double global_dmax(struct All_variables *, double);
 float global_fmax(struct All_variables *, double);



More information about the CIG-COMMITS mailing list