Skip to content

About using multi nodes in python interface #77

@haotianh9

Description

@haotianh9

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

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