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

MPILogHandler not working and logger example fails #389

Open
smiet opened this issue Jan 17, 2024 · 0 comments
Open

MPILogHandler not working and logger example fails #389

smiet opened this issue Jan 17, 2024 · 0 comments

Comments

@smiet
Copy link
Contributor

smiet commented Jan 17, 2024

I am having issues running the MPILogHandler, which would be very useful for debugging/understanding some large runs.

The example examples/1_simple/logger_example.py fails because 'initialize_logging' should be imported directly from 'simsopt.util'. Fixing that, we get the error:

Traceback (most recent call last):
  File "/my_mount/1_Simple/logger_example.py", line 26, in <module>
    initialize_logging(mpi=True, filename='mpi.log')
  File "/venv/lib/python3.10/site-packages/simsopt/util/logger.py", line 46, in initialize_logging
    logging.config.dictConfig(config_dict)
  File "/usr/lib/python3.10/logging/config.py", line 811, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python3.10/logging/config.py", line 572, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'mpi_file_handler'

which, after some digging, I found out is due to a failed relative import of from .._core/dev import SimsoptRequires in simsopt.util.mpi_logger.py.

This is probably because MPILogHandler is spawned in a child process that is only fed the file and cannot resolve the relative import as this requires rest of simsopt.

Commenting out the SimsoptRequires produces acceptable log files, but now the logger does not exit when the script completes.

does anyone have experience with MPI logging, and knows a fix? MPILogHandler seems based on 2013 code, there might be better solutions now... Looking for suggestions and willing to implement them when pointed in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant