X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bc32dc8200e58f87951a43bf5ba56bf116f08e62..7672ae43c2b49a7dcdc0976cc89a05cc87ae534c:/src/surf/host_clm03.cpp diff --git a/src/surf/host_clm03.cpp b/src/surf/host_clm03.cpp index d11eeeab4b..03dd2a9d92 100644 --- a/src/surf/host_clm03.cpp +++ b/src/surf/host_clm03.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2022. 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. */ @@ -9,6 +9,7 @@ #include "simgrid/sg_config.hpp" #include "src/kernel/EngineImpl.hpp" +#include "src/kernel/resource/NetworkModel.hpp" #include "src/surf/host_clm03.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_host); @@ -21,6 +22,7 @@ void surf_host_model_init_current_default() engine->add_model(host_model); engine->get_netzone_root()->set_host_model(host_model); surf_cpu_model_init_Cas01(); + surf_disk_model_init_S19(); surf_network_model_init_LegrandVelho(); } @@ -32,9 +34,7 @@ void surf_host_model_init_compound() engine->get_netzone_root()->set_host_model(host_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { double HostCLM03Model::next_occurring_event(double /*now*/) { @@ -94,6 +94,11 @@ Action* HostCLM03Model::execute_parallel(const std::vector& host_lis return action; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +Action* HostCLM03Model::execute_thread(const s4u::Host* host, double flops_amount, int thread_count) +{ + auto cpu = host->get_cpu(); + /* Create a single action whose cost is thread_count * flops_amount and that requests thread_count cores. */ + return cpu->execution_start(thread_count * flops_amount, thread_count, -1); +} + +} // namespace simgrid::kernel::resource