Added to use cap when there're many messages to be released.
authorChao Mei <chaomei2@illinois.edu>
Mon, 4 Apr 2011 20:25:52 +0000 (15:25 -0500)
committerChao Mei <chaomei2@illinois.edu>
Mon, 4 Apr 2011 20:25:52 +0000 (15:25 -0500)
src/arch/mpi/machine.c

index a0b717ea0496566341e24dec626a6a3ecca6d691..c01d809d5d6699ba113d785a24eaf75c399d73b4 100644 (file)
@@ -55,8 +55,8 @@ static void sleep(int secs) {Sleep(1000*secs);}
  */
 #define CMI_DYNAMIC_OUTGOING_THRESHOLD 8
 #define CMI_DYNAMIC_MAXCAPSIZE 1000
  */
 #define CMI_DYNAMIC_OUTGOING_THRESHOLD 8
 #define CMI_DYNAMIC_MAXCAPSIZE 1000
-#define CMI_DYNAMIC_SEND_CAPSIZE 10
-#define CMI_DYNAMIC_RECV_CAPSIZE 10
+#define CMI_DYNAMIC_SEND_CAPSIZE 6
+#define CMI_DYNAMIC_RECV_CAPSIZE 6
 /* initial values, -1 indiates there's no cap */
 static int dynamicSendCap = CMI_DYNAMIC_MAXCAPSIZE;
 static int dynamicRecvCap = CMI_DYNAMIC_MAXCAPSIZE;
 /* initial values, -1 indiates there's no cap */
 static int dynamicSendCap = CMI_DYNAMIC_MAXCAPSIZE;
 static int dynamicRecvCap = CMI_DYNAMIC_MAXCAPSIZE;
@@ -867,7 +867,8 @@ int PumpMsgs(void)
        recvCnt++;
        /* check sendMsgBuf  to get the  number of messages that have not been sent */
        /* MsgQueueLen indicates the number of messages that have not been released by MPI */
        recvCnt++;
        /* check sendMsgBuf  to get the  number of messages that have not been sent */
        /* MsgQueueLen indicates the number of messages that have not been released by MPI */
-       if(PCQueueLength(sendMsgBuf) > CMI_DYNAMIC_OUTGOING_THRESHOLD){
+       if(PCQueueLength(sendMsgBuf) > CMI_DYNAMIC_OUTGOING_THRESHOLD
+               || MsgQueueLen > CMI_DYNAMIC_OUTGOING_THRESHOLD){
                dynamicRecvCap = CMI_DYNAMIC_RECV_CAPSIZE;
        }
 #endif 
                dynamicRecvCap = CMI_DYNAMIC_RECV_CAPSIZE;
        }
 #endif