ARGOBOTS  2202510f2bd4ba732a2ba2215171c0820320f58d
abtd_env.c
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #include "abti.h"
7 #include <unistd.h>
8 #include <strings.h>
9 
10 #define ABTD_KEY_TABLE_DEFAULT_SIZE 4
11 #define ABTD_THREAD_DEFAULT_STACKSIZE 16384
12 #define ABTD_SCHED_DEFAULT_STACKSIZE (4 * 1024 * 1024)
13 #define ABTD_SCHED_EVENT_FREQ 50
14 #define ABTD_SCHED_SLEEP_NSEC 100
15 
16 #define ABTD_SYS_PAGE_SIZE 4096
17 #define ABTD_HUGE_PAGE_SIZE (2 * 1024 * 1024)
18 #define ABTD_MEM_PAGE_SIZE (2 * 1024 * 1024)
19 #define ABTD_MEM_STACK_PAGE_SIZE (8 * 1024 * 1024)
20 #define ABTD_MEM_MAX_NUM_STACKS 1024
21 #define ABTD_MEM_MAX_TOTAL_STACK_SIZE (64 * 1024 * 1024)
22 #define ABTD_MEM_MAX_NUM_DESCS 4096
23 
24 /* To avoid potential overflow, we intentionally use a smaller value than the
25  * real limit. */
26 #define ABTD_ENV_INT_MAX ((int)(INT_MAX / 2))
27 #define ABTD_ENV_UINT32_MAX ((uint32_t)(UINT32_MAX / 2))
28 #define ABTD_ENV_UINT64_MAX ((uint64_t)(UINT64_MAX / 2))
29 #define ABTD_ENV_SIZE_MAX ((size_t)(SIZE_MAX / 2))
30 
31 static uint32_t roundup_pow2_uint32(uint32_t val);
32 static size_t roundup_pow2_size(size_t val);
33 static const char *get_abt_env(const char *env_suffix);
34 static ABT_bool is_false(const char *str, ABT_bool include0);
35 static ABT_bool is_true(const char *str, ABT_bool include1);
36 static ABT_bool load_env_bool(const char *env_suffix, ABT_bool default_val);
37 static int load_env_int(const char *env_suffix, int default_val, int min_val,
38  int max_val);
39 static uint32_t load_env_uint32(const char *env_suffix, uint32_t default_val,
40  uint32_t min_val, uint32_t max_val);
41 static uint64_t load_env_uint64(const char *env_suffix, uint64_t default_val,
42  uint64_t min_val, uint64_t max_val);
43 static size_t load_env_size(const char *env_suffix, size_t default_val,
44  size_t min_val, size_t max_val);
45 
46 void ABTD_env_init(ABTI_global *p_global)
47 {
48  const char *env;
49 
50  /* Get the number of available cores in the system */
51  p_global->num_cores = sysconf(_SC_NPROCESSORS_ONLN);
52 
53  /* ABT_SET_AFFINITY, ABT_ENV_SET_AFFINITY */
54  env = get_abt_env("SET_AFFINITY");
55  if (env != NULL && is_false(env, ABT_FALSE)) {
56  p_global->set_affinity = ABT_FALSE;
57  } else {
58  /* By default, we use the CPU affinity */
59  p_global->set_affinity = ABT_TRUE;
60  ABTD_affinity_init(p_global, env);
61  }
62 
63 #ifdef ABT_CONFIG_USE_DEBUG_LOG_PRINT
64  /* If the debug log printing is set in configure, logging is turned on by
65  * default. */
66  const ABT_bool default_use_logging = ABT_TRUE;
67  const ABT_bool default_use_debug = ABT_TRUE;
68 #else
69  /* Otherwise, logging is not turned on by default. */
70  const ABT_bool default_use_logging = ABT_FALSE;
71  const ABT_bool default_use_debug = ABT_FALSE;
72 #endif
73  /* ABT_USE_LOG, ABT_ENV_USE_LOG */
74  p_global->use_logging = load_env_bool("USE_LOG", default_use_logging);
75 
76  /* ABT_USE_DEBUG, ABT_ENV_USE_DEBUG */
77  p_global->use_debug = load_env_bool("USE_DEBUG", default_use_debug);
78 
79  /* ABT_MAX_NUM_XSTREAMS, ABT_ENV_MAX_NUM_XSTREAMS
80  * Maximum size of the internal ES array */
81  p_global->max_xstreams =
82  load_env_int("MAX_NUM_XSTREAMS", p_global->num_cores, 1,
83  ABTD_ENV_INT_MAX);
84 
85  /* ABT_KEY_TABLE_SIZE, ABT_ENV_KEY_TABLE_SIZE
86  * Default key table size */
87  p_global->key_table_size = roundup_pow2_uint32(
88  load_env_uint32("KEY_TABLE_SIZE", ABTD_KEY_TABLE_DEFAULT_SIZE, 1,
89  ABTD_ENV_UINT32_MAX));
90 
91  /* ABT_STACK_OVERFLOW_CHECK, ABT_ENV_STACK_OVERFLOW_CHECK */
92  env = get_abt_env("STACK_OVERFLOW_CHECK");
93  if (env) {
94  if (strcasecmp(env, "mprotect_strict") == 0) {
95  p_global->stack_guard_kind = ABTI_STACK_GUARD_MPROTECT_STRICT;
96  } else if (strcasecmp(env, "mprotect") == 0) {
97  p_global->stack_guard_kind = ABTI_STACK_GUARD_MPROTECT;
98  } else {
99  /* Otherwise, disable mprotect-based stack guard. */
100  p_global->stack_guard_kind = ABTI_STACK_GUARD_NONE;
101  }
102  } else {
103  /* Set the default mode. */
104 #if ABT_CONFIG_STACK_CHECK_TYPE == ABTI_STACK_CHECK_TYPE_MPROTECT
105  p_global->stack_guard_kind = ABTI_STACK_GUARD_MPROTECT;
106 #elif ABT_CONFIG_STACK_CHECK_TYPE == ABTI_STACK_CHECK_TYPE_MPROTECT_STRICT
107  p_global->stack_guard_kind = ABTI_STACK_GUARD_MPROTECT_STRICT;
108 #else
109  /* Stack canary is compile-time setting. */
110  p_global->stack_guard_kind = ABTI_STACK_GUARD_NONE;
111 #endif
112  }
113 
114  /* ABT_SYS_PAGE_SIZE, ABT_ENV_SYS_PAGE_SIZE
115  * System page size. It must be 2^N. */
116  size_t sys_page_size = ABTD_SYS_PAGE_SIZE;
117 #if HAVE_GETPAGESIZE
118  sys_page_size = getpagesize();
119 #endif
120  p_global->sys_page_size = roundup_pow2_size(
121  load_env_size("SYS_PAGE_SIZE", sys_page_size, 64, ABTD_ENV_SIZE_MAX));
122 
123  /* ABT_THREAD_STACKSIZE, ABT_ENV_THREAD_STACKSIZE
124  * Default stack size for ULT */
125  size_t default_thread_stacksize = ABTD_THREAD_DEFAULT_STACKSIZE;
126  if (p_global->stack_guard_kind == ABTI_STACK_GUARD_MPROTECT ||
127  p_global->stack_guard_kind == ABTI_STACK_GUARD_MPROTECT_STRICT) {
128  /* Maximum 2 pages are used for mprotect(), so let's increase the
129  * default stack size. */
130  default_thread_stacksize += p_global->sys_page_size * 2;
131  }
132  p_global->thread_stacksize =
133  ABTU_roundup_size(load_env_size("THREAD_STACKSIZE",
134  default_thread_stacksize, 512,
135  ABTD_ENV_SIZE_MAX),
137 
138  /* ABT_SCHED_STACKSIZE, ABT_ENV_SCHED_STACKSIZE
139  * Default stack size for scheduler */
140  size_t default_sched_stacksize = ABTD_SCHED_DEFAULT_STACKSIZE;
141  if (p_global->stack_guard_kind == ABTI_STACK_GUARD_MPROTECT ||
142  p_global->stack_guard_kind == ABTI_STACK_GUARD_MPROTECT_STRICT) {
143  /* Maximum 2 pages are used for mprotect(), so let's increase the
144  * default stack size. */
145  default_sched_stacksize += p_global->sys_page_size * 2;
146  }
147  p_global->sched_stacksize =
148  ABTU_roundup_size(load_env_size("SCHED_STACKSIZE",
149  default_sched_stacksize, 512,
150  ABTD_ENV_SIZE_MAX),
152 
153  /* ABT_SCHED_EVENT_FREQ, ABT_ENV_SCHED_EVENT_FREQ
154  * Default frequency for event checking by the scheduler */
155  p_global->sched_event_freq =
156  load_env_uint32("SCHED_EVENT_FREQ", ABTD_SCHED_EVENT_FREQ, 1,
157  ABTD_ENV_UINT32_MAX);
158 
159  /* ABT_SCHED_SLEEP_NSEC, ABT_ENV_SCHED_SLEEP_NSEC
160  * Default nanoseconds for scheduler sleep */
161  p_global->sched_sleep_nsec =
162  load_env_uint64("SCHED_SLEEP_NSEC", ABTD_SCHED_SLEEP_NSEC, 0,
163  ABTD_ENV_UINT64_MAX);
164 
165  /* ABT_MUTEX_MAX_HANDOVERS, ABT_ENV_MUTEX_MAX_HANDOVERS
166  * Default maximum number of mutex handover */
167  p_global->mutex_max_handovers =
168  load_env_uint32("MUTEX_MAX_HANDOVERS", 64, 1, ABTD_ENV_UINT32_MAX);
169 
170  /* ABT_MUTEX_MAX_WAKEUPS, ABT_ENV_MUTEX_MAX_WAKEUPS
171  * Default maximum number of mutex wakeup operations */
172  p_global->mutex_max_wakeups =
173  load_env_uint32("MUTEX_MAX_WAKEUPS", 1, 1, ABTD_ENV_UINT32_MAX);
174 
175  /* ABT_PRINT_RAW_STACK, ABT_ENV_PRINT_RAW_STACK */
176  ABT_bool default_print_raw_stack = ABT_TRUE;
177 #ifdef ABT_CONFIG_DISABLE_STACK_UNWIND_DUMP_RAW_STACK
178  default_print_raw_stack = ABT_FALSE;
179 #endif
180  p_global->print_raw_stack =
181  load_env_bool("PRINT_RAW_STACK", default_print_raw_stack);
182  /* ABT_HUGE_PAGE_SIZE, ABT_ENV_HUGE_PAGE_SIZE
183  * Huge page size */
184  size_t default_huge_page_size = (ABT_CONFIG_SYS_HUGE_PAGE_SIZE != 0)
186  : ABTD_HUGE_PAGE_SIZE;
187  p_global->huge_page_size =
188  load_env_size("HUGE_PAGE_SIZE", default_huge_page_size, 4096,
189  ABTD_ENV_SIZE_MAX);
190 
191 #ifdef ABT_CONFIG_USE_MEM_POOL
192  /* ABT_MEM_PAGE_SIZE, ABT_ENV_MEM_PAGE_SIZE
193  * Page size for memory allocation. It must be 2^N. */
194  p_global->mem_page_size = roundup_pow2_size(
195  ABTU_roundup_size(load_env_size("MEM_PAGE_SIZE", ABTD_MEM_PAGE_SIZE,
196  4096, ABTD_ENV_SIZE_MAX),
198 
199  /* ABT_MEM_STACK_PAGE_SIZE, ABT_ENV_MEM_STACK_PAGE_SIZE
200  * Stack page size for memory allocation */
201  p_global->mem_sp_size =
202  ABTU_roundup_size(load_env_size("MEM_STACK_PAGE_SIZE",
203  ABTD_MEM_STACK_PAGE_SIZE,
204  p_global->thread_stacksize * 4,
205  ABTD_ENV_SIZE_MAX),
207 
208  /* ABT_MEM_MAX_NUM_STACKS, ABT_ENV_MEM_MAX_NUM_STACKS
209  * Maximum number of stacks that each ES can keep during execution. */
210  /* If each execution stream caches too many stacks in total, let's reduce
211  * the max # of stacks. */
212  const uint32_t default_mem_max_stacks =
213  ABTU_min_uint32(ABTD_MEM_MAX_TOTAL_STACK_SIZE /
214  p_global->thread_stacksize,
215  ABTD_MEM_MAX_NUM_STACKS);
216  /* The value must be a multiple of ABT_MEM_POOL_MAX_LOCAL_BUCKETS. */
217  p_global->mem_max_stacks =
218  ABTU_roundup_uint32(load_env_uint32("MEM_MAX_NUM_STACKS",
219  default_mem_max_stacks,
221  ABTD_ENV_UINT32_MAX),
223 
224  /* ABT_MEM_MAX_NUM_DESCS, ABT_ENV_MEM_MAX_NUM_DESCS
225  * Maximum number of descriptors that each ES can keep during execution */
226  /* The value must be a multiple of ABT_MEM_POOL_MAX_LOCAL_BUCKETS. */
227  p_global->mem_max_descs =
228  ABTU_roundup_uint32(load_env_uint32("MEM_MAX_NUM_DESCS",
229  ABTD_MEM_MAX_NUM_DESCS,
231  ABTD_ENV_UINT32_MAX),
233 
234  /* ABT_MEM_LP_ALLOC, ABT_ENV_MEM_LP_ALLOC
235  * How to allocate large pages. The default is to use mmap() for huge
236  * pages and then to fall back to allocate regular pages using mmap() when
237  * huge pages are run out of. */
238  int lp_alloc;
239 #if defined(HAVE_MAP_ANONYMOUS) || defined(HAVE_MAP_ANON)
240  /*
241  * To use hugepage, mmap() needs a correct size of hugepage; otherwise,
242  * an error happens on "munmap()" (not mmap()).
243  */
244  if (get_abt_env("HUGE_PAGE_SIZE")) {
245  /* If the explicitly user explicitly sets the huge page size via the
246  * environmental variable, we respect that value. It is the user's
247  * responsibility to set a correct huge page size. */
248  lp_alloc = ABTI_MEM_LP_MMAP_HP_RP;
249  } else {
250  /* Let's use huge page when both of the following conditions are met:
251  * 1. Huge page is actually usable (ABT_CONFIG_USE_HUGE_PAGE_DEFAULT).
252  * 2. The huge page size is not too large (e.g., some systems use 512 MB
253  * huge page, which is too big for the default setting). */
254 #ifdef ABT_CONFIG_USE_HUGE_PAGE_DEFAULT
255  if (4096 <= ABT_CONFIG_SYS_HUGE_PAGE_SIZE &&
256  ABT_CONFIG_SYS_HUGE_PAGE_SIZE <= 8 * 1024 * 1024) {
257  lp_alloc = ABTI_MEM_LP_MMAP_HP_RP;
258  } else {
259  lp_alloc = ABTI_MEM_LP_MMAP_RP;
260  }
261 #else
262  /* Huge page allocation failed at configuration time. Don't use it.*/
263  lp_alloc = ABTI_MEM_LP_MMAP_RP;
264 #endif
265  }
266 #else
267  /* We cannot use mmap(). Let's use a normal malloc(). */
268  lp_alloc = ABTI_MEM_LP_MALLOC;
269 #endif
270  env = get_abt_env("MEM_LP_ALLOC");
271  if (env != NULL) {
272  if (strcasecmp(env, "malloc") == 0) {
273  lp_alloc = ABTI_MEM_LP_MALLOC;
274 #if defined(HAVE_MAP_ANONYMOUS) || defined(HAVE_MAP_ANON)
275  } else if (strcasecmp(env, "mmap_rp") == 0) {
276  lp_alloc = ABTI_MEM_LP_MMAP_RP;
277  } else if (strcasecmp(env, "mmap_hp_rp") == 0) {
278  lp_alloc = ABTI_MEM_LP_MMAP_HP_RP;
279  } else if (strcasecmp(env, "mmap_hp_thp") == 0) {
280  lp_alloc = ABTI_MEM_LP_MMAP_HP_THP;
281 #endif
282  } else if (strcasecmp(env, "thp") == 0) {
283  lp_alloc = ABTI_MEM_LP_THP;
284  }
285  }
286 
287  /* Check if the requested allocation method is really possible. */
288  if (lp_alloc != ABTI_MEM_LP_MALLOC) {
289  p_global->mem_lp_alloc = ABTI_mem_check_lp_alloc(p_global, lp_alloc);
290  } else {
291  p_global->mem_lp_alloc = lp_alloc;
292  }
293 #endif
294 
295  /* ABT_PRINT_CONFIG, ABT_ENV_PRINT_CONFIG
296  * Whether to print the configuration on ABT_init() */
297  p_global->print_config = load_env_bool("PRINT_CONFIG", ABT_FALSE);
298 
299  /* Init timer */
300  ABTD_time_init();
301 }
302 
303 /*****************************************************************************/
304 /* Internal static functions */
305 /*****************************************************************************/
306 
307 static uint32_t roundup_pow2_uint32(uint32_t val)
308 {
309  /* 3 -> 4
310  * 4 -> 4
311  * 5 -> 8 */
312  if (val == 0)
313  return 0;
314  uint32_t i;
315  for (i = 0; i < sizeof(uint32_t) * 8 - 1; i++) {
316  if ((val - 1) >> i == 0)
317  break;
318  }
319  return ((uint32_t)1) << i;
320 }
321 
322 static size_t roundup_pow2_size(size_t val)
323 {
324  if (val == 0)
325  return 0;
326  size_t i;
327  for (i = 0; i < sizeof(size_t) * 8 - 1; i++) {
328  if ((val - 1) >> i == 0)
329  break;
330  }
331  return ((size_t)1) << i;
332 }
333 
334 static const char *get_abt_env(const char *env_suffix)
335 {
336  /* Valid prefix is ABT_ and ABT_ENV_. ABT_ is prioritized. */
337  char buffer[128];
338  const char *prefixes[] = { "ABT_", "ABT_ENV_" };
339  uint32_t i;
340  for (i = 0; i < sizeof(prefixes) / sizeof(prefixes[0]); i++) {
341  int prefix_size = strlen(prefixes[i]);
342  int env_suffix_size = strlen(env_suffix);
343  if (prefix_size + env_suffix_size + 1 <= (int)sizeof(buffer)) {
344  memcpy(buffer, prefixes[i], prefix_size);
345  memcpy(buffer + prefix_size, env_suffix, env_suffix_size);
346  buffer[prefix_size + env_suffix_size] = '\0';
347  const char *env = getenv(buffer);
348  if (env)
349  return env;
350  }
351  }
352  return NULL;
353 }
354 
355 static ABT_bool is_false(const char *str, ABT_bool include0)
356 {
357  if (include0 && strcmp(str, "0") == 0) {
358  return ABT_TRUE;
359  } else if (strcasecmp(str, "n") == 0 || strcasecmp(str, "no") == 0 ||
360  strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0) {
361  return ABT_TRUE;
362  }
363  return ABT_FALSE;
364 }
365 
366 static ABT_bool is_true(const char *str, ABT_bool include1)
367 {
368  if (include1 && strcmp(str, "1") == 0) {
369  return ABT_TRUE;
370  } else if (strcasecmp(str, "y") == 0 || strcasecmp(str, "yes") == 0 ||
371  strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0) {
372  return ABT_TRUE;
373  }
374  return ABT_FALSE;
375 }
376 
377 static ABT_bool load_env_bool(const char *env_suffix, ABT_bool default_val)
378 {
379  const char *env = get_abt_env(env_suffix);
380  if (!env) {
381  return default_val;
382  } else {
383  if (default_val) {
384  /* If env is not "false", return true */
385  return is_false(env, ABT_TRUE) ? ABT_FALSE : ABT_TRUE;
386  } else {
387  /* If env is not "true", return false */
388  return is_true(env, ABT_TRUE) ? ABT_TRUE : ABT_FALSE;
389  }
390  }
391 }
392 
393 static int load_env_int(const char *env_suffix, int default_val, int min_val,
394  int max_val)
395 {
396  const char *env = get_abt_env(env_suffix);
397  if (!env) {
398  return ABTU_max_int(min_val, ABTU_min_int(max_val, default_val));
399  } else {
400  int val;
401  int abt_errno = ABTU_atoi(env, &val, NULL);
402  if (abt_errno != ABT_SUCCESS) {
403  return ABTU_max_int(min_val, ABTU_min_int(max_val, default_val));
404  } else {
405  return ABTU_max_int(min_val, ABTU_min_int(max_val, val));
406  }
407  }
408 }
409 
410 static uint32_t load_env_uint32(const char *env_suffix, uint32_t default_val,
411  uint32_t min_val, uint32_t max_val)
412 {
413  const char *env = get_abt_env(env_suffix);
414  if (!env) {
415  return ABTU_max_uint32(min_val, ABTU_min_uint32(max_val, default_val));
416  } else {
417  uint32_t val;
418  int abt_errno = ABTU_atoui32(env, &val, NULL);
419  if (abt_errno != ABT_SUCCESS) {
420  return ABTU_max_uint32(min_val,
421  ABTU_min_uint32(max_val, default_val));
422  } else {
423  return ABTU_max_uint32(min_val, ABTU_min_uint32(max_val, val));
424  }
425  }
426 }
427 
428 static uint64_t load_env_uint64(const char *env_suffix, uint64_t default_val,
429  uint64_t min_val, uint64_t max_val)
430 {
431  const char *env = get_abt_env(env_suffix);
432  if (!env) {
433  return ABTU_max_uint64(min_val, ABTU_min_uint64(max_val, default_val));
434  } else {
435  uint64_t val;
436  int abt_errno = ABTU_atoui64(env, &val, NULL);
437  if (abt_errno != ABT_SUCCESS) {
438  return ABTU_max_uint64(min_val,
439  ABTU_min_uint64(max_val, default_val));
440  } else {
441  return ABTU_max_uint64(min_val, ABTU_min_uint64(max_val, val));
442  }
443  }
444 }
445 
446 static size_t load_env_size(const char *env_suffix, size_t default_val,
447  size_t min_val, size_t max_val)
448 {
449  const char *env = get_abt_env(env_suffix);
450  if (!env) {
451  return ABTU_max_size(min_val, ABTU_min_size(max_val, default_val));
452  } else {
453  size_t val;
454  int abt_errno = ABTU_atosz(env, &val, NULL);
455  if (abt_errno != ABT_SUCCESS) {
456  return ABTU_max_size(min_val, ABTU_min_size(max_val, default_val));
457  } else {
458  return ABTU_max_size(min_val, ABTU_min_size(max_val, val));
459  }
460  }
461 }
load_env_uint64
static uint64_t load_env_uint64(const char *env_suffix, uint64_t default_val, uint64_t min_val, uint64_t max_val)
Definition: abtd_env.c:428
load_env_uint32
static uint32_t load_env_uint32(const char *env_suffix, uint32_t default_val, uint32_t min_val, uint32_t max_val)
Definition: abtd_env.c:410
ABTU_max_size
static size_t ABTU_max_size(size_t a, size_t b)
Definition: abtu.h:40
ABTU_min_int
static int ABTU_min_int(int a, int b)
Definition: abtu.h:45
ABT_bool
int ABT_bool
Boolean type.
Definition: abt.h:1001
ABTU_max_uint64
static uint64_t ABTU_max_uint64(uint64_t a, uint64_t b)
Definition: abtu.h:35
is_true
static ABT_bool is_true(const char *str, ABT_bool include1)
Definition: abtd_env.c:366
ABTU_max_int
static int ABTU_max_int(int a, int b)
Definition: abtu.h:15
ABTU_roundup_size
static size_t ABTU_roundup_size(size_t val, size_t multiple)
Definition: abtu.h:95
load_env_size
static size_t load_env_size(const char *env_suffix, size_t default_val, size_t min_val, size_t max_val)
Definition: abtd_env.c:446
ABTU_min_size
static size_t ABTU_min_size(size_t a, size_t b)
Definition: abtu.h:70
ABT_MEM_POOL_MAX_LOCAL_BUCKETS
#define ABT_MEM_POOL_MAX_LOCAL_BUCKETS
Definition: abti_mem_pool.h:9
roundup_pow2_size
static size_t roundup_pow2_size(size_t val)
Definition: abtd_env.c:322
ABTU_min_uint64
static uint64_t ABTU_min_uint64(uint64_t a, uint64_t b)
Definition: abtu.h:65
roundup_pow2_uint32
static uint32_t roundup_pow2_uint32(uint32_t val)
Definition: abtd_env.c:307
load_env_int
static int load_env_int(const char *env_suffix, int default_val, int min_val, int max_val)
Definition: abtd_env.c:393
is_false
static ABT_bool is_false(const char *str, ABT_bool include0)
Definition: abtd_env.c:355
ABTU_max_uint32
static uint32_t ABTU_max_uint32(uint32_t a, uint32_t b)
Definition: abtu.h:25
ABTU_atoui64
ABTU_ret_err int ABTU_atoui64(const char *str, uint64_t *p_val, ABT_bool *p_overflow)
Definition: atoi.c:65
get_abt_env
static const char * get_abt_env(const char *env_suffix)
Definition: abtd_env.c:334
abti.h
ABT_CONFIG_STATIC_CACHELINE_SIZE
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
Definition: abt_config.h:78
ABT_SUCCESS
#define ABT_SUCCESS
Error code: the routine returns successfully.
Definition: abt.h:92
ABTU_atoui32
ABTU_ret_err int ABTU_atoui32(const char *str, uint32_t *p_val, ABT_bool *p_overflow)
Definition: atoi.c:39
ABT_TRUE
#define ABT_TRUE
True constant for ABT_bool.
Definition: abt.h:748
ABTU_atoi
ABTU_ret_err int ABTU_atoi(const char *str, int *p_val, ABT_bool *p_overflow)
Definition: atoi.c:11
ABT_FALSE
#define ABT_FALSE
False constant for ABT_bool.
Definition: abt.h:750
ABT_CONFIG_SYS_HUGE_PAGE_SIZE
#define ABT_CONFIG_SYS_HUGE_PAGE_SIZE
Definition: abt_config.h:81
load_env_bool
static ABT_bool load_env_bool(const char *env_suffix, ABT_bool default_val)
Definition: abtd_env.c:377
ABTU_atosz
ABTU_ret_err int ABTU_atosz(const char *str, size_t *p_val, ABT_bool *p_overflow)
Definition: atoi.c:85
ABTU_min_uint32
static uint32_t ABTU_min_uint32(uint32_t a, uint32_t b)
Definition: abtu.h:55
ABTU_roundup_uint32
static uint32_t ABTU_roundup_uint32(uint32_t val, uint32_t multiple)
Definition: abtu.h:75