Skip to content

Commit

Permalink
Add setters for GenmapHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Feb 8, 2019
1 parent fe8b8b5 commit 5282d17
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/genmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,41 @@ GenmapElements GenmapGetElements(GenmapHandle h) {
return (GenmapElements) h->elementArray.ptr;
}

void GenmapSetElements(GenmapHandle h, GenmapElements elements) {
h->elementArray.ptr = elements;
}

GenmapComm GenmapGetLocalComm(GenmapHandle h) {
return h->local;
}

void GenmapSetLocalComm(GenmapHandle h, GenmapComm c) {
h->local = c;
}

GenmapComm GenmapGetGlobalComm(GenmapHandle h) {
return h->global;
}

void GenmapSetGlobalComm(GenmapHandle h, GenmapComm c) {
h->global = c;
}

GenmapInt GenmapGetNLocalElements(GenmapHandle h) {
return h->header->lelt;
}

void GenmapSetNLocalElements(GenmapHandle h, GenmapInt localElements) {
h->header->lelt = localElements;
}

GenmapLong GenmapGetNGlobalElements(GenmapHandle h) {
return h->header->nel;
}

void GenmapSetNGlobalElements(GenmapHandle h, GenmapLong globalElements) {
h->header->nel = globalElements;
}
//
// GenmapMalloc, Realloc, Calloc and Free
//
Expand Down
9 changes: 9 additions & 0 deletions src/genmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ int GenmapRegisterReader(char *name, int (*Create)(GenmapHandle h));
// Genmap header helper functions
//
GenmapElements GenmapGetElements(GenmapHandle h);
void GenmapSetElements(GenmapHandle h, GenmapElements elements);

GenmapComm GenmapGetLocalComm(GenmapHandle h);
void GenmapSetLocalComm(GenmapHandle h, GenmapComm c);

GenmapComm GenmapGetGlobalComm(GenmapHandle h);
void GenmapSetGlobalComm(GenmapHandle h, GenmapComm c);

GenmapInt GenmapGetNLocalElements(GenmapHandle h);
void GenmapSetNLocalElements(GenmapHandle h, GenmapInt localElements);

GenmapLong GenmapGetNGlobalElements(GenmapHandle h);
void GenmapSetNGlobalElements(GenmapHandle h, GenmapLong globalElements);
//
// GenmapCommExternal
//
Expand Down

0 comments on commit 5282d17

Please sign in to comment.