SimGrid  3.16
Versatile Simulation of Distributed Systems
smpi_shared.cpp File Reference
#include <map>
#include <cstring>
#include "private.h"
#include "private.hpp"
#include "xbt/dict.h"
#include "xbt/ex.hpp"
#include <errno.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>

Classes

class  std::hash< smpi_source_location >
 

Namespaces

 std
 

Macros

#define MAP_ANONYMOUS   MAP_ANON
 
#define MAP_POPULATE   0
 
#define PTR_STRLEN   (2 + 2 * sizeof(void*) + 1)
 
#define PAGE_SIZE   0x1000
 
#define ALIGN_UP(n, align)   (((n) + (align)-1) & -(align))
 
#define ALIGN_DOWN(n, align)   ((n) & -(align))
 
#define HUGE_PAGE_SIZE   1<<21
 

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (smpi_shared, smpi, "Logging specific to SMPI (shared memory macros)")
 
void smpi_shared_destroy ()
 
static size_t shm_size (int fd)
 
static voidshm_map (int fd, size_t size, shared_data_key_type *data)
 
static voidsmpi_shared_malloc_local (size_t size, const char *file, int line)
 
voidsmpi_shared_malloc_partial (size_t size, size_t *shared_block_offsets, int nb_shared_blocks)
 
voidsmpi_shared_malloc (size_t size, const char *file, int line)
 
int smpi_is_shared (void *ptr, std::vector< std::pair< size_t, size_t >> &private_blocks, size_t *offset)
 
std::vector< std::pair< size_t, size_t > > shift_and_frame_private_blocks (const std::vector< std::pair< size_t, size_t >> vec, size_t offset, size_t buff_size)
 
std::vector< std::pair< size_t, size_t > > merge_private_blocks (std::vector< std::pair< size_t, size_t >> src, std::vector< std::pair< size_t, size_t >> dst)
 
void smpi_shared_free (void *ptr)
 
int smpi_shared_known_call (const char *func, const char *input)
 
voidsmpi_shared_get_call (const char *func, const char *input)
 
voidsmpi_shared_set_call (const char *func, const char *input, void *data)
 

Macro Definition Documentation

◆ MAP_ANONYMOUS

#define MAP_ANONYMOUS   MAP_ANON

◆ MAP_POPULATE

#define MAP_POPULATE   0

◆ PTR_STRLEN

#define PTR_STRLEN   (2 + 2 * sizeof(void*) + 1)

◆ PAGE_SIZE

#define PAGE_SIZE   0x1000

◆ ALIGN_UP

#define ALIGN_UP (   n,
  align 
)    (((n) + (align)-1) & -(align))

◆ ALIGN_DOWN

#define ALIGN_DOWN (   n,
  align 
)    ((n) & -(align))

◆ HUGE_PAGE_SIZE

#define HUGE_PAGE_SIZE   1<<21

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( smpi_shared  ,
smpi  ,
"Logging specific to SMPI (shared memory macros)"   
)

◆ smpi_shared_destroy()

void smpi_shared_destroy ( )

◆ shm_size()

static size_t shm_size ( int  fd)
static

◆ shm_map()

static void* shm_map ( int  fd,
size_t  size,
shared_data_key_type *  data 
)
static

◆ smpi_shared_malloc_local()

static void* smpi_shared_malloc_local ( size_t  size,
const char *  file,
int  line 
)
static

◆ smpi_shared_malloc_partial()

void* smpi_shared_malloc_partial ( size_t  size,
size_t *  shared_block_offsets,
int  nb_shared_blocks 
)

◆ smpi_shared_malloc()

void* smpi_shared_malloc ( size_t  size,
const char *  file,
int  line 
)

◆ smpi_is_shared()

int smpi_is_shared ( void ptr,
std::vector< std::pair< size_t, size_t >> &  private_blocks,
size_t *  offset 
)

◆ shift_and_frame_private_blocks()

std::vector<std::pair<size_t, size_t> > shift_and_frame_private_blocks ( const std::vector< std::pair< size_t, size_t >>  vec,
size_t  offset,
size_t  buff_size 
)

◆ merge_private_blocks()

std::vector<std::pair<size_t, size_t> > merge_private_blocks ( std::vector< std::pair< size_t, size_t >>  src,
std::vector< std::pair< size_t, size_t >>  dst 
)

◆ smpi_shared_free()

void smpi_shared_free ( void ptr)

◆ smpi_shared_known_call()

int smpi_shared_known_call ( const char *  func,
const char *  input 
)

◆ smpi_shared_get_call()

void* smpi_shared_get_call ( const char *  func,
const char *  input 
)

◆ smpi_shared_set_call()

void* smpi_shared_set_call ( const char *  func,
const char *  input,
void data 
)