Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Priorities.h

Go to the documentation of this file.
00001 
00007 #ifndef PRIORITIES_H
00008 #define PRIORITIES_H
00009 
00010 // pass PRIORITY_SIZE as last argument to new when allocating message
00011 // e.g.,  MyMsg *msg = new (len1, len2, PRIORITY_SIZE) MyMsg;
00012 
00013 #define PRIORITY_SIZE ((int) sizeof(int)*8)
00014 
00015 // total priority is sequence + type + patch
00016 // always use lowest (most urgent) patch priority applicable
00017 
00018 #define SET_PRIORITY(MSG,SEQ,PRIO) { \
00019   CkSetQueueing(MSG, CK_QUEUEING_IFIFO); \
00020   *((int*) CkPriorityPtr(MSG)) = (((SEQ)&0xffff)<<15) + (PRIO); }
00021 // sequence priority is 16 bits shifted by 15 to leave sign bit 0
00022 
00023 // patch priorities in range [1,252]
00024 // reserve 0 for tuples, use prime to randomize neighbors
00025 #define PATCH_PRIORITY(PID) (((PID)%251)+1)
00026 
00027 // the following are in order of decreasing urgency
00028 
00029 #define PME_PRIORITY (2<<8)
00030 #define PME_GRID_PRIORITY (PME_PRIORITY+1)
00031 #define PME_TRANS_PRIORITY (PME_PRIORITY+2)
00032 #define PME_TRANS2_PRIORITY (PME_PRIORITY+3)
00033 #define PME_UNTRANS_PRIORITY (PME_PRIORITY+4)
00034 #define PME_UNTRANS2_PRIORITY (PME_PRIORITY+5)
00035  
00036 #ifdef NAMD_CUDA
00037 // higher priority so offloaded work can overlap
00038 #define PROXY_DATA_PRIORITY (1<<8)
00039 #else
00040 #define PROXY_DATA_PRIORITY (3<<8)
00041 #endif
00042 
00043 //used in HomePatch::positionsReady
00044 //gbis positions distributed with normal PROXY_DATA_PRIORITY
00045 //compute priorities are inited in ComputePatch* and added in Compute.C
00046 
00047 //use in Compute::patchReady              DONE
00048 #define GB1_COMPUTE_PROXY_PRIORITY (4<<8)
00049 //use in ProxyPatch::boxClosed            DONE
00050 #define GB1_PROXY_RESULTS_PRIORITY (5<<8)
00051 //use in Compute::patchReady              DONE
00052 #define GB1_COMPUTE_HOME_PRIORITY (6<<8)
00053 //used in HomePatch::gbisP2Ready          DONE
00054 #define GB2_PROXY_DATA_PRIORITY (7<<8)
00055 //use in Compute::gbisP2PatchReady        DONE
00056 #define GB2_COMPUTE_PROXY_PRIORITY (8<<8)
00057 //use in ProxyPatch::boxClosed            DONE
00058 #define GB2_PROXY_RESULTS_PRIORITY (9<<8)
00059 //use in Compute::patchReady              DONE
00060 #define GB2_COMPUTE_HOME_PRIORITY (10<<8)
00061 //used in HomePatch::gbisP3Ready          DONE
00062 #define GB3_PROXY_DATA_PRIORITY (11<<8)
00063 
00064 // from here on GB computes use normal compute priorities
00065 //use in Compute::gbisP3PatchReady        DONE
00066 #define COMPUTE_PROXY_PRIORITY (12<<8)
00067 //use in ProxyPatch::send
00068 #define PROXY_RESULTS_PRIORITY (13<<8) // DONE
00069 #define PME_UNGRID_PRIORITY (14<<8)
00070 //use in Compute::patchReady              DONE
00071 #define COMPUTE_HOME_PRIORITY (15<<8)
00072 //end gbis
00073 
00074 #endif // PRIORITIES_H
00075 

Generated on Fri May 25 04:07:16 2012 for NAMD by  doxygen 1.3.9.1