$ mkfile replay/one_trace
! timeout 60
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000
> [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036
> [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676
< replay/actions_bcast.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622
$ rm -f replay/one_trace
< replay/actions1.txt
$ mkfile ./split_traces_tesh
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 1e6 0.167158
> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 1e6 0.167158
> [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847
< replay/actions_barrier.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 1e7 1.518421
> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 1e7 1.518421
> [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976
< replay/actions_with_isend.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 Irecv 0 1e6 0.000000
> [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424
> [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0.000100
< replay/actions_allReduce.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allReduce 5e4 5e8 5.112775
> [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allReduce 5e4 5e8 6.584135
> [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allReduce 5e4 5e8 6.584775
< replay/actions_alltoall.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 allToAll 500 500 0.004041
> [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 allToAll 500 500 0.006920
> [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 allToAll 500 500 0.006920
< replay/actions_alltoallv.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 0.004000] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1000 1 80 100 0.004000
> [Jupiter:1:(2) 0.006935] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1000 40 1 30 0.006935
> [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1000 30 40 1 0.006936
< replay/actions_allgatherv.txt
$ mkfile replay/one_trace
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 1.397261] [smpi_replay/VERBOSE] 0 allGatherV 275427 275427 275427 275427 204020 0 0 1.397261
> [Ginette:3:(4) 1.760421] [smpi_replay/VERBOSE] 3 allGatherV 204020 275427 275427 275427 204020 0 0 1.760421
> [Fafard:2:(3) 1.941986] [smpi_replay/VERBOSE] 2 allGatherV 275427 275427 275427 275427 204020 0 0 1.941986
$ mkfile replay/one_trace
! output sort 19
-$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 Irecv 1 3000 0.000000
> [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 Isend 0 3000 0.000000
> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 Isend 0 2000 0.000000
{
std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, socket));
// TODO, automatic detection of the config from the process
- process->privatized(smpi_privatize_global_variables != SMPI_PRIVATIZE_NONE);
+ process->privatized(smpi_privatize_global_variables != SmpiPrivStrategies::None);
modelChecker_ = std::unique_ptr<ModelChecker>(
new simgrid::mc::ModelChecker(std::move(process)));
xbt_assert(mc_model_checker == nullptr);
region.size = size;
region.block = ((char*)stack - (char*)heap->heapbase) / BLOCKSIZE + 1;
#if HAVE_SMPI
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP && process)
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap && process)
region.process_index = process->pid - 1;
else
#endif
} else if (siginfo->si_signo == SIGSEGV) {
fprintf(stderr, "Segmentation fault.\n");
#if HAVE_SMPI
- if (smpi_enabled() && smpi_privatize_global_variables == SMPI_PRIVATIZE_NONE) {
+ if (smpi_enabled() && smpi_privatize_global_variables == SmpiPrivStrategies::None) {
#if HAVE_PRIVATIZATION
fprintf(stderr, "Try to enable SMPI variable privatization with --cfg=smpi/privatization:yes.\n");
#else
XBT_PUBLIC smpi_trace_call_location_t* smpi_trace_get_call_location();
}
-enum smpi_priv_strategies {
- SMPI_PRIVATIZE_NONE = 0,
- SMPI_PRIVATIZE_MMAP = 1,
- SMPI_PRIVATIZE_DLOPEN = 2,
- SMPI_PRIVATIZE_DEFAULT = SMPI_PRIVATIZE_DLOPEN
-};
+enum class SmpiPrivStrategies { None = 0, Mmap = 1, Dlopen = 2, Default = Dlopen };
-extern XBT_PRIVATE int smpi_privatize_global_variables;
+extern XBT_PRIVATE SmpiPrivStrategies smpi_privatize_global_variables;
#endif
void smpi_bench_begin()
{
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
auto private_blocks = merge_private_blocks(src_private_blocks, dst_private_blocks);
check_blocks(private_blocks, buff_size);
void* tmpbuff=buff;
- if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && (static_cast<char*>(buff) >= smpi_data_exe_start) &&
+ if ((smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) &&
+ (static_cast<char*>(buff) >= smpi_data_exe_start) &&
(static_cast<char*>(buff) < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
smpi_switch_data_segment(comm->src_proc->iface());
memcpy_private(tmpbuff, buff, private_blocks);
}
- if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && ((char*)comm->dst_buff >= smpi_data_exe_start) &&
+ if ((smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) && ((char*)comm->dst_buff >= smpi_data_exe_start) &&
((char*)comm->dst_buff < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
smpi_switch_data_segment(comm->dst_proc->iface());
xbt_os_timer_free(global_timer);
}
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP)
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap)
smpi_destroy_global_memory_segments();
smpi_free_static();
}
xbt_assert(smpi_host_speed >= 0, "You're trying to set the host_speed to a negative value (%f)", smpi_host_speed);
std::string smpi_privatize_option = xbt_cfg_get_string("smpi/privatization");
if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
- smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
+ smpi_privatize_global_variables = SmpiPrivStrategies::None;
else if (smpi_privatize_option == "yes" || smpi_privatize_option == "1")
- smpi_privatize_global_variables = SMPI_PRIVATIZE_DEFAULT;
+ smpi_privatize_global_variables = SmpiPrivStrategies::Default;
else if (smpi_privatize_option == "mmap")
- smpi_privatize_global_variables = SMPI_PRIVATIZE_MMAP;
+ smpi_privatize_global_variables = SmpiPrivStrategies::Mmap;
else if (smpi_privatize_option == "dlopen")
- smpi_privatize_global_variables = SMPI_PRIVATIZE_DLOPEN;
+ smpi_privatize_global_variables = SmpiPrivStrategies::Dlopen;
else
xbt_die("Invalid value for smpi/privatization: '%s'", smpi_privatize_option.c_str());
+ if (not SMPI_switch_data_segment) {
+ XBT_DEBUG("Running without smpi_main(); disable smpi/privatization.");
+ smpi_privatize_global_variables = SmpiPrivStrategies::None;
+ }
#if defined(__FreeBSD__)
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
- XBT_INFO("mmap privatization is broken on FreeBSD, switching to dlopen privatization instead.");
- smpi_privatize_global_variables = SMPI_PRIVATIZE_DLOPEN;
- }
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ XBT_INFO("mmap privatization is broken on FreeBSD, switching to dlopen privatization instead.");
+ smpi_privatize_global_variables = SmpiPrivStrategies::Dlopen;
+ }
#endif
if (smpi_cpu_threshold < 0)
SIMIX_comm_set_copy_data_callback(smpi_comm_copy_buffer_callback);
smpi_init_options();
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_DLOPEN) {
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Dlopen) {
std::string executable_copy = executable;
int fdout = open(target_executable.c_str(), O_CREAT | O_RDWR, S_IRWXU);
xbt_assert(fdout >= 0, "Cannot write into %s", target_executable.c_str());
+ XBT_DEBUG("Copy %ld bytes into %s", static_cast<long>(fdin_size), target_executable.c_str());
#if HAVE_SENDFILE
ssize_t sent_size = sendfile(fdout, fdin, NULL, fdin_size);
xbt_assert(sent_size == fdin_size,
"Error while copying %s: only %zd bytes copied instead of %ld (errno: %d -- %s)",
target_executable.c_str(), sent_size, fdin_size, errno, strerror(errno));
#else
- XBT_VERB("Copy %d bytes into %s", static_cast<int>(fdin_size), target_executable.c_str());
const int bufsize = 1024 * 1024 * 4;
char buf[bufsize];
while (int got = read(fdin, buf, bufsize)) {
smpi_check_options();
TRACE_smpi_alloc();
simgrid::s4u::onSimulationEnd.connect(TRACE_smpi_release);
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP)
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap)
smpi_backup_global_memory_segment();
}
int smpi_loaded_page = -1;
char* smpi_data_exe_start = nullptr;
int smpi_data_exe_size = 0;
-int smpi_privatize_global_variables;
+SmpiPrivStrategies smpi_privatize_global_variables;
static void* smpi_data_exe_copy;
// We keep a copy of all the privatization regions: We can then delete everything easily by iterating over this
XBT_DEBUG("bss+data segment found : size %d starting at %p", smpi_data_exe_size, smpi_data_exe_start);
if (smpi_data_exe_size == 0) { // no need to do anything as global variables don't exist
- smpi_privatize_global_variables=false;
+ smpi_privatize_global_variables = SmpiPrivStrategies::None;
return;
}
// of the simulation and can be used to initialize a dynamically added, new process.
asan_safe_memcpy(smpi_data_exe_copy, TOPAGE(smpi_data_exe_start), smpi_data_exe_size);
#else /* ! HAVE_PRIVATIZATION */
- smpi_privatize_global_variables = false;
+ smpi_privatize_global_variables = SmpiPrivStrategies::None;
xbt_die("You are trying to use privatization on a system that does not support it. Don't.");
return;
#endif
// cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved
// this up here so that I can set the privatized region before the switch.
Process* process = smpi_process_remote(proc);
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
/* Now using the segment index of this process */
process->set_privatized_region(smpi_init_global_memory_segment_process());
/* Done at the process's creation */
}
int Comm::dup(MPI_Comm* newcomm){
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ // we need to switch as the called function may silently touch global variables
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
MPI_Group cp = new Group(this->group());
smpi_process()->set_replaying(false);
}
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ // we need to switch as the called function may silently touch global variables
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
//identify neighbours in comm
Coll_allgather_mpich::allgather(&leader, 1, MPI_INT , leaders_map, 1, MPI_INT, this);
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ // we need to switch as the called function may silently touch global variables
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
}
Coll_bcast_mpich::bcast(&(is_uniform_),1, MPI_INT, 0, comm_intra );
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){ //we need to switch as the called function may silently touch global variables
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ // we need to switch as the called function may silently touch global variables
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
// Are the ranks blocked ? = allocated contiguously on the SMP nodes
// FIXME Handle the case of a partial shared malloc.
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
/* First check if we really have something to do */
void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
{
- if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){//we need to switch as the called function may silently touch global variables
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+ // we need to switch as the called function may silently touch global variables
XBT_DEBUG("Applying operation, switch to the right data frame ");
smpi_switch_data_segment(simgrid::s4u::Actor::self());
}
if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
oldbuf = buf_;
if (not process->replaying() && oldbuf != nullptr && size_ != 0) {
- if ((smpi_privatize_global_variables != 0) && (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
+ if ((smpi_privatize_global_variables != SmpiPrivStrategies::None) &&
+ (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
(static_cast<char*>(buf_) < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
smpi_switch_data_segment(simgrid::s4u::Actor::byPid(src_));
if (((req->flags_ & ACCUMULATE) != 0) ||
(datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
- if (not smpi_process()->replaying() && smpi_privatize_global_variables != 0 &&
+ if (not smpi_process()->replaying() && smpi_privatize_global_variables != SmpiPrivStrategies::None &&
static_cast<char*>(req->old_buf_) >= smpi_data_exe_start &&
static_cast<char*>(req->old_buf_) < smpi_data_exe_start + smpi_data_exe_size) {
XBT_VERB("Privatization : We are unserializing to a zone in global memory Switch data segment ");
filter_and_compile() {
list_add TMPFILES "${TMPFILE}"
- #replace "program main_name by subroutine user\_main (and the end clause as well)"
- sed 's/[[:space:]]*[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9\-\_]*\)/ subroutine user\_main /g' "${ARG}" > "${TMPFILE}"
+ #replace "program main_name by subroutine user_main (and the end clause as well)"
+ sed 's/[[:space:]]*[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9_]*\)/ subroutine user_main /g' "${ARG}" > "${TMPFILE}"
SRCFILE="${TMPFILE}"
list_add CMDLINE "${SRCFILE}"
}
filter_and_compile_f77() {
list_add TMPFILES "${TMPFILE}"
- #replace "program main_name by subroutine user\_main (and the end clause as well)"
+ #replace "program main_name by subroutine user_main (and the end clause as well)"
if [ $TRACE_CALL_LOCATION -gt 0 ]; then
echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > ${TMPFILE}
echo "#line 1 \"${ARG}\"" >> ${TMPFILE}
fi
- sed 's/[[:space:]]\{6\}[[:space:]]*\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9\-\_]*\)/ \1subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
+ sed 's/[[:space:]]\{6\}[[:space:]]*\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9_]*\)/ \1subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
SRCFILE="${TMPFILE}"
list_add CMDLINE "${SRCFILE}"
}
filter_and_compile_f90() {
list_add TMPFILES "${TMPFILE}"
- #replace "program main_name by subroutine user\_main (and the end clause as well)"
+ #replace "program main_name by subroutine user_main (and the end clause as well)"
if [ $TRACE_CALL_LOCATION -gt 0 ]; then
echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > ${TMPFILE}
echo "#line 1 \"${ARG}\"" >> ${TMPFILE}
fi
- sed 's/[[:space:]]*[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9\-\_]*\)/ subroutine user\_main /g' "${ARG}" > "${TMPFILE}"
+ sed 's/[[:space:]]*[pP][rR][oO][gG][rR][aA][mM][[:space:]][[:space:]]*\([a-zA-Z0-9_]*\)/ subroutine user_main /g' "${ARG}" > "${TMPFILE}"
SRCFILE="${TMPFILE}"
list_add CMDLINE "${SRCFILE}"
}
shift 2
;;
"-no-privatize")
- PRIVATIZE=""
+ PRIVATIZE="--cfg=smpi/privatization:no"
shift 1
;;
"-map")
> [rank 2] -> Fafard
> [rank 3] -> Ginette
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [rank 0] -> Tremblay
> [rank 1] -> Jupiter
> [rank 2] -> Fafard
> [rank 2] -> Fafard
> [rank 3] -> Ginette
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
> [rank 0] -> Tremblay
> [rank 1] -> Jupiter
> [rank 2] -> Fafard