Skip to content

Commit

Permalink
Merge pull request #129 from shintaro-iwasaki/HugePageWorkaround
Browse files Browse the repository at this point in the history
Disable hugepage allocation by default on non-x86/64.
  • Loading branch information
shintaro-iwasaki authored Nov 17, 2019
2 parents deec51f + 7c9dffc commit 20c237a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/arch/abtd_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,22 @@ void ABTD_env_init(ABTI_global *p_global)
env = getenv("ABT_MEM_LP_ALLOC");
if (env == NULL) env = getenv("ABT_ENV_MEM_LP_ALLOC");
#if defined(HAVE_MAP_ANONYMOUS) || defined(HAVE_MAP_ANON)
#if defined(__x86_64__)
int lp_alloc = ABTI_MEM_LP_MMAP_HP_RP;
#else
/*
* If hugepage is used, mmap() needs a correct size of hugepage; otherwise,
* error happens on munmap(). However, the default size is for typical
* x86/64 machines, not for other architectures, so the error happens when
* the hugepage size is different. To run Argobots with default settings
* on these architectures, we disable hugepage allocation by default on
* non-x86/64 architectures; on such a machine, hugepage settings should
* be explicitly enabled via an environmental variable.
*
* TODO: fix this issue by detecting and setting a correct hugepage size.
*/
int lp_alloc = ABTI_MEM_LP_MALLOC;
#endif
#else
int lp_alloc = ABTI_MEM_LP_MALLOC;
#endif
Expand Down

0 comments on commit 20c237a

Please sign in to comment.