A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add gatherv test
[simgrid.git]
/
src
/
smpi
/
internals
/
smpi_bench.cpp
diff --git
a/src/smpi/internals/smpi_bench.cpp
b/src/smpi/internals/smpi_bench.cpp
index f4687afbd80eeb5be3d8ee8e904e61b879fc0baf..542c0ee1e64057ad9f7694620b010f3a41663753 100644
(file)
--- a/
src/smpi/internals/smpi_bench.cpp
+++ b/
src/smpi/internals/smpi_bench.cpp
@@
-1,9
+1,8
@@
-/* Copyright (c) 2007-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-202
3
. 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. */
/* 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"
#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 "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/mc/mc_replay.hpp"
-#include "src/surf/surf_interface.hpp" // sg_surf_precision
#include "xbt/config.hpp"
#include "xbt/file.hpp"
#include "xbt/config.hpp"
#include "xbt/file.hpp"
+#include <getopt.h>
#include "src/smpi/include/smpi_actor.hpp"
#include "src/smpi/include/smpi_actor.hpp"
-#include <unordered_map>
-#ifndef WIN32
-#include <sys/mman.h>
-#endif
#include <cerrno>
#include <cmath>
#include <cerrno>
#include <cmath>
+#include <sys/mman.h>
+#include <unordered_map>
#if HAVE_PAPI
#include <papi.h>
#if HAVE_PAPI
#include <papi.h>
@@
-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<time_t>(secs);
double secs = trunc(now);
double usecs = (now - secs) * 1e6;
tv->tv_sec = static_cast<time_t>(secs);
- tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
(or useconds_t on WIN32)
+ tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
}
if (smpi_wtime_sleep > 0)
simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
}
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;
unsigned long long smpi_rastro_resolution ()
{
const SmpiBenchGuard suspend_bench;
- return static_cast<unsigned long long>(1.0 / sg_
surf_precision
);
+ return static_cast<unsigned long long>(1.0 / sg_
precision_timing
);
}
unsigned long long smpi_rastro_timestamp ()
{
const SmpiBenchGuard suspend_bench;
}
unsigned long long smpi_rastro_timestamp ()
{
const SmpiBenchGuard suspend_bench;
- return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_
surf_precision
);
+ return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_
precision_timing
);
}
/* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/
}
/* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/
@@
-422,7
+420,7
@@
smpi_trace_call_location_t* smpi_trace_get_call_location()
return smpi_process()->call_location();
}
return smpi_process()->call_location();
}
-void smpi_trace_set_call_location(const char* file, const int line)
+void smpi_trace_set_call_location(const char* file, const int line
, const char* call_name
)
{
smpi_trace_call_location_t* loc = smpi_process()->call_location();
{
smpi_trace_call_location_t* loc = smpi_process()->call_location();
@@
-432,19
+430,21
@@
void smpi_trace_set_call_location(const char* file, const int line)
loc->filename = simgrid::xbt::Path(file).get_base_name();
else
loc->filename = file;
loc->filename = simgrid::xbt::Path(file).get_base_name();
else
loc->filename = file;
+ std::replace(loc->filename.begin(), loc->filename.end(), ' ', '_');
loc->linenumber = line;
loc->linenumber = line;
+ loc->func_call = call_name;
}
/** Required for Fortran bindings */
}
/** Required for Fortran bindings */
-void smpi_trace_set_call_location_(const char* file, const int* line)
+void smpi_trace_set_call_location_(const char* file, const int* line
, const char* call_name
)
{
{
- smpi_trace_set_call_location(file, *line);
+ smpi_trace_set_call_location(file, *line
, call_name
);
}
/** Required for Fortran if -fsecond-underscore is activated */
}
/** Required for Fortran if -fsecond-underscore is activated */
-void smpi_trace_set_call_location__(const char* file, const int* line)
+void smpi_trace_set_call_location__(const char* file, const int* line
, const char* call_name
)
{
{
- smpi_trace_set_call_location(file, *line);
+ smpi_trace_set_call_location(file, *line
, call_name
);
}
void smpi_bench_destroy()
}
void smpi_bench_destroy()
@@
-483,3
+483,7
@@
int smpi_getopt (int argc, char *const *argv, const char *options)
smpi_process()->set_optind(optind);
return ret;
}
smpi_process()->set_optind(optind);
return ret;
}
+
+pid_t smpi_getpid(){
+ return static_cast<pid_t>(simgrid::s4u::this_actor::get_pid());
+}