Removing the mapregion implementation from isomalloc
authorNikhil Jain <nikhil@illinois.edu>
Thu, 6 Oct 2011 04:47:52 +0000 (23:47 -0500)
committerNikhil Jain <nikhil@illinois.edu>
Thu, 6 Oct 2011 04:47:52 +0000 (23:47 -0500)
src/conv-core/isomalloc.c

index b371a6ad980bd7e429d713e08b76126cd3e0c94b..8d165d82e096be03484ef4429fbbda96c41b84be 100644 (file)
@@ -46,12 +46,6 @@ added by Ryan Mokos in July 2008.
 
 #define CMK_THREADS_DEBUG 0
 
-/* 0: do not use the intermediate mapregion management
-   1: use the intermediate mapregion management  */
-#ifndef USE_MAPREGION
-#define USE_MAPREGION      0
-#endif
-
 /* 0: use the old isomalloc implementation (array)
    1: use the new isomalloc implementation (b-tree)  */
 #define USE_BTREE_ISOMALLOC 1
@@ -1602,402 +1596,6 @@ init_map(char **argv)
 
 #endif /* UNIX memory map */
 
-#if USE_MAPREGION
-
-/* method to check if mmap behaved as was desired*/
-static int 
-check_map(void *pa, void *addr, CmiInt8 requestSize)
-{
-  if (pa != addr)
-  { /*Map worked, but gave us back the wrong place*/
-#if CMK_THREADS_DEBUG
-    //CmiPrintf("[%d] tried to mmap %p, but got %p back\n",CmiMyPe(),addr,pa);
-#endif
-    call_munmap(pa,requestSize);
-    return 1;
-  }
-
-  if (pa==NULL)
-  { /*Map just failed completely*/
-
-#if CMK_THREADS_DEBUG
-    perror("mmap failed");
-    //CmiPrintf("[%d] tried to mmap %p, but encountered error\n",CmiMyPe(),addr);
-#endif
-    return 1;
-  }
-  return 0;
-}
-
-/* method to handle mmap of VM spots beyong processor's local range - uses linked lists,
-   one for each processor  */
-static CmiIsomallocBlock *
-remoteSlotmap(CmiInt8 slot, CmiInt8 nslots)
-{
-  void *addr = slot2addr(slot);
-  void *pa,*newaddr;
-  maplist *newentry,*temp,*prev,*next;
-
-  int whichPE = slot/numslots;
-  CmiInt8 startRegion, endRegion;
-  CmiInt8 left, tleft;
-  maplist **mapList = CpvAccess(mapLists);
-  CmiInt8 ratio = regionSize/slotsize;
-
-  startRegion = (slot/ratio);
-  endRegion = (slot + nslots - 1)/ratio;
-
-  /* new linked list for memory in this range*/
-  if(mapList[whichPE] == NULL)
-  {
-       newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-       newentry->prev = newentry->next = NULL;
-       newaddr = (void *)(slot2addr(startRegion*ratio));
-       pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-       if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-         return NULL;
-        newentry->start = (startRegion * ratio);
-       newentry->end = ((endRegion+1) * ratio);
-       newentry->count = nslots;
-       mapList[whichPE] = newentry;
-       return (CmiIsomallocBlock *)addr;
-  }    
-
-  temp = mapList[whichPE];
-
-  /* VM region needed should be head of this linked list*/
-  if((slot + nslots - 1) < temp->start) 
-  {
-        newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-        newentry->prev = NULL;
-       newentry->next = temp;
-       temp->prev = newentry;
-       newaddr = (void *)(slot2addr(startRegion*ratio));
-        pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-       if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-         return NULL;
-        newentry->start = (startRegion * ratio);
-        newentry->end = ((endRegion+1) * ratio);
-        newentry->count = nslots;
-        mapList[whichPE] = newentry;
-        return (CmiIsomallocBlock *)addr;
-  }
-
-  prev = NULL;
-  while(temp != NULL)
-  {
-       if(slot < temp->end)
-               break; 
-       prev = temp;
-       temp = temp->next;
-  }
-
-  /* VM region needed should be at the end of linked list */ 
-  if(temp == NULL)
-  {
-        newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-        newentry->prev = prev;
-       prev->next = newentry; 
-       newentry->next = NULL;
-       newaddr = (void *)(slot2addr(startRegion*ratio));
-        pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-       if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-         return NULL;
-        newentry->start = (startRegion * ratio);
-        newentry->end = ((endRegion+1) * ratio);
-        newentry->count = nslots;
-        return (CmiIsomallocBlock *)addr;
-  }
-
-  left = nslots;
-
-  /* VM region needed should be added before temp region */
-  if((slot + nslots - 1) < temp->start)
-  {
-        newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-        newentry->prev = prev;
-       prev->next = newentry; 
-       newentry->next = temp;
-       temp->prev = newentry;
-       newaddr = (void *)(slot2addr(startRegion*ratio));
-        pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-       if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-         return NULL;
-        newentry->start = (startRegion * ratio);
-        newentry->end = ((endRegion+1) * ratio);
-        newentry->count = nslots;
-        return (CmiIsomallocBlock *)addr;
-  }
-
-  /* VM region needed starts before temp but overlaps with it */
-  if((slot < temp->start))
-  {
-       tleft = (slot + nslots - temp->start);
-       temp->count += tleft;
-       left -= tleft;
-       endRegion = (temp->start/ratio) - 1;
-
-       newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-       if(mapList[whichPE] == temp)
-       {
-               mapList[whichPE] = newentry;
-               newentry->prev = NULL;
-       }
-       else
-       {
-               newentry->prev = prev;
-               prev->next = newentry;
-       }
-       temp->prev = newentry;
-       newentry->next = temp;
-       newaddr = (void *)(slot2addr(startRegion*ratio));
-       pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-       if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-         return NULL;
-       newentry->start = (startRegion * ratio);
-       newentry->end = ((endRegion+1) * ratio);
-       newentry->count = left;
-       return (CmiIsomallocBlock *)addr;
-  }
-  tleft = temp->end - slot;
-  if(tleft >= nslots)
-  {
-       temp->count += nslots;
-        return (CmiIsomallocBlock *)addr;
-  }
-  else
-  {
-       temp->count += tleft;
-       left -= tleft;
-       startRegion = temp->end/ratio;
-  }
-        
-  next = temp->next;
-
-  if(next != NULL)
-  {
-         if((slot + nslots) > next->start)
-         {
-               tleft = (slot + nslots - next->start);
-               next->count += tleft;
-               left -= tleft;
-               if(left <= 0)
-               {
-                       return (CmiIsomallocBlock *)addr;
-               }
-               endRegion = (next->start/ratio)-1;
-         }
-  }
-
-  /* add a new region in between 2 existing region */   
-  newentry = (maplist *)(malloc_reentrant(sizeof(maplist)));
-  newentry->prev = temp;
-  temp->next = newentry;
-  newentry->next = next;
-  if(next != NULL)
-       next->prev = newentry;
-  newaddr = (void *)(slot2addr(startRegion*ratio));
-  pa = call_mmap_fixed(newaddr, (endRegion-startRegion+1)*regionSize);
-  if(check_map(pa,newaddr,(endRegion-startRegion+1)*regionSize))
-    return NULL;
-  newentry->start = (startRegion * ratio);
-  newentry->end = ((endRegion+1) * ratio);
-  newentry->count = left;
-  return (CmiIsomallocBlock *)addr;
-  
-}
-#endif
-
-#if USE_MAPREGION
-/**
- * maps the virtual memory associated with slot using mmap
-   using list based mmap slot maintenance
- */
-static CmiIsomallocBlock *
-map_slots(CmiInt8 slot, CmiInt8 nslots)
-{
-  void *pa;
-  void *addr,*newaddr;
-  int ratio, checkmap;
-  CmiInt8 i, starti, endi, j;
-  CmiInt8 start1off, start2off, end1off, end2off;
-  CmiInt8 off1, off2, temp, toff1, toff2;
-  CmiInt8 actualSlot, requestSize, begin, currentR;
-  CmiInt8 startAddr, left, tleft, extraleft;
-
-  mapRegion *mapregion = CpvAccess(mapRegions);
-  CmiInt8 startSlot, endSlot;
-
-  startSlot = pe2slot(CmiMyPe());
-  endSlot = startSlot + numslots - 1;
-  if((slot < startSlot) || (slot > endSlot))
-       return ((CmiIsomallocBlock *)remoteSlotmap(slot,nslots)); 
-
-  startAddr = (CmiInt8)slot2addr(slot);
-  addr = slot2addr(slot);
-       
-  ratio = regionSize/slotsize;
-  actualSlot = slot - pe2slot(CmiMyPe());
-  left = nslots;
-
-  start1off = actualSlot/(1024*ratio);
-  start2off = (actualSlot - 1024*ratio*start1off)/ratio;
-  currentR = (1024*start1off) + start2off;  
-
-  end1off = (actualSlot + nslots - 1)/(1024*ratio);
-  end2off = (actualSlot + nslots - 1 - 1024*ratio*end1off)/ratio;
-
-  if(!(end1off < mapregion->count))
-  {
-       starti = mapregion->count;
-       endi = end1off + 11;
-       for(i = starti; i < endi; i++)
-       {
-               mapregion->counter[i] = (int *)(malloc_reentrant
-                                       (1024 * sizeof(int)));
-               mapregion->marker[i] = (CmiInt8 *)(malloc_reentrant
-                                       (1024 * sizeof(CmiInt8)));
-               for(j = 0; j < 1024; j++)
-               {
-                       mapregion->counter[i][j] = 0;
-                       mapregion->marker[i][j] = -1;
-               }
-       }       
-       mapregion->count = endi;
-  } 
-
-  temp = mapregion->marker[start1off][start2off];
-  if(temp != -1)
-  {
-       if(temp >= currentR)
-       {
-               begin = currentR;
-       }       
-       else
-       {
-               begin = temp;
-               temp = mapregion->marker[begin/1024][begin - ((begin/1024)*1024)];
-       }
-       tleft = (((temp + 1)*ratio) - actualSlot);
-       off1 = begin/1024;
-       off2 = begin - (off1 * 1024);
-       if(left <= tleft)
-       {
-               mapregion->counter[off1][off2] += left ;        
-               return (CmiIsomallocBlock *)addr;
-       }               
-       else
-       {
-               mapregion->counter[off1][off2] += tleft ;       
-               left -= tleft;
-               off1 = (temp+1)/1024;
-               off2 = (temp+1) - (off1 * 1024);
-       }
-  }                    
-  else
-  {
-       off1 = start1off;
-       off2 = start2off;
-  }
-
-  extraleft = 0;
-  if(mapregion->marker[start1off][start2off] == -1)
-  {
-       extraleft = actualSlot % ratio;
-  }
-  temp = mapregion->marker[end1off][end2off];
-  currentR = (1024*end1off) + end2off;  
-  
-  if(temp != -1)
-  {
-       if(temp > currentR)
-       {
-               temp = currentR;
-       }       
-       toff1 = temp/1024;
-       toff2 = temp - (toff1*1024);
-       tleft = (actualSlot + nslots) - (temp * ratio);
-       mapregion->counter[toff1][toff2] += tleft;
-       left -= tleft;
-       end1off = (temp - 1)/1024;
-       end2off = (temp - 1) - (end1off * 1024);
-  }    
-
-  if((end1off < off1)||((end1off == off1)&&(end2off < off2)))
-  {
-       return (CmiIsomallocBlock *)addr;
-  }
-
-  requestSize = ((left + extraleft + (ratio-1))/ratio)*regionSize;
-  newaddr = (void*)((CmiInt8)slot2addr(pe2slot(CmiMyPe())));
-  newaddr = (void*)((CmiInt8)newaddr + ((1024*off1 + off2)*regionSize));
-  pa = call_mmap_fixed(newaddr, requestSize);
-  if (pa != newaddr)
-  { /*Map worked, but gave us back the wrong place*/
-#if CMK_THREADS_DEBUG
-    //CmiPrintf("[%d] tried to mmap %p, but got %p back\n",CmiMyPe(),newaddr,pa);
-#endif
-    call_munmap(newaddr,requestSize);
-    return NULL;
-  }
-
-  if (pa==NULL)
-  { /*Map just failed completely*/
-
-#if CMK_THREADS_DEBUG
-    perror("mmap failed");
-    //CmiPrintf("[%d] tried to mmap %p, but encountered error\n",CmiMyPe(),addr);
-#endif
-    return NULL;
-  }
-#if CMK_THREADS_DEBUG
-  //CmiPrintf("[%d] mmap'd slots %ld-%ld to address %p\n",CmiMyPe(),
-            slot,slot+nslots-1,addr);
-#endif
-
-  mapregion->counter[off1][off2] += left;
-  mapregion->marker[off1][off2] = 1024*end1off + end2off;
-
-  temp = (1024 * off1) + off2;
-
-  starti = off2 + 1;
-  if(off1 == end1off)
-       endi = end2off + 1;
-  else
-       endi = 1024;
-
-  for(i = starti; i < endi; i++)
-  {
-       mapregion->marker[off1][i] = temp;
-  }
-  starti = off1 + 1;
-  endi = end1off;
-  for(i = starti; i < endi; i++)
-  {
-       for(j = 0; j < 1024; j++)       
-               mapregion->marker[i][j] = temp;
-  }
-
-  starti = 0;
-  if(off1 == end1off)
-       endi = 0;
-  else
-       endi = end2off + 1;
-
-  for(i = starti; i < endi; i++)
-  {
-       mapregion->marker[end1off][i] = temp;
-  }
-
-  return (CmiIsomallocBlock *)addr;
-}
-
-#else
-
 /**
  * maps the virtual memory associated with slot using mmap
  */
@@ -2030,278 +1628,6 @@ map_slots(CmiInt8 slot, CmiInt8 nslots)
 #endif
   return (CmiIsomallocBlock *)pa;
 }
-#endif //end of else of if USE_MAPREGION 
-
-#if USE_MAPREGION
-
-/* method to delete a node of in a linked list */
-static void
-freelistentry(maplist *target)
-{
-       maplist *prev,*next;
-       prev = target->prev;
-       next = target->next;
-       if(prev != NULL)
-               prev->next = next;
-       if(next != NULL)
-               next->prev = prev;
-       free_reentrant(target);
-}
-
-/* method to free an entry for VM not in range of my processor */
-static void 
-remoteSlotunmap(CmiInt8 slot, CmiInt8 nslots)
-{
-  void *addr = slot2addr(slot);
-  void *pa,*newaddr;
-  maplist *temp,*tofree;
-
-  CmiInt8 left, tleft;
-  maplist **mapList = CpvAccess(mapLists);
-  CmiInt8 ratio = regionSize/slotsize;
-
-  int whichPE = slot/numslots;
-
-  if(mapList[whichPE] == NULL)
-  {
-       return;
-  }
-
-  temp = mapList[whichPE];
-
-  while(temp != NULL)
-  {
-        if(slot < temp->end)
-                break;
-        temp = temp->next;
-  }
-  if(temp == NULL)
-  {
-       return;
-  }
-
-  left = nslots;
-
-  tleft = temp->end - slot;
-  if(tleft >= nslots)
-  {
-        temp->count -= nslots;
-       left -= nslots;
-  }
-  else
-  {
-       temp->count -= tleft;
-       left -= tleft;
-  }
-
-  tofree = temp;
-  temp = temp->next;
-  if(tofree->count <= 0)
-  {
-       newaddr = (void *)(slot2addr(tofree->start));
-       call_munmap(newaddr, (tofree->end - tofree->start)*slotsize);
-       if(tofree == mapList[whichPE])
-       {
-               mapList[whichPE] = tofree->next;
-       }
-       freelistentry(tofree);
-  }
-
-  if((temp == NULL) || (left <= 0))
-  {
-       return;
-  }
-
-  if((slot+nslots-1) < temp->end)
-  {
-       tleft = slot + nslots - temp->start;
-  }
-  else
-  {
-       tleft = temp->count;
-  }
-
-  temp->count -= tleft;
-  left -= tleft;
-
-  tofree = temp;
-  temp = temp->next;
-  if(tofree->count <= 0)
-  {
-        newaddr = (void *)(slot2addr(tofree->start));
-        call_munmap(newaddr, (tofree->end - tofree->start)*slotsize);
-        if(tofree == mapList[whichPE])
-        {
-                mapList[whichPE] = tofree->next;
-        }
-        freelistentry(tofree);
-  }
-
-  if((temp == NULL) || (left <= 0))
-  {
-      return;
-  }
-
-  tleft = slot + nslots - temp->start;
-  temp->count -= tleft;
-  left -= tleft;
-
-  tofree = temp;
-
-  if(tofree->count <= 0)
-  {
-        newaddr = (void *)(slot2addr(tofree->start));
-        call_munmap(newaddr, (tofree->end - tofree->start)*slotsize);
-        if(tofree == mapList[whichPE])
-        {
-                mapList[whichPE] = tofree->next;
-        }
-        freelistentry(tofree);
-  }
-}
-#endif
-
-#if USE_MAPREGION
-
-/*
- * unmaps the virtual memory associated with slot using munmap and in the list
- */
-static void
-unmap_slots(CmiInt8 slot, CmiInt8 nslots)
-{
-  void *addr=slot2addr(slot);
-
-  mapRegion *mapregion;
-  CmiInt8 start1off, start2off, end1off, end2off;
-  CmiInt8 off1, off2, requestSize;
-  CmiInt8 actualSlot, temp, left, tleft;
-  CmiInt8 i, starti, endi, j;
-  CmiInt8 currentR, begin;
-  int ratio;
-
-  CmiInt8 startSlot, endSlot;
-  startSlot = pe2slot(CmiMyPe());
-  endSlot = startSlot + numslots - 1;
-  if((slot < startSlot) || (slot > endSlot))
-  {
-    remoteSlotunmap(slot,nslots); 
-    return;
-  }
-
-  mapregion = CpvAccess(mapRegions);
-
-  ratio = regionSize/slotsize;
-  actualSlot = slot - pe2slot(CmiMyPe());
-  left = nslots;
-
-  start1off = actualSlot/(1024*ratio);
-  start2off = (actualSlot - (start1off*1024*ratio))/ratio;
-  currentR = (1024*start1off + start2off);  
-
-  end1off = (actualSlot+nslots-1)/(1024*ratio);
-  end2off = (actualSlot+nslots-1 - (end1off*1024*ratio))/ratio;
-
-  temp = mapregion->marker[start1off][start2off];
-
-  if(temp >= currentR)
-  {
-       begin = currentR;
-  }
-  else
-  {
-       begin = temp;
-       temp = mapregion->marker[begin/1024][begin - ((begin/1024)*1024)]; 
-  }
-
-  tleft = (ratio*(temp+1)) - actualSlot;
-  off1 = begin/1024;
-  off2 = begin - (off1*1024);
-
-  if(tleft >= nslots)
-  {
-       mapregion->counter[off1][off2] -= nslots;
-       left -= nslots;
-  }
-  else
-  {
-       mapregion->counter[off1][off2] -= tleft;
-       left -= tleft;
-  }
-
-  if(mapregion->counter[off1][off2] == 0)
-  {
-       addr = (void*)((CmiInt8)slot2addr(pe2slot(CmiMyPe())));
-       addr = (void*)((CmiInt8)addr + ((1024*off1 + off2)*regionSize));
-       call_munmap(addr,(temp+1-begin)*regionSize);
-       for(i = begin; i <= temp; i++)
-       {
-               mapregion->marker[i/1024][i - ((i/1024)*1024)] = -1;
-       }
-  }
-
- if(left <= 0)
-       return;
-
-  starti = temp + 1;
-
-  currentR = (1024*end1off + end2off);
-  temp = mapregion->marker[end1off][end2off];
-
-  if(temp >= currentR)
-  {
-       begin = currentR;
-  }
-  else
-  {
-       begin = temp;
-       temp = mapregion->marker[begin/1024][begin - ((begin/1024)*1024)]; 
-  }
-
-  tleft = (actualSlot+nslots) - (ratio*begin);
-  off1 = begin/1024;
-  off2 = begin - (off1*1024);
-
-  mapregion->counter[off1][off2] -= tleft;
-  left -= tleft;
-
-  if(mapregion->counter[off1][off2] == 0)
-  {
-       addr = (void*)((CmiInt8)slot2addr(pe2slot(CmiMyPe())));
-       addr = (void*)((CmiInt8)addr + ((1024*off1 + off2)*regionSize));
-       call_munmap(addr,(temp+1-begin)*regionSize);
-       for(i = begin; i <= temp; i++)
-       {
-               mapregion->marker[i/1024][i - ((i/1024)*1024)] = -1;
-       }
-  }
-
-  if(left <= 0)
-       return;
-
-  endi = begin;
-
-  begin = starti;
-  off1 = begin/1024;
-  off2 = begin - (1024*off1);
-  temp = mapregion->marker[off1][off2];
-  mapregion->counter[off1][off2] = 0;
-  
-  addr = (void*)((CmiInt8)slot2addr(pe2slot(CmiMyPe())));
-  addr = (void*)((CmiInt8)addr + ((1024*off1 + off2)*regionSize));
-  call_munmap(addr,(temp+1-begin)*regionSize);
-
-  for(i = starti; i < endi; i++)
-  {
-       mapregion->marker[i/1024][i - ((i/1024)*1024)] = -1;
-  }    
-
-
-#if CMK_THREADS_DEBUG
-  CmiPrintf("[%d] munmap'd slots %ld-%ld from address %p\n",CmiMyPe(),
-           slot,slot+nslots-1,addr);
-#endif
-}
-#else
 
 /*
  * unmaps the virtual memory associated with slot using munmap
@@ -2316,7 +1642,6 @@ unmap_slots(CmiInt8 slot, CmiInt8 nslots)
             slot,slot+nslots-1,addr);
 #endif
 }
-#endif 
 
 static void map_failed(CmiInt8 s,CmiInt8 n)
 {
@@ -2669,22 +1994,6 @@ static void init_ranges(char **argv)
   memRange_t intMax=(((memRange_t)1)<<(sizeof(int)*8-1))-1;
   int pagesize = 0;
 
-
-#if USE_MAPREGION
-  /*Round regionSize size up to nearest page size*/
-  CmiInt8 i,j;
-  maplist **mapList;
-  mapRegion *mapregion;
-  slotsize = 128;
-  regionSize=16*1024;
-
-#if CMK_HAS_GETPAGESIZE
-  pagesize = getpagesize();
-#endif
-  if (pagesize < CMK_MEMORY_PAGESIZE)
-    pagesize = CMK_MEMORY_PAGESIZE;
-  regionSize=(regionSize+pagesize-1) & ~(pagesize-1);
-#else
   /*Round slot size up to nearest page size*/
   slotsize=16*1024;
 #if CMK_HAS_GETPAGESIZE
@@ -2693,7 +2002,6 @@ static void init_ranges(char **argv)
   if (pagesize < CMK_MEMORY_PAGESIZE)
     pagesize = CMK_MEMORY_PAGESIZE;
   slotsize=(slotsize+pagesize-1) & ~(pagesize-1);
-#endif
 
 #if CMK_THREADS_DEBUG
   if (CmiMyPe() == 0)
@@ -2844,14 +2152,8 @@ static void init_ranges(char **argv)
   {
         /*Isomalloc covers entire unused region*/
         isomallocStart=freeRegion.start;
-#if USE_MAPREGION
-        numslots=((freeRegion.len/regionSize)/CmiNumPes())*(regionSize/slotsize);
-        freeRegion.len = numslots*CmiNumPes()*slotsize;
-        isomallocEnd=freeRegion.start+ freeRegion.len;
-#else
         isomallocEnd=freeRegion.start+freeRegion.len;
         numslots=(freeRegion.len/slotsize)/CmiNumPes();
-#endif 
 
 #if CMK_THREADS_DEBUG
         CmiPrintf("[%d] Can isomalloc up to %lu megs per pe\n",CmiMyPe(),
@@ -2867,36 +2169,6 @@ static void init_ranges(char **argv)
  
   if (isomallocStart!=NULL) {
     CpvAccess(myss) = new_slotset(pe2slot(CmiMyPe()), numslots);
-
-#if USE_MAPREGION
-    CpvInitialize(maplist **, mapLists);
-    CpvAccess(mapLists) = (maplist **)(malloc_reentrant(CmiNumPes()*sizeof(maplist *)));
-    mapList = CpvAccess(mapLists);
-    for(i=0; i < CmiNumPes(); i++)
-       mapList[i] = NULL;
-
-    CpvInitialize(mapRegion *,mapRegions);
-    CpvAccess(mapRegions) = (mapRegion *)(malloc_reentrant(sizeof(mapRegion)));
-    mapregion = CpvAccess(mapRegions);
-    mapregion->size = 32 * 1024;//good enough for 512 GB       
-    mapregion->counter = (int **)(malloc_reentrant
-                       (mapregion->size * sizeof(int*)));
-    mapregion->marker = (CmiInt8 **)(malloc_reentrant
-                       (mapregion->size * sizeof(CmiInt8*)));
-    mapregion->count = 10;
-    for(i = 0; i < mapregion->count; i++)      
-    {
-       mapregion->counter[i] = (int *)(malloc_reentrant
-                               (1024 * sizeof(int)));
-       mapregion->marker[i] = (CmiInt8 *)(malloc_reentrant
-                               (1024 * sizeof(CmiInt8)));
-       for(j = 0; j < 1024; j++)
-       {
-               mapregion->counter[i][j] = 0;
-               mapregion->marker[i][j] = -1;
-       }
-    }
-#endif
   }
 }