X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3c242fa5d818b0c2986ecb06e76f691e295c698..0617119206ff65bfdad4e484f653638abbc3c747:/src/instr/instr_private.hpp diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp index 57413b0999..0004fa948b 100644 --- a/src/instr/instr_private.hpp +++ b/src/instr/instr_private.hpp @@ -19,6 +19,7 @@ #include "xbt/graph.h" #include /** std::setprecision **/ #include +#include #include #include #include @@ -42,9 +43,9 @@ class TIData { public: int endpoint = 0; int send_size = 0; - std::vector* sendcounts = nullptr; + std::shared_ptr> sendcounts = nullptr; int recv_size = 0; - std::vector* recvcounts = nullptr; + std::shared_ptr> recvcounts = nullptr; std::string send_type = ""; std::string recv_type = ""; @@ -68,6 +69,12 @@ public: // VarCollTI: gatherV, scatterV, allGatherV, allToAllV (+ reduceScatter out of laziness) 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) + : TIData(name, root, send_size, std::shared_ptr>(sendcounts), recv_size, + std::shared_ptr>(recvcounts), send_type, recv_type){}; + + explicit TIData(std::string name, int root, int send_size, std::shared_ptr> sendcounts, + int recv_size, std::shared_ptr> recvcounts, std::string send_type, + std::string recv_type) : name_(name) , endpoint(root) , send_size(send_size) @@ -77,11 +84,7 @@ public: , send_type(send_type) , recv_type(recv_type){}; - virtual ~TIData() - { - delete sendcounts; - delete recvcounts; - } + virtual ~TIData() {} std::string getName() { return name_; } double getAmount() { return amount_; } @@ -151,6 +154,12 @@ public: 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){}; + + explicit VarCollTIData(std::string name, int root, int send_size, std::shared_ptr> sendcounts, + int recv_size, std::shared_ptr> 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 { std::stringstream stream;