From b66e38b815d05be3ae3a4f98b3b27a2ea705fc46 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 18 Apr 2021 11:53:53 +0200 Subject: [PATCH] MPI_SOURCE is a rank; src_traced should be a PID. --- src/smpi/bindings/smpi_pmpi_request.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index e75d904147..67be9f38a2 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -598,15 +598,14 @@ int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* statu static void trace_smpi_recv_helper(MPI_Request* request, MPI_Status* status) { const simgrid::smpi::Request* req = *request; - if (req != MPI_REQUEST_NULL) { // Received requests become null + // Requests already received are null. Is this request a wait for RECV? + if (req != MPI_REQUEST_NULL && (req->flags() & MPI_REQ_RECV)) { int src_traced = req->src(); - // the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE) int dst_traced = req->dst(); - if (req->flags() & MPI_REQ_RECV) { // Is this request a wait for RECV? - if (src_traced == MPI_ANY_SOURCE) - src_traced = (status != MPI_STATUS_IGNORE) ? req->comm()->group()->rank(status->MPI_SOURCE) : req->src(); - TRACE_smpi_recv(src_traced, dst_traced, req->tag()); - } + // the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE) + if (src_traced == MPI_ANY_SOURCE && status != MPI_STATUS_IGNORE) + src_traced = req->comm()->group()->actor(status->MPI_SOURCE)->get_pid(); + TRACE_smpi_recv(src_traced, dst_traced, req->tag()); } } -- 2.20.1