Skip to content

Commit 20c237a

Browse files
Merge pull request #129 from shintaro-iwasaki/HugePageWorkaround
Disable hugepage allocation by default on non-x86/64.
2 parents deec51f + 7c9dffc commit 20c237a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/arch/abtd_env.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,22 @@ void ABTD_env_init(ABTI_global *p_global)
201201
env = getenv("ABT_MEM_LP_ALLOC");
202202
if (env == NULL) env = getenv("ABT_ENV_MEM_LP_ALLOC");
203203
#if defined(HAVE_MAP_ANONYMOUS) || defined(HAVE_MAP_ANON)
204+
#if defined(__x86_64__)
204205
int lp_alloc = ABTI_MEM_LP_MMAP_HP_RP;
206+
#else
207+
/*
208+
* If hugepage is used, mmap() needs a correct size of hugepage; otherwise,
209+
* error happens on munmap(). However, the default size is for typical
210+
* x86/64 machines, not for other architectures, so the error happens when
211+
* the hugepage size is different. To run Argobots with default settings
212+
* on these architectures, we disable hugepage allocation by default on
213+
* non-x86/64 architectures; on such a machine, hugepage settings should
214+
* be explicitly enabled via an environmental variable.
215+
*
216+
* TODO: fix this issue by detecting and setting a correct hugepage size.
217+
*/
218+
int lp_alloc = ABTI_MEM_LP_MALLOC;
219+
#endif
205220
#else
206221
int lp_alloc = ABTI_MEM_LP_MALLOC;
207222
#endif

0 commit comments

Comments
 (0)