change the implementation of ARMCI_Malloc_local to also support migration. (using...
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 13 Jan 2012 05:28:42 +0000 (23:28 -0600)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 13 Jan 2012 05:28:42 +0000 (23:28 -0600)
examples/armci/putTest/put.c
src/libs/ck-libs/armci/armci_api.C

index d1dba14ee5b44e714095117a642d1ddcc3f51863..6bc1484346622fc2a9a2518c80424facbb516576 100644 (file)
@@ -23,12 +23,11 @@ int main(int argc, char * argv[]) {
 
   // allocate data (collective operation)
   ARMCI_Malloc(baseAddress, MAX_BUF_SIZE*sizeof(char));
+  local = (char *)ARMCI_Malloc_local(MAX_BUF_SIZE*sizeof(char));
 
   ARMCI_Barrier();
   ARMCI_Migrate();
 
-  local = (char *)ARMCI_Malloc_local(MAX_BUF_SIZE*sizeof(char));
-   
   if (thisImage == 0) {
     for(size = 1; size <= MAX_BUF_SIZE; size = size<<1){
       startTime = CkWallTimer();
index f90e59fec144c4bdfb66d3dc0f5302c2cf3bac89..17c96df805ad5820ad2b07c85c056ad82b9568df 100644 (file)
@@ -371,13 +371,17 @@ CDECL int ARMCI_Free(void *address) {
   return 0;
 }
 CDECL void *ARMCI_Malloc_local(armci_size_t bytes){
+  ArmciVirtualProcessor *vp = CtvAccess(_armci_ptr);
+  pointer ptr = vp->BlockMalloc(bytes);
   TCHARM_API_TRACE("ARMCI_Malloc_local", "armci");
-  return malloc(bytes);
+  //return malloc(bytes);
+  return ptr;
 }
 
 CDECL int ARMCI_Free_local(void *ptr){
+  CmiIsomallocBlockListFree(ptr);
   TCHARM_API_TRACE("ARMCI_Free_local", "armci");
-  free(ptr);
+  //free(ptr);
   return 0;
 }