Nick Collier writes:> Hmm, I think it should work. Thanks though. The example I posted was
> modified from:> http://ci-tutor.ncsa.illinois.edu/content.php?cid=1137
> Namely,
> /* deadlock avoided */
> #include <stdio.h>
> #include <mpi.h>> void main (int argc, char **argv) {
> int myrank;
> MPI_Request request;
> MPI_Status status;
> double a[100], b[100];> MPI_Init(&argc, &argv); /* Initialize MPI */
> MPI_Comm_rank(MPI_COMM_WORLD, &myrank); /* Get rank */
> if( myrank == 0 ) {
> /* Post a receive, send a message, then wait */
> MPI_Irecv( b, 100, MPI_DOUBLE, 1, 19, MPI_COMM_WORLD, &request );
> MPI_Send( a, 100, MPI_DOUBLE, 1, 17, MPI_COMM_WORLD );
> MPI_Wait( &request, &status );
> }
> else if( myrank == 1 ) {
> /* Post a receive, send a message, then wait */
> MPI_Irecv( b, 100, MPI_DOUBLE, 0, 17, MPI_COMM_WORLD, &request );
> MPI_Send( a, 100, MPI_DOUBLE, 0, 19, MPI_COMM_WORLD );
> MPI_Wait( &request, &status );
> }> MPI_Finalize(); /* Terminate MPI */
> }
>I am not sure why MPI was added to Boost. Recently there was aneffort to get Boost libs ready for the next C++ standard. I don't thinkthe MPI library was considered in that as it's ties to C are so strong.Having to specify MPI_DOUBLE above when a and b are both declaredof type double is sad. Naming it "Message Passing Interface" whenyou are restricted to messages of a single type is hardly an apt name.If it's going to be in Boost, it may wind up being called the Most PitifulInterface.
--
Brian Wood
Ebenezer Enterprises
www.webEbenezer.net
"The New Deal and Great Society entrenched a welfare mentality in[the US]. The idea of the federal government as the great providerhas even moved to the level of corporate America, with business'leaders' flying to Washington in private jets to beg Congress forhandouts to keep their companies afloat." Bill Ragle_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users