Skip to content

Commit

Permalink
h->header->lelt --> GenmapGetNLocalElements(h)
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Feb 8, 2019
1 parent 182a2eb commit fe8b8b5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions src/genmap-algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int GenmapLanczosLegendary(GenmapHandle h, GenmapComm c, GenmapVector f,
GenmapVector upper) {
assert(diag->size == niter);
assert(diag->size == upper->size + 1);
assert(f->size == h->header->lelt);
assert(f->size == GenmapGetNLocalElements(h));

if(h->header->nel < niter) {
niter = h->header->nel;
Expand All @@ -313,7 +313,7 @@ int GenmapLanczosLegendary(GenmapHandle h, GenmapComm c, GenmapVector f,
rtz1 = 1.0;

GenmapScalar tmp;
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);

// Store Local Laplacian weights
GenmapCreateVector(&weights, lelt);
Expand Down Expand Up @@ -404,7 +404,7 @@ int GenmapLanczos(GenmapHandle h, GenmapComm c, GenmapVector init,
GenmapVector beta) {
assert(alpha->size == iter);
assert(alpha->size == beta->size + 1);
assert(init->size == h->header->lelt);
assert(init->size == GenmapGetNLocalElements(h));

if(h->header->nel < iter) {
iter = h->header->nel;
Expand All @@ -415,7 +415,7 @@ int GenmapLanczos(GenmapHandle h, GenmapComm c, GenmapVector init,
GenmapVector q0, q1, u;
GenmapScalar normq1 = 0., b = 0.;

GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);

// Create vector q1 orthogonalizing init in 1-norm to (1,1,1...)
GenmapCreateVector(&q1, lelt);
Expand Down Expand Up @@ -492,7 +492,7 @@ void GenmapFiedlerMinMax(GenmapHandle h, GenmapScalar *min,

GenmapElements e = GenmapGetElements(h);
GenmapInt i;
for(i = 0; i < h->header->lelt; i++) {
for(i = 0; i < GenmapGetNLocalElements(h); i++) {
if(e[i].fiedler < *min) {
*min = e[i].fiedler;
}
Expand All @@ -512,7 +512,7 @@ GenmapInt GenmapSetProcessorId(GenmapHandle h) {

GenmapInt np = GenmapCommSize(GenmapGetLocalComm(h));
GenmapInt nbins = np;
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapElements elements = GenmapGetElements(h);

GenmapElements p, e;
Expand All @@ -538,7 +538,7 @@ void GenmapGlobalMinMax(GenmapHandle h, GenmapLong *min,

GenmapElements e = GenmapGetElements(h);
GenmapInt i;
for(i = 0; i < h->header->lelt; i++) {
for(i = 0; i < GenmapGetNLocalElements(h); i++) {
if(e[i].globalId < *min) {
*min = e[i].globalId;
}
Expand All @@ -558,7 +558,7 @@ GenmapInt GenmapSetProcessorIdGlobal(GenmapHandle h) {

GenmapInt np = GenmapCommSize(GenmapGetLocalComm(h));
GenmapInt nbins = np;
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapElements elements = GenmapGetElements(h);

GenmapElements p, e;
Expand All @@ -581,10 +581,10 @@ GenmapInt GenmapSetProcessorIdGlobal(GenmapHandle h) {
int GenmapFiedler(GenmapHandle h, GenmapComm c, int maxIter,
int global) {
// 1. Do lanczos in local communicator.
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapVector initVec, alphaVec, betaVec;

GenmapCreateVector(&initVec, h->header->lelt);
GenmapCreateVector(&initVec, GenmapGetNLocalElements(h));
GenmapElements elements = GenmapGetElements(h);

GenmapInt i;
Expand Down Expand Up @@ -738,7 +738,7 @@ void GenmapPrimeFactors(GenmapInt n, GenmapInt *pCount,
void GenmapRSB(GenmapHandle h) {
GenmapInt id = GenmapCommRank(GenmapGetLocalComm(h));
GenmapInt np = GenmapCommSize(GenmapGetLocalComm(h));
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapLong nel = h->header->nel;
GenmapLong start = h->header->start;
GenmapElements elements = GenmapGetElements(h);
Expand Down
2 changes: 1 addition & 1 deletion src/genmap-comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int GenmapAx(GenmapHandle h, GenmapComm c, GenmapVector u,

int GenmapAxInit(GenmapHandle h, GenmapComm c,
GenmapVector weights) {
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapInt nv = h->header->nv;
GenmapUInt numPoints = (GenmapUInt) nv * lelt;

Expand Down
2 changes: 1 addition & 1 deletion src/genmap-quality.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
GenmapInt GenmapPartitionQuality(GenmapHandle h) {
GenmapInt id = GenmapCommRank(GenmapGetGlobalComm(h));
GenmapInt np = GenmapCommSize(GenmapGetGlobalComm(h));
GenmapInt lelt = h->header->lelt;
GenmapInt lelt = GenmapGetNLocalElements(h);
GenmapInt nv = h->header->nv;

GenmapLong *data;
Expand Down
4 changes: 2 additions & 2 deletions src/parRSB.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int parRSB_partMesh(long long *egl, long long *vl, int *negl,
h->header->nv = nve;

GenmapLong out[2][1], buf[2][1];
GenmapLong lelt_ = h->header->lelt;
GenmapLong lelt_ = GenmapGetNLocalElements(h);
comm_scan(out, &(GenmapGetGlobalComm(h)->gsComm), genmap_gs_long, gs_add,
&lelt_, 1,
buf);
Expand All @@ -76,7 +76,7 @@ int parRSB_partMesh(long long *egl, long long *vl, int *negl,
GenmapElements elements = GenmapGetElements(h);
GenmapInt nv = h->header->nv;

*negl = h->header->lelt;
*negl = GenmapGetNLocalElements(h);

for(i = 0; i < *negl; i++) {
egl[i] = elements[i].globalId;
Expand Down

0 comments on commit fe8b8b5

Please sign in to comment.