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
s/HAVE_SENDFILE/SG_HAVE_SENDFILE/
[simgrid.git]
/
src
/
smpi
/
internals
/
smpi_replay.cpp
diff --git
a/src/smpi/internals/smpi_replay.cpp
b/src/smpi/internals/smpi_replay.cpp
index
dd65a62
..
8214e5f
100644
(file)
--- a/
src/smpi/internals/smpi_replay.cpp
+++ b/
src/smpi/internals/smpi_replay.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-201
9
. 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. */
@@
-447,8
+447,6
@@
void SendAction::kernel(simgrid::xbt::ReplayAction& action)
void RecvAction::kernel(simgrid::xbt::ReplayAction& action)
{
void RecvAction::kernel(simgrid::xbt::ReplayAction& action)
{
- int src_traced = MPI_COMM_WORLD->group()->actor(args.partner)->get_pid();
-
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
args.tag, Datatype::encode(args.datatype1)));
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
args.tag, Datatype::encode(args.datatype1)));
@@
-469,6
+467,7
@@
void RecvAction::kernel(simgrid::xbt::ReplayAction& action)
TRACE_smpi_comm_out(my_proc_id);
// TODO: Check why this was only activated in the "recv" case and not in the "irecv" case
if (name == "recv" && not TRACE_smpi_view_internals()) {
TRACE_smpi_comm_out(my_proc_id);
// TODO: Check why this was only activated in the "recv" case and not in the "irecv" case
if (name == "recv" && not TRACE_smpi_view_internals()) {
+ int src_traced = MPI_COMM_WORLD->group()->actor(status.MPI_SOURCE)->get_pid();
TRACE_smpi_recv(src_traced, my_proc_id, args.tag);
}
}
TRACE_smpi_recv(src_traced, my_proc_id, args.tag);
}
}
@@
-702,9
+701,13
@@
void AllToAllVAction::kernel(simgrid::xbt::ReplayAction& action)
static std::unordered_map<aid_t, simgrid::smpi::replay::RequestStorage> storage;
/** @brief Only initialize the replay, don't do it for real */
static std::unordered_map<aid_t, simgrid::smpi::replay::RequestStorage> storage;
/** @brief Only initialize the replay, don't do it for real */
-void smpi_replay_init(
int* argc, char*** argv
)
+void smpi_replay_init(
const char* instance_id, int rank, double start_delay_flops
)
{
{
- simgrid::smpi::ActorExt::init(argc, argv);
+ if (not smpi_process()->initializing()){
+ simgrid::s4u::Actor::self()->set_property("instance_id", instance_id);
+ simgrid::s4u::Actor::self()->set_property("rank", std::to_string(rank));
+ simgrid::smpi::ActorExt::init();
+ }
smpi_process()->mark_as_initialized();
smpi_process()->set_replaying(true);
smpi_process()->mark_as_initialized();
smpi_process()->set_replaying(true);
@@
-742,10
+745,9
@@
void smpi_replay_init(int* argc, char*** argv)
xbt_replay_action_register("compute", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ComputeAction().execute(action); });
//if we have a delayed start, sleep here.
xbt_replay_action_register("compute", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ComputeAction().execute(action); });
//if we have a delayed start, sleep here.
- if(*argc>2){
- double value = xbt_str_parse_double((*argv)[2], "%s is not a double");
- XBT_VERB("Delayed start for instance - Sleeping for %f flops ",value );
- smpi_execute_flops(value);
+ if (start_delay_flops > 0) {
+ XBT_VERB("Delayed start for instance - Sleeping for %f flops ", start_delay_flops);
+ smpi_execute_flops(start_delay_flops);
} else {
// Wait for the other actors to initialize also
simgrid::s4u::this_actor::yield();
} else {
// Wait for the other actors to initialize also
simgrid::s4u::this_actor::yield();
@@
-753,12
+755,13
@@
void smpi_replay_init(int* argc, char*** argv)
}
/** @brief actually run the replay after initialization */
}
/** @brief actually run the replay after initialization */
-void smpi_replay_main(int
* argc, char*** argv
)
+void smpi_replay_main(int
rank, const char* trace_filename
)
{
static int active_processes = 0;
active_processes++;
storage[simgrid::s4u::this_actor::get_pid()] = simgrid::smpi::replay::RequestStorage();
{
static int active_processes = 0;
active_processes++;
storage[simgrid::s4u::this_actor::get_pid()] = simgrid::smpi::replay::RequestStorage();
- simgrid::xbt::replay_runner(*argc, *argv);
+ std::string rank_string = std::to_string(rank);
+ simgrid::xbt::replay_runner(rank_string.c_str(), trace_filename);
/* and now, finalize everything */
/* One active process will stop. Decrease the counter*/
/* and now, finalize everything */
/* One active process will stop. Decrease the counter*/
@@
-793,8
+796,8
@@
void smpi_replay_main(int* argc, char*** argv)
}
/** @brief chain a replay initialization and a replay start */
}
/** @brief chain a replay initialization and a replay start */
-void smpi_replay_run(
int* argc, char*** argv
)
+void smpi_replay_run(
const char* instance_id, int rank, double start_delay_flops, const char* trace_filename
)
{
{
- smpi_replay_init(
argc, argv
);
- smpi_replay_main(
argc, argv
);
+ smpi_replay_init(
instance_id, rank, start_delay_flops
);
+ smpi_replay_main(
rank, trace_filename
);
}
}