Skip to content

Commit

Permalink
Update futures_mpi.py
Browse files Browse the repository at this point in the history
  • Loading branch information
quaquel committed Mar 28, 2024
1 parent a87b3a8 commit 6b44677
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions ema_workbench/em_framework/futures_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,46 +90,19 @@ def logwatcher(stop_event):
comm = MPI.COMM_WORLD.Accept(port, info, root)
_logger.debug("client connected...")

# while not stop_event.is_set():
# record = comm.irecv(None, MPI.ANY_SOURCE, tag=0)
# success = False
# message = None
# start_time = time.time()
#
# while not success or (
# (time.time() - start_time) > 10
# ): # what is a good timeout number given initialization of worker processes?
# success, message = record.test()
# time.sleep(1)
#
# if success:
# try:
# logger = logging.getLogger(message.name)
# except Exception as e:
# # AttributeError if record does not have a name attribute
# # TypeError record.name is not a string
# raise e
# else:
# logger.callHandlers(message)
# else:
# record.cancel()
# record.Free()
# else:
# _logger.info("closing logwatcher")

while not stop_event.is_set():
if rank == root:
record = comm.recv(None, MPI.ANY_SOURCE, tag=0)
try:
logger = logging.getLogger(record.name)
except Exception as e:
_logger.info(repr(record))
if record.msg is None:
_logger.info("received sentinel")
break
else:
# AttributeError if record does not have a name attribute
# TypeError record.name is not a string
_logger.info("some exception {e}")
raise e
else:
logger.callHandlers(record)
Expand Down

0 comments on commit 6b44677

Please sign in to comment.