X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/af3b64b82b7bf86f53f5cbe2ec042e1b40022c82..d6eb772e45cc853fc204bb5aebeb411cdfa7c929:/src/smpi/internals/smpi_bench.cpp diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index f4687afbd8..d79504f4f7 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -1,9 +1,8 @@ -/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. 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. */ -#include "getopt.h" #include "private.hpp" #include "simgrid/host.h" #include "simgrid/modelchecker.h" @@ -12,19 +11,18 @@ #include "smpi_comm.hpp" #include "smpi_utils.hpp" #include "src/internal_config.h" +#include "src/kernel/lmm/System.hpp" // sg_precision_timing #include "src/mc/mc_replay.hpp" -#include "src/surf/surf_interface.hpp" // sg_surf_precision #include "xbt/config.hpp" #include "xbt/file.hpp" +#include #include "src/smpi/include/smpi_actor.hpp" -#include -#ifndef WIN32 -#include -#endif #include #include +#include +#include #if HAVE_PAPI #include @@ -211,7 +209,7 @@ int smpi_gettimeofday(struct timeval* tv, struct timezone* tz) double secs = trunc(now); double usecs = (now - secs) * 1e6; tv->tv_sec = static_cast(secs); - tv->tv_usec = static_casttv_usec)>(usecs); // suseconds_t (or useconds_t on WIN32) + tv->tv_usec = static_casttv_usec)>(usecs); // suseconds_t } if (smpi_wtime_sleep > 0) simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep); @@ -258,13 +256,13 @@ double smpi_mpi_wtime() unsigned long long smpi_rastro_resolution () { const SmpiBenchGuard suspend_bench; - return static_cast(1.0 / sg_surf_precision); + return static_cast(1.0 / sg_precision_timing); } unsigned long long smpi_rastro_timestamp () { const SmpiBenchGuard suspend_bench; - return static_cast(simgrid::s4u::Engine::get_clock() / sg_surf_precision); + return static_cast(simgrid::s4u::Engine::get_clock() / sg_precision_timing); } /* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/ @@ -483,3 +481,7 @@ int smpi_getopt (int argc, char *const *argv, const char *options) smpi_process()->set_optind(optind); return ret; } + +pid_t smpi_getpid(){ + return static_cast(simgrid::s4u::this_actor::get_pid()); +}