From e6f2f55d358cd40d1c8178958856db1f952bb174 Mon Sep 17 00:00:00 2001 From: sage Date: Sat, 4 Jun 2005 01:28:45 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@260 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/msg/MPIMessenger.cc | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/ceph/msg/MPIMessenger.cc b/ceph/msg/MPIMessenger.cc index 1adbc9faa5f3d..976ea5d9d364a 100644 --- a/ceph/msg/MPIMessenger.cc +++ b/ceph/msg/MPIMessenger.cc @@ -100,6 +100,7 @@ Message *mpi_recv() dout(10) << "mpi_recv waiting for message" << endl; + /* // get message size ASSERT(MPI_Probe(MPI_ANY_SOURCE, TAG_ENV, @@ -110,21 +111,29 @@ Message *mpi_recv() // make sure it's the size of an envelope! assert(status.count <= MSG_ENVELOPE_LEN); + */ msg_envelope_t env; - ASSERT(MPI_Recv((void*)&env, - status.count,//MSG_ENVELOPE_LEN, - MPI_CHAR, - MPI_ANY_SOURCE, - TAG_ENV, - MPI_COMM_WORLD, - &status) == MPI_SUCCESS); + MPI_Request env_req; + ASSERT(MPI_Irecv((void*)&env, + sizeof(env), + MPI_CHAR, + MPI_ANY_SOURCE, + TAG_ENV, + MPI_COMM_WORLD, + &env_req) == MPI_SUCCESS); + + ASSERT(MPI_Wait(&env_req, &status) == MPI_SUCCESS); if (status.count < MSG_ENVELOPE_LEN) { dout(10) << "mpi_recv got short recv " << status.count << " bytes" << endl; return 0; } + if (env.type == 0) { + dout(10) << "mpi_recv got type 0 message, kicked!" << endl; + return 0; + } dout(10) << "mpi_recv got envelope " << status.count << ", type=" << env.type << " src " << env.source << " dst " << env.dest << " nchunks=" << env.nchunks << " from " << status.MPI_SOURCE << endl; @@ -328,9 +337,11 @@ MPI_Request kick_req; void mpimessenger_kick_loop() { // wake up the event loop with a bad "message" - char stop = 0; // a byte will do - ASSERT(MPI_Isend(&stop, - 1, + //char stop = 0; // a byte will do + msg_envelope_t env; + env.type = 0; + ASSERT(MPI_Isend(&env, + sizeof(env), MPI_CHAR, mpi_rank, TAG_ENV, -- 2.39.5