Skip to content

Commit

Permalink
mem: disable hugepage allocation by default on non-x86/64.
Browse files Browse the repository at this point in the history
Mismatching of hugepage size causes an error, while the current default constant
is for x86/64.  To run Argobots with default settings on non-x86/64
architectures, this patch disables hugepage allocation by default on non-x86/64
architectures.

In the future, this issue should be fixed by using a correct hugepage size.
  • Loading branch information
shintaro-iwasaki committed Nov 17, 2019
1 parent deec51f commit 7c9dffc
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 7c9dffc

Please sign in to comment.