| 1 |
/* Setup */ |
| 2 |
|
| 3 |
MUSIC_Setup *MUSIC_createSetup (int *argc, char ***argv); |
| 4 |
|
| 5 |
/* Communicators */ |
| 6 |
|
| 7 |
MPI_Intracomm MUSIC_Setup_communicator (MUSIC_setup *setup); |
| 8 |
|
| 9 |
/* Port creation */ |
| 10 |
|
| 11 |
MUSIC_ContOutputPort *MUSIC_publishContOutput (MUSIC_setup *setup, |
| 12 |
char *id); |
| 13 |
MUSIC_ContInputPort *MUSIC_publishContInput (MUSIC_setup *setup, |
| 14 |
char *id); |
| 15 |
MUSIC_EventOutputPort *MUSIC_publishEventOutput (MUSIC_setup *setup, |
| 16 |
char *id); |
| 17 |
MUSIC_EventInputPort *MUSIC_publishEventInput (MUSIC_setup *setup, |
| 18 |
char *id); |
| 19 |
MUSIC_MessageOutputPort *MUSIC_publishMessageOutput (MUSIC_setup *setup, |
| 20 |
char *id); |
| 21 |
MUSIC_MessageInputPort *MUSIC_publishMessageInput (MUSIC_setup *setup, |
| 22 |
char *id); |
| 23 |
|
| 24 |
void MUSIC_destroyContOutput (MUSIC_ContOutputPort* port); |
| 25 |
void MUSIC_destroyContInput (MUSIC_ContInputPort* port); |
| 26 |
void MUSIC_destroyEventOutput (MUSIC_EventOutputPort* port); |
| 27 |
void MUSIC_destroyEventInput (MUSIC_EventInputPort* port); |
| 28 |
void MUSIC_destroyMessageOutput (MUSIC_MessageOutputPort* port); |
| 29 |
void MUSIC_destroyMessageInput (MUSIC_MessageInputPort* port); |
| 30 |
|
| 31 |
/* General port methods */ |
| 32 |
|
| 33 |
/* Xxx = Cont | Event |
| 34 |
Ddd = Output | Input */ |
| 35 |
|
| 36 |
int MUSIC_XxxDddPort_isConnected (XxxDddPort *port); |
| 37 |
int MUSIC_MessageDddPort_isConnected (MessageDddPort *port); |
| 38 |
int MUSIC_XxxDddPort_hasWidth (XxxDddPort *port); |
| 39 |
int MUSIC_XxxDddPort_width (XxxDddPort *port); |
| 40 |
|
| 41 |
/* Mapping */ |
| 42 |
|
| 43 |
/* No arguments are optional. */ |
| 44 |
|
| 45 |
void MUSIC_ContOutputPort_map (MUSIC_ContOutputPort *port, |
| 46 |
MUSIC_ContData *dMap, |
| 47 |
int maxBuffered); |
| 48 |
|
| 49 |
void MUSIC_ContInputPort_map (MUSIC_ContInputPort *port, |
| 50 |
MUSIC_ContData *dMap, |
| 51 |
double delay, |
| 52 |
int maxBuffered, |
| 53 |
int interpolate); |
| 54 |
|
| 55 |
void MUSIC_EventOutputPort_map (MUSIC_EventOutputPort *port, |
| 56 |
MUSIC_IndexMap *indices, |
| 57 |
int maxBuffered); |
| 58 |
|
| 59 |
typedef void MUSIC_EventHandler (double t, int id); |
| 60 |
|
| 61 |
void MUSIC_EventInputPort_map (MUSIC_EventInputPort *port, |
| 62 |
MUSIC_IndexMap *indices, |
| 63 |
MUSIC_EventHandler *handleEvent, |
| 64 |
double accLatency, |
| 65 |
int maxBuffered); |
| 66 |
|
| 67 |
void MUSIC_MessageOutputPort_map (MUSIC_MessageOutputPort *port, |
| 68 |
int maxBuffered); |
| 69 |
|
| 70 |
typedef void MUSIC_MessageHandler (double t, void *msg, size_t size); |
| 71 |
|
| 72 |
void MUSIC_MessageInputPort_map (MUSIC_MessageInputPort *port, |
| 73 |
MUSIC_MessageHandler *handleMessage, |
| 74 |
double accLatency, |
| 75 |
int maxBuffered); |
| 76 |
|
| 77 |
/* Index maps */ |
| 78 |
|
| 79 |
MUSIC_PermutationIndex *MUSIC_createPermutationIndex (int *indices, |
| 80 |
int size); |
| 81 |
|
| 82 |
void MUSIC_destroyPermutationIndex (MUSIC_PermutationIndex *index); |
| 83 |
|
| 84 |
MUSIC_LinearIndex *MUSIC_createLinearIndex (int baseIndex, |
| 85 |
int size); |
| 86 |
|
| 87 |
void MUSIC_destroyLinearIndex (MUSIC_LinearIndex *index); |
| 88 |
|
| 89 |
/* Data maps */ |
| 90 |
|
| 91 |
/* Exception: The map argument can take any type of index map. */ |
| 92 |
|
| 93 |
MUSIC_ArrayData *MUSIC_createArrayData (void *buffer, |
| 94 |
MPI_Datatype type, |
| 95 |
void *map); |
| 96 |
|
| 97 |
/* Exception: MUSIC_createLinearArrayData corresponds to |
| 98 |
c++ music::ArrayData::ArrayData (..., ..., ..., ...) */ |
| 99 |
|
| 100 |
MUSIC_ArrayData *MUSIC_createLinearArrayData (void *buffer, |
| 101 |
MPI_Datatype type, |
| 102 |
int baseIndex, |
| 103 |
int size); |
| 104 |
|
| 105 |
void MUSIC_destroyArrayData (MUSIC_ArrayData *arrayData); |
| 106 |
|
| 107 |
/* Configuration variables */ |
| 108 |
|
| 109 |
/* Exceptions: Result is char * |
| 110 |
Extra maxlen argument prevents buffer overflow. |
| 111 |
Result is terminated by \0 unless longer than maxlen - 1 */ |
| 112 |
|
| 113 |
int MUSIC_config (MUSIC_Setup *setup, |
| 114 |
char *name, |
| 115 |
char *result, |
| 116 |
size_t maxLen); |
| 117 |
|
| 118 |
int MUSIC_config (MUSIC_Setup *setup, char *name, int *result); |
| 119 |
|
| 120 |
int MUSIC_config (MUSIC_Setup *setup, char *name, double *result); |
| 121 |
|
| 122 |
/* Runtime */ |
| 123 |
|
| 124 |
MUSIC_Runtime *MUSIC_createRuntime (MUSIC_Setup *setup, double h); |
| 125 |
|
| 126 |
void MUSIC_tick (MUSIC_Runtime *runtime); |
| 127 |
|
| 128 |
double MUSIC_time (MUSIC_Runtime *runtime); |
| 129 |
|
| 130 |
/* Finalization */ |
| 131 |
|
| 132 |
void MUSIC_destroyRuntime (MUSIC_Runtime *runtime); |