|
[Sponsors] |
Parallel Fortran CFD development: mpi_send/mpi_recv vs mpi_bcast |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 19, 2023, 17:35 |
Parallel Fortran CFD development: mpi_send/mpi_recv vs mpi_bcast
|
#1 |
New Member
Huzafa
Join Date: Mar 2023
Posts: 2
Rep Power: 0 |
I am learning how to use Open MPI in order to develop my own finite difference CFD solver in Fortran90.
I have read on a few tutorials and pages online that mpi_send and mpi_recv routines need to be called in order pass data from the "edge" cells from one mesh partition to its adjacent mesh partition. What is stopping me from just using mpi_bcast? If I just broadcast the entire mesh data from the root processor to all processors and then carry out the same numerical process on all processors - but of course change the minimum/maximum cells that each processors processes. Is this generally a less efficient way or something? Looking at the material online, it appears to me that no one uses this approach and I am wondering why. Is there a situation in which this is not possible and I have to use mpi_send/mpi_recv? |
|
March 19, 2023, 18:10 |
|
#2 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
The most important goal of an MPI communication scheme -right after correctness- is low overhead.
In general, you want to exchange as little data as possible, between as few processes as possible. Sending and receiving data costs time. If your solver spends a lot of time doing the MPI communication, you will get little to no speedup when increasing the number of processes. BCAST is bad here because it sends data to all other processes, even those that don't need it. Which wastes valuable time. Broadcasting the ENTIRE data from all cells is even worse, because you are sending data that actually none of the processes need. Doing it this way will lead to negative speedup, on top of using tons of memory. Last edited by flotus1; March 20, 2023 at 04:08. |
|
Tags |
fortran 90, mpi, parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Run a user fortran routine in parallel | Smilodon | CFX | 2 | March 28, 2017 05:35 |
Explicitly filtered LES | saeedi | Main CFD Forum | 16 | October 14, 2015 12:58 |
simpleFoam parallel | AndrewMortimer | OpenFOAM Running, Solving & CFD | 12 | August 7, 2015 19:45 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
ASME CFD Symposium - Call for Papers | Chris Kleijn | Main CFD Forum | 0 | September 25, 2001 11:17 |