SimGrid  3.16
Versatile Simulation of Distributed Systems
smpi_memory.cpp File Reference
#include <cstdint>
#include <climits>
#include <cstring>
#include <vector>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include <sys/mman.h>
#include <unistd.h>
#include "src/xbt/memory_map.hpp"
#include "src/smpi/private.h"
#include "private.hpp"

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (smpi_memory, smpi, "Memory layout support for SMPI")
 
void smpi_get_executable_global_size ()
 
void smpi_switch_data_segment (int dest)
 Map a given SMPI privatization segment (make a SMPI process active) More...
 
void smpi_really_switch_data_segment (int dest)
 Map a given SMPI privatization segment (make a SMPI process active) even if SMPI thinks it is already active. More...
 
int smpi_is_privatisation_file (char *file)
 
void smpi_initialize_global_memory_segments ()
 
void smpi_destroy_global_memory_segments ()
 

Variables

int smpi_loaded_page = -1
 
char * smpi_start_data_exe = nullptr
 
int smpi_size_data_exe = 0
 
int smpi_privatize_global_variables
 
static const int PROT_RWX = (PROT_READ | PROT_WRITE | PROT_EXEC)
 
static const int PROT_RW = (PROT_READ | PROT_WRITE )
 
static XBT_ATTRIB_UNUSED const int PROT_RX = (PROT_READ | PROT_EXEC )
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( smpi_memory  ,
smpi  ,
"Memory layout support for SMPI"   
)

◆ smpi_get_executable_global_size()

void smpi_get_executable_global_size ( )

◆ smpi_switch_data_segment()

void smpi_switch_data_segment ( int  dest)

Map a given SMPI privatization segment (make a SMPI process active)

◆ smpi_really_switch_data_segment()

void smpi_really_switch_data_segment ( int  dest)

Map a given SMPI privatization segment (make a SMPI process active) even if SMPI thinks it is already active.

When doing a state restoration, the state of the restored variables might not be consistent with the state of the virtual memory. In this case, we to change the data segment.

◆ smpi_is_privatisation_file()

int smpi_is_privatisation_file ( char *  file)

◆ smpi_initialize_global_memory_segments()

void smpi_initialize_global_memory_segments ( )

◆ smpi_destroy_global_memory_segments()

void smpi_destroy_global_memory_segments ( )

Variable Documentation

◆ smpi_loaded_page

int smpi_loaded_page = -1

◆ smpi_start_data_exe

char* smpi_start_data_exe = nullptr

◆ smpi_size_data_exe

int smpi_size_data_exe = 0

◆ smpi_privatize_global_variables

int smpi_privatize_global_variables

◆ PROT_RWX

const int PROT_RWX = (PROT_READ | PROT_WRITE | PROT_EXEC)
static

◆ PROT_RW

const int PROT_RW = (PROT_READ | PROT_WRITE )
static

◆ PROT_RX

XBT_ATTRIB_UNUSED const int PROT_RX = (PROT_READ | PROT_EXEC )
static