Skip to content

Commit

Permalink
Merge branch 'hotfix/dirac-ITT-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
paboyle committed Sep 5, 2017
2 parents d75369c + aed5de4 commit c709883
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/communicator/Communicator_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void CartesianCommunicator::ShmInitGeneric(void){
perror("mmap failed ");
exit(EXIT_FAILURE);
}
#ifdef MADV_HUGEPAGE
if (!Hugepages ) madvise(ShmCommBuf,MAX_MPI_SHM_BYTES,MADV_HUGEPAGE);
#endif
#else
ShmBufStorageVector.resize(MAX_MPI_SHM_BYTES);
ShmCommBuf=(void *)&ShmBufStorageVector[0];
Expand Down
11 changes: 8 additions & 3 deletions lib/communicator/Communicator_mpi3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ void CartesianCommunicator::Init(int *argc, char ***argv) {
perror("open hugetlbfs");
exit(0);
}

int mmap_flag = MAP_SHARED |MAP_POPULATE;
int mmap_flag = MAP_SHARED ;
#ifdef MAP_POPULATE
mmap_flag|=MAP_POPULATE;
#endif
#ifdef MAP_HUGETLB
if ( Hugepages ) mmap_flag |= MAP_HUGETLB;
#endif
Expand Down Expand Up @@ -249,7 +251,10 @@ void CartesianCommunicator::Init(int *argc, char ***argv) {
if ( fd < 0 ) { perror("failed shm_open"); assert(0); }
ftruncate(fd, size);

int mmap_flag = MAP_SHARED|MAP_POPULATE;
int mmap_flag = MAP_SHARED;
#ifdef MAP_POPULATE
mmap_flag |= MAP_POPULATE;
#endif
#ifdef MAP_HUGETLB
if (Hugepages) mmap_flag |= MAP_HUGETLB;
#endif
Expand Down

0 comments on commit c709883

Please sign in to comment.