Skip to content

Commit

Permalink
UCS/CONFIG: Use uint64_t to parse configuration bitmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
tvegas1 committed Sep 2, 2024
1 parent 173b905 commit 8a84af8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ucm/api/ucm.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ typedef struct ucm_global_config {
ucm_mmap_hook_mode_t mmap_hook_mode; /* MMAP hook mode */
int enable_malloc_hooks; /* Enable installing malloc hooks */
int enable_malloc_reloc; /* Enable installing malloc relocations */
int cuda_hook_modes; /* Bitmap of allowed cuda hooks modes */
uint64_t cuda_hook_modes; /* Bitmap of allowed cuda hooks modes */
int enable_dynamic_mmap_thresh; /* Enable adaptive mmap threshold */
size_t alloc_alignment; /* Alignment for memory allocations */
int dlopen_process_rpath; /* Process RPATH section in dlopen hook */
Expand Down
2 changes: 1 addition & 1 deletion src/ucp/core/ucp_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ typedef struct ucp_context_config {
/** Enable indirect IDs to object pointers in wire protocols */
ucs_on_off_auto_value_t proto_indirect_id;
/** Bitmap of memory types whose allocations are registered fully */
unsigned reg_whole_alloc_bitmap;
uint64_t reg_whole_alloc_bitmap;
/** Always use flush operation in rendezvous put */
int rndv_put_force_flush;
/** Maximum size of mem type direct rndv*/
Expand Down
4 changes: 2 additions & 2 deletions src/ucs/config/global_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef struct {
int mpool_fifo;

/* Handle errors mode */
unsigned handle_errors;
uint64_t handle_errors;

/* Error signals */
UCS_CONFIG_ARRAY_FIELD(int, signals) error_signals;
Expand Down Expand Up @@ -105,7 +105,7 @@ typedef struct {
size_t memtrack_limit;

/* Profiling mode */
unsigned profile_mode;
uint64_t profile_mode;

/* Profiling output file name */
char *profile_file;
Expand Down
9 changes: 6 additions & 3 deletions src/ucs/config/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,18 @@ int ucs_config_sscanf_bitmap(const char *buf, void *dest, const void *arg)
}

ret = 1;
*((unsigned*)dest) = 0;
*((uint64_t*)dest) = 0;
p = strtok_r(str, ",", &saveptr);
while (p != NULL) {
i = ucs_string_find_in_list(p, (const char**)arg, 0);
if (i < 0) {
ret = 0;
break;
}
*((unsigned*)dest) |= UCS_BIT(i);

ucs_assertv(i < (sizeof(uint64_t) * 8), "bit %d overflows for '%s'", i,
p);
*((uint64_t*)dest) |= UCS_BIT(i);
p = strtok_r(NULL, ",", &saveptr);
}

Expand All @@ -462,7 +465,7 @@ int ucs_config_sscanf_bitmap(const char *buf, void *dest, const void *arg)
int ucs_config_sprintf_bitmap(char *buf, size_t max,
const void *src, const void *arg)
{
ucs_flags_str(buf, max, *((unsigned*)src), (const char**)arg);
ucs_flags_str(buf, max, *((uint64_t*)src), (const char**)arg);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/uct/ib/base/ib_md.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ typedef struct uct_ib_md_config {

int mlx5dv; /**< mlx5 support */
int devx; /**< DEVX support */
unsigned devx_objs; /**< Objects to be created by DevX */
uint64_t devx_objs; /**< Objects to be created by DevX */
ucs_ternary_auto_value_t mr_relaxed_order; /**< Allow reorder memory accesses */
int enable_gpudirect_rdma; /**< Enable GPUDirect RDMA */
int xgvmi_umr_enable; /**< Enable UMR workflow for XGVMI */
Expand Down

0 comments on commit 8a84af8

Please sign in to comment.