[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of E->trace.max_ntracers as part of caps_per_proc_removal (1221a3a)

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


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

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

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

commit 1221a3aaed6e26cd156d97f6b5da236466d37e65
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Sep 24 12:19:07 2014 -0700

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


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

1221a3aaed6e26cd156d97f6b5da236466d37e65
 lib/Full_tracer_advection.c     |  2 +-
 lib/Regional_tracer_advection.c |  4 ++--
 lib/Tracer_setup.c              | 28 ++++++++++++++--------------
 lib/tracer_defs.h               |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/lib/Full_tracer_advection.c b/lib/Full_tracer_advection.c
index 4fec9d6..46bdcd2 100644
--- a/lib/Full_tracer_advection.c
+++ b/lib/Full_tracer_advection.c
@@ -712,7 +712,7 @@ void full_lost_souls(struct All_variables *E)
     for (kk=0;kk<irec[CPPR];kk++) {
         E->trace.ntracers++;
 
-        if (E->trace.ntracers>(E->trace.max_ntracers[CPPR]-5)) 
+        if (E->trace.ntracers>(E->trace.max_ntracers-5)) 
           expand_tracer_arrays(E);
 
         ireceive_position=kk*E->trace.number_of_tracer_quantities;
diff --git a/lib/Regional_tracer_advection.c b/lib/Regional_tracer_advection.c
index b1130b0..bcc2dc5 100644
--- a/lib/Regional_tracer_advection.c
+++ b/lib/Regional_tracer_advection.c
@@ -808,7 +808,7 @@ static void put_found_tracers(struct All_variables *E, int recv_size, double *re
             E->trace.ntracers++;
             ilast = E->trace.ntracers;
 
-            if (E->trace.ntracers > (E->trace.max_ntracers[CPPR]-5))
+            if (E->trace.ntracers > (E->trace.max_ntracers-5))
                 expand_tracer_arrays(E);
 
             for (pp=0; pp<E->trace.number_of_basic_quantities; pp++)
@@ -837,7 +837,7 @@ static void put_found_tracers(struct All_variables *E, int recv_size, double *re
         else {
             if (E->trace.ilatersize[CPPR]==0) {
 
-                E->trace.ilatersize[CPPR]=E->trace.max_ntracers[CPPR]/5;
+                E->trace.ilatersize[CPPR]=E->trace.max_ntracers/5;
 
                 for (kk=0;kk<E->trace.number_of_tracer_quantities;kk++) {
                     if ((E->trace.rlater[CPPR][kk]=(double *)malloc(E->trace.ilatersize[CPPR]*sizeof(double)))==NULL) {
diff --git a/lib/Tracer_setup.c b/lib/Tracer_setup.c
index 42d6496..c699868 100644
--- a/lib/Tracer_setup.c
+++ b/lib/Tracer_setup.c
@@ -942,7 +942,7 @@ static void read_tracer_file(struct All_variables *E)
 
             E->trace.ntracers++;
 
-            if (E->trace.ntracers>=(E->trace.max_ntracers[CPPR]-5)) 
+            if (E->trace.ntracers>=(E->trace.max_ntracers-5)) 
               expand_tracer_arrays(E);
 
             E->trace.basicq[0][E->trace.ntracers]=theta;
@@ -1351,22 +1351,22 @@ void allocate_tracer_arrays(struct All_variables *E, int number_of_tracers)
     /* max_ntracers is physical size of tracer array */
     /* (initially make it 25% larger than required */
 
-    E->trace.max_ntracers[CPPR]=number_of_tracers+number_of_tracers/4;
+    E->trace.max_ntracers=number_of_tracers+number_of_tracers/4;
     E->trace.ntracers=0;
 
     /* make tracer arrays */
 
-    if ((E->trace.ielement[CPPR]=(int *) malloc(E->trace.max_ntracers[CPPR]*sizeof(int)))==NULL) {
+    if ((E->trace.ielement[CPPR]=(int *) malloc(E->trace.max_ntracers*sizeof(int)))==NULL) {
         fprintf(E->trace.fpt,"ERROR(make tracer array)-no memory 1a\n");
         fflush(E->trace.fpt);
         exit(10);
     }
-    for (kk=1;kk<E->trace.max_ntracers[CPPR];kk++)
+    for (kk=1;kk<E->trace.max_ntracers;kk++)
         E->trace.ielement[CPPR][kk]=-99;
 
 
     for (kk=0;kk<E->trace.number_of_basic_quantities;kk++) {
-        if ((E->trace.basicq[kk]=(double *)malloc(E->trace.max_ntracers[CPPR]*sizeof(double)))==NULL) {
+        if ((E->trace.basicq[kk]=(double *)malloc(E->trace.max_ntracers*sizeof(double)))==NULL) {
             fprintf(E->trace.fpt,"ERROR(initialize tracer arrays)-no memory 1b.%d\n",kk);
             fflush(E->trace.fpt);
             exit(10);
@@ -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[kk]=(double *)malloc(E->trace.max_ntracers[CPPR]*sizeof(double)))==NULL) {
+        if ((E->trace.extraq[kk]=(double *)malloc(E->trace.max_ntracers*sizeof(double)))==NULL) {
             fprintf(E->trace.fpt,"ERROR(initialize tracer arrays)-no memory 1c.%d\n",kk);
             fflush(E->trace.fpt);
             exit(10);
@@ -1394,7 +1394,7 @@ void allocate_tracer_arrays(struct All_variables *E, int number_of_tracers)
 
 
     fprintf(E->trace.fpt,"Physical size of tracer arrays (max_ntracers): %d\n",
-            E->trace.max_ntracers[CPPR]);
+            E->trace.max_ntracers);
     fflush(E->trace.fpt);
 }
 
@@ -1413,7 +1413,7 @@ void expand_tracer_arrays(struct All_variables *E)
 
     icushion=100;
 
-    inewsize=E->trace.max_ntracers[CPPR]+E->trace.max_ntracers[CPPR]/5+icushion;
+    inewsize=E->trace.max_ntracers+E->trace.max_ntracers/5+icushion;
 
     if ((E->trace.ielement[CPPR]=(int *)realloc(E->trace.ielement[CPPR],inewsize*sizeof(int)))==NULL) {
         fprintf(E->trace.fpt,"ERROR(expand tracer arrays )-no memory (ielement)\n");
@@ -1439,9 +1439,9 @@ void expand_tracer_arrays(struct All_variables *E)
 
 
     fprintf(E->trace.fpt,"Expanding physical memory of ielement, basicq, and extraq to %d from %d\n",
-            inewsize,E->trace.max_ntracers[CPPR]);
+            inewsize,E->trace.max_ntracers);
 
-    E->trace.max_ntracers[CPPR]=inewsize;
+    E->trace.max_ntracers=inewsize;
 }
 
 
@@ -1461,7 +1461,7 @@ static void reduce_tracer_arrays(struct All_variables *E)
 
         /* if physical size is double tracer size, reduce it */
 
-        iempty_space=(E->trace.max_ntracers[CPPR]-E->trace.ntracers);
+        iempty_space=(E->trace.max_ntracers-E->trace.ntracers);
 
         if (iempty_space>(E->trace.ntracers+icushion)) {
 
@@ -1500,9 +1500,9 @@ static void reduce_tracer_arrays(struct All_variables *E)
 
 
             fprintf(E->trace.fpt,"Reducing physical memory of ielement, basicq, and extraq to %d from %d\n",
-                    E->trace.max_ntracers[CPPR],inewsize);
+                    E->trace.max_ntracers,inewsize);
 
-            E->trace.max_ntracers[CPPR]=inewsize;
+            E->trace.max_ntracers=inewsize;
 
         } /* end if */
 }
@@ -1525,7 +1525,7 @@ static void put_away_later(struct All_variables *E, int it)
 
     if (E->trace.ilatersize[CPPR]==0) {
 
-        E->trace.ilatersize[CPPR]=E->trace.max_ntracers[CPPR]/5;
+        E->trace.ilatersize[CPPR]=E->trace.max_ntracers/5;
 
         for (kk=0;kk<=((E->trace.number_of_tracer_quantities)-1);kk++) {
             if ((E->trace.rlater[CPPR][kk]=(double *)malloc(E->trace.ilatersize[CPPR]*sizeof(double)))==NULL) {
diff --git a/lib/tracer_defs.h b/lib/tracer_defs.h
index aadc7a0..587b284 100644
--- a/lib/tracer_defs.h
+++ b/lib/tracer_defs.h
@@ -55,7 +55,7 @@ struct TRACE{
     double *extraq[100];
 
     int ntracers;
-    int max_ntracers[13];
+    int max_ntracers;
     int *ielement[13];
 
     int number_of_tracers;



More information about the CIG-COMMITS mailing list