Skip to content

Commit

Permalink
Applies results of autoformatting to repo + manually divides includes…
Browse files Browse the repository at this point in the history
… into groups
  • Loading branch information
ilumsden committed Dec 16, 2024
1 parent a7c4ec9 commit c0ea2b2
Show file tree
Hide file tree
Showing 25 changed files with 2,324 additions and 2,223 deletions.
16 changes: 8 additions & 8 deletions include/dyad/common/dyad_dtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
extern "C" {
#endif


enum dyad_dtl_mode { DYAD_DTL_UCX = 0,
DYAD_DTL_FLUX_RPC = 1,
DYAD_DTL_DEFAULT = 1,
DYAD_DTL_END = 2 };
enum dyad_dtl_mode {
DYAD_DTL_UCX = 0,
DYAD_DTL_FLUX_RPC = 1,
DYAD_DTL_DEFAULT = 1,
DYAD_DTL_END = 2
};
typedef enum dyad_dtl_mode dyad_dtl_mode_t;

static const char* dyad_dtl_mode_name[DYAD_DTL_END+1] __attribute__((unused))
= {"UCX", "FLUX_RPC", "DTL_UNKNOWN"};
static const char* dyad_dtl_mode_name[DYAD_DTL_END + 1]
__attribute__ ((unused)) = {"UCX", "FLUX_RPC", "DTL_UNKNOWN"};

enum dyad_dtl_comm_mode {
DYAD_COMM_NONE = 0, // Sanity check value for when
Expand All @@ -30,7 +31,6 @@ enum dyad_dtl_comm_mode {
};
typedef enum dyad_dtl_comm_mode dyad_dtl_comm_mode_t;


#define DYAD_DTL_RPC_NAME "dyad.fetch"

struct dyad_dtl;
Expand Down
43 changes: 21 additions & 22 deletions include/dyad/common/dyad_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ extern "C" {
#endif

enum dyad_core_return_codes {
DYAD_RC_OK = 0, // Operation worked correctly
DYAD_RC_SYSFAIL = -1, // Some sys call or C standard
// library call failed
DYAD_RC_OK = 0, // Operation worked correctly
DYAD_RC_SYSFAIL = -1, // Some sys call or C standard
// library call failed
// Internal
DYAD_RC_NOCTX = -1000, // No DYAD Context found
DYAD_RC_BADMETADATA = -1001, // Cannot create/populate a DYAD response
Expand All @@ -42,27 +42,26 @@ enum dyad_core_return_codes {
DYAD_RC_BAD_CLI_PARSE = -1009, // Trying to parse CLI arguments failed
DYAD_RC_BADBUF = -1010, // Invalid buffer/pointer passed to function


// FLUX
DYAD_RC_FLUXFAIL = -2000, // Some Flux function failed
DYAD_RC_BADCOMMIT = -2001, // Flux KVS commit didn't work
DYAD_RC_NOTFOUND = -2002, // Flux KVS lookup didn't work
DYAD_RC_BADFETCH = -2003, // Flux KVS commit didn't work
DYAD_RC_BADRPC = -2004, // Flux RPC pack or get didn't work
DYAD_RC_BADPACK = -2005, // JSON packing failed
DYAD_RC_BADUNPACK = -2006, // JSON unpacking failed
DYAD_RC_RPC_FINISHED = -2007, // The Flux RPC responded with ENODATA (i.e.,
// end of stream) sooner than expected
DYAD_RC_FLUXFAIL = -2000, // Some Flux function failed
DYAD_RC_BADCOMMIT = -2001, // Flux KVS commit didn't work
DYAD_RC_NOTFOUND = -2002, // Flux KVS lookup didn't work
DYAD_RC_BADFETCH = -2003, // Flux KVS commit didn't work
DYAD_RC_BADRPC = -2004, // Flux RPC pack or get didn't work
DYAD_RC_BADPACK = -2005, // JSON packing failed
DYAD_RC_BADUNPACK = -2006, // JSON unpacking failed
DYAD_RC_RPC_FINISHED = -2007, // The Flux RPC responded with ENODATA (i.e.,
// end of stream) sooner than expected

//UCX
DYAD_RC_UCXINIT_FAIL = -3001, // UCX initialization failed
DYAD_RC_UCXWAIT_FAIL = -3002, // UCX wait (either custom or
// 'ucp_worker_wait') failed
DYAD_RC_UCXEP_FAIL = -3003, // An operation on a ucp_ep_h failed
DYAD_RC_UCXCOMM_FAIL = -3004, // UCX communication routine failed
DYAD_RC_UCXMMAP_FAIL = -3005, // Failed to perform operations with ucp_mem_map
DYAD_RC_UCXRKEY_PACK_FAILED = -3006, // Failed to perform operations with ucp_mem_map
DYAD_RC_UCXRKEY_UNPACK_FAILED = -3007, // Failed to perform operations with ucp_mem_map
// UCX
DYAD_RC_UCXINIT_FAIL = -3001, // UCX initialization failed
DYAD_RC_UCXWAIT_FAIL = -3002, // UCX wait (either custom or
// 'ucp_worker_wait') failed
DYAD_RC_UCXEP_FAIL = -3003, // An operation on a ucp_ep_h failed
DYAD_RC_UCXCOMM_FAIL = -3004, // UCX communication routine failed
DYAD_RC_UCXMMAP_FAIL = -3005, // Failed to perform operations with ucp_mem_map
DYAD_RC_UCXRKEY_PACK_FAILED = -3006, // Failed to perform operations with ucp_mem_map
DYAD_RC_UCXRKEY_UNPACK_FAILED = -3007, // Failed to perform operations with ucp_mem_map

};

Expand Down
46 changes: 27 additions & 19 deletions include/dyad/core/dyad_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ extern "C" {

DYAD_DLL_EXPORTED extern const struct dyad_ctx dyad_ctx_default;

DYAD_DLL_EXPORTED dyad_ctx_t *dyad_ctx_get();
DYAD_DLL_EXPORTED void dyad_ctx_init(dyad_dtl_comm_mode_t dtl_comm_mode,
void *flux_handle);
DYAD_DLL_EXPORTED void dyad_ctx_fini();
DYAD_DLL_EXPORTED dyad_ctx_t *dyad_ctx_get ();
DYAD_DLL_EXPORTED void dyad_ctx_init (dyad_dtl_comm_mode_t dtl_comm_mode, void *flux_handle);
DYAD_DLL_EXPORTED void dyad_ctx_fini ();

/**
* @brief Intialize the DYAD context
Expand All @@ -47,37 +46,46 @@ DYAD_DLL_EXPORTED void dyad_ctx_fini();
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_init(
bool debug, bool check, bool shared_storage, bool reinit,
bool async_publish, bool fsync_write, unsigned int key_depth,
unsigned int key_bins, unsigned int service_mux, const char *kvs_namespace,
const char *prod_managed_path, const char *cons_managed_path,
bool relative_to_managed_path, const char *dtl_mode_str,
const dyad_dtl_comm_mode_t dtl_comm_mode, void *flux_handle);
DYAD_DLL_EXPORTED dyad_rc_t dyad_init (bool debug,
bool check,
bool shared_storage,
bool reinit,
bool async_publish,
bool fsync_write,
unsigned int key_depth,
unsigned int key_bins,
unsigned int service_mux,
const char *kvs_namespace,
const char *prod_managed_path,
const char *cons_managed_path,
bool relative_to_managed_path,
const char *dtl_mode_str,
const dyad_dtl_comm_mode_t dtl_comm_mode,
void *flux_handle);

/**
* @brief Intialize the DYAD context using environment variables
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t
dyad_init_env(const dyad_dtl_comm_mode_t dtl_comm_mode, void *flux_handle);
DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t dtl_comm_mode,
void *flux_handle);

/**
* @brief Reset producer path. Can be used by the module
* @param[in] producer path string
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_prod_path(const char *path);
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_prod_path (const char *path);

/**
* @brief Reset consumer path. Can be used by the module
* @param[in] consumer path string
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_cons_path(const char *path);
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_cons_path (const char *path);

/**
* @brief Reset dtl mode. Can be used by the module
Expand All @@ -86,23 +94,23 @@ DYAD_DLL_EXPORTED dyad_rc_t dyad_set_cons_path(const char *path);
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_and_init_dtl_mode(
const char *dtl_mode_name, dyad_dtl_comm_mode_t dtl_comm_mode);
DYAD_DLL_EXPORTED dyad_rc_t dyad_set_and_init_dtl_mode (const char *dtl_mode_name,
dyad_dtl_comm_mode_t dtl_comm_mode);

/**
* Reset the contents of the ctx to the default values and deallocate
* internal objects linked. However, do not destroy the ctx object itself.
* This is needed for wrapper to handle dyad exceptions as the wrapper requires
* ctx for it's lifetime
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_clear();
DYAD_DLL_EXPORTED dyad_rc_t dyad_clear ();

/**
* @brief Finalizes the DYAD instance and deallocates the context
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_finalize();
DYAD_DLL_EXPORTED dyad_rc_t dyad_finalize ();

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion include/dyad/stream/dyad_params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace dyad
struct dyad_params {
bool m_debug;
/** Indicate if the storage associated with the managed path is shared
* (i.e. visible to all ranks) */
* (i.e. visible to all ranks) */
bool m_shared_storage;
/// Indicate if reinitialization is required even if already initinialized
bool m_reinit;
Expand Down
Loading

0 comments on commit c0ea2b2

Please sign in to comment.