SimGrid  3.16
Versatile Simulation of Distributed Systems
smx_network.cpp File Reference
#include <algorithm>
#include <boost/range/algorithm.hpp>
#include "src/kernel/activity/CommImpl.hpp"
#include <xbt/ex.hpp>
#include "simgrid/s4u/Host.hpp"
#include "mc/mc.h"
#include "simgrid/s4u/Activity.hpp"
#include "simgrid/s4u/Mailbox.hpp"
#include "src/mc/mc_replay.h"
#include "src/simix/smx_private.h"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/surf_interface.hpp"
#include "src/surf/network_interface.hpp"

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (simix_network, simix, "SIMIX network-related synchronization")
 
static void SIMIX_waitany_remove_simcall_from_actions (smx_simcall_t simcall)
 
static void SIMIX_comm_copy_data (smx_activity_t synchro)
 Copy the communication data from the sender's buffer to the receiver's one. More...
 
static void SIMIX_comm_start (simgrid::kernel::activity::CommImplPtr comm)
 Starts the simulation of a communication synchro. More...
 
static simgrid::kernel::activity::CommImplPtr _find_matching_comm (boost::circular_buffer_space_optimized< smx_activity_t > *deque, e_smx_comm_type_t type, int(*match_fun)(void *, void *, smx_activity_t), void *this_user_data, smx_activity_t my_synchro, bool remove_matching)
 Checks if there is a communication activity queued in a deque matching our needs. More...
 
void simcall_HANDLER_comm_send (smx_simcall_t simcall, smx_actor_t src, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int(*match_fun)(void *, void *, smx_activity_t), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double timeout)
 
smx_activity_t simcall_HANDLER_comm_isend (smx_simcall_t simcall, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int(*match_fun)(void *, void *, smx_activity_t), void(*clean_fun)(void *), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, int detached)
 
void simcall_HANDLER_comm_recv (smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int(*match_fun)(void *, void *, smx_activity_t), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double timeout, double rate)
 
smx_activity_t simcall_HANDLER_comm_irecv (smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int(*match_fun)(void *, void *, smx_activity_t), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double rate)
 
smx_activity_t SIMIX_comm_irecv (smx_actor_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int(*match_fun)(void *, void *, smx_activity_t), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double rate)
 
smx_activity_t simcall_HANDLER_comm_iprobe (smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, int(*match_fun)(void *, void *, smx_activity_t), void *data)
 
smx_activity_t SIMIX_comm_iprobe (smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, int(*match_fun)(void *, void *, smx_activity_t), void *data)
 
void simcall_HANDLER_comm_wait (smx_simcall_t simcall, smx_activity_t synchro, double timeout)
 
void simcall_HANDLER_comm_test (smx_simcall_t simcall, smx_activity_t synchro)
 
void simcall_HANDLER_comm_testany (smx_simcall_t simcall, simgrid::kernel::activity::ActivityImplPtr comms[], size_t count)
 
void simcall_HANDLER_comm_waitany (smx_simcall_t simcall, xbt_dynar_t synchros, double timeout)
 
void SIMIX_comm_finish (smx_activity_t synchro)
 Answers the SIMIX simcalls associated to a communication synchro. More...
 
void SIMIX_comm_set_copy_data_callback (void(*callback)(smx_activity_t, void *, size_t))
 
void SIMIX_comm_copy_pointer_callback (smx_activity_t synchro, void *buff, size_t buff_size)
 
void SIMIX_comm_copy_buffer_callback (smx_activity_t synchro, void *buff, size_t buff_size)
 

Variables

static void(* SIMIX_comm_copy_data_callback )(smx_activity_t, void *, size_t) = &SIMIX_comm_copy_pointer_callback
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( simix_network  ,
simix  ,
"SIMIX network-related synchronization"   
)

◆ SIMIX_waitany_remove_simcall_from_actions()

void SIMIX_waitany_remove_simcall_from_actions ( smx_simcall_t  simcall)
static

◆ SIMIX_comm_copy_data()

void SIMIX_comm_copy_data ( smx_activity_t  synchro)
static

Copy the communication data from the sender's buffer to the receiver's one.

Parameters
synchroThe communication

◆ SIMIX_comm_start()

static void SIMIX_comm_start ( simgrid::kernel::activity::CommImplPtr  comm)
inlinestatic

Starts the simulation of a communication synchro.

Parameters
synchrothe communication synchro

◆ _find_matching_comm()

static simgrid::kernel::activity::CommImplPtr _find_matching_comm ( boost::circular_buffer_space_optimized< smx_activity_t > *  deque,
e_smx_comm_type_t  type,
int(*)(void *, void *, smx_activity_t match_fun,
void this_user_data,
smx_activity_t  my_synchro,
bool  remove_matching 
)
static

Checks if there is a communication activity queued in a deque matching our needs.

Parameters
typeThe type of communication we are looking for (comm_send, comm_recv)
Returns
The communication activity if found, nullptr otherwise

◆ simcall_HANDLER_comm_send()

void simcall_HANDLER_comm_send ( smx_simcall_t  simcall,
smx_actor_t  src,
smx_mailbox_t  mbox,
double  task_size,
double  rate,
void src_buff,
size_t  src_buff_size,
int(*)(void *, void *, smx_activity_t match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void data,
double  timeout 
)

◆ simcall_HANDLER_comm_isend()

smx_activity_t simcall_HANDLER_comm_isend ( smx_simcall_t  simcall,
smx_actor_t  src_proc,
smx_mailbox_t  mbox,
double  task_size,
double  rate,
void src_buff,
size_t  src_buff_size,
int(*)(void *, void *, smx_activity_t match_fun,
void(*)(void *)  clean_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void data,
int  detached 
)

◆ simcall_HANDLER_comm_recv()

void simcall_HANDLER_comm_recv ( smx_simcall_t  simcall,
smx_actor_t  receiver,
smx_mailbox_t  mbox,
void dst_buff,
size_t *  dst_buff_size,
int(*)(void *, void *, smx_activity_t match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void data,
double  timeout,
double  rate 
)

◆ simcall_HANDLER_comm_irecv()

smx_activity_t simcall_HANDLER_comm_irecv ( smx_simcall_t  simcall,
smx_actor_t  receiver,
smx_mailbox_t  mbox,
void dst_buff,
size_t *  dst_buff_size,
int(*)(void *, void *, smx_activity_t match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void data,
double  rate 
)

◆ SIMIX_comm_irecv()

smx_activity_t SIMIX_comm_irecv ( smx_actor_t  dst_proc,
smx_mailbox_t  mbox,
void dst_buff,
size_t *  dst_buff_size,
int(*)(void *, void *, smx_activity_t match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void data,
double  rate 
)

◆ simcall_HANDLER_comm_iprobe()

smx_activity_t simcall_HANDLER_comm_iprobe ( smx_simcall_t  simcall,
smx_mailbox_t  mbox,
int  type,
int  src,
int  tag,
int(*)(void *, void *, smx_activity_t match_fun,
void data 
)

◆ SIMIX_comm_iprobe()

smx_activity_t SIMIX_comm_iprobe ( smx_actor_t  dst_proc,
smx_mailbox_t  mbox,
int  type,
int  src,
int  tag,
int(*)(void *, void *, smx_activity_t match_fun,
void data 
)

◆ simcall_HANDLER_comm_wait()

void simcall_HANDLER_comm_wait ( smx_simcall_t  simcall,
smx_activity_t  synchro,
double  timeout 
)

◆ simcall_HANDLER_comm_test()

void simcall_HANDLER_comm_test ( smx_simcall_t  simcall,
smx_activity_t  synchro 
)

◆ simcall_HANDLER_comm_testany()

void simcall_HANDLER_comm_testany ( smx_simcall_t  simcall,
simgrid::kernel::activity::ActivityImplPtr  comms[],
size_t  count 
)

◆ simcall_HANDLER_comm_waitany()

void simcall_HANDLER_comm_waitany ( smx_simcall_t  simcall,
xbt_dynar_t  synchros,
double  timeout 
)

◆ SIMIX_comm_finish()

void SIMIX_comm_finish ( smx_activity_t  synchro)

Answers the SIMIX simcalls associated to a communication synchro.

Parameters
synchroa finished communication synchro

◆ SIMIX_comm_set_copy_data_callback()

void SIMIX_comm_set_copy_data_callback ( void(*)(smx_activity_t, void *, size_t)  callback)

◆ SIMIX_comm_copy_pointer_callback()

void SIMIX_comm_copy_pointer_callback ( smx_activity_t  synchro,
void buff,
size_t  buff_size 
)

◆ SIMIX_comm_copy_buffer_callback()

void SIMIX_comm_copy_buffer_callback ( smx_activity_t  synchro,
void buff,
size_t  buff_size 
)

Variable Documentation

◆ SIMIX_comm_copy_data_callback

void(* SIMIX_comm_copy_data_callback) (smx_activity_t, void *, size_t) = &SIMIX_comm_copy_pointer_callback
static