[MPICH] Send and Recv Guidance Needed
Junjie Lai
laijj02 at mails.tsinghua.edu.cn
Wed Apr 11 00:34:48 CDT 2007
I think you can use threads in rank 0.Each thread contacts with one specific rank.
And make the vector of strings global to all threads.
Like..
thread 1 in rank0 <----- rank 1.
thread 2 in rank0 <----- rank 2.
...
When every thread exit,rank 0 call MPI_Finalize().
> -----Original Message-----
> From: "Erich Peterson" <erichpeterson at hotmail.com>
> Date: Tue, 10 Apr 2007 22:52:10 -0500
> To: <mpich-discuss at mcs.anl.gov>
> Subject: [MPICH] Send and Recv Guidance Needed
>
> 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
>
> ;
>
>
Junjie Lai
High-speed Signal Processing Laboratory
EE Dept , Tsinghua University
More information about the mpich-discuss
mailing list