Skip to content

Commit

Permalink
Make sure that either of prod/cons managed path env is set before ini…
Browse files Browse the repository at this point in the history
…t module
  • Loading branch information
JaeseungYeom committed Feb 15, 2024
1 parent b3cd0fc commit 09212b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pydyad/pydyad/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(self):

self.dyad_init_env = self.dyad_ctx_lib.dyad_init_env
self.dyad_init_env.argtypes = [
ctypes.c_inti, # dtl_comm_mode
ctypes.c_int, # dtl_comm_mode
ctypes.c_void_p # flux_handle
]
self.dyad_init_env.restype = ctypes.c_int
Expand Down Expand Up @@ -228,7 +228,7 @@ def init(
cons_managed_path=None,
relative_to_managed_path=False,
dtl_mode=None,
dtl_comm_mode=DTL_COMM_RECV,
dtl_comm_mode=DTLCommMode.DYAD_COMM_RECV,
flux_handle=None
):
self.log_inst = dlio_logger.initialize_log(logfile=None, data_dir=None, process_id=-1)
Expand Down
12 changes: 6 additions & 6 deletions src/dyad/core/dyad_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ DYAD_DLL_EXPORTED dyad_ctx_t* dyad_ctx_get ()
return ctx;
}

DYAD_DLL_EXPORTED void dyad_ctx_init (const dyad_dtl_comm_mode_t comm_mode,
DYAD_DLL_EXPORTED void dyad_ctx_init (const dyad_dtl_comm_mode_t dtl_comm_mode,
void* flux_handle)
{

Expand All @@ -87,7 +87,7 @@ DYAD_DLL_EXPORTED void dyad_ctx_init (const dyad_dtl_comm_mode_t comm_mode,
DYAD_C_FUNCTION_START();
dyad_rc_t rc = DYAD_RC_OK;

rc = dyad_init_env (comm_mode, flux_handle);
rc = dyad_init_env (dtl_comm_mode, flux_handle);

if (DYAD_IS_ERROR (rc)) {
fprintf (stderr, "Failed to initialize DYAD (code = %d)", rc);
Expand Down Expand Up @@ -324,7 +324,7 @@ init_region_finish:;
return rc;
}

DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t comm_mode,
DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t dtl_comm_mode,
void* flux_handle)
{
DYAD_C_FUNCTION_START();
Expand Down Expand Up @@ -452,14 +452,14 @@ DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t comm_mode
cons_managed_path,
relative_to_managed_path,
dtl_mode,
comm_mode,
dtl_comm_mode,
flux_handle);
DYAD_C_FUNCTION_END();
return rc;
}

DYAD_DLL_EXPORTED dyad_rc_t dyad_set_and_init_dtl_mode (const char* dtl_name,
dyad_dtl_comm_mode_t comm_mode)
dyad_dtl_comm_mode_t dtl_comm_mode)
{
int rc = DYAD_RC_OK;
size_t dtl_name_len = 0ul;
Expand Down Expand Up @@ -493,7 +493,7 @@ DYAD_DLL_EXPORTED dyad_rc_t dyad_set_and_init_dtl_mode (const char* dtl_name,
goto set_and_init_dtl_mode_region_finish;
}

rc = dyad_dtl_init (ctx, dtl_mode, comm_mode, ctx->debug);
rc = dyad_dtl_init (ctx, dtl_mode, dtl_comm_mode, ctx->debug);
if (DYAD_IS_ERROR (rc)) {
DYAD_LOG_ERROR (ctx, "Cannot initialize the DTL %s\n", \
dyad_dtl_mode_name[dtl_mode]);
Expand Down
6 changes: 3 additions & 3 deletions src/dyad/core/dyad_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {
#endif

DYAD_DLL_EXPORTED dyad_ctx_t* dyad_ctx_get ();
DYAD_DLL_EXPORTED void dyad_ctx_init (dyad_dtl_comm_mode_t m,
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 ();

Expand Down Expand Up @@ -68,7 +68,7 @@ DYAD_DLL_EXPORTED dyad_rc_t dyad_init (bool debug,
*
* @return An error code from dyad_rc.h
*/
DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t comm_mode,
DYAD_DLL_EXPORTED dyad_rc_t dyad_init_env (const dyad_dtl_comm_mode_t dtl_comm_mode,
void* flux_handle);

/**
Expand All @@ -95,7 +95,7 @@ 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 comm_mode);
dyad_dtl_comm_mode_t dtl_comm_mode);

/**
* Reset the contents of the ctx to the default values and deallocate
Expand Down

0 comments on commit 09212b3

Please sign in to comment.