teshsuite/smpi/mpich3-test/f77/rma/winfencef
teshsuite/smpi/mpich3-test/f77/rma/wingetf
teshsuite/smpi/mpich3-test/f77/rma/winnamef
+teshsuite/smpi/mpich3-test/f77/rma/winscale1f
teshsuite/smpi/mpich3-test/f77/topo/cartcrf
teshsuite/smpi/mpich3-test/f90/coll/allredint8f90
teshsuite/smpi/mpich3-test/f90/coll/allredopttf90
teshsuite/smpi/mpich3-test/f90/rma/winfencef90
teshsuite/smpi/mpich3-test/f90/rma/wingetf90
teshsuite/smpi/mpich3-test/f90/rma/winnamef90
+teshsuite/smpi/mpich3-test/f90/rma/winscale1f90
teshsuite/smpi/mpich3-test/group/groupcreate
teshsuite/smpi/mpich3-test/group/groupnullincl
teshsuite/smpi/mpich3-test/group/grouptest
teshsuite/smpi/mpich3-test/rma/accfence1
teshsuite/smpi/mpich3-test/rma/accfence2
teshsuite/smpi/mpich3-test/rma/accfence2_am
+teshsuite/smpi/mpich3-test/rma/accpscw1
teshsuite/smpi/mpich3-test/rma/allocmem
teshsuite/smpi/mpich3-test/rma/epochtest
teshsuite/smpi/mpich3-test/rma/getfence1
teshsuite/smpi/mpich3-test/rma/getgroup
teshsuite/smpi/mpich3-test/rma/manyrma3
+teshsuite/smpi/mpich3-test/rma/nullpscw
teshsuite/smpi/mpich3-test/rma/putfence1
teshsuite/smpi/mpich3-test/rma/putfidx
+teshsuite/smpi/mpich3-test/rma/putpscw1
teshsuite/smpi/mpich3-test/rma/test1
teshsuite/smpi/mpich3-test/rma/test1_am
teshsuite/smpi/mpich3-test/rma/test1_dt
+teshsuite/smpi/mpich3-test/rma/test2
+teshsuite/smpi/mpich3-test/rma/test2_am
+teshsuite/smpi/mpich3-test/rma/test3
teshsuite/smpi/mpich3-test/rma/test5
teshsuite/smpi/mpich3-test/rma/test5_am
teshsuite/smpi/mpich3-test/rma/transpose1
teshsuite/smpi/mpich3-test/rma/transpose2
+teshsuite/smpi/mpich3-test/rma/transpose3
teshsuite/smpi/mpich3-test/rma/transpose6
teshsuite/smpi/mpich3-test/rma/transpose7
teshsuite/smpi/mpich3-test/rma/window_creation
if(enable_smpi)
include(FindGFortran)
- #really checks for objdump for privatization
- find_package(BinUtils QUIET)
- mark_as_advanced(BinUtils_DIR)
SET(HAVE_SMPI 1)
-
- if( NOT "${CMAKE_OBJDUMP}" MATCHES "CMAKE_OBJDUMP-NOTFOUND" AND HAVE_MMAP)
+ if("${CMAKE_SYSTEM}" MATCHES "Linux")
+ SET(USE_LIBUTIL 0)
SET(HAVE_PRIVATIZATION 1)
- else()
+ elseif("${CMAKE_SYSTEM}" MATCHES "^FreeBSD")
+ SET(USE_LIBUTIL 0)
SET(HAVE_PRIVATIZATION 0)
endif()
endif()
SimGrid (3.13) UNRELEASED; urgency=low
+ SMPI
+ * BC breaks:
+ - The option smpi/async_small_thres was renamed to smpi/async_small_thresh
+ as we attempt to unify our naming schemes -> smpi/send_is_detached_thresh
+
+
XBT
* Kill the setset datacontainer: it's unused since a while.
It is possible to specify that messages below a certain size will be sent
as soon as the call to MPI_Send is issued, without waiting for the
correspondant receive. This threshold can be configured through the
-\b smpi/async_small_thres item. The default value is 0. This behavior can also be
+\b smpi/async_small_thresh item. The default value is 0. This behavior can also be
manually set for MSG mailboxes, by setting the receiving mode of the mailbox
with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this
mailbox will have this behavior, so consider using two mailboxes if needed.
- \c surf/precision: \ref options_model_precision
- \c <b>For collective operations of SMPI, please refer to Section \ref options_index_smpi_coll</b>
-- \c smpi/async_small_thres: \ref options_model_network_asyncsend
+- \c smpi/async_small_thresh: \ref options_model_network_asyncsend
- \c smpi/bw_factor: \ref options_model_smpi_bw_factor
- \c smpi/coll_selector: \ref options_model_smpi_collectives
- \c smpi/cpu_threshold: \ref options_smpi_bench
process->pid_ = pid;
process->running_ = true;
process->status_ = 0;
- process->memory_map_ = get_memory_map(pid);
+ process->memory_map_ = simgrid::xbt::get_memory_map(pid);
process->cache_flags = MC_PROCESS_CACHE_FLAG_NONE;
process->init_memory_map_info();
process->clear_refs_fd_ = -1;
if(regcomp(&res.so_re, SO_RE, 0) || regcomp(&res.version_re, VERSION_RE, 0))
xbt_die(".so regexp did not compile");
- std::vector<simgrid::mc::VmMap> const& maps = this->memory_map_;
+ std::vector<simgrid::xbt::VmMap> const& maps = this->memory_map_;
const char* current_name = NULL;
this->object_infos.resize(0);
for (size_t i=0; i < maps.size(); i++) {
- simgrid::mc::VmMap const& reg = maps[i];
+ simgrid::xbt::VmMap const& reg = maps[i];
const char* pathname = maps[i].pathname.c_str();
// Nothing to do
#include "src/simix/popping_private.h"
#include "src/simix/smx_private.h"
+#include "../xbt/memory_map.hpp"
+
#include "mc_forward.hpp"
#include "mc_base.h"
#include "mc_mmalloc.h" // std_heap
-#include "mc_memory_map.h"
#include "AddressSpace.hpp"
#include "mc_protocol.h"
int socket_;
int status_;
bool running_;
- std::vector<VmMap> memory_map_;
+ std::vector<simgrid::xbt::VmMap> memory_map_;
remote_ptr<void> maestro_stack_start_, maestro_stack_end_;
int memory_file;
std::vector<IgnoredRegion> ignored_regions_;
#include <dirent.h>
#include "src/internal_config.h"
-#include "mc_memory_map.h"
#include "mc_private.h"
#include "xbt/module.h"
#include <xbt/mmalloc.h>
* `dl_iterate_phdr` would be more robust but would not work in cross-process.
* */
void MC_find_object_address(
- std::vector<simgrid::mc::VmMap> const& maps,
+ std::vector<simgrid::xbt::VmMap> const& maps,
simgrid::mc::ObjectInformation* result)
{
char* file_name = xbt_strdup(result->file_name.c_str());
const char *name = basename(file_name);
for (size_t i = 0; i < maps.size(); ++i) {
- simgrid::mc::VmMap const& reg = maps[i];
+ simgrid::xbt::VmMap const& reg = maps[i];
if (maps[i].pathname.empty()
|| strcmp(basename(maps[i].pathname.c_str()), name)) {
// Nothing to do
result->start_rw = (char*) reg.start_addr;
result->end_rw = (char*) reg.end_addr;
// .bss is usually after the .data:
- simgrid::mc::VmMap const& next = maps[i + 1];
+ simgrid::xbt::VmMap const& next = maps[i + 1];
if (next.pathname.empty() && (next.prot & PROT_WRITE)
&& next.start_addr == reg.end_addr) {
result->end_rw = (char*) maps[i + 1].end_addr;
/** \brief Finds informations about a given shared object/executable */
std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
- std::vector<simgrid::mc::VmMap> const& maps, const char *name)
+ std::vector<simgrid::xbt::VmMap> const& maps, const char *name)
{
std::shared_ptr<simgrid::mc::ObjectInformation> result =
std::make_shared<simgrid::mc::ObjectInformation>();
#include <dwarf.h>
#include "src/mc/Variable.hpp"
-#include "src/mc/mc_memory_map.h"
namespace simgrid {
namespace dwarf {
#include "mc_comm_pattern.h"
#include "mc_request.h"
#include "mc_safety.h"
-#include "mc_memory_map.h"
#include "mc_snapshot.h"
#include "mc_liveness.h"
#include "mc_private.h"
#include <xbt/base.h>
#include "mc_forward.hpp"
-#include "mc_memory_map.h"
+#include "../xbt/memory_map.hpp"
XBT_PRIVATE std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
- std::vector<simgrid::mc::VmMap> const& maps, const char* name);
+ std::vector<simgrid::xbt::VmMap> const& maps, const char* name);
XBT_PRIVATE void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info);
#endif
#include "xbt/fifo.h"
#include "xbt/config.h"
+#ifdef __cplusplus
+#include "../xbt/memory_map.hpp"
+#endif
+
#include "xbt/function_types.h"
#include "xbt/mmalloc.h"
#include "../simix/smx_private.h"
XBT_PRIVATE void MC_invalidate_cache(void);
+#ifdef __cplusplus
+
+XBT_PRIVATE void MC_find_object_address(
+ std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
+
+#endif
+
SG_END_DECL()
#endif
xbt_cfgelm_double, 1, 1, NULL, NULL);
xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/cpu_threshold", 1e-6);
- xbt_cfg_register(&_sg_cfg_set, "smpi/async_small_thres",
+ xbt_cfg_register(&_sg_cfg_set, "smpi/async_small_thresh",
"Maximal size of messages that are to be sent asynchronously, without waiting for the receiver",
xbt_cfgelm_int, 1, 1, NULL, NULL);
- xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thres", 0);
+ xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thresh", 0);
xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
"Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
if (request->flags & RECV) {
print_request("New recv", request);
- int async_small_thres = sg_cfg_get_int("smpi/async_small_thres");
+ int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
xbt_mutex_t mut = smpi_process_mailboxes_mutex();
- if (async_small_thres != 0 ||request->flags & RMA)
+ if (async_small_thresh != 0 ||request->flags & RMA)
xbt_mutex_acquire(mut);
- if (async_small_thres == 0 && !(request->flags & RMA)) {
+ if (async_small_thresh == 0 && !(request->flags & RMA)) {
mailbox = smpi_process_mailbox();
}
- else if (request->flags & RMA || request->size < async_small_thres){
+ else if (request->flags & RMA || request->size < async_small_thresh){
//We have to check both mailboxes (because SSEND messages are sent to the large mbox). begin with the more appropriate one : the small one.
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("Is there a corresponding send already posted in the small mailbox %p (in case of SSEND)?", mailbox);
request, -1.0);
XBT_DEBUG("recv simcall posted");
- if (async_small_thres != 0 || request->flags & RMA)
+ if (async_small_thresh != 0 || request->flags & RMA)
xbt_mutex_release(mut);
} else {
XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size));
}
- int async_small_thres = sg_cfg_get_int("smpi/async_small_thres");
+ int async_small_thresh = sg_cfg_get_int("smpi/async_small_thresh");
xbt_mutex_t mut=smpi_process_remote_mailboxes_mutex(receiver);
- if (async_small_thres != 0 || request->flags & RMA)
+ if (async_small_thresh != 0 || request->flags & RMA)
xbt_mutex_acquire(mut);
- if (!(async_small_thres != 0 || request->flags & RMA)) {
+ if (!(async_small_thresh != 0 || request->flags & RMA)) {
mailbox = smpi_process_remote_mailbox(receiver);
}
- else if (request->flags & RMA || request->size < async_small_thres) { // eager mode
+ else if (request->flags & RMA || request->size < async_small_thresh) { // eager mode
mailbox = smpi_process_remote_mailbox(receiver);
XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %p?", mailbox);
smx_synchro_t action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, (void*)request);
if (request->action)
simcall_set_category(request->action, TRACE_internal_smpi_get_category());
- if (async_small_thres != 0 || request->flags & RMA)
+ if (async_small_thresh != 0 || request->flags & RMA)
xbt_mutex_release(mut);
}
print_request("New iprobe", request);
// We have to test both mailboxes as we don't know if we will receive one one or another
- if (sg_cfg_get_int("smpi/async_small_thres")>0){
+ if (sg_cfg_get_int("smpi/async_small_thresh")>0){
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("trying to probe the perm recv mailbox");
request->action = simcall_comm_iprobe(mailbox, 0, request->src, request->tag, &match_recv, (void*)request);
return strncmp("/dev/shm/my-buffer-", file, 19) == 0;
}
-void smpi_get_executable_global_size(){
- int size_bss_binary=0;
- int size_data_binary=0;
- FILE *fp;
- char *line = NULL; /* Temporal storage for each line that is readed */
- ssize_t read; /* Number of bytes readed */
- size_t n = 0; /* Amount of bytes to read by xbt_getline */
-
- char *lfields[7];
- int i, found = 0;
-
- char *command = bprintf("objdump --section-headers %s", xbt_binary_name);
-
- fp = popen(command, "r");
-
- if(fp == NULL){
- perror("popen failed");
- xbt_abort();
- }
-
- while ((read = xbt_getline(&line, &n, fp)) != -1 && found != 2) {
-
- if(n == 0)
- continue;
-
- /* Wipeout the new line character */
- line[read - 1] = '\0';
-
- lfields[0] = strtok(line, " ");
-
- if(lfields[0] == NULL)
- continue;
-
- if(strcmp(lfields[0], "Sections:") == 0
- || strcmp(lfields[0], "Idx") == 0
- || strncmp(lfields[0], xbt_binary_name, strlen(xbt_binary_name)) == 0)
- continue;
-
- for (i = 1; i < 7 && lfields[i - 1] != NULL; i++) {
- lfields[i] = strtok(NULL, " ");
- }
-
- /*
- * we are looking for these fields
- 23 .data 02625a20 00000000006013e0 00000000006013e0 000013e0 2**5
- CONTENTS, ALLOC, LOAD, DATA
- 24 .bss 02625a40 0000000002c26e00 0000000002c26e00 02626e00 2**5
- ALLOC
- */
-
- if(i>=6){
- if(strcmp(lfields[1], ".data") == 0){
- size_data_binary = strtoul(lfields[2], NULL, 16);
- smpi_start_data_exe = (char*) strtoul(lfields[4], NULL, 16);
- found++;
- }else if(strcmp(lfields[1], ".bss") == 0){
- //the beginning of bss is not exactly the end of data if not aligned, grow bss reported size accordingly
- //TODO : check if this is OK, as some segments may be inserted between them..
- size_bss_binary = ((char*) strtoul(lfields[4], NULL, 16) - (smpi_start_data_exe + size_data_binary))
- + strtoul(lfields[2], NULL, 16);
- found++;
- }
-
- }
-
- }
-
- smpi_size_data_exe = (unsigned long) smpi_start_data_exe
- - (unsigned long) TOPAGE(smpi_start_data_exe)
- + size_data_binary+size_bss_binary;
- xbt_free(command);
- xbt_free(line);
- pclose(fp);
-
-}
-
void smpi_initialize_global_memory_segments(){
#ifndef HAVE_PRIVATIZATION
static void smpi_check_options(){
//check correctness of MPI parameters
- xbt_assert(sg_cfg_get_int("smpi/async_small_thres") <=
+ xbt_assert(sg_cfg_get_int("smpi/async_small_thresh") <=
sg_cfg_get_int("smpi/send_is_detached_thres"));
if (sg_cfg_is_default_value("smpi/running_power")) {
--- /dev/null
+/* Copyright (c) 2015. 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 <iostream>
+
+#include <limits.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#include "../xbt/memory_map.hpp"
+
+#include "private.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi,
+ "Memory layout support for SMPI");
+
+#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
+
+#define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC)
+#define PROT_RW (PROT_READ | PROT_WRITE )
+#define PROT_RX (PROT_READ | PROT_EXEC )
+
+void smpi_get_executable_global_size(void)
+{
+ char buffer[PATH_MAX];
+ char* full_name = realpath(xbt_binary_name, buffer);
+ if (full_name == nullptr)
+ xbt_die("Could not resolve binary file name");
+
+ std::vector<simgrid::xbt::VmMap> map = simgrid::xbt::get_memory_map(getpid());
+ for (auto i = map.begin(); i != map.end() ; ++i) {
+ // TODO, In practice, this implementation would not detect a completely
+ // anonymous data segment. This does not happen in practice, however.
+
+ // File backed RW entry:
+ if (i->pathname == full_name
+ && (i->prot & PROT_RWX) == PROT_RW) {
+ smpi_start_data_exe = (char*) i->start_addr;
+ smpi_size_data_exe = i->end_addr - i->start_addr;
+ ++i;
+ /* Here we are making the assumption that a suitable empty region
+ following the rw- area is the end of the data segment. It would
+ be better to check with the size of the data segment. */
+ if (i != map.end()
+ && i->pathname.empty()
+ && (i->prot & PROT_RWX) == PROT_RW
+ && i->start_addr == (std::uint64_t) smpi_start_data_exe + smpi_size_data_exe) {
+ smpi_size_data_exe = i->end_addr - (std::uint64_t) smpi_start_data_exe;
+ }
+ return;
+ }
+ }
+ xbt_die("Did not find my data segment.");
+}
XBT_LOG_CONNECT(mcer_ignore);
XBT_LOG_CONNECT(mc_liveness);
XBT_LOG_CONNECT(mc_memory);
- XBT_LOG_CONNECT(mc_memory_map);
XBT_LOG_CONNECT(mc_page_snapshot);
XBT_LOG_CONNECT(mc_request);
XBT_LOG_CONNECT(mc_safety);
#include <cstring>
#include <sys/types.h>
+#include <sys/mman.h>
+#include <xbt/sysdep.h>
#include <xbt/base.h>
+#include <xbt/file.h>
+#include <xbt/log.h>
-#include "mc_memory_map.h"
-#include "mc_private.h"
+#include "memory_map.hpp"
extern "C" {
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory_map, mc,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_memory_map, xbt,
"Logging specific to algorithms for memory_map");
}
namespace simgrid {
-namespace mc {
+namespace xbt {
XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
{
+#ifdef __linux__
/* Open the actual process's proc maps file and create the memory_map_t */
/* to be returned. */
char* path = bprintf("/proc/%i/maps", (int) pid);
std::free(line);
std::fclose(fp);
return std::move(ret);
+#else
+ /* On FreeBSD, kinfo_getvmmap() could be used but mmap() support is disabled
+ anyway. */
+ xbt_die("Could not get memory map from process %lli", (long long int) pid);
+#endif
}
}
/* 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. */
-#ifndef SIMGRID_MC_MEMORY_MAP_H
-#define SIMGRID_MC_MEMORY_MAP_H
+#ifndef SIMGRID_XBT_MEMORY_MAP_HPP
+#define SIMGRID_XBT_MEMORY_MAP_HPP
#include <cstdint>
-
#include <string>
#include <vector>
-#include <sys/types.h>
-
#include <xbt/base.h>
-
-#include <simgrid_config.h>
-#include "mc_forward.hpp"
+#include <sys/types.h>
namespace simgrid {
-namespace mc {
+namespace xbt {
/** An virtual memory map entry from /proc/$pid/maps */
struct VmMap {
}
}
-extern "C" {
-
-XBT_PRIVATE void MC_find_object_address(
- std::vector<simgrid::mc::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
-
-}
-
#endif
elsif (/--?maxnp=(.*)/) { $np_max = $1; }
elsif (/--?tests=(.*)/) { $listfiles = $1; }
elsif (/--?srcdir=(.*)/) { $srcdir = $1;
- $mpiexec="$mpiexec -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running_power:1e9 --cfg=smpi/async_small_thres:65536"; }
+ $mpiexec="$mpiexec -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running_power:1e9 --cfg=smpi/async_small_thresh:65536"; }
elsif (/--?verbose/) { $verbose = 1; }
elsif (/--?showprogress/) { $showProgress = 1; }
elsif (/--?debug/) { $debug = 1; }
src/xbt/heap_private.h
src/xbt/log_private.h
src/xbt/mallocator_private.h
+
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm.c
src/xbt/mmalloc/mm_legacy.c
src/smpi/instr_smpi.c
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
+ src/smpi/smpi_memory.cpp
src/smpi/smpi_c99.c
src/smpi/smpi_coll.c
src/smpi/smpi_comm.c
src/xbt/lib.c
src/xbt/log.c
src/xbt/mallocator.c
+ src/xbt/memory_map.cpp
+ src/xbt/memory_map.hpp
src/xbt/parmap.cpp
src/xbt/set.c
src/xbt/snprintf.c
src/xbt/xbt_strbuff.c
src/xbt/xbt_virtu.c
src/xbt_modinter.h
+
)
if(HAVE_MMALLOC)
src/mc/mc_state.h
src/mc/mc_state.cpp
src/mc/mc_visited.cpp
- src/mc/mc_memory_map.h
- src/mc/memory_map.cpp
src/mc/mc_client.cpp
src/mc/mc_client_api.cpp
src/mc/mc_client.h