make ibverb work in standalone mode
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 23 Jan 2012 19:22:47 +0000 (11:22 -0800)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 23 Jan 2012 19:22:47 +0000 (11:22 -0800)
src/arch/net/machine-ibverbs.c

index 3d12779590375267e827c6cd60f66352d49651fb..0cb4b15e89d1bd7aee7956ebc395dd8452071714 100644 (file)
@@ -540,6 +540,7 @@ static void CmiMachineInit(char **argv){
                createLocalQps(dev,ibPort,_Cmi_mynode,_Cmi_numnodes,context->localAddr);
        }
        
+        if (Cmi_charmrun_fd == -1) return;
        
        //TURN ON RDMA
        rdma=1;
@@ -2503,6 +2504,7 @@ void * infi_CmiAlloc(int size){
 #if CMK_IBVERBS_STATS
        numAlloc++;
 #endif
+        if (Cmi_charmrun_fd == -1) return malloc(size);
 #if THREAD_MULTI_POOL
        res = getInfiCmiChunkThread(size-sizeof(CmiChunkHeader));
        res -= sizeof(CmiChunkHeader);
@@ -2648,6 +2650,7 @@ void infi_CmiFree(void *ptr){
        numFree++;
 #endif
        
+        if (Cmi_charmrun_fd == -1) return free(ptr);
 #if CMK_SMP    
        CmiMemLock();
 #endif