- Thank you received: 6
MPI related question: how to evaluate a coefficient function
- Guosheng Fu
- Topic Author
- Offline
- Elite Member
Less
More
5 years 7 months ago #1543
by Guosheng Fu
I am trying to evaluate a grid function at a specific mesh point, but it failed for the MPI version with the following snippet...
Code:
if mesh.Contains(0,0):
gfu(mesh(0,0))
5 years 7 months ago - 5 years 7 months ago #1548
by lkogler
Replied by lkogler on topic MPI related question: how to evaluate a coefficient function
It looks like empty meshes (rank 0 has no elements) are not handled correctly.
As a workaround:
Should be fixed shortly.
As a workaround:
Code:
if mesh.comm.rank!=0 and mesh.Contains(0,0):
gfu(mesh(0,0))
Last edit: 5 years 7 months ago by lkogler.
- Guosheng Fu
- Topic Author
- Offline
- Elite Member
Less
More
- Thank you received: 6
5 years 7 months ago #1549
by Guosheng Fu
Replied by Guosheng Fu on topic MPI related question: how to evaluate a coefficient function
Thanks!
Say, do you have any suggestions on code debugging in MPI?
It would be a good exercise for me to trace a bug and try to fix it myself first before asking these small questions...
Say, do you have any suggestions on code debugging in MPI?
It would be a good exercise for me to trace a bug and try to fix it myself first before asking these small questions...
5 years 7 months ago - 5 years 7 months ago #1553
by lkogler
Replied by lkogler on topic MPI related question: how to evaluate a coefficient function
I have not found a solution I am really satisfied with myself, but I can tell you what I usually do.
Just keep in mind that this is all just cobbled together.
For small jobs, you can run each MPI process in a seperate xterm-window and attach gdb to each of them.
You can also pipe the output of each process to a seperate file, for example, with OpenMPI you could write
a small script like this:
Then you can use gdb on each process, and tell it to print the back-trace when it encounters a problem
This way you can do bigger jobs, but you cannot use gdb interactively.
This also works with valgrind instead of gdb.
Just keep in mind that this is all just cobbled together.
For small jobs, you can run each MPI process in a seperate xterm-window and attach gdb to each of them.
Code:
mpirun -np 1 gdb -ex run --args python3 PYTHON_SCRIPT : \
-np X xterm -hold -e gdb -ex run --args python3 PYTHON_SCRIPT
You can also pipe the output of each process to a seperate file, for example, with OpenMPI you could write
a small script like this:
Code:
#!/bin/sh
$@ 1>out_p$OMPI_COMM_WORLD_RANK 2>err_p$OMPI_COMM_WORLD_RANK
Code:
mpirun -np X bash WRAP_SCRIPT gdb -batch -ex "run" -ex bt --args python3 PYTHON_SCRIPT
This also works with valgrind instead of gdb.
Last edit: 5 years 7 months ago by lkogler.
Time to create page: 0.124 seconds