00001
00002 #ifndef __CHARM_EVENTS_H__
00003 #define __CHARM_EVENTS_H__
00004
00005 #include "charmProjections.h"
00006 #include "traceCoreAPI.h"
00007
00008
00009 #define _CHARM_LANG_ID 2 // language ID for charm
00010
00011
00012 #define _E_CREATION 1
00013 #define _E_BEGIN_PROCESSING 2
00014 #define _E_END_PROCESSING 3
00015 #define _E_ENQUEUE 4
00016 #define _E_DEQUEUE 5
00017 #define _E_BEGIN_COMPUTATION 6
00018 #define _E_END_COMPUTATION 7
00019 #define _E_BEGIN_INTERRUPT 8
00020 #define _E_END_INTERRUPT 9
00021 #define _E_MSG_RECV_CHARM 10
00022 #define _E_USER_EVENT_CHARM 13
00023 #define _E_BEGIN_PACK 16
00024 #define _E_END_PACK 17
00025 #define _E_BEGIN_UNPACK 18
00026 #define _E_END_UNPACK 19
00027
00028 #define _E_USER_EVENT_PAIR 100
00029
00030
00031 #define REGISTER_CHARM \
00032 { RegisterLanguage(_CHARM_LANG_ID, "charm\0"); \
00033 RegisterEvent(_CHARM_LANG_ID, _E_CREATION ); \
00034 RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_PROCESSING ); \
00035 RegisterEvent(_CHARM_LANG_ID, _E_END_PROCESSING ); \
00036 RegisterEvent(_CHARM_LANG_ID, _E_ENQUEUE ); \
00037 RegisterEvent(_CHARM_LANG_ID, _E_DEQUEUE ); \
00038 RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_COMPUTATION); \
00039 RegisterEvent(_CHARM_LANG_ID, _E_END_COMPUTATION ); \
00040 RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_INTERRUPT ); \
00041 RegisterEvent(_CHARM_LANG_ID, _E_END_INTERRUPT ); \
00042 RegisterEvent(_CHARM_LANG_ID, _E_MSG_RECV_CHARM ); \
00043 RegisterEvent(_CHARM_LANG_ID, _E_USER_EVENT_CHARM ); \
00044 RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_PACK ); \
00045 RegisterEvent(_CHARM_LANG_ID, _E_END_PACK ); \
00046 RegisterEvent(_CHARM_LANG_ID, _E_BEGIN_UNPACK ); \
00047 RegisterEvent(_CHARM_LANG_ID, _E_END_UNPACK ); \
00048 RegisterEvent(_CHARM_LANG_ID, _E_USER_EVENT_PAIR ); \
00049 \
00050 }
00051 #define _LOG_E_CREATION_N(env, ep, n) { LOGCONDITIONAL(charm_creation(env, ep, n)); }
00052 #define _LOG_E_BEGIN_EXECUTE(env) { LOGCONDITIONAL(charm_beginExecute(env)); }
00053 #define _LOG_E_BEGIN_EXECUTE_DETAILED(event, msgType, ep, srcPe, ml) \
00054 { LOGCONDITIONAL(charm_beginExecuteDetailed(event, msgType, ep, srcPe, ml)); }
00055 #define _LOG_E_END_EXECUTE() { LOGCONDITIONAL(charm_endExecute()); }
00056
00057
00058
00059 #define _LOG_E_ENQUEUE(env) { LOGCONDITIONAL(charm_enqueueMsg(env)); }
00060 #define _LOG_E_DEQUEUE(env) { LOGCONDITIONAL(charm_dequeueMsg(env)); }
00061 #define _LOG_E_BEGIN_COMPUTATION() { LOGCONDITIONAL(charm_beginComputation()); }
00062 #define _LOG_E_END_COMPUTATION() { LOGCONDITIONAL(charm_endComputation()); }
00063
00064 #define _LOG_E_BEGIN_INTERRUPT()
00065 #define _LOG_E_END_INTERRUPT()
00066
00067
00068 #define _LOG_E_MSG_RECV_CHARM(env, pe) { LOGCONDITIONAL(charm_messageRecv(env, pe)); }
00069 #define _LOG_E_USER_EVENT_CHARM(x) { LOGCONDITIONAL(charm_userEvent(x)); }
00070 #define _LOG_E_BEGIN_PACK() { LOGCONDITIONAL(charm_beginPack()); }
00071 #define _LOG_E_END_PACK() { LOGCONDITIONAL(charm_endPack()); }
00072 #define _LOG_E_BEGIN_UNPACK() { LOGCONDITIONAL(charm_beginUnpack()); }
00073 #define _LOG_E_END_UNPACK() { LOGCONDITIONAL(charm_endUnpack()); }
00074 #define _LOG_E_USER_EVENT_PAIR_CHARM(x,bt,et) { LOGCONDITIONAL(charm_userPairEvent(x,bt,et));}
00075 #endif