[cig-commits] [commit] rajesh-petsc-schur: replaced all occurences of the caps_per_proc iteration variable by CPPR in Regional_tracer_advection.c (1e66ea8)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Sep 16 16:14:15 PDT 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/400e8500968f38074f2de7627682299fce9f86bb...1bfd8478d42e61b89bc8cfc1679ae9dcc94936f5
>---------------------------------------------------------------
commit 1e66ea820eee860b57ca148ab9b1c227245b5e5a
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Tue Sep 16 10:46:46 2014 -0700
replaced all occurences of the caps_per_proc iteration variable by CPPR in Regional_tracer_advection.c
>---------------------------------------------------------------
1e66ea820eee860b57ca148ab9b1c227245b5e5a
lib/Regional_tracer_advection.c | 90 ++++++++++++++++++++---------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/lib/Regional_tracer_advection.c b/lib/Regional_tracer_advection.c
index d4ccb0c..7734730 100644
--- a/lib/Regional_tracer_advection.c
+++ b/lib/Regional_tracer_advection.c
@@ -68,7 +68,7 @@ void regional_tracer_setup(struct All_variables *E)
/* Some error control */
- if (E->sphere.caps_per_proc>1) {
+ if (E->sphere.caps_per_proc > 1) {
fprintf(stderr,"This code does not work for multiple caps per processor!\n");
parallel_process_termination();
}
@@ -250,13 +250,13 @@ static void make_mesh_ijk(struct All_variables *E)
for(m=1;m<=E->sphere.caps_per_proc;m++) {
for(i=0;i<nox;i++)
- E->trace.x_space[i]=E->sx[m][1][i*noz+1];
+ E->trace.x_space[i]=E->sx[CPPR][1][i*noz+1];
for(j=0;j<noy;j++)
- E->trace.y_space[j]=E->sx[m][2][j*nox*noz+1];
+ E->trace.y_space[j]=E->sx[CPPR][2][j*nox*noz+1];
for(k=0;k<noz;k++)
- E->trace.z_space[k]=E->sx[m][3][k+1];
+ E->trace.z_space[k]=E->sx[CPPR][3][k+1];
} /* end of m */
@@ -622,7 +622,7 @@ 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;
+ const int j = CPPR;
int lev = E->mesh.levmax;
int i, d, kk;
@@ -645,20 +645,20 @@ void regional_lost_souls(struct All_variables *E)
double CPU_time0();
double begin_time = CPU_time0();
- E->trace.istat_isend = E->trace.ilater[j];
+ E->trace.istat_isend = E->trace.ilater[CPPR];
/* the bounding box */
for (d=0; d<E->mesh.nsd; d++) {
- bounds[d][0] = E->sx[j][d+1][1];
- bounds[d][1] = E->sx[j][d+1][E->lmesh.nno];
+ bounds[d][0] = E->sx[CPPR][d+1][1];
+ bounds[d][1] = E->sx[CPPR][d+1][E->lmesh.nno];
}
/* set up ranks for neighboring procs */
/* if ngbr_rank is -1, there is no neighbor on this side */
ipass = 1;
for (kk=1; kk<=6; kk++) {
- if (E->parallel.NUM_PASS[lev][j].bound[kk] == 1) {
- ngbr_rank[kk] = E->parallel.PROCESSOR[lev][j].pass[ipass];
+ if (E->parallel.NUM_PASS[lev][CPPR].bound[kk] == 1) {
+ ngbr_rank[kk] = E->parallel.PROCESSOR[lev][CPPR].pass[ipass];
ipass++;
}
else {
@@ -689,7 +689,7 @@ void regional_lost_souls(struct All_variables *E)
/* Allocate Maximum Memory to Send Arrays */
- max_send_size = max(2*E->trace.ilater[j], E->trace.ntracers[j]/100);
+ max_send_size = max(2*E->trace.ilater[CPPR], E->trace.ntracers[CPPR]/100);
itemp_size = max_send_size * E->trace.number_of_tracer_quantities;
if ((send[0] = (double *)malloc(itemp_size*sizeof(double)))
@@ -707,7 +707,7 @@ void regional_lost_souls(struct All_variables *E)
for (d=0; d<E->mesh.nsd; d++) {
- int original_size = E->trace.ilater[j];
+ int original_size = E->trace.ilater[CPPR];
int idb;
int kk = 1;
int isend[2], irecv[2];
@@ -715,17 +715,17 @@ void regional_lost_souls(struct All_variables *E)
/* move out-of-bound tracers to send array */
- while (kk<=E->trace.ilater[j]) {
+ while (kk<=E->trace.ilater[CPPR]) {
double coord;
/* Is the tracer within the bounds in the d-th dimension */
- coord = E->trace.rlater[j][d][kk];
+ coord = E->trace.rlater[CPPR][d][kk];
if (coord < bounds[d][0]) {
- put_lost_tracers(E, &(isend[0]), send[0], kk, j);
+ put_lost_tracers(E, &(isend[0]), send[0], kk, CPPR);
}
else if (coord >= bounds[d][1]) {
- put_lost_tracers(E, &(isend[1]), send[1], kk, j);
+ put_lost_tracers(E, &(isend[1]), send[1], kk, CPPR);
}
else {
/* check next tracer */
@@ -766,10 +766,10 @@ void regional_lost_souls(struct All_variables *E)
/* check the total # of tracers is conserved */
- if ((isend[0] + isend[1] + E->trace.ilater[j]) != original_size) {
+ if ((isend[0] + isend[1] + E->trace.ilater[CPPR]) != original_size) {
fprintf(E->trace.fpt, "original_size: %d, rlater_size: %d, "
"send_size: %d\n",
- original_size, E->trace.ilater[j], kk);
+ original_size, E->trace.ilater[CPPR], kk);
}
@@ -878,7 +878,7 @@ void regional_lost_souls(struct All_variables *E)
/* put the received tracers */
for (i=0; i<2; i++) {
- put_found_tracers(E, irecv[i], recv[i], j);
+ put_found_tracers(E, irecv[i], recv[i], CPPR);
}
@@ -889,13 +889,13 @@ void regional_lost_souls(struct All_variables *E)
/* rlater should be empty by now */
- if (E->trace.ilater[j] > 0) {
+ if (E->trace.ilater[CPPR] > 0) {
fprintf(E->trace.fpt, "Error(regional_lost_souls) lost tracers\n");
- for (kk=1; kk<=E->trace.ilater[j]; kk++) {
+ for (kk=1; kk<=E->trace.ilater[CPPR]; kk++) {
fprintf(E->trace.fpt, "lost #%d xx=(%e, %e, %e)\n", kk,
- E->trace.rlater[j][0][kk],
- E->trace.rlater[j][1][kk],
- E->trace.rlater[j][2][kk]);
+ E->trace.rlater[CPPR][0][kk],
+ E->trace.rlater[CPPR][1][kk],
+ E->trace.rlater[CPPR][2][kk]);
}
fflush(E->trace.fpt);
exit(10);
@@ -924,16 +924,16 @@ static void put_lost_tracers(struct All_variables *E,
for (pp=0; pp<E->trace.number_of_tracer_quantities; pp++) {
ipos = isend_position + pp;
- send[ipos] = E->trace.rlater[j][pp][kk];
+ send[ipos] = E->trace.rlater[CPPR][pp][kk];
}
(*send_size)++;
/* eject the tracer from rlater */
- ilast_tracer = E->trace.ilater[j];
+ ilast_tracer = E->trace.ilater[CPPR];
for (pp=0; pp<E->trace.number_of_tracer_quantities; pp++) {
- E->trace.rlater[j][pp][kk] = E->trace.rlater[j][pp][ilast_tracer];
+ E->trace.rlater[CPPR][pp][kk] = E->trace.rlater[CPPR][pp][ilast_tracer];
}
- E->trace.ilater[j]--;
+ E->trace.ilater[CPPR]--;
return;
}
@@ -963,7 +963,7 @@ static void put_found_tracers(struct All_variables *E,
/* check whether this tracer is inside this proc */
/* check radius first, since it is cheaper */
- inside = icheck_processor_shell(E, j, rad);
+ inside = icheck_processor_shell(E, CPPR, rad);
if (inside == 1)
inside = regional_icheck_cap(E, 0, theta, phi, rad, rad);
else
@@ -978,22 +978,22 @@ static void put_found_tracers(struct All_variables *E,
if (inside) {
- E->trace.ntracers[j]++;
- ilast = E->trace.ntracers[j];
+ E->trace.ntracers[CPPR]++;
+ ilast = E->trace.ntracers[CPPR];
- if (E->trace.ntracers[j] > (E->trace.max_ntracers[j]-5))
- expand_tracer_arrays(E, j);
+ if (E->trace.ntracers[CPPR] > (E->trace.max_ntracers[CPPR]-5))
+ expand_tracer_arrays(E, CPPR);
for (pp=0; pp<E->trace.number_of_basic_quantities; pp++)
- E->trace.basicq[j][pp][ilast] = recv[ipos+pp];
+ E->trace.basicq[CPPR][pp][ilast] = recv[ipos+pp];
ipos += E->trace.number_of_basic_quantities;
for (pp=0; pp<E->trace.number_of_extra_quantities; pp++)
- E->trace.extraq[j][pp][ilast] = recv[ipos+pp];
+ E->trace.extraq[CPPR][pp][ilast] = recv[ipos+pp];
/* found the element */
- iel = regional_iget_element(E, j, -99, 0, 0, 0, theta, phi, rad);
+ iel = regional_iget_element(E, CPPR, -99, 0, 0, 0, theta, phi, rad);
if (iel<1) {
fprintf(E->trace.fpt, "Error(regional lost souls) - "
@@ -1004,16 +1004,16 @@ static void put_found_tracers(struct All_variables *E,
exit(10);
}
- E->trace.ielement[j][ilast] = iel;
+ E->trace.ielement[CPPR][ilast] = iel;
}
else {
- if (E->trace.ilatersize[j]==0) {
+ if (E->trace.ilatersize[CPPR]==0) {
- E->trace.ilatersize[j]=E->trace.max_ntracers[j]/5;
+ E->trace.ilatersize[CPPR]=E->trace.max_ntracers[CPPR]/5;
for (kk=0;kk<E->trace.number_of_tracer_quantities;kk++) {
- if ((E->trace.rlater[j][kk]=(double *)malloc(E->trace.ilatersize[j]*sizeof(double)))==NULL) {
+ if ((E->trace.rlater[CPPR][kk]=(double *)malloc(E->trace.ilatersize[CPPR]*sizeof(double)))==NULL) {
fprintf(E->trace.fpt,"AKM(put_found_tracers)-no memory (%d)\n",kk);
fflush(E->trace.fpt);
exit(10);
@@ -1021,14 +1021,14 @@ static void put_found_tracers(struct All_variables *E,
}
} /* end first particle initiating memory allocation */
- E->trace.ilater[j]++;
- ilast = E->trace.ilater[j];
+ E->trace.ilater[CPPR]++;
+ ilast = E->trace.ilater[CPPR];
- if (E->trace.ilater[j] > (E->trace.ilatersize[j]-5))
- expand_later_array(E, j);
+ if (E->trace.ilater[CPPR] > (E->trace.ilatersize[CPPR]-5))
+ expand_later_array(E, CPPR);
for (pp=0; pp<E->trace.number_of_tracer_quantities; pp++)
- E->trace.rlater[j][pp][ilast] = recv[ipos+pp];
+ E->trace.rlater[CPPR][pp][ilast] = recv[ipos+pp];
} /* end of if-else */
/** debug **
More information about the CIG-COMMITS
mailing list