Skip to content

avoidable multiprocessing guards on Windows and MacOS. #225

Description

@dkriegner

The powdermodel example script is somewhat complicated due to the fact that a main function needs to be defined for it to work on windows and MacOS.

def main():
"""
dummy main function to enable multiprocessing on Windows and macOS.
This is required to avoid starting of the multiprocessing code upon import
of the script and is connected with the used multiprocessing start method.
See also:
https://docs.python.org/3/library/multiprocessing.html#the-spawn-and-forkserver-start-methods
"""

There could be a workaround which would not require this for any platform and would make using PowderModel for users of these platforms much easier.
https://stackoverflow.com/questions/79397519/a-solution-to-multiprocessing-in-python-without-the-if-name-main-gu

Its however currently unclear to me how/if this is directly applicable for the multiprocessing code in powder.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions