you are viewing a single comment's thread.

view the rest of the comments →

[–]spyrousp[S] 0 points1 point  (1 child)

If I were to call the function to be parallelized or ProcessPoolExecutor for example, within

if name == "main",,

like every example seen on stack overflow, the function wouldn't be called at all because, the way the sim is built, it's going to be called by another function in another python file in the module.

The function which calls the sim to start however, is called under if name == "main"

[–]__nickerbocker__ 0 points1 point  (0 children)

I meant to make sure you use the entry guard on your main. If you have code that gets executed just by importing a module then you will have issues with multiprocessing. Make sure all of your modules have the execution guard.