From: Bruno Donassolo Date: Fri, 11 Mar 2022 11:36:55 +0000 (+0100) Subject: Minor improv in threads X-Git-Tag: v3.31~154 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e53dd061b19eb00edcb1ab45fb14981d0b8848b8 Minor improv in threads Let the user_bound for bounds given by S4U user (if any). For the requested_cores, the bound is already configured when creating the action at CpuCas01Action. Also, the current implementation for threads use the same mechanism used by VMs, for a N-thread action: - priority/sharing_penalty: 1/N to increase the amount of CPU given to action. - individual bound: speed < N*C: to limit the action speed to the number of cores. --- diff --git a/src/kernel/resource/VirtualMachineImpl.cpp b/src/kernel/resource/VirtualMachineImpl.cpp index c1ae6a1e7b..e741ba131d 100644 --- a/src/kernel/resource/VirtualMachineImpl.cpp +++ b/src/kernel/resource/VirtualMachineImpl.cpp @@ -174,9 +174,7 @@ double VMModel::next_occurring_event(double now) Action* VMModel::execute_thread(const s4u::Host* host, double flops_amount, int thread_count) { auto cpu = host->get_cpu(); - return cpu->execution_start(thread_count * flops_amount, thread_count, - cpu->get_speed(1.0) / cpu->get_speed_ratio() * - std::min(thread_count, cpu->get_core_count())); + return cpu->execution_start(thread_count * flops_amount, thread_count, -1); } /************ diff --git a/src/surf/host_clm03.cpp b/src/surf/host_clm03.cpp index 55b8cf49ab..d7353cf68d 100644 --- a/src/surf/host_clm03.cpp +++ b/src/surf/host_clm03.cpp @@ -97,12 +97,8 @@ Action* HostCLM03Model::execute_parallel(const std::vector& host_lis 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,, that requests thread_count cores and - * is bounded to the currently available speed (i.e., under current load) time the minimum between the - * number of thread and the number of cores of the host */ - return cpu->execution_start(thread_count * flops_amount, thread_count, - cpu->get_speed(1.0) / cpu->get_speed_ratio() * - std::min(thread_count, cpu->get_core_count())); + /* 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 resource