[cig-commits] [commit] rajesh-petsc-schur: removed E->sphere.caps_per_proc as part of the final cleanup related to caps_per_proc removal (2194cb9)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Sep 25 15:35:38 PDT 2014


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

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/ec0945705eef4b24081ed7ef0f52224d56e1b34c...2194cb92e3d480070e7e74e58562844ceff3264f

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

commit 2194cb92e3d480070e7e74e58562844ceff3264f
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Thu Sep 25 15:35:37 2014 -0700

    removed E->sphere.caps_per_proc as part of the final cleanup related to caps_per_proc removal


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

2194cb92e3d480070e7e74e58562844ceff3264f
 lib/Checkpoints.c               |  13 +-
 lib/Construct_arrays.c          |  21 ----
 lib/Full_boundary_conditions.c  |  18 +--
 lib/Full_parallel_related.c     |  16 +--
 lib/Full_tracer_advection.c     | 259 ----------------------------------------
 lib/Output_gzdir.c              |  20 ++--
 lib/Output_vtk.c                |  14 +--
 lib/Regional_parallel_related.c |   4 +-
 lib/Regional_tracer_advection.c |   2 -
 lib/Tracer_setup.c              |   3 +-
 lib/global_defs.h               |   1 -
 11 files changed, 24 insertions(+), 347 deletions(-)

diff --git a/lib/Checkpoints.c b/lib/Checkpoints.c
index aa1713b..6c7829b 100644
--- a/lib/Checkpoints.c
+++ b/lib/Checkpoints.c
@@ -195,15 +195,12 @@ static void general_checkpoint(struct All_variables *E, FILE *fp)
     fwrite(&(E->parallel.nprocx), sizeof(int), 1, fp);
     fwrite(&(E->parallel.nprocy), sizeof(int), 1, fp);
     fwrite(&(E->parallel.nprocz), sizeof(int), 1, fp);
-    fwrite(&(E->sphere.caps_per_proc), sizeof(int), 1, fp);
 
     /* write timing information */
     fwrite(&(E->monitor.solution_cycles), sizeof(int), 1, fp);
     fwrite(&(E->monitor.elapsed_time), sizeof(float), 1, fp);
     fwrite(&(E->advection.timestep), sizeof(float), 1, fp);
     fwrite(&(E->control.start_age), sizeof(float), 1, fp);
-
-    return;
 }
 
 
@@ -220,14 +217,12 @@ static void read_general_checkpoint(struct All_variables *E, FILE *fp)
        (tmp[2] != E->lmesh.noz) ||
        (tmp[3] != E->parallel.nprocx) ||
        (tmp[4] != E->parallel.nprocy) ||
-       (tmp[5] != E->parallel.nprocz) ||
-       (tmp[6] != E->sphere.caps_per_proc)) {
+       (tmp[5] != E->parallel.nprocz)) {
 
         fprintf(stderr, "Error in reading checkpoint file: mesh parameters mismatch, me=%d\n",
                 E->parallel.me);
-        fprintf(stderr, "%d %d %d %d %d %d %d\n",
-                tmp[0], tmp[1], tmp[2], tmp[3],
-                tmp[4], tmp[5], tmp[6]);
+        fprintf(stderr, "%d %d %d %d %d %d\n",
+                tmp[0], tmp[1], tmp[2], tmp[3], tmp[4], tmp[5]);
         exit(-1);
     }
 
@@ -240,8 +235,6 @@ static void read_general_checkpoint(struct All_variables *E, FILE *fp)
       myerror(E,"read_general_checkpoint: header error");
 
     E->advection.timesteps = E->monitor.solution_cycles;
-
-    return;
 }
 
 
diff --git a/lib/Construct_arrays.c b/lib/Construct_arrays.c
index d541485..ccfd02f 100644
--- a/lib/Construct_arrays.c
+++ b/lib/Construct_arrays.c
@@ -77,19 +77,6 @@ void construct_ien(E)
 	     }
 
     }     /* end loop for lev */
-
-
-/* if(E->control.verbose)  { */
-/*   for (lev=E->mesh.levmax;lev>=E->mesh.levmin;lev--)  { */
-/*     fprintf(E->fp_out,"output_IEN_arrays me=%d lev=%d \n",E->parallel.me,lev); */
-/*   for (j=1;j<=E->sphere.caps_per_proc;j++) { */
-/*     fprintf(E->fp_out,"output_IEN_arrays me=%d %d %d\n",E->parallel.me,j,E->sphere.capid[j]); */
-/*     for (i=1;i<=E->lmesh.NEL[lev];i++) */
-/*        fprintf(E->fp_out,"%d %d %d %d %d %d %d %d %d\n",i,E->IEN[lev][j][i].node[1],E->IEN[lev][j][i].node[2],E->IEN[lev][j][i].node[3],E->IEN[lev][j][i].node[4],E->IEN[lev][j][i].node[5],E->IEN[lev][j][i].node[6],E->IEN[lev][j][i].node[7],E->IEN[lev][j][i].node[8]); */
-/*     } */
-/*     } */
-/*   fflush (E->fp_out); */
-/*   } */
 }
 
 
@@ -174,14 +161,6 @@ void construct_id(E)
 
     E->lmesh.neq = E->lmesh.NEQ[E->mesh.levmax];
     E->mesh.neq = E->mesh.NEQ[E->mesh.levmax];
-
-/*     if (E->control.verbose) { */
-/*       fprintf(E->fp_out,"output_ID_arrays \n"); */
-/*       for(j=1;j<=E->sphere.caps_per_proc;j++)    */
-/*         for (i=1;i<=E->lmesh.nno;i++) */
-/*           fprintf(E->fp_out,"%d %d %d %d %d\n",eqn_count,i,E->ID[lev][j][i].doff[1],E->ID[lev][j][i].doff[2],E->ID[lev][j][i].doff[3]); */
-/*       fflush(E->fp_out); */
-/*       } */
 }
 
 
diff --git a/lib/Full_boundary_conditions.c b/lib/Full_boundary_conditions.c
index f0513bf..9593fef 100644
--- a/lib/Full_boundary_conditions.c
+++ b/lib/Full_boundary_conditions.c
@@ -119,24 +119,8 @@ void full_velocity_boundary_conditions(E)
       if(E->control.side_sbcs)
 	apply_side_sbc(E);
 
-/* if(E->control.verbose) { */
-/*  for (j=1;j<=E->sphere.caps_per_proc;j++) */
-/*    for (node=1;node<=E->lmesh.nno;node++) */
-/*       fprintf(E->fp_out,"m=%d VB== %d %g %g %g flag %u %u %u\n",j,node,E->sphere.cap[j].VB[1][node],E->sphere.cap[j].VB[2][node],E->sphere.cap[j].VB[3][node],E->node[j][node]&VBX,E->node[j][node]&VBY,E->node[j][node]&VBZ); */
-/*  fflush(E->fp_out); */
-/* } */
-
-  /* If any imposed internal velocity structure it goes here */
-
-      
-      /*
-	apply stress or velocity boundary conditions, read from file
-	settings are to be implemented in those routines (will only do
-	anything at present, if E->mesh.toplayerbc != 0
-      */
       assign_internal_bc(E);
-
-   return; }
+}
 
 /* ========================================== */
 
diff --git a/lib/Full_parallel_related.c b/lib/Full_parallel_related.c
index 6f957cc..8a67d2b 100644
--- a/lib/Full_parallel_related.c
+++ b/lib/Full_parallel_related.c
@@ -72,13 +72,6 @@ void full_parallel_processor_setup(struct All_variables *E)
     parallel_process_termination();
     }
 
-  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");
-    parallel_process_termination();
-  }
-
   /* determine the location of processors in each cap */
   cap_id_surf = me / proc_per_cap;
 
@@ -107,9 +100,9 @@ oordinate and F-B
 
   /* determine cap id for each cap in a given processor  */
   pid_surf = me/proc_per_cap; /* cap number (0~11) */
-  i = cases[E->sphere.caps_per_proc]; /* 1 for more than 12 processors */
+  i = cases[1]; /* 1 for more than 12 processors */
 
-    temp = pid_surf*E->sphere.caps_per_proc; /* cap number (out of 12) */
+    temp = pid_surf; /* 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  */
@@ -133,11 +126,6 @@ oordinate and F-B
     for (i=0;i<E->parallel.nprocx;i++)
       for (j=0;j<E->parallel.nprocy;j++)
 	for (k=0;k<E->parallel.nprocz;k++) {
-	  if (E->sphere.caps_per_proc>1) {
-	    temp = cases[E->sphere.caps_per_proc];
-	    E->parallel.loc2proc_map[m][i][j][k] = incases2[temp].links[m-1];
-	  }
-	  else
 	    E->parallel.loc2proc_map[m][i][j][k] = m*proc_per_cap
 	      + j*E->parallel.nprocx*E->parallel.nprocz
 	      + i*E->parallel.nprocz + k;
diff --git a/lib/Full_tracer_advection.c b/lib/Full_tracer_advection.c
index 23e78e4..32281f2 100644
--- a/lib/Full_tracer_advection.c
+++ b/lib/Full_tracer_advection.c
@@ -131,14 +131,6 @@ void full_tracer_setup(struct All_variables *E)
     double CPU_time0();
     double begin_time = CPU_time0();
 
-    /* Some error control */
-
-    if (E->sphere.caps_per_proc>1) {
-            fprintf(stderr,"This code does not work for multiple caps per processor!\n");
-            parallel_process_termination();
-    }
-
-
     /* open tracing output file */
 
     sprintf(output_file,"%s.tracer_log.%d",E->control.data_file,E->parallel.me);
@@ -2989,257 +2981,6 @@ void analytical_test(E)
      struct All_variables *E;
 
 {
-#if 0
-    int kk,pp;
-    int nsteps;
-    int j;
-    int my_number,number;
-    int nrunge_steps;
-    int nrunge_refinement;
-
-    double dt;
-    double runge_dt;
-    double theta,phi,rad;
-    double time;
-    double vel_s[4];
-    double vel_c[4];
-    double my_theta0,my_phi0,my_rad0;
-    double my_thetaf,my_phif,my_radf;
-    double theta0,phi0,rad0;
-    double thetaf,phif,radf;
-    double x0_s[4],xf_s[4];
-    double x0_c[4],xf_c[4];
-    double vec[4];
-    double runge_path_length,runge_time;
-    double x0,y0,z0;
-    double xf,yf,zf;
-    double difference;
-    double difperpath;
-
-    void analytical_test_function();
-    void predict_tracers();
-    void correct_tracers();
-    void analytical_runge_kutte();
-    void sphere_to_cart();
-
-
-    fprintf(E->trace.fpt,"Starting Analytical Test\n");
-    if (E->parallel.me==0) fprintf(stderr,"Starting Analytical Test\n");
-    fflush(E->trace.fpt);
-
-    /* Reset Box cushion to 0 */
-
-    E->trace.box_cushion=0.0000;
-
-    /* test paramters */
-
-    nsteps=200;
-    dt=0.0001;
-
-    E->advection.timestep=dt;
-
-    fprintf(E->trace.fpt,"steps: %d  dt: %f\n",nsteps,dt);
-
-    /* Assign test velocity to Citcom nodes */
-
-    for (j=1;j<=E->sphere.caps_per_proc;j++)
-        {
-            for (kk=1;kk<=E->lmesh.nno;kk++)
-                {
-
-                    theta=E->sx[j][1][kk];
-                    phi=E->sx[j][2][kk];
-                    rad=E->sx[j][3][kk];
-
-                    analytical_test_function(E,theta,phi,rad,vel_s,vel_c);
-
-                    E->sphere.cap[j].V[1][kk]=vel_s[1];
-                    E->sphere.cap[j].V[2][kk]=vel_s[2];
-                    E->sphere.cap[j].V[3][kk]=vel_s[3];
-                }
-        }
-
-    time=0.0;
-
-    my_theta0=0.0;
-    my_phi0=0.0;
-    my_rad0=0.0;
-    my_thetaf=0.0;
-    my_phif=0.0;
-    my_radf=0.0;
-
-    for (j=1;j<=E->sphere.caps_per_proc;j++)
-        {
-            if (E->trace.ntracers[j]>10)
-                {
-                    fprintf(E->trace.fpt,"Warning(analytical)-too many tracers to print!\n");
-                    fflush(E->trace.fpt);
-                    if (E->trace.itracer_warnings) exit(10);
-                }
-        }
-
-    /* print initial positions */
-
-    E->monitor.solution_cycles=0;
-    for (j=1;j<=E->sphere.caps_per_proc;j++)
-        {
-            for (pp=1;pp<=E->trace.ntracers[j];pp++)
-                {
-                    theta=E->trace.basicq[j][0][pp];
-                    phi=E->trace.basicq[j][1][pp];
-                    rad=E->trace.basicq[j][2][pp];
-
-                    fprintf(E->trace.fpt,"(%d) time: %f theta: %f phi: %f rad: %f\n",E->monitor.solution_cycles,time,theta,phi,rad);
-
-                    if (pp==1) fprintf(stderr,"(%d) time: %f theta: %f phi: %f rad: %f\n",E->monitor.solution_cycles,time,theta,phi,rad);
-
-                    if (pp==1)
-                        {
-                            my_theta0=theta;
-                            my_phi0=phi;
-                            my_rad0=rad;
-                        }
-                }
-        }
-
-    /* advect tracers */
-
-    for (kk=1;kk<=nsteps;kk++)
-        {
-            E->monitor.solution_cycles=kk;
-
-            time=time+dt;
-
-            predict_tracers(E);
-            correct_tracers(E);
-
-            for (j=1;j<=E->sphere.caps_per_proc;j++)
-                {
-                    for (pp=1;pp<=E->trace.ntracers[j];pp++)
-                        {
-                            theta=E->trace.basicq[j][0][pp];
-                            phi=E->trace.basicq[j][1][pp];
-                            rad=E->trace.basicq[j][2][pp];
-
-                            fprintf(E->trace.fpt,"(%d) time: %f theta: %f phi: %f rad: %f\n",E->monitor.solution_cycles,time,theta,phi,rad);
-
-                            if (pp==1) fprintf(stderr,"(%d) time: %f theta: %f phi: %f rad: %f\n",E->monitor.solution_cycles,time,theta,phi,rad);
-
-                            if ((kk==nsteps) && (pp==1))
-                                {
-                                    my_thetaf=theta;
-                                    my_phif=phi;
-                                    my_radf=rad;
-                                }
-                        }
-                }
-
-        }
-
-    /* Get ready for comparison to Runge-Kutte (only works for one tracer) */
-
-    fflush(E->trace.fpt);
-    parallel_process_sync(E);
-
-    fprintf(E->trace.fpt,"\n\nComparison to Runge-Kutte\n");
-    if (E->parallel.me==0) fprintf(stderr,"Comparison to Runge-Kutte\n");
-
-    for (j=1;j<=E->sphere.caps_per_proc;j++)
-        {
-            my_number=E->trace.ntracers[j];
-        }
-
-    MPI_Allreduce(&my_number,&number,1,MPI_INT,MPI_SUM,E->parallel.world);
-
-    fprintf(E->trace.fpt,"Number of tracers: %d\n", number);
-    if (E->parallel.me==0) fprintf(stderr,"Number of tracers: %d\n", number);
-
-    /* if more than 1 tracer, exit */
-
-    if (number!=1)
-        {
-            fprintf(E->trace.fpt,"(Note: RK comparison only appropriate for one tracing particle (%d here) \n",number);
-            if (E->parallel.me==0) fprintf(stderr,"(Note: RK comparison only appropriate for one tracing particle (%d here) \n",number);
-            fflush(E->trace.fpt);
-            parallel_process_termination();
-        }
-
-
-    /* communicate starting and final positions */
-
-    MPI_Allreduce(&my_theta0,&theta0,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-    MPI_Allreduce(&my_phi0,&phi0,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-    MPI_Allreduce(&my_rad0,&rad0,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-    MPI_Allreduce(&my_thetaf,&thetaf,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-    MPI_Allreduce(&my_phif,&phif,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-    MPI_Allreduce(&my_radf,&radf,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
-
-    x0_s[1]=theta0;
-    x0_s[2]=phi0;
-    x0_s[3]=rad0;
-
-    nrunge_refinement=1000;
-
-    nrunge_steps=nsteps*nrunge_refinement;
-    runge_dt=dt/(1.0*nrunge_refinement);
-
-
-    analytical_runge_kutte(E,nrunge_steps,runge_dt,x0_s,x0_c,xf_s,xf_c,vec);
-
-    runge_time=vec[1];
-    runge_path_length=vec[2];
-
-    /* initial coordinates - both citcom and RK */
-
-    x0=x0_c[1];
-    y0=x0_c[2];
-    z0=x0_c[3];
-
-    /* convert final citcom coords into cartesian */
-
-    sphere_to_cart(E,thetaf,phif,radf,&xf,&yf,&zf);
-
-    difference=sqrt((xf-xf_c[1])*(xf-xf_c[1])+(yf-xf_c[2])*(yf-xf_c[2])+(zf-xf_c[3])*(zf-xf_c[3]));
-
-    difperpath=difference/runge_path_length;
-
-    /* Print out results */
-
-    fprintf(E->trace.fpt,"Citcom calculation: steps: %d  dt: %f\n",nsteps,dt);
-    fprintf(E->trace.fpt,"  (nodes per cap: %d x %d x %d)\n",E->lmesh.nox,E->lmesh.noy,(E->lmesh.noz-1)*E->parallel.nprocz+1);
-    fprintf(E->trace.fpt,"                    starting position: theta: %f phi: %f rad: %f\n", theta0,phi0,rad0);
-    fprintf(E->trace.fpt,"                    final position: theta: %f phi: %f rad: %f\n", thetaf,phif,radf);
-    fprintf(E->trace.fpt,"                    (final time: %f) \n",time );
-
-    fprintf(E->trace.fpt,"\n\nRunge-Kutte calculation: steps: %d  dt: %g\n",nrunge_steps,runge_dt);
-    fprintf(E->trace.fpt,"                    starting position: theta: %f phi: %f rad: %f\n", theta0,phi0,rad0);
-    fprintf(E->trace.fpt,"                    final position: theta: %f phi: %f rad: %f\n",xf_s[1],xf_s[2],xf_s[3]);
-    fprintf(E->trace.fpt,"                    path length: %f \n",runge_path_length );
-    fprintf(E->trace.fpt,"                    (final time: %f) \n",runge_time );
-
-    fprintf(E->trace.fpt,"\n\n Difference between Citcom and RK: %e  (diff per path length: %e)\n\n",difference,difperpath);
-
-    if (E->parallel.me==0)
-        {
-            fprintf(stderr,"Citcom calculation: steps: %d  dt: %f\n",nsteps,dt);
-            fprintf(stderr,"  (nodes per cap: %d x %d x %d)\n",E->lmesh.nox,E->lmesh.noy,(E->lmesh.noz-1)*E->parallel.nprocz+1);
-            fprintf(stderr,"                    starting position: theta: %f phi: %f rad: %f\n", theta0,phi0,rad0);
-            fprintf(stderr,"                    final position: theta: %f phi: %f rad: %f\n", thetaf,phif,radf);
-            fprintf(stderr,"                    (final time: %f) \n",time );
-
-            fprintf(stderr,"\n\nRunge-Kutte calculation: steps: %d  dt: %f\n",nrunge_steps,runge_dt);
-            fprintf(stderr,"                    starting position: theta: %f phi: %f rad: %f\n", theta0,phi0,rad0);
-            fprintf(stderr,"                    final position: theta: %f phi: %f rad: %f\n",xf_s[1],xf_s[2],xf_s[3]);
-            fprintf(stderr,"                    path length: %f \n",runge_path_length );
-            fprintf(stderr,"                    (final time: %f) \n",runge_time );
-
-            fprintf(stderr,"\n\n Difference between Citcom and RK: %e  (diff per path length: %e)\n\n",difference,difperpath);
-
-        }
-
-    fflush(E->trace.fpt);
-#endif
-    return;
 }
 
 /*************** ANALYTICAL RUNGE KUTTE ******************/
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index 2b8d92f..5a52b84 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -269,11 +269,10 @@ void gzdir_output_coord(struct All_variables *E)
       myfprintf(fp1,"DATASET UNSTRUCTURED_GRID\n");
       if(E->output.gzdir.vtk_io == 2) /* serial */
 	sprintf(message,"POINTS %i float\n", /* total number of nodes */
-		E->lmesh.nno * E->parallel.nproc *
-		E->sphere.caps_per_proc);
+		E->lmesh.nno * E->parallel.nproc);
       else			/* parallel */
 	sprintf(message,"POINTS %i float\n",
-		E->lmesh.nno * E->sphere.caps_per_proc);
+		E->lmesh.nno);
       myfprintf(fp1,message);
     }else{			/* serial output */
       /* if not first CPU, wait for previous before appending */
@@ -304,10 +303,9 @@ void gzdir_output_coord(struct All_variables *E)
     if((E->output.gzdir.vtk_io == 3) || (E->parallel.me == 0)){ /* in first CPU, or parallel output */
       if(E->output.gzdir.vtk_io == 2){ /* need to reopen, serial */
 	fp1 = output_open(output_file,"a");
-	j = E->parallel.nproc * E->lmesh.nel *
-	  E->sphere.caps_per_proc; /* total number of elements */
+	j = E->parallel.nproc * E->lmesh.nel; /* total number of elements */
       }else{			/* parallel */
-	j = E->lmesh.nel * E->sphere.caps_per_proc;
+	j = E->lmesh.nel;
       }
       sprintf(message,"CELLS %i %i\n", /* number of elements
 				      total number of int entries
@@ -352,9 +350,9 @@ void gzdir_output_coord(struct All_variables *E)
     if((E->output.gzdir.vtk_io==3) || (E->parallel.me == 0) ){
       if(E->output.gzdir.vtk_io == 2){ /* serial */
 	fp1 = output_open(output_file,"a");
-	j=E->parallel.nproc*E->lmesh.nel*E->sphere.caps_per_proc;
+	j=E->parallel.nproc*E->lmesh.nel;
       }else{			/* parallel */
-	j = E->lmesh.nel*E->sphere.caps_per_proc;
+	j = E->lmesh.nel;
       }
       sprintf(message,"CELL_TYPES %i\n",j); /* number of elements*/
       myfprintf(fp1,message);
@@ -460,7 +458,7 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
     if((!E->output.gzdir.vtk_base_init) ||(!E->output.gzdir.vtk_base_save)){
       /* either not computed, or need to compute anew */
       if(!E->output.gzdir.vtk_base_init) /* init space */
-	E->output.gzdir.vtk_base = (float *)safe_malloc(sizeof(float)*os*E->sphere.caps_per_proc);
+	E->output.gzdir.vtk_base = (float *)safe_malloc(sizeof(float)*os);
       /* compute */
 	for(i=1,k=0;i <= E->lmesh.nno;i++,k += 9){
 	  /* cartesian basis vectors at theta, phi */
@@ -508,9 +506,9 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
       }
       fp1 = output_open(output_file,"a");
       if(E->output.gzdir.vtk_io == 2) /* serial */
-	sprintf(message,"POINT_DATA %i\n",E->lmesh.nno*E->parallel.nproc*E->sphere.caps_per_proc);
+	sprintf(message,"POINT_DATA %i\n",E->lmesh.nno*E->parallel.nproc);
       else			/* parallel */
-	sprintf(message,"POINT_DATA %i\n",E->lmesh.nno*E->sphere.caps_per_proc);
+	sprintf(message,"POINT_DATA %i\n",E->lmesh.nno);
       myfprintf(fp1,message);
       myfprintf(fp1,"SCALARS temperature float 1\n");
       myfprintf(fp1,"LOOKUP_TABLE default\n");
diff --git a/lib/Output_vtk.c b/lib/Output_vtk.c
index 88d8f85..b378a2a 100644
--- a/lib/Output_vtk.c
+++ b/lib/Output_vtk.c
@@ -106,7 +106,7 @@ static void vtk_cell_data_trailer(struct All_variables *E, FILE *fp)
 static void vtk_output_temp(struct All_variables *E, FILE *fp)
 {
     int i;
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
     float* floattemp = malloc(nodes*sizeof(float));
 
     fprintf(fp, "        <DataArray type=\"Float32\" Name=\"temperature\" format=\"%s\">\n", E->output.vtk_format);
@@ -127,7 +127,7 @@ static void vtk_output_temp(struct All_variables *E, FILE *fp)
 static void vtk_output_velo(struct All_variables *E, FILE *fp)
 {
     int i, j;
-    int nodes=E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes=E->lmesh.nno;
     double sint, sinf, cost, cosf;
     float *V[4];
     const int lev = E->mesh.levmax;
@@ -162,7 +162,7 @@ static void vtk_output_velo(struct All_variables *E, FILE *fp)
 
 static void vtk_output_visc(struct All_variables *E, FILE *fp)
 {
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
     int lev = E->mesh.levmax;
 
     fprintf(fp, "        <DataArray type=\"Float32\" Name=\"viscosity\" format=\"%s\">\n", E->output.vtk_format);
@@ -181,7 +181,7 @@ static void vtk_output_coord(struct All_variables *E, FILE *fp)
     /* Output Cartesian coordinates as most VTK visualization softwares
        assume it. */
     int i, j;
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
     float* floatpos = malloc(nodes*3*sizeof(float));
 
     fputs("      <Points>\n", fp);
@@ -204,7 +204,7 @@ static void vtk_output_coord(struct All_variables *E, FILE *fp)
 
 static void vtk_output_stress(struct All_variables *E, FILE *fp)
 {
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
    /* for stress computation */
     void allocate_STD_mem();
     void compute_nodal_stress();
@@ -232,7 +232,7 @@ static void vtk_output_comp_nd(struct All_variables *E, FILE *fp)
 {
     int i, j, k;
     char name[255];
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
     float* floatcompo = malloc (nodes*sizeof(float));
 
     for(k=0;k<E->composition.ncomp;k++) {
@@ -255,7 +255,7 @@ static void vtk_output_comp_nd(struct All_variables *E, FILE *fp)
 static void vtk_output_surf(struct All_variables *E,  FILE *fp, int cycles)
 {
     int i, j, k;
-    int nodes = E->sphere.caps_per_proc*E->lmesh.nno;
+    int nodes = E->lmesh.nno;
     char output_file[255];
     float* floattopo = malloc (nodes*sizeof(float));
 
diff --git a/lib/Regional_parallel_related.c b/lib/Regional_parallel_related.c
index a7baa84..d57411a 100644
--- a/lib/Regional_parallel_related.c
+++ b/lib/Regional_parallel_related.c
@@ -76,11 +76,9 @@ void regional_parallel_processor_setup(struct All_variables *E)
   i = ((me - j)/E->parallel.nprocz - k)/E->parallel.nprocx % E->parallel.nprocy;
   E->parallel.me_loc[2] = i;
 
-  E->sphere.caps_per_proc = 1;
-
   /* determine cap id for each cap in a given processor  */
   pid_surf = me/E->parallel.nprocz;
-  i = cases[E->sphere.caps_per_proc];
+  i = cases[1];
 
   E->sphere.capid[1] = 1;
 
diff --git a/lib/Regional_tracer_advection.c b/lib/Regional_tracer_advection.c
index ec71dff..4b28e9a 100644
--- a/lib/Regional_tracer_advection.c
+++ b/lib/Regional_tracer_advection.c
@@ -526,8 +526,6 @@ void regional_keep_within_bounds(struct All_variables *E,
 
 void regional_lost_souls(struct All_variables *E)
 {
-    /* This part only works if E->sphere.caps_per_proc==1 */
-    const int j = 1;
     int lev = E->mesh.levmax;
 
     int i, d, kk;
diff --git a/lib/Tracer_setup.c b/lib/Tracer_setup.c
index f5febca..d59577e 100644
--- a/lib/Tracer_setup.c
+++ b/lib/Tracer_setup.c
@@ -1312,8 +1312,7 @@ void get_neighboring_caps(struct All_variables *E)
 
         /* Storing the received cap information
          * XXX: this part assumes:
-         *      1) E->sphere.caps_per_proc==1
-         *      2) E->mesh.nsd==3
+         *      1) E->mesh.nsd==3
          */
         for (kk=0; kk<=num_ngb; kk++) {
             n = 0;
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 9fa59d6..4386d6b 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -265,7 +265,6 @@ struct CAP    {
 
 struct SPHERE   {
   int caps;
-  int caps_per_proc;
   int capid[NCS];
   int max_connections;
   int *hindex[100];



More information about the CIG-COMMITS mailing list