Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: fixes CI by correcting cpp-logger and DLIO profiler/dftracer stuff #117

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ else ()
message(FATAL_ERROR "-- [${PROJECT_NAME}] FluxCore is needed for ${PROJECT_NAME} build")
endif ()
find_package(Jansson 2.10 REQUIRED)
if (${JANSSON_FOUND})
if (${JANSSON_FOUND}) # Note: this find_package does not properly name its '_FOUND' variable. This is the correct name
message(STATUS "[${PROJECT_NAME}] found Jansson at ${JANSSON_INCLUDE_DIRS}")
else ()
message(FATAL_ERROR "-- [${PROJECT_NAME}] Jansson is needed for ${PROJECT_NAME} build")
Expand All @@ -231,7 +231,7 @@ if (DYAD_LOGGER STREQUAL "CPP_LOGGER")
${CPP_LOGGER_PATH} ${cpp-logger_PATH}
$ENV{CPP_LOGGER_DIR} $ENV{cpp-logger_DIR}
$ENV{CPP_LOGGER_PATH} $ENV{cpp-logger_PATH})
if (${CPP_LOGGER_FOUND})
if (${cpp-logger_FOUND})
ilumsden marked this conversation as resolved.
Show resolved Hide resolved
message(STATUS "[${PROJECT_NAME}] found cpp-logger at ${CPP_LOGGER_INCLUDE_DIRS}")
include_directories(${CPP_LOGGER_INCLUDE_DIRS})
set(DEPENDENCY_LIB ${DEPENDENCY_LIB} ${CPP_LOGGER_LIBRARIES})
Expand Down
24 changes: 12 additions & 12 deletions pydyad/pydyad/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import enum
from pathlib import Path
import warnings
from dlio_profiler.logger import dlio_logger, fn_interceptor
dlio_log = fn_interceptor("DYAD_PY")
from dftracer.logger import dftracer, dft_fn
dft_log = dft_fn("DYAD_PY")

DYAD_LIB_DIR = None

Expand Down Expand Up @@ -94,7 +94,7 @@ class DTLCommMode(enum.IntEnum):


class Dyad:
@dlio_log.log_init
@dft_log.log_init
def __init__(self):
self.initialized = False
self.dyad_core_lib = None
Expand Down Expand Up @@ -211,7 +211,7 @@ def __init__(self):
self.prod_path = None
self.log_inst = None

@dlio_log.log
@dft_log.log
def init(
self,
debug=False,
Expand All @@ -231,7 +231,7 @@ def init(
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)
self.log_inst = dftracer.initialize_log(logfile=None, data_dir=None, process_id=-1)
if self.dyad_init is None:
warnings.warn(
"Trying to initialize DYAD when libdyad_ctx.so was not found",
Expand Down Expand Up @@ -270,7 +270,7 @@ def init(
self.cons_path = Path(self.ctx.contents.cons_managed_path.decode("utf-8")).expanduser().resolve()
self.initialized = True

@dlio_log.log
@dft_log.log
def init_env(
self,
dtl_comm_mode=DTLCommMode.DYAD_COMM_RECV,
Expand Down Expand Up @@ -301,7 +301,7 @@ def init_env(
def __del__(self):
self.finalize()

@dlio_log.log
@dft_log.log
def produce(self, fname):
if self.dyad_produce is None:
warnings.warn(
Expand All @@ -316,7 +316,7 @@ def produce(self, fname):
if int(res) != 0:
raise RuntimeError("Cannot produce data with DYAD!")

@dlio_log.log
@dft_log.log
def get_metadata(self, fname, should_wait=False, raw=False):
if self.dyad_get_metadata is None:
warnings.warn(
Expand All @@ -337,7 +337,7 @@ def get_metadata(self, fname, should_wait=False, raw=False):
return DyadMetadata(mdata, self)
return mdata

@dlio_log.log
@dft_log.log
def free_metadata(self, metadata_wrapper):
if self.dyad_free_metadata is None:
warnings.warn("Trying to free DYAD metadata when libdyad_core.so was not found", RuntimeWarning)
Expand All @@ -348,7 +348,7 @@ def free_metadata(self, metadata_wrapper):
if int(res) != 0:
raise RuntimeError("Could not free DYAD metadata")

@dlio_log.log
@dft_log.log
def consume(self, fname):
if self.dyad_consume is None:
warnings.warn(
Expand All @@ -363,7 +363,7 @@ def consume(self, fname):
if int(res) != 0:
raise RuntimeError("Cannot consume data with DYAD!")

@dlio_log.log
@dft_log.log
def consume_w_metadata(self, fname, metadata_wrapper):
if self.dyad_consume is None:
warnings.warn(
Expand All @@ -379,7 +379,7 @@ def consume_w_metadata(self, fname, metadata_wrapper):
if int(res) != 0:
raise RuntimeError("Cannot consume data with metadata with DYAD!")

@dlio_log.log
@dft_log.log
def finalize(self):
if not self.initialized:
return
Expand Down
6 changes: 3 additions & 3 deletions pydyad/pydyad/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import io
from pathlib import Path

from dlio_profiler.logger import fn_interceptor
dlio_log = fn_interceptor("DYAD_PY")
from dftracer.logger import dft_fn
dft_log = dft_fn("DYAD_PY")
DYAD_IO = None


# The design of dyad_open is based on the PEP for Python's 'with' syntax:
# https://peps.python.org/pep-0343/
@contextmanager
@dlio_log.log
@dft_log.log
def dyad_open(*args, dyad_ctx=None, metadata_wrapper=None, register_dyad_ctx=False, **kwargs):
global DYAD_IO
local_dyad_io = dyad_ctx
Expand Down
3 changes: 2 additions & 1 deletion pydyad/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ classifier =
python_requires = >=3.7
install_requires =
numpy
dlio_profiler_py @ git+https://github.com/hariharan-devarajan/dlio-profiler.git
# dlio_profiler_py @ git+https://github.com/hariharan-devarajan/dlio-profiler.git
ilumsden marked this conversation as resolved.
Show resolved Hide resolved
pydftracer @ git+https://github.com/hariharan-devarajan/dftracer.git
Loading