From: Frederic Suter Date: Thu, 9 Nov 2017 10:06:02 +0000 (+0100) Subject: address new smells and hack smthg for sendrecv X-Git-Tag: v3.18~242^2~66 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6f536df44e36ac12984106ae7c0e2784e45b30d6?hp=a73e3b31f63b6da6b5f520f258f96d8aeca337be address new smells and hack smthg for sendrecv --- diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp index 03ec6ded92..b07bc6575a 100644 --- a/src/instr/instr_paje_types.hpp +++ b/src/instr/instr_paje_types.hpp @@ -14,7 +14,6 @@ namespace simgrid { namespace instr { class ContainerType; class EventType; -class TIData; class Type { long long int id_; diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp index 77392a8824..f4ada976c6 100644 --- a/src/instr/instr_private.hpp +++ b/src/instr/instr_private.hpp @@ -50,15 +50,15 @@ public: ; // NoOpTI: init, finalize, test, wait, barrier - TIData(std::string name) : name_(name){}; + explicit TIData(std::string name) : name_(name){}; // CPuTI: compute, sleep (+ waitAny and waitAll out of laziness) - TIData(std::string name, double amount) : name_(name), amount_(amount){}; + explicit TIData(std::string name, double amount) : name_(name), amount_(amount){}; // Pt2PtTI: send, isend, sssend, issend, recv, irecv - TIData(std::string name, int endpoint, int size, std::string datatype) + explicit TIData(std::string name, int endpoint, int size, std::string datatype) : name_(name), endpoint(endpoint), send_size(size), send_type(datatype){}; // CollTI: bcast, reduce, allReduce, gather, scatter, allGather, allToAll - TIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type, - std::string recv_type) + explicit TIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type, + std::string recv_type) : name_(name) , amount_(amount) , endpoint(root) @@ -67,8 +67,8 @@ public: , send_type(send_type) , recv_type(recv_type){}; // VarCollTI: gatherV, scatterV, allGatherV, allToAllV (+ reduceScatter out of laziness) - TIData(std::string name, int root, int send_size, std::vector* sendcounts, int recv_size, - std::vector* recvcounts, std::string send_type, std::string recv_type) + explicit TIData(std::string name, int root, int send_size, std::vector* sendcounts, int recv_size, + std::vector* recvcounts, std::string send_type, std::string recv_type) : name_(name) , endpoint(root) , send_size(send_size) @@ -92,14 +92,14 @@ public: class NoOpTIData : public TIData { public: - NoOpTIData(std::string name) : TIData(name){}; + explicit NoOpTIData(std::string name) : TIData(name){}; std::string print() override { return getName(); } std::string display_size() override { return ""; } }; class CpuTIData : public TIData { public: - CpuTIData(std::string name, double amount) : TIData(name, amount){}; + explicit CpuTIData(std::string name, double amount) : TIData(name, amount){}; std::string print() override { std::stringstream stream; @@ -111,7 +111,7 @@ public: class Pt2PtTIData : public TIData { public: - Pt2PtTIData(std::string name, int endpoint, int size, std::string datatype) + explicit Pt2PtTIData(std::string name, int endpoint, int size, std::string datatype) : TIData(name, endpoint, size, datatype){}; std::string print() override { @@ -127,8 +127,8 @@ public: class CollTIData : public TIData { public: - CollTIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type, - std::string recv_type) + explicit CollTIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type, + std::string recv_type) : TIData(name, root, amount, send_size, recv_size, send_type, recv_type){}; std::string print() override { @@ -149,8 +149,8 @@ public: class VarCollTIData : public TIData { public: - VarCollTIData(std::string name, int root, int send_size, std::vector* sendcounts, int recv_size, - std::vector* recvcounts, std::string send_type, std::string recv_type) + explicit VarCollTIData(std::string name, int root, int send_size, std::vector* sendcounts, int recv_size, + std::vector* recvcounts, std::string send_type, std::string recv_type) : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){}; std::string print() override { diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 53bd024603..87f437513e 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -406,14 +406,15 @@ int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); int src_traced = comm->group()->index(src); - // extra->src = src_traced; - // extra->dst = dst_traced; - // extra->send_size = sendtype->is_basic() ? sendcount : sendcount * sendtype->size(); - // extra->recv_size = recvtype->is_basic() ? recvcount : recvcount * recvtype->size(); - // extra->datatype1 = encode_datatype(sendtype); - // extra->datatype2 = encode_datatype(recvtype); - - // TODO TRACE_smpi_comm_in(rank, __FUNCTION__, extra); + + // FIXME: Hack the way to trace this one + TRACE_smpi_comm_in(rank, __FUNCTION__, + new simgrid::instr::VarCollTIData( + "sendRecv", -1, sendtype->is_basic() ? sendcount : sendcount * sendtype->size(), + new std::vector(src_traced), + recvtype->is_basic() ? recvcount : recvcount * recvtype->size(), + new std::vector(src_traced), encode_datatype(sendtype), encode_datatype(recvtype))); + TRACE_smpi_send(rank, rank, dst_traced, sendtag, sendcount * sendtype->size()); simgrid::smpi::Request::sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src,