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

Using Multiprocessing.Pool with Taichi #8361

Closed
kurt-rhee opened this issue Oct 6, 2023 · 1 comment
Closed

Using Multiprocessing.Pool with Taichi #8361

kurt-rhee opened this issue Oct 6, 2023 · 1 comment
Labels
question Question on using Taichi

Comments

@kurt-rhee
Copy link

I am attempting to use multiprocessing.pool in a part of my application that is outside of the taichi kernel.

My program structure is as follows in pseudo-code:

if __name__ == '__main__':
   import taichi as ti
   from file_a import function_a
   
   function_a()

In file_a:

import taichi as ti
from file_b import function_b
from file_c import function_c

function_b()
function_c()

in file_b

import taichi as ti
print(j)

def function_b():
   do_stuff_with_taichi_functions

in file_c

import multiprocessing
def function_c():
   do_stuff_with_multiprocessing

I've noticed that what happens is I end up importing taichi many times:

image

@kurt-rhee kurt-rhee added the question Question on using Taichi label Oct 6, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang Oct 6, 2023
@kurt-rhee
Copy link
Author

I actually found out that it was adding the file to the init that was causing the issue

@github-project-automation github-project-automation bot moved this from Untriaged to Done in Taichi Lang Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question on using Taichi
Projects
Status: Done
Development

No branches or pull requests

1 participant