Skip to content

Commit

Permalink
UTIL: add parser doc (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev authored Feb 29, 2024
1 parent 8ab35ce commit dab6623
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/m4/ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ AS_IF([test "x$ucx_checked" != "xyes"],[
[AC_DEFINE([UCS_HAVE_PARSER_SET_VALUE_TABLE_PREFIX], [1], [flags for ucs_rcache_get])],
[])
AC_CHECK_MEMBER(ucs_config_parser_t.doc,
[AC_DEFINE([UCS_HAVE_PARSER_CONFIG_DOC], [1], [flags for ucs_rcache_get])],
[],
[#include <ucs/memory/rcache.h>])
],
[
AS_IF([test "x$with_ucx" != "xguess"],
Expand Down
24 changes: 23 additions & 1 deletion src/utils/ucc_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,29 @@ int ucc_config_sprintf_uint_ranged(char *buf, size_t max, const void *src,
ucs_status_t ucc_config_clone_uint_ranged(const void *src, void *dest,
const void *arg);

void ucc_config_release_uint_ranged(void *ptr, const void *arg);
void ucc_config_release_uint_ranged(void *ptr, const void *arg);

#ifdef UCS_HAVE_PARSER_CONFIG_DOC
#define UCC_CONFIG_TYPE_UINT_RANGED \
{ \
ucc_config_sscanf_uint_ranged, ucc_config_sprintf_uint_ranged, \
ucc_config_clone_uint_ranged, ucc_config_release_uint_ranged, \
ucs_config_help_generic, ucs_config_doc_nop, \
"[<munit>-<munit>:[mtype]:value," \
"<munit>-<munit>:[mtype]:value,...,]default_value\n" \
"# value and default_value can be \"auto\"" \
}

#define UCC_CONFIG_TYPE_PIPELINE_PARAMS \
{ \
ucc_config_sscanf_pipeline_params, ucc_config_sprintf_pipeline_params, \
ucc_config_clone_pipeline_params, \
ucc_config_release_pipeline_params, ucs_config_help_generic, \
ucs_config_doc_nop, \
"thresh=<memunit>:fragsize=<memunit>:nfrags=" \
"<uint>:pdepth=<uint>:<ordered/parallel/sequential>" \
}
#else
#define UCC_CONFIG_TYPE_UINT_RANGED \
{ \
ucc_config_sscanf_uint_ranged, ucc_config_sprintf_uint_ranged, \
Expand All @@ -289,3 +310,4 @@ void ucc_config_release_uint_ranged(void *ptr, const void *arg);
}

#endif
#endif

0 comments on commit dab6623

Please sign in to comment.