SimGrid  3.14.159
Versatile Simulation of Distributed Systems
smpi_bench.cpp File Reference
#include <cstring>
#include <unordered_map>
#include <utility>
#include "src/internal_config.h"
#include "private.h"
#include "private.hpp"
#include <xbt/ex.hpp>
#include "xbt/dict.h"
#include "xbt/sysdep.h"
#include "xbt/ex.h"
#include "surf/surf.h"
#include "simgrid/sg_config.h"
#include "simgrid/modelchecker.h"
#include "src/mc/mc_replay.h"
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

Classes

class  std::hash< smpi_source_location >
 
struct  local_data_t
 

Namespaces

 std
 

Macros

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

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (smpi_bench, smpi, "Logging specific to SMPI (benchmarking)")
 
static size_t shm_size (int fd)
 
static voidshm_map (int fd, size_t size, shared_data_key_type *data)
 
void smpi_bench_destroy ()
 
void smpi_execute_flops_ (double *flops)
 
void smpi_execute_ (double *duration)
 
void smpi_execute_flops (double flops)
 
void smpi_execute (double duration)
 
void smpi_bench_begin ()
 
void smpi_bench_end ()
 
static unsigned int private_sleep (double secs)
 
unsigned int smpi_sleep (unsigned int secs)
 
int smpi_usleep (useconds_t usecs)
 
int smpi_gettimeofday (struct timeval *tv, void *tz)
 
unsigned long long smpi_rastro_resolution ()
 
unsigned long long smpi_rastro_timestamp ()
 
static char * sample_location (int global, const char *file, int line)
 
static int sample_enough_benchs (local_data_t *data)
 
void smpi_sample_1 (int global, const char *file, int line, int iters, double threshold)
 
int smpi_sample_2 (int global, const char *file, int line)
 
void smpi_sample_3 (int global, const char *file, int line)
 
voidsmpi_shared_malloc (size_t size, const char *file, int line)
 
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)
 
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 ()
 
smpi_trace_call_location_tsmpi_trace_get_call_location ()
 These functions will be called from the user code. More...
 
void smpi_trace_set_call_location (const char *file, const int line)
 Functions for call location tracing. More...
 
void smpi_trace_set_call_location_ (const char *file, int *line)
 Required for Fortran bindings. More...
 
void smpi_trace_set_call_location__ (const char *file, int *line)
 Required for Fortran if -fsecond-underscore is activated. More...
 

Variables

xbt_dict_t samples = nullptr
 
xbt_dict_t calls = nullptr
 
double smpi_cpu_threshold
 
double smpi_host_speed
 
int smpi_loaded_page = -1
 
char * smpi_start_data_exe = nullptr
 
int smpi_size_data_exe = 0
 
bool smpi_privatize_global_variables
 
double smpi_total_benched_time = 0
 
smpi_privatisation_region_t smpi_privatisation_regions
 
double sg_surf_precision
 

Macro Definition Documentation

§ MAP_ANONYMOUS

#define MAP_ANONYMOUS   MAP_ANON

§ PTR_STRLEN

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

Function Documentation

§ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( smpi_bench  ,
smpi  ,
"Logging specific to SMPI (benchmarking)"   
)

§ 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_bench_destroy()

void smpi_bench_destroy ( )

§ smpi_execute_flops_()

void smpi_execute_flops_ ( double *  flops)

§ smpi_execute_()

void smpi_execute_ ( double *  duration)

§ smpi_execute_flops()

void smpi_execute_flops ( double  flops)

§ smpi_execute()

void smpi_execute ( double  duration)

§ smpi_bench_begin()

void smpi_bench_begin ( )

§ smpi_bench_end()

void smpi_bench_end ( )

§ private_sleep()

static unsigned int private_sleep ( double  secs)
static

§ smpi_sleep()

unsigned int smpi_sleep ( unsigned int  secs)

§ smpi_usleep()

int smpi_usleep ( useconds_t  usecs)

§ smpi_gettimeofday()

int smpi_gettimeofday ( struct timeval *  tv,
void tz 
)

§ smpi_rastro_resolution()

unsigned long long smpi_rastro_resolution ( )

§ smpi_rastro_timestamp()

unsigned long long smpi_rastro_timestamp ( )

§ sample_location()

static char* sample_location ( int  global,
const char *  file,
int  line 
)
static

§ sample_enough_benchs()

static int sample_enough_benchs ( local_data_t data)
static

§ smpi_sample_1()

void smpi_sample_1 ( int  global,
const char *  file,
int  line,
int  iters,
double  threshold 
)

§ smpi_sample_2()

int smpi_sample_2 ( int  global,
const char *  file,
int  line 
)

§ smpi_sample_3()

void smpi_sample_3 ( int  global,
const char *  file,
int  line 
)

§ smpi_shared_malloc()

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

§ 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 
)

§ 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 ( )

§ smpi_trace_get_call_location()

smpi_trace_call_location_t* smpi_trace_get_call_location ( )

These functions will be called from the user code.

§ smpi_trace_set_call_location()

void smpi_trace_set_call_location ( const char *  file,
int  line 
)

Functions for call location tracing.

These functions will be called from the user's application! (With the FILE and LINE values passed as parameters.)

§ smpi_trace_set_call_location_()

void smpi_trace_set_call_location_ ( const char *  file,
int *  line 
)

Required for Fortran bindings.

Fortran binding.

§ smpi_trace_set_call_location__()

void smpi_trace_set_call_location__ ( const char *  file,
int *  line 
)

Required for Fortran if -fsecond-underscore is activated.

Fortran binding + -fsecond-underscore.

Variable Documentation

§ samples

xbt_dict_t samples = nullptr

§ calls

xbt_dict_t calls = nullptr

§ smpi_cpu_threshold

double smpi_cpu_threshold

§ smpi_host_speed

double smpi_host_speed

§ 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

bool smpi_privatize_global_variables

§ smpi_total_benched_time

double smpi_total_benched_time = 0

§ smpi_privatisation_regions

smpi_privatisation_region_t smpi_privatisation_regions

§ sg_surf_precision

double sg_surf_precision