Fatal error in MPI_Bsend when meshing

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
marolas
Posts: 8
Joined: Wed May 11, 2022 9:07 am

Fatal error in MPI_Bsend when meshing

Post by marolas »

Hello there,

I have this problem where I want to mesh a domain in cfMesh which has a lot of mesh refinements and I search for a good quality mesh. Thus, I want to take advantage of parallel cores so I wanted to use 10 cores to mesh my domain.

My surprise was when this Fatal error in MPI_Bsend: Invalid buffer pointer came in. I googled it (https://www.cfd-online.com/Forums/su2-i ... error.html) and found out that it has to do with the MAX_MPI_BUFFER size. It seems that, as it can be noted in the attached file, my total buffer size is only about 20MB.

How do I increase MAX_MPI_BUFFER size? I run on Windows 10 Pro and have 128GB of RAM.

Thank you so much for your help.

Marc.
Attachments
MPI_error.txt
(9.56 KiB) Downloaded 40 times
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Fatal error in MPI_Bsend when meshing

Post by oliveroxtoby »

marolas wrote: Thu Jun 02, 2022 4:06 pm How do I increase MAX_MPI_BUFFER size? I run on Windows 10 Pro and have 128GB of RAM.
Try this: After writing the mesh case, click 'Edit' and modify the Allmesh file. Add the line

Code: Select all

export MPI_BUFFER_SIZE=200000000
before the line that runs cartesianMesh. Return to FreeCAD and click "Run mesher".

Please report whether this works, and I'll make it the default.
marolas
Posts: 8
Joined: Wed May 11, 2022 9:07 am

Re: Fatal error in MPI_Bsend when meshing

Post by marolas »

Hi Oliver,

Thanks for your reply.

I added the line you said (attached the Allmesh file):
CaptureCFDOF.PNG
CaptureCFDOF.PNG (20.21 KiB) Viewed 1754 times
Altough not an error message about MPI Buffer has appeared, the meshing process exited with error, I atach the log (Meshing exited with error.txt).

Marc.
Attachments
Allmesh.rar
(720 Bytes) Downloaded 29 times
Meshing exited with error.txt
(10.12 KiB) Downloaded 36 times
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Fatal error in MPI_Bsend when meshing

Post by oliveroxtoby »

marolas wrote: Fri Jun 03, 2022 12:02 pm Altough not an error message about MPI Buffer has appeared, the meshing process exited with error, I atach the log (Meshing exited with error.txt).
This looks like a separate issue. Can you share your FreeCAD file or freshly written meshCase directory?
marolas
Posts: 8
Joined: Wed May 11, 2022 9:07 am

Re: Fatal error in MPI_Bsend when meshing

Post by marolas »

Hello Oliver,

Sorry for the late reply. Here I attach the freshly written meshCase file in CfMesh.
meshCase.rar
(92.32 KiB) Downloaded 33 times
At last I ended up meshing using gmesh tetahedral without errors and good quality mesh. If you need anything else, please just ask.

Altough, if we could fix the MPI Buffer issue would be great.

Thanks in advance.

Marc.
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Fatal error in MPI_Bsend when meshing

Post by oliveroxtoby »

marolas wrote: Thu Jun 09, 2022 7:05 am Hello Oliver,

Sorry for the late reply. Here I attach the freshly written meshCase file in CfMesh.
On a machine with 16GB of RAM I get a similar error, but on a 64GB machine it goes through fine and I end up with a ~20M cell mesh. I can't explain why it fails on your 128GB machine, but it looks like something memory related.

Incidentally if you have the latest update of cfMesh, you will probably find that it runs faster with multithreading rather than with multiprocessing.
marolas
Posts: 8
Joined: Wed May 11, 2022 9:07 am

Re: Fatal error in MPI_Bsend when meshing

Post by marolas »

oliveroxtoby wrote: Thu Jun 09, 2022 7:38 pm On a machine with 16GB of RAM I get a similar error, but on a 64GB machine it goes through fine and I end up with a ~20M cell mesh. I can't explain why it fails on your 128GB machine, but it looks like something memory related.
I will give it another try with another geometry by increasing the MPI Buffer and will reply with results.
oliveroxtoby wrote: Thu Jun 09, 2022 7:38 pm Incidentally if you have the latest update of cfMesh, you will probably find that it runs faster with multithreading rather than with multiprocessing.
Please, could you explain how to change from multithreading to multiprocessing in CfdOF? Do I have to change the "number of threads" to 0 and "number of processes to 1?

Thanks,

Marc.
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Fatal error in MPI_Bsend when meshing

Post by oliveroxtoby »

marolas wrote: Mon Jun 13, 2022 6:37 am Please, could you explain how to change from multithreading to multiprocessing in CfdOF? Do I have to change the "number of threads" to 0 and "number of processes to 1?
Yes, that will do it.
marolas
Posts: 8
Joined: Wed May 11, 2022 9:07 am

Re: Fatal error in MPI_Bsend when meshing

Post by marolas »

oliveroxtoby wrote: Mon Jun 13, 2022 7:12 pm Yes, that will do it.
Thanks for the help Oliver!
Post Reply