[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of E->parallel.NUM_sNODE as part of caps_per_proc_removal (dd5a7bd)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Sep 24 15:23:29 PDT 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/980de677d7efb78fdd5c41fd4b35a9283a2d251f...b86b2dd00f2bd13fb282a2eb9169871be4b1e923
>---------------------------------------------------------------
commit dd5a7bdd7e72b0f631cca8b9bcdfefc596f96028
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Wed Sep 24 11:23:50 2014 -0700
Changed the shape of E->parallel.NUM_sNODE as part of caps_per_proc_removal
>---------------------------------------------------------------
dd5a7bdd7e72b0f631cca8b9bcdfefc596f96028
lib/Full_parallel_related.c | 30 +++++++++++++++---------------
lib/Regional_parallel_related.c | 22 +++++++++++-----------
lib/global_defs.h | 2 +-
3 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/lib/Full_parallel_related.c b/lib/Full_parallel_related.c
index f6ae772..d4d654e 100644
--- a/lib/Full_parallel_related.c
+++ b/lib/Full_parallel_related.c
@@ -762,10 +762,10 @@ void full_parallel_communication_routs_s(E)
for (kkk=1;kkk<=E->parallel.TNUM_PASS[lev];kkk++) {
if (kkk<=4) { /* first 4 communications are for XZ and YZ planes */
ii = kkk;
- E->parallel.NUM_sNODE[lev][CPPR].pass[kkk] =
+ E->parallel.NUM_sNODE[lev].pass[kkk] =
E->parallel.NUM_NNO[lev].bound[ii]/noz;
- for (k=1;k<=E->parallel.NUM_sNODE[lev][CPPR].pass[kkk];k++) {
+ for (k=1;k<=E->parallel.NUM_sNODE[lev].pass[kkk];k++) {
lnode = k;
node = (E->parallel.NODE[lev][CPPR][lnode].bound[ii]-1)/noz + 1;
E->parallel.EXCHANGE_sNODE[lev][CPPR][k].pass[kkk] = node;
@@ -773,9 +773,9 @@ void full_parallel_communication_routs_s(E)
} /* end for first 4 communications */
else { /* the last FOUR communications are for lines */
- E->parallel.NUM_sNODE[lev][CPPR].pass[kkk]=1;
+ E->parallel.NUM_sNODE[lev].pass[kkk]=1;
- for (k=1;k<=E->parallel.NUM_sNODE[lev][CPPR].pass[kkk];k++) {
+ for (k=1;k<=E->parallel.NUM_sNODE[lev].pass[kkk];k++) {
node = E->parallel.EXCHANGE_NODE[lev][k].pass[kkk]/noz + 1;
E->parallel.EXCHANGE_sNODE[lev][CPPR][k].pass[kkk] = node;
} /* end for node k */
@@ -790,9 +790,9 @@ void full_parallel_communication_routs_s(E)
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]);
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][CPPR].pass[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");
- for (ii=1;ii<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];ii++)
+ for (ii=1;ii<=E->parallel.NUM_sNODE[lev].pass[k];ii++)
fprintf(E->fp_out,"%d %d\n",ii,E->parallel.EXCHANGE_sNODE[lev][CPPR][ii].pass[k]);
}
@@ -1185,7 +1185,7 @@ void full_exchange_snode_f(struct All_variables *E, float *U1, float *U2, int le
kk=0;
for (k=1;k<=E->parallel.TNUM_PASS[E->mesh.levmax];k++) {
++kk;
- sizeofk = (1+2*E->parallel.NUM_sNODE[E->mesh.levmax][CPPR].pass[k])*sizeof(float);
+ sizeofk = (1+2*E->parallel.NUM_sNODE[E->mesh.levmax].pass[k])*sizeof(float);
S[kk]=(float *)malloc( sizeofk );
R[kk]=(float *)malloc( sizeofk );
}
@@ -1196,16 +1196,16 @@ void full_exchange_snode_f(struct All_variables *E, float *U1, float *U2, int le
kk=k;
/* pack */
- for (j=1;j<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];j++) {
+ for (j=1;j<=E->parallel.NUM_sNODE[lev].pass[k];j++) {
S[kk][j-1] = U1[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ];
- S[kk][j-1+E->parallel.NUM_sNODE[lev][CPPR].pass[k]]
+ S[kk][j-1+E->parallel.NUM_sNODE[lev].pass[k]]
= U2[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ];
}
if (E->parallel.PROCESSOR[lev].pass[k]!=E->parallel.me) {
if (E->parallel.PROCESSOR[lev].pass[k]!=-1) {
idb ++;
- MPI_Isend(S[kk],2*E->parallel.NUM_sNODE[lev][CPPR].pass[k],MPI_FLOAT,
+ MPI_Isend(S[kk],2*E->parallel.NUM_sNODE[lev].pass[k],MPI_FLOAT,
E->parallel.PROCESSOR[lev].pass[k],1,E->parallel.world,&request[idb-1]);
}
}
@@ -1219,17 +1219,17 @@ void full_exchange_snode_f(struct All_variables *E, float *U1, float *U2, int le
if (E->parallel.PROCESSOR[lev].pass[k]!=-1) {
idb ++;
- MPI_Irecv(R[kk],2*E->parallel.NUM_sNODE[lev][CPPR].pass[k],MPI_FLOAT,
+ MPI_Irecv(R[kk],2*E->parallel.NUM_sNODE[lev].pass[k],MPI_FLOAT,
E->parallel.PROCESSOR[lev].pass[k],1,E->parallel.world,&request[idb-1]);
}
}
else {
kk=k;
- for (j=1;j<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];j++) {
+ for (j=1;j<=E->parallel.NUM_sNODE[lev].pass[k];j++) {
U1[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] += S[kk][j-1];
U2[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] +=
- S[kk][j-1+E->parallel.NUM_sNODE[lev][CPPR].pass[k]];
+ S[kk][j-1+E->parallel.NUM_sNODE[lev].pass[k]];
}
}
} /* for k */
@@ -1242,10 +1242,10 @@ void full_exchange_snode_f(struct All_variables *E, float *U1, float *U2, int le
/* unpack */
if (E->parallel.PROCESSOR[lev].pass[k]!=E->parallel.me)
if (E->parallel.PROCESSOR[lev].pass[k]!=-1) {
- for (j=1;j<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];j++) {
+ for (j=1;j<=E->parallel.NUM_sNODE[lev].pass[k];j++) {
U1[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] += R[kk][j-1];
U2[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] +=
- R[kk][j-1+E->parallel.NUM_sNODE[lev][CPPR].pass[k]];
+ R[kk][j-1+E->parallel.NUM_sNODE[lev].pass[k]];
}
}
}
diff --git a/lib/Regional_parallel_related.c b/lib/Regional_parallel_related.c
index ca0a0fa..be8d57f 100644
--- a/lib/Regional_parallel_related.c
+++ b/lib/Regional_parallel_related.c
@@ -644,9 +644,9 @@ void regional_parallel_communication_routs_s(E)
E->parallel.sPROCESSOR[lev][CPPR].pass[kkk]=me-((i==1)?1:-1)*nproczl;
- E->parallel.NUM_sNODE[lev][CPPR].pass[kkk] =
+ E->parallel.NUM_sNODE[lev].pass[kkk] =
E->parallel.NUM_NNO[lev].bound[ii]/noz;
- for (k=1;k<=E->parallel.NUM_sNODE[lev][CPPR].pass[kkk];k++) {
+ for (k=1;k<=E->parallel.NUM_sNODE[lev].pass[kkk];k++) {
lnode = k; /* due to lnode increases in horizontal di first */
node = (E->parallel.NODE[lev][CPPR][lnode].bound[ii]-1)/noz+1;
E->parallel.EXCHANGE_sNODE[lev][CPPR][k].pass[kkk] = node;
@@ -672,10 +672,10 @@ void regional_parallel_communication_routs_s(E)
E->parallel.sPROCESSOR[lev][CPPR].pass[kkk]=me-((k==1)?1:-1)*nprocxl*nproczl;
- E->parallel.NUM_sNODE[lev][CPPR].pass[kkk] =
+ E->parallel.NUM_sNODE[lev].pass[kkk] =
E->parallel.NUM_NNO[lev].bound[ii]/noz;
- for (kk=1;kk<=E->parallel.NUM_sNODE[lev][CPPR].pass[kkk];kk++) {
+ for (kk=1;kk<=E->parallel.NUM_sNODE[lev].pass[kkk];kk++) {
lnode = kk; /* due to lnode increases in horizontal di first */
node = (E->parallel.NODE[lev][CPPR][lnode].bound[ii]-1)/noz+1;
E->parallel.EXCHANGE_sNODE[lev][CPPR][kk].pass[kkk] = node;
@@ -836,29 +836,29 @@ void regional_exchange_snode_f(struct All_variables *E, float *U1,
MPI_Status status;
for (k=1;k<=E->parallel.sTNUM_PASS[lev];k++) {
- sizeofk = (1+2*E->parallel.NUM_sNODE[lev][CPPR].pass[k])*sizeof(float);
+ sizeofk = (1+2*E->parallel.NUM_sNODE[lev].pass[k])*sizeof(float);
S[k]=(float *)malloc( sizeofk );
R[k]=(float *)malloc( sizeofk );
}
for (k=1;k<=E->parallel.sTNUM_PASS[lev];k++) {
- for (j=1;j<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];j++) {
+ for (j=1;j<=E->parallel.NUM_sNODE[lev].pass[k];j++) {
S[k][j-1] = U1[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ];
- S[k][j-1+E->parallel.NUM_sNODE[lev][CPPR].pass[k]]
+ S[k][j-1+E->parallel.NUM_sNODE[lev].pass[k]]
= U2[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ];
}
- MPI_Sendrecv(S[k],2*E->parallel.NUM_sNODE[lev][CPPR].pass[k],MPI_FLOAT,
+ MPI_Sendrecv(S[k],2*E->parallel.NUM_sNODE[lev].pass[k],MPI_FLOAT,
E->parallel.sPROCESSOR[lev][CPPR].pass[k],1,
- R[k],2*E->parallel.NUM_sNODE[lev][CPPR].pass[k],MPI_FLOAT,
+ R[k],2*E->parallel.NUM_sNODE[lev].pass[k],MPI_FLOAT,
E->parallel.sPROCESSOR[lev][CPPR].pass[k],1,
E->parallel.world,&status);
- for (j=1;j<=E->parallel.NUM_sNODE[lev][CPPR].pass[k];j++) {
+ for (j=1;j<=E->parallel.NUM_sNODE[lev].pass[k];j++) {
U1[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] += R[k][j-1];
U2[ E->parallel.EXCHANGE_sNODE[lev][CPPR][j].pass[k] ] +=
- R[k][j-1+E->parallel.NUM_sNODE[lev][CPPR].pass[k]];
+ R[k][j-1+E->parallel.NUM_sNODE[lev].pass[k]];
}
}
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 4cb9e23..55c24ff 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -252,7 +252,7 @@ struct Parallel {
struct PASS NUM_NODEz[MAX_LEVELS];
int sTNUM_PASS[MAX_LEVELS];
- struct PASS NUM_sNODE[MAX_LEVELS][NCS];
+ struct PASS NUM_sNODE[MAX_LEVELS];
struct PASS sPROCESSOR[MAX_LEVELS][NCS];
struct PASS *EXCHANGE_sNODE[MAX_LEVELS][NCS];
};
More information about the CIG-COMMITS
mailing list