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

About using multi nodes in python interface #77

Open
haotianh9 opened this issue Apr 11, 2022 · 0 comments
Open

About using multi nodes in python interface #77

haotianh9 opened this issue Apr 11, 2022 · 0 comments

Comments

@haotianh9
Copy link

haotianh9 commented Apr 11, 2022

Hello Dr. Wilson and Dr. Vaughn,

Thank you so much for the help you provided me before. Now I'm having another issue regarding the python interface. When I want to run the code on multiple nodes by mpirun -n 2 python3 testBaryTreeInterface.py .

From the output and timing of this, I found that this actually runs the python interface code in two different processes/nodes and run the task twice. However, what we want to improve performance is to run only one python interface, and let it do a single task, but start the C backend with multiple processes/nodes.

In order to do this, I found this instruction which tells me how to pass the MPI_Comm_world from python mpi4py to the C function. However, in your C code, the interface function does not take MPI_Comm as an argument. Thus I wonder whether it is possible to fulfill this? Thank you!

Moreover, running using two node will give me an incorrect result. I changed this two lines errorcheck1 errorcheck2 in testBaryTreeInterface.py to print(abs(output[0]-expectedOutput)) to see the error. By running on one node mpirun -n 1 python3 testBaryTreeInterface.py , I got correct answer:

[BaryTree] BaryTree has finished.
[BaryTree]
1.1368683772161603e-13
[BaryTree] BaryTree has finished.
[BaryTree]
0.006440073111093625
If no errors printed, then the calls to the treecode wrapper worked (one using explicit theta/degree, one use beta)

By running on one node mpirun -n 2 python3 testBaryTreeInterface.py , I got incorrect answer:

[BaryTree] BaryTree has finished.
[BaryTree]
567.7814360701254
567.7814360701254
[BaryTree] BaryTree has finished.
[BaryTree]
567.7956567896165
If no errors printed, then the calls to the treecode wrapper worked (one using explicit theta/degree, one use beta)
567.7956567896165
If no errors printed, then the calls to the treecode wrapper worked (one using explicit theta/degree, one use beta)

Yours sincerely
Haotian

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