Merged arrays into Charj mainline.
[charm.git] / src / conv-perf / charmEvents.h
1
2 #ifndef __CHARM_EVENTS_H__
3 #define __CHARM_EVENTS_H__
4
5 #include "charmProjections.h"
6 #include "traceCoreAPI.h"
7
8 /* Language ID */
9 #define _CHARM_LANG_ID          2       // language ID for charm
10
11 /* Event IDs */
12 #define  _E_CREATION            1
13 #define  _E_BEGIN_PROCESSING    2
14 #define  _E_END_PROCESSING      3
15 #define  _E_ENQUEUE             4
16 #define  _E_DEQUEUE             5
17 #define  _E_BEGIN_COMPUTATION   6
18 #define  _E_END_COMPUTATION     7
19 #define  _E_BEGIN_INTERRUPT     8
20 #define  _E_END_INTERRUPT       9
21 #define  _E_MSG_RECV_CHARM      10
22 #define  _E_USER_EVENT_CHARM    13
23 #define  _E_BEGIN_PACK          16
24 #define  _E_END_PACK            17
25 #define  _E_BEGIN_UNPACK        18
26 #define  _E_END_UNPACK          19
27
28 #define  _E_USER_EVENT_PAIR    100
29
30 /* Trace Macros */
31 #define REGISTER_CHARM \
32         { RegisterLanguage(_CHARM_LANG_ID, "charm\0"); \
33           RegisterEvent(_CHARM_LANG_ID, _E_CREATION         ); \
34           RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_PROCESSING ); \
35           RegisterEvent(_CHARM_LANG_ID, _E_END_PROCESSING   ); \
36           RegisterEvent(_CHARM_LANG_ID, _E_ENQUEUE          ); \
37           RegisterEvent(_CHARM_LANG_ID, _E_DEQUEUE          ); \
38           RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_COMPUTATION); \
39           RegisterEvent(_CHARM_LANG_ID, _E_END_COMPUTATION  ); \
40           RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_INTERRUPT  ); \
41           RegisterEvent(_CHARM_LANG_ID, _E_END_INTERRUPT    ); \
42           RegisterEvent(_CHARM_LANG_ID, _E_MSG_RECV_CHARM   ); \
43           RegisterEvent(_CHARM_LANG_ID, _E_USER_EVENT_CHARM ); \
44           RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_PACK       ); \
45           RegisterEvent(_CHARM_LANG_ID, _E_END_PACK         ); \
46           RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_UNPACK     ); \
47           RegisterEvent(_CHARM_LANG_ID, _E_END_UNPACK       ); \
48           RegisterEvent(_CHARM_LANG_ID, _E_USER_EVENT_PAIR  ); \
49           \
50         }
51 #define _LOG_E_CREATION_N(env, ep, n)   { LOGCONDITIONAL(charm_creation(env, ep, n)); }
52 #define _LOG_E_BEGIN_EXECUTE(env)       { LOGCONDITIONAL(charm_beginExecute(env)); }
53 #define _LOG_E_BEGIN_EXECUTE_DETAILED(event, msgType, ep, srcPe, ml) \
54         { LOGCONDITIONAL(charm_beginExecuteDetailed(event, msgType, ep, srcPe, ml)); }
55 #define _LOG_E_END_EXECUTE()            { LOGCONDITIONAL(charm_endExecute()); }
56 //what is EXECUTE ? isn't it the same as processing --- schak
57 //TODO#define _LOG_E_BEGIN_PROCESSING()
58 //TODO#define _LOG_E_END_PROCESSING()
59 #define _LOG_E_ENQUEUE(env)             { LOGCONDITIONAL(charm_enqueueMsg(env)); }
60 #define _LOG_E_DEQUEUE(env)             { LOGCONDITIONAL(charm_dequeueMsg(env)); }
61 #define _LOG_E_BEGIN_COMPUTATION()      { LOGCONDITIONAL(charm_beginComputation()); }
62 #define _LOG_E_END_COMPUTATION()        { LOGCONDITIONAL(charm_endComputation()); }
63 //even projection actually doesn't use these  two
64 #define _LOG_E_BEGIN_INTERRUPT()
65 #define _LOG_E_END_INTERRUPT()
66
67
68 #define _LOG_E_MSG_RECV_CHARM(env, pe)  { LOGCONDITIONAL(charm_messageRecv(env, pe)); }
69 #define _LOG_E_USER_EVENT_CHARM(x)              { LOGCONDITIONAL(charm_userEvent(x)); }
70 #define _LOG_E_BEGIN_PACK()                     { LOGCONDITIONAL(charm_beginPack()); }
71 #define _LOG_E_END_PACK()                               { LOGCONDITIONAL(charm_endPack()); }
72 #define _LOG_E_BEGIN_UNPACK()                   { LOGCONDITIONAL(charm_beginUnpack()); }
73 #define _LOG_E_END_UNPACK()                     { LOGCONDITIONAL(charm_endUnpack()); }
74 #define _LOG_E_USER_EVENT_PAIR_CHARM(x,bt,et)   { LOGCONDITIONAL(charm_userPairEvent(x,bt,et));}
75 #endif