[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of E->trace.extraq as part of caps_per_proc_removal (95f57dc)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:13:11 PST 2014


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

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

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

commit 95f57dc50e03cd11dae20348202655196987fb1f
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Sep 24 12:15:16 2014 -0700

    Changed the shape of E->trace.extraq as part of caps_per_proc_removal


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

95f57dc50e03cd11dae20348202655196987fb1f
 lib/Checkpoints.c               |  4 ++--
 lib/Full_tracer_advection.c     |  2 +-
 lib/Output.c                    |  2 +-
 lib/Output_gzdir.c              |  2 +-
 lib/Regional_tracer_advection.c |  2 +-
 lib/Tracer_setup.c              | 18 +++++++++---------
 lib/tracer_defs.h               |  2 +-
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/Checkpoints.c b/lib/Checkpoints.c
index a62a3e8..c3a1a3c 100644
--- a/lib/Checkpoints.c
+++ b/lib/Checkpoints.c
@@ -265,7 +265,7 @@ static void tracer_checkpoint(struct All_variables *E, FILE *fp)
                    E->trace.ntracers[CPPR]+1, fp);
         }
         for(i=0; i<E->trace.number_of_extra_quantities; i++) {
-            fwrite(E->trace.extraq[CPPR][i], sizeof(double),
+            fwrite(E->trace.extraq[i], sizeof(double),
                    E->trace.ntracers[CPPR]+1, fp);
         }
         fwrite(E->trace.ielement[CPPR], sizeof(int),
@@ -324,7 +324,7 @@ static void read_tracer_checkpoint(struct All_variables *E, FILE *fp)
                   E->trace.ntracers[CPPR]+1, fp);
         }
         for(i=0; i<E->trace.number_of_extra_quantities; i++) {
-            fread(E->trace.extraq[CPPR][i], sizeof(double),
+            fread(E->trace.extraq[i], sizeof(double),
                   E->trace.ntracers[CPPR]+1, fp);
         }
         fread(E->trace.ielement[CPPR], sizeof(int),
diff --git a/lib/Full_tracer_advection.c b/lib/Full_tracer_advection.c
index b0dd796..d8d88f5 100644
--- a/lib/Full_tracer_advection.c
+++ b/lib/Full_tracer_advection.c
@@ -725,7 +725,7 @@ void full_lost_souls(struct All_variables *E)
         for (mm=0;mm<E->trace.number_of_extra_quantities;mm++) {
             ipos=ireceive_position+E->trace.number_of_basic_quantities+mm;
 
-            E->trace.extraq[CPPR][mm][E->trace.ntracers[CPPR]]=REC[CPPR][ipos];
+            E->trace.extraq[mm][E->trace.ntracers[CPPR]]=REC[CPPR][ipos];
         }
 
         theta=E->trace.basicq[0][E->trace.ntracers[CPPR]];
diff --git a/lib/Output.c b/lib/Output.c
index c2ffe76..b774863 100644
--- a/lib/Output.c
+++ b/lib/Output.c
@@ -647,7 +647,7 @@ void output_tracer(struct All_variables *E, int cycles)
 
           /* write extra quantities */
           for (i=0; i<E->trace.number_of_extra_quantities; i++) {
-              fprintf(fp1," %.12e", E->trace.extraq[CPPR][i][n]);
+              fprintf(fp1," %.12e", E->trace.extraq[i][n]);
           }
           fprintf(fp1, "\n");
       }
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index eecb3fe..2d26c60 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -1053,7 +1053,7 @@ void gzdir_output_tracer(struct All_variables *E, int cycles)
 
           /* write extra quantities */
           for (i=0; i<E->trace.number_of_extra_quantities; i++) {
-              gzprintf(fp1," %9.5e", E->trace.extraq[CPPR][i][n]);
+              gzprintf(fp1," %9.5e", E->trace.extraq[i][n]);
           }
           gzprintf(fp1, "\n");
       }
diff --git a/lib/Regional_tracer_advection.c b/lib/Regional_tracer_advection.c
index 516730a..d9b19f4 100644
--- a/lib/Regional_tracer_advection.c
+++ b/lib/Regional_tracer_advection.c
@@ -816,7 +816,7 @@ static void put_found_tracers(struct All_variables *E, int recv_size, double *re
 
             ipos += E->trace.number_of_basic_quantities;
             for (pp=0; pp<E->trace.number_of_extra_quantities; pp++)
-                E->trace.extraq[CPPR][pp][ilast] = recv[ipos+pp];
+                E->trace.extraq[pp][ilast] = recv[ipos+pp];
 
 
             /* found the element */
diff --git a/lib/Tracer_setup.c b/lib/Tracer_setup.c
index 43a566d..129fc23 100644
--- a/lib/Tracer_setup.c
+++ b/lib/Tracer_setup.c
@@ -667,7 +667,7 @@ void count_tracers_of_flavors(struct All_variables *E)
         /* Fill arrays */
         for (kk=1; kk<=numtracers; kk++) {
             e = E->trace.ielement[CPPR][kk];
-            flavor = E->trace.extraq[CPPR][0][kk];
+            flavor = E->trace.extraq[0][kk];
             E->trace.ntracer_flavor[CPPR][flavor][e]++;
         }
 }
@@ -953,7 +953,7 @@ static void read_tracer_file(struct All_variables *E)
             E->trace.basicq[5][E->trace.ntracers[CPPR]]=z;
 
             for (i=0; i<E->trace.number_of_extra_quantities; i++)
-                E->trace.extraq[CPPR][i][E->trace.ntracers[CPPR]]=buffer[i+3];
+                E->trace.extraq[i][E->trace.ntracers[CPPR]]=buffer[i+3];
 
         } /* end kk, number of tracers */
 
@@ -1083,7 +1083,7 @@ static void read_old_tracer_file(struct All_variables *E)
             E->trace.basicq[5][kk]=z;
 
             for (i=0; i<E->trace.number_of_extra_quantities; i++)
-                E->trace.extraq[CPPR][i][kk]=buffer[i+3];
+                E->trace.extraq[i][kk]=buffer[i+3];
 
         }
 
@@ -1218,7 +1218,7 @@ static void init_tracer_flavors(struct All_variables *E)
                   break;
               }
           }
-          E->trace.extraq[CPPR][0][kk] = flavor;
+          E->trace.extraq[0][kk] = flavor;
 	}
       break;
 
@@ -1374,7 +1374,7 @@ void allocate_tracer_arrays(struct All_variables *E, int number_of_tracers)
     }
 
     for (kk=0;kk<E->trace.number_of_extra_quantities;kk++) {
-        if ((E->trace.extraq[CPPR][kk]=(double *)malloc(E->trace.max_ntracers[CPPR]*sizeof(double)))==NULL) {
+        if ((E->trace.extraq[kk]=(double *)malloc(E->trace.max_ntracers[CPPR]*sizeof(double)))==NULL) {
             fprintf(E->trace.fpt,"ERROR(initialize tracer arrays)-no memory 1c.%d\n",kk);
             fflush(E->trace.fpt);
             exit(10);
@@ -1430,7 +1430,7 @@ void expand_tracer_arrays(struct All_variables *E)
     }
 
     for (kk=0;kk<=((E->trace.number_of_extra_quantities)-1);kk++) {
-        if ((E->trace.extraq[CPPR][kk]=(double *)realloc(E->trace.extraq[CPPR][kk],inewsize*sizeof(double)))==NULL) {
+        if ((E->trace.extraq[kk]=(double *)realloc(E->trace.extraq[kk],inewsize*sizeof(double)))==NULL) {
             fprintf(E->trace.fpt,"ERROR(expand tracer arrays )-no memory 78 (%d)\n",kk);
             fflush(E->trace.fpt);
             exit(10);
@@ -1491,7 +1491,7 @@ static void reduce_tracer_arrays(struct All_variables *E)
             }
 
             for (kk=0;kk<=((E->trace.number_of_extra_quantities)-1);kk++) {
-                if ((E->trace.extraq[CPPR][kk]=(double *)realloc(E->trace.extraq[CPPR][kk],inewsize*sizeof(double)))==NULL) {
+                if ((E->trace.extraq[kk]=(double *)realloc(E->trace.extraq[kk],inewsize*sizeof(double)))==NULL) {
                     fprintf(E->trace.fpt,"AKM(reduce tracer arrays )-no memory 783 (%d)\n",kk);
                     fflush(E->trace.fpt);
                     exit(10);
@@ -1549,7 +1549,7 @@ static void put_away_later(struct All_variables *E, int it)
         E->trace.rlater[CPPR][kk][E->trace.ilater[CPPR]]=E->trace.basicq[kk][it];
 
     for (kk=0;kk<=((E->trace.number_of_extra_quantities)-1);kk++)
-        E->trace.rlater[CPPR][E->trace.number_of_basic_quantities+kk][E->trace.ilater[CPPR]]=E->trace.extraq[CPPR][kk][it];
+        E->trace.rlater[CPPR][E->trace.number_of_basic_quantities+kk][E->trace.ilater[CPPR]]=E->trace.extraq[kk][it];
 }
 
 
@@ -1601,7 +1601,7 @@ static void eject_tracer(struct All_variables *E, int it)
         E->trace.basicq[kk][it]=E->trace.basicq[kk][ilast_tracer];
 
     for (kk=0;kk<=((E->trace.number_of_extra_quantities)-1);kk++)
-        E->trace.extraq[CPPR][kk][it]=E->trace.extraq[CPPR][kk][ilast_tracer];
+        E->trace.extraq[kk][it]=E->trace.extraq[kk][ilast_tracer];
 
     E->trace.ntracers[CPPR]--;
 }
diff --git a/lib/tracer_defs.h b/lib/tracer_defs.h
index 1827428..821d513 100644
--- a/lib/tracer_defs.h
+++ b/lib/tracer_defs.h
@@ -52,7 +52,7 @@ struct TRACE{
     int number_of_tracer_quantities;
 
     double *basicq[100];
-    double *extraq[13][100];
+    double *extraq[100];
 
     int ntracers[13];
     int max_ntracers[13];



More information about the CIG-COMMITS mailing list