ROSS
Typedefs | Functions | Variables
network-mpi.h File Reference

Go to the source code of this file.

Typedefs

typedef long tw_node
 

Functions

const tw_optdeftw_net_init (int *argc, char ***argv)
 Initalize the network library and parse options. More...
 
void tw_comm_set (MPI_Comm comm)
 Setup the MPI_COMM_ROSS communicator to use instead of MPI_COMM_WORLD. More...
 
void tw_net_start (void)
 Starts the network library after option parsing. More...
 
void tw_net_stop (void)
 Stops the network library after simulation end. More...
 
void tw_net_abort (void) NORETURN
 
void tw_net_read (tw_pe *)
 starts service_queues() to poll network More...
 
void tw_net_send (tw_event *)
 Adds the event to the outgoing queue of events to be sent, polls for finished sends, and attempts to start sends from outq. More...
 
void tw_net_cancel (tw_event *)
 Cancel the given remote event by either removing from the outq or sending an antimessage, depending on the status of the original positive send. More...
 
unsigned tw_nnodes (void)
 
void tw_net_barrier (void)
 
tw_stime tw_net_minimum (void)
 Obtain the lowest timestamp inside the network buffers. More...
 
tw_statisticstw_net_statistics (tw_pe *, tw_statistics *)
 Function to reduce all the statistics for output. More...
 

Variables

MPI_Comm MPI_COMM_ROSS
 

Typedef Documentation

typedef long tw_node

Definition at line 4 of file network-mpi.h.

Function Documentation

void tw_comm_set ( MPI_Comm  comm)

This function should be called before tw_net_init.

Parameters
[in]commCustom MPI communicator for setting MPI_COMM_ROSS

Definition at line 59 of file network-mpi.c.

References custom_communicator, and MPI_COMM_ROSS.

Referenced by main().

Here is the caller graph for this function:

void tw_net_abort ( void  )

Aborts the entire simulation when a grave error is found.

Definition at line 147 of file network-mpi.c.

References MPI_COMM_ROSS.

Referenced by tw_error().

Here is the caller graph for this function:

void tw_net_barrier ( void  )

Block until all nodes call the barrier.

Definition at line 175 of file network-mpi.c.

References MPI_COMM_ROSS, tw_error(), and TW_LOC.

Referenced by tw_sched_init(), tw_scheduler_conservative(), tw_scheduler_optimistic(), and tw_scheduler_optimistic_realtime().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_net_cancel ( tw_event )
Parameters
[in]eremote event to be canceled

Definition at line 595 of file network-mpi.c.

References tw_event::cancel_asend, tw_event::cancel_q, tw_event::owner, tw_lp::pe, service_queues(), tw_event::src_lp, tw_event::state, tw_error(), tw_event_free(), tw_eventq_delete_any(), tw_eventq_unshift(), TW_LOC, TW_net_asend, TW_net_outq, and TW_pe_sevent_q.

Referenced by event_cancel().

Here is the call graph for this function:

Here is the caller graph for this function:

const tw_optdef* tw_net_init ( int *  argc,
char ***  argv 
)

argc and argv are pointers to the original command line; the network library may edit these before the option parser sees them allowing for network implementation specific argument handling to occur.

It's possible for a model to init MPI itself, as this function will first check if MPI is already initialized before attempting to call MPI_Init().

This function also sets the global variables g_tw_masternode and g_tw_mynode.

Parameters
[in]argcPointer to command line arg count
[in]argvPointer to command line args
Returns
tw_optdef array to be included in overall process command line argument display and parsing; NULL may be returned to indicate the implementation has no options it wants included.

Definition at line 66 of file network-mpi.c.

References g_tw_masternode, g_tw_mynode, MPI_COMM_ROSS, mpi_opts, tw_error(), and TW_LOC.

Referenced by tw_init().

Here is the call graph for this function:

Here is the caller graph for this function:

tw_stime tw_net_minimum ( void  )
Returns
minimum timestamp for this PE's network buffers

Definition at line 182 of file network-mpi.c.

References act_q::cur, act_q::event_list, tw_eventq::head, tw_event::next, posted_sends, tw_event::recv_ts, TW_STIME_CMP, and TW_STIME_MAX.

Referenced by tw_gvt_step2().

Here is the caller graph for this function:

void tw_net_read ( tw_pe )
Parameters
[in]mepointer to the PE

Definition at line 572 of file network-mpi.c.

References service_queues().

Referenced by tw_gvt_step2(), tw_sched_init(), tw_scheduler_conservative(), tw_scheduler_optimistic(), and tw_scheduler_optimistic_realtime().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_net_send ( tw_event )
Parameters
[in]eremote event to be sent

Definition at line 578 of file network-mpi.c.

References tw_event::owner, tw_lp::pe, posted_sends, tw_event::remote, send_begin(), send_finish(), tw_event::src_lp, tw_event::state, test_q(), tw_eventq_unshift(), and TW_net_outq.

Referenced by tw_event_send().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_net_start ( void  )

Makes calls to initialize the PE (g_tw_pe), create the hash/AVL tree (for optimistic modes), and queues for posted sends/recvs. Also pre-posts MPI Irecvs operations.

Definition at line 109 of file network-mpi.c.

References CONSERVATIVE, g_tw_mynode, g_tw_net_device_size, g_tw_pe, g_tw_synchronization_protocol, init_q(), MPI_COMM_ROSS, NO_SYNCH, OPTIMISTIC, posted_recvs, posted_sends, read_buffer, recv_begin(), send_buffer, SEQUENTIAL, tw_error(), TW_LOC, tw_nnodes(), tw_pe_init(), and world_size.

Referenced by tw_init().

Here is the call graph for this function:

Here is the caller graph for this function:

tw_statistics* tw_net_statistics ( tw_pe me,
tw_statistics s 
)
Attention
Notice that the MPI_Reduce "count" parameter is greater than one. We are reducing on multiple variables simultaneously so if you change this function or the struct tw_statistics, you must update the other.

Function to reduce all the statistics for output.

tw_net_statistics

Attention
Notice that the MPI_Reduce "count" parameter is greater than one. We are reducing on multiple variables simultaneously so if you change this function or the struct tw_statistics, you must update the other.

Definition at line 656 of file network-mpi.c.

References g_tw_masternode, MPI_COMM_ROSS, tw_statistics::s_events_past_end, tw_statistics::s_max_run_time, tw_statistics::s_min_detected_offset, tw_statistics::s_net_events, tw_statistics::s_total, tw_pe::stats, tw_error(), and TW_LOC.

Referenced by tw_stats().

Here is the call graph for this function:

Here is the caller graph for this function:

void tw_net_stop ( void  )

Checks to see if custom communicator was used. If not, finalizes MPI. Otherwise, the application is expected to finalize MPI itself.

Definition at line 154 of file network-mpi.c.

References custom_communicator, tw_error(), and TW_LOC.

Referenced by apply_opt(), match_opt(), need_argument(), and tw_end().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned tw_nnodes ( void  )

Variable Documentation

MPI_Comm MPI_COMM_ROSS