Skip to content

multiprocessing problem on macOSX arm architecture #85

@j-l-s

Description

@j-l-s

Then running the Tuto-GUDHI-ConfRegions-PersDiag-datapoints.ipynb notebook on macOSX/M1, the following error occurs in all childs:
AttributeError: Can't get attribute 'hauss_dist' on <module 'persistence_statistics'

This is due to a known problem of the multiprocessing package.
https://stackoverflow.com/questions/69493104/multiprocessing-example-giving-attributeerror-on-mac

Workaround:

  • use context "fork" instead of "spawn"
context = get_context("fork")
with context.Pool(ncores) as p:
    dist_vec = p.map(hauss_dist,[m]*B)

(it may not work if not in a if __name__ == "__main__": block

  • use another multi-threading library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions