2 Framework for measuring message-passing speed.
3 Orion Sky Lawlor, olawlor@uiuc.edu, 2003/8/21
5 This is needed to accurately, uniformly compare
6 vertically, across all our API's:
7 - Converse's netlrts-linux
11 And horizontally, across different interconnects:
20 The basic idea is that an interconnect writes
21 a small, simple set of routines-- basically send
22 and recv-- and this code will try out a bunch of
23 different message passing styles to measure speed,
24 bandwidth, and congestion.
26 This header should be usable outside of Charm++.
28 #ifndef __CHARM_MSG_SPEED_H
29 #define __CHARM_MSG_SPEED_H
35 typedef struct msg_comm msg_comm
;
36 typedef struct msg_driver msg_driver
;
39 Send len bytes of data to dest.
40 Once the data is sent, you must call msg_send_complete.
42 typedef void (*msg_send_fn
)(void *data
,int len
, int dest
,msg_comm
*comm
);
45 This message was actually sent. This call can
46 be made from a msg_send_fn (for a blocking send)
47 or from outside (for a non-blocking send).
49 void msg_send_complete(msg_comm
*comm
,void *data
,int len
);
53 Hint: you're about to recv len bytes of data from src.
54 Once the data arrives, you must call msg_recv_complete.
55 You only own the data pointer from this call until
56 you make the call to msg_recv_complete.
58 typedef void (*msg_recv_fn
)(void *data
,int len
, int src
,msg_comm
*comm
);
61 This message just arrived. This call can
62 be made from a msg_recv_fn (for a blocking API
63 like MPI), or can be made from outside (for an
64 asynchronous API like converse or Charm++).
66 The data pointer need not be the same one passed
67 to msg_recv, and this function does not transfer
68 ownership of the data pointer.
70 void msg_recv_complete(msg_comm
*comm
,void *data
,int len
);
74 We're ready to stop the test now. (collective)
76 typedef void (*msg_finish_fn
)(msg_comm
*comm
);
79 Interconnect writers will fill this struct out with
80 their send and recv functions, possibly extending the struct
84 msg_driver
*driver
; /* controller routine private data */
88 msg_finish_fn finish_fn
;
92 Begin a test using this msg_comm state.
93 The "driver" portion can be left uninitalized,
94 but all other fields must be filled out.
96 This call must be made from exactly two processors,
97 0 and 1, at the same time.
99 This call will result in calls to the comm
100 send and recv functions. After a number of calls,
101 the finish function will be executed, at which
102 point the test is over.
104 void msg_comm_test(msg_comm
*comm
,const char *desc
,int myPe
,int verbose
);
107 /* Returns wall clock time in seconds */
108 double msg_timer(void);