[MPICH] Send and Recv Guidance Needed

James Frye frye at cs.unr.edu
Wed Apr 11 10:40:26 CDT 2007


Maybe the simplist way to approach this would be to have all the worker 
processes send a termination code when they're finished with their part of 
the work. (You could do this with either a special message value, or by 
using message tags.) The root node then does MPI_Recv in a loop until it 
has received the code from all the workers.

James

On Tue, 10 Apr 2007, Erich Peterson wrote:

> Hi all,
>
>                I am trying to come up with the best way to approach this. I
> am want to have many processes access a file, each gathering records, using
> a specified criteria (which is not important here). I want each process to
> send each record (100 bytes long) it matches to process rank 0 as a string.
> Lastly, I want rank 0 to place all the records it receives into a vector of
> strings (vector<string>).
>
>                I thought of letting each process call MPI_Send() from each
> record it matches and have process rank 0 call MPI_Recv, but, process rank 0
> won't know how many times to call MPI_Recv to receive all the records.
>
>
>
>                Thanks,
>
> Erich
>
>
>
>




More information about the mpich-discuss mailing list