--- trunk/uoms/src/UOMS.upc 2010/04/14 07:40:20 6 +++ trunk/uoms/src/UOMS.upc 2010/04/23 09:49:46 7 @@ -61,7 +61,6 @@ /* UPC */ #include -#include #include /* Timers */ @@ -132,7 +131,7 @@ shared double b;// for reduction result shared int perm[THREADS]; //for permutation -shared long times[THREADS]; //for timing +shared long threads_times[THREADS]; //for timing long *sizes; int num_sizes = 0; @@ -216,6 +215,14 @@ case ALMEMPUT: case AMEMPUT: #endif + #ifdef ASYNCI_MEM_TEST + case AILMEMCPY: + case AIMEMCPY: + case AILMEMGET: + case AIMEMGET: + case AILMEMPUT: + case AIMEMPUT: + #endif case SMEMCPY: case MEMMOVE: return 1; @@ -365,14 +372,14 @@ upc_free(mem_alloc_tests_pointer); } - times[MYTHREAD]=end; + threads_times[MYTHREAD]=end; upc_barrier; if (MYTHREAD == 0) { int i; tmax = 0L; for(i=0;itmax) - tmax=times[i]; + if (threads_times[i]>tmax) + tmax=threads_times[i]; } } end=tmax; @@ -536,11 +543,25 @@ #ifdef ASYNC_MEM_TEST case AMEMGET: if (!MYTHREAD){ + upc_handle_t handler = upc_memget_async((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize); + upc_waitsync(handler); + } + break; + case ALMEMGET: + if (!MYTHREAD){ + upc_handle_t handler = upc_memget_async((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); + upc_waitsync(handler); + } + break; + #endif + #ifdef ASYNCI_MEM_TEST + case AIMEMGET: + if (!MYTHREAD){ upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize); upc_waitsynci(); } break; - case ALMEMGET: + case AILMEMGET: if (!MYTHREAD){ upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); upc_waitsynci(); @@ -558,11 +579,25 @@ #ifdef ASYNC_MEM_TEST case AMEMPUT: if (!MYTHREAD){ + upc_handle_t handler = upc_memput_async(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize); + upc_waitsync(handler); + } + break; + case ALMEMPUT: + if (!MYTHREAD){ + upc_handle_t handler = upc_memput_async(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); + upc_waitsync(handler); + } + break; + #endif + #ifdef ASYNCI_MEM_TEST + case AIMEMPUT: + if (!MYTHREAD){ upc_memput_asynci(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize); upc_waitsynci(); } break; - case ALMEMPUT: + case AILMEMPUT: if (!MYTHREAD){ upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); upc_waitsynci(); @@ -580,11 +615,25 @@ #ifdef ASYNC_MEM_TEST case AMEMCPY: if (!MYTHREAD){ + upc_handle_t handler = upc_memcpy_async(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + upc_waitsync(handler); + } + break; + case ALMEMCPY: + if (!MYTHREAD){ + upc_handle_t handler = upc_memcpy_async(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + upc_waitsync(handler); + } + break; + #endif + #ifdef ASYNCI_MEM_TEST + case AIMEMCPY: + if (!MYTHREAD){ upc_memcpy_asynci(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); upc_waitsynci(); } break; - case ALMEMCPY: + case AILMEMCPY: if (!MYTHREAD){ upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); upc_waitsynci();