X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85..2ffca84edbea56d2142bda01affe79fdb4747851:/src/surf/ptask_L07.hpp diff --git a/src/surf/ptask_L07.hpp b/src/surf/ptask_L07.hpp index 98d6940dca..6f42adfc4e 100644 --- a/src/surf/ptask_L07.hpp +++ b/src/surf/ptask_L07.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -36,11 +36,11 @@ class XBT_PRIVATE L07Action; class HostL07Model : public HostModel { public: HostL07Model(); - ~HostL07Model(); + ~HostL07Model() override; double next_occuring_event(double now) override; void update_actions_state(double now, double delta) override; - kernel::resource::Action* execute_parallel(int host_nb, sg_host_t* host_list, double* flops_amount, + kernel::resource::Action* execute_parallel(size_t host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate) override; }; @@ -71,12 +71,12 @@ public: class CpuL07 : public Cpu { public: - CpuL07(CpuL07Model* model, simgrid::s4u::Host* host, std::vector* speed_per_pstate, int core); + CpuL07(CpuL07Model* model, s4u::Host* host, std::vector* speed_per_pstate, int core); ~CpuL07() override; bool is_used() override; - void apply_event(tmgr_trace_event_t event, double value) override; + void apply_event(kernel::profile::Event* event, double value) override; kernel::resource::Action* execution_start(double size) override; - simgrid::kernel::resource::Action* execution_start(double size, int requested_cores) override + kernel::resource::Action* execution_start(double, int) override { THROW_UNIMPLEMENTED; return nullptr; @@ -93,7 +93,7 @@ public: s4u::Link::SharingPolicy policy); ~LinkL07() override; bool is_used() override; - void apply_event(tmgr_trace_event_t event, double value) override; + void apply_event(kernel::profile::Event* event, double value) override; void set_bandwidth(double value) override; void set_latency(double value) override; }; @@ -104,21 +104,26 @@ public: class L07Action : public CpuAction { friend Action *CpuL07::execution_start(double size); friend Action *CpuL07::sleep(double duration); - friend Action* HostL07Model::execute_parallel(int host_nb, sg_host_t* host_list, double* flops_amount, + friend Action* HostL07Model::execute_parallel(size_t host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate); + friend Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate); public: - L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* host_list, double* flops_amount, + L07Action(kernel::resource::Model* model, size_t host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate); ~L07Action(); void updateBound(); - std::vector* hostList_ = new std::vector(); - double *computationAmount_; - double *communicationAmount_; + std::vector hostList_; + double* computationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if free_arrays */ + double* communicationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if free_arrays */ double latency_; double rate_; + +private: + bool free_arrays_ = false; // By default, computationAmount_ and friends are freed by caller. But not for sequential + // exec and regular comms }; }