SimGrid  3.13
Versatile Simulation of Distributed Systems
app-token-ring.c File Reference
#include "simgrid/msg.h"

Functions

 XBT_LOG_NEW_DEFAULT_CATEGORY (msg_app_token_ring,"Messages specific for this msg example")
 
static int foo (int argc, char *argv[])
 Single function for all hosts. More...
 
int main (int argc, char *argv[])
 

Function Documentation

XBT_LOG_NEW_DEFAULT_CATEGORY ( msg_app_token_ring  ,
"Messages specific for this msg example"   
)
static int foo ( int  argc,
char *  argv[] 
)
static

Single function for all hosts.

The token is 1MB long

  • The root (rank 0) first sends the token then waits to receive it back
  • The others receive from their left neighbor (rank-1) and send to their right neighbor (rank+1)
  • Except for the last one which sends the token back to rank 0
int main ( int  argc,
char *  argv[] 
)
  • Load the platform description
  • Give a unique rank to each host and create a foo process on each
  • Run the simulation