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 #define MSM_PRIORITY PME_PRIORITY
00037  
00038 #if defined(NAMD_CUDA) || defined(NAMD_MIC)
00039 // higher priority so offloaded work can overlap
00040 #define PROXY_DATA_PRIORITY (1<<8)
00041 #define PME_OFFLOAD_PRIORITY 0
00042 #define PME_OFFLOAD_UNGRID_PRIORITY (3<<8)
00043 #else
00044 #define PROXY_DATA_PRIORITY (3<<8)
00045 #endif
00046 
00047 //used in HomePatch::positionsReady
00048 //gbis positions distributed with normal PROXY_DATA_PRIORITY
00049 //compute priorities are inited in ComputePatch* and added in Compute.C
00050 
00051 //use in Compute::patchReady              DONE
00052 #define GB1_COMPUTE_PROXY_PRIORITY (4<<8)
00053 //use in ProxyPatch::boxClosed            DONE
00054 #define GB1_PROXY_RESULTS_PRIORITY (5<<8)
00055 //use in Compute::patchReady              DONE
00056 #define GB1_COMPUTE_HOME_PRIORITY (6<<8)
00057 //used in HomePatch::gbisP2Ready          DONE
00058 #define GB2_PROXY_DATA_PRIORITY (7<<8)
00059 //use in Compute::gbisP2PatchReady        DONE
00060 #define GB2_COMPUTE_PROXY_PRIORITY (8<<8)
00061 //use in ProxyPatch::boxClosed            DONE
00062 #define GB2_PROXY_RESULTS_PRIORITY (9<<8)
00063 //use in Compute::patchReady              DONE
00064 #define GB2_COMPUTE_HOME_PRIORITY (10<<8)
00065 //used in HomePatch::gbisP3Ready          DONE
00066 #define GB3_PROXY_DATA_PRIORITY (11<<8)
00067 
00068 
00069 // from here on GB computes use normal compute priorities
00070 //use in Compute::gbisP3PatchReady        DONE
00071 #define COMPUTE_PROXY_PRIORITY (12<<8)
00072 //use in ProxyPatch::send
00073 #define PROXY_RESULTS_PRIORITY (13<<8) // DONE
00074 #define PME_UNGRID_PRIORITY (14<<8)
00075 //use in Compute::patchReady              DONE
00076 #define COMPUTE_HOME_PRIORITY (15<<8)
00077 //end gbis
00078 
00079 #endif // PRIORITIES_H
00080 

Generated on Tue Nov 21 01:17:14 2017 for NAMD by  doxygen 1.4.7