--- trunk/uoms/src/UOMS.upc 2010/05/12 11:28:19 13 +++ trunk/uoms/src/UOMS.upc 2010/11/29 18:07:07 14 @@ -1,51 +1,51 @@ -/*****************************************************************************/ -/* */ -/* Copyright (c) 2008, 2009, 2010 */ -/* Computer Architecture Group (CAG) */ -/* University of A Coruña, Spain */ -/* (http://gac.des.udc.es) */ -/* Galicia Supercomputing Center (CESGA) */ -/* (http://www.cesga.es) */ -/* Hewlett-Packard Spain (HP) */ -/* (http://www.hp.es) */ -/* */ -/* This file is part of UPC Operations Microbenchmarking Suite (UOMS). */ -/* */ -/* UOMS is free software: you can redistribute it and/or modify */ -/* it under the terms of the GNU Lesser General Public License as published */ -/* by the Free Software Foundation, either version 3 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* UOMS is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* GNU Lesser General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU Lesser General Public License */ -/* along with UOMS. If not, see . */ -/* */ -/*****************************************************************************/ - -/*****************************************************************************/ -/* */ -/* FUNDING: This development has been funded by Hewlett-Packard Spain */ -/* */ -/* Project Name: */ -/* UPCHACO (2008-2011) */ -/* Subproject: */ -/* Improving UPC Usability and Performance in Constellation Systems: */ -/* Implementation/Extensions of UPC Libraries. */ -/* (UPCPU­Project -> UPC Performance and Usability Project) */ -/* */ -/*****************************************************************************/ +/******************************************************************************/ +/* */ +/* Copyright (c) 2008, 2009, 2010 */ +/* Computer Architecture Group (CAG) */ +/* University of A Coruña, Spain */ +/* (http://gac.des.udc.es) */ +/* Galicia Supercomputing Center (CESGA) */ +/* (http://www.cesga.es) */ +/* Hewlett-Packard Spain (HP) */ +/* (http://www.hp.es) */ +/* */ +/* This file is part of UPC Operations Microbenchmarking Suite (UOMS). */ +/* */ +/* UOMS is free software: you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as published */ +/* by the Free Software Foundation, either version 3 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* UOMS is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public License */ +/* along with UOMS. If not, see . */ +/* */ +/******************************************************************************/ + +/******************************************************************************/ +/* */ +/* FUNDING: This development has been funded by Hewlett-Packard Spain */ +/* */ +/* Project Name: */ +/* UPCHACO (2008-2011) */ +/* Subproject: */ +/* Improving UPC Usability and Performance in Constellation Systems: */ +/* Implementation/Extensions of UPC Libraries. */ +/* (UPCPUProject -> UPC Performance and Usability Project) */ +/* */ +/******************************************************************************/ -/***************************************************************************** +/****************************************************************************** For further documentation, see [1] Files under doc/ -******************************************************************************/ +*******************************************************************************/ #include #include @@ -150,6 +150,8 @@ upc_flag_t sync_mode = UPC_IN_ALLSYNC | UPC_OUT_ALLSYNC; char * char_sync_mode = "UPC_IN_ALLSYNC|UPC_OUT_ALLSYNC"; +int global_aux_var = 0; + int main(int argc, char **argv) /* @@ -333,7 +335,7 @@ nbuckets=1; } - if(allocate_arrays(operation_code,cursize,nbuckets) == -1) // Unsuccesfully allocation + if(allocate_arrays(operation_code,cursize,nbuckets) == -1) // Unsuccessful allocation continue; upc_barrier; @@ -363,6 +365,9 @@ upc_barrier; end = getTicks() - start; + /* + For this benchmark the array should be freed per iteration + */ if(operation_code == ALLALLOC){ UPCMEM_OK(mem_alloc_tests_pointer); if(mem_is_ok == -1) @@ -422,242 +427,290 @@ */ void function(int operation_code, long int cursize,long int offset){ + int aux_var = 0; + switch (operation_code) { + case FORALL_R: + upc_forall(int i = offset; i < cursize*THREADS+offset; i++; &distArr[i]){ + aux_var+=distArr[i]; + } + /* + Some compilers with aggressive optimizations may drop the whole loop if they detect that + aux_var is not going to be used. Writing its value to an external variable may prevent this. + */ + global_aux_var = aux_var; + break; + case FORALL_W: + upc_forall(int i = offset; i < cursize*THREADS+offset; i++; &distArr[i]){ + distArr[i] = i; + } + break; + case FORALL_RW: + upc_forall(int i = offset; i < cursize*THREADS+offset; i++; &distArr[i]){ + distArr[i] += i; + } + break; + case FOR_R: + if(MYTHREAD == 0){ + for(int i = offset; i < cursize*THREADS+offset; i++){ + aux_var+=distArr[i]; + } + } + /* + Some compilers with aggressive optimizations may drop the whole loop if they detect that + aux_var is not going to be used. Writing its value to an external variable may prevent this. + */ + global_aux_var = aux_var; + break; + case FOR_W: + if(MYTHREAD == 0){ + for(int i = offset; i < cursize*THREADS+offset; i++){ + distArr[i] = i; + } + } + break; + case FOR_RW: + if(MYTHREAD == 0){ + for(int i = offset; i < cursize*THREADS+offset; i++){ + distArr[i] += i; + } + } + break; case BROADCAST: - upc_all_broadcast(&(distArr[THREADS*offset]),&(broadcastArr[offset]), cursize, sync_mode); - break; + upc_all_broadcast(&(distArr[THREADS*offset]),&(broadcastArr[offset]), cursize, sync_mode); + break; case SCATTER: - upc_all_scatter(&(distArr[THREADS*offset]),&(scatterArr[THREADS*offset]), cursize, sync_mode); - break; + upc_all_scatter(&(distArr[THREADS*offset]),&(scatterArr[THREADS*offset]), cursize, sync_mode); + break; case GATHER: - upc_all_gather( &(gatherArr[THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode); - break; + upc_all_gather( &(gatherArr[THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode); + break; case GATHERALL: - upc_all_gather_all( &(gatherallArr[THREADS*THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode); - break; + upc_all_gather_all( &(gatherallArr[THREADS*THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode); + break; case EXCHANGE: - upc_all_exchange(&(exchangeArr[THREADS*THREADS*offset]), &(distArr[THREADS*THREADS*offset]), cursize, sync_mode ); - break; + upc_all_exchange(&(exchangeArr[THREADS*THREADS*offset]), &(distArr[THREADS*THREADS*offset]), cursize, sync_mode ); + break; case PERMUTE: - upc_all_permute(&(permuteArr[THREADS*offset]), &(distArr[THREADS*offset]), perm, cursize, sync_mode ); - break; + upc_all_permute(&(permuteArr[THREADS*offset]), &(distArr[THREADS*offset]), perm, cursize, sync_mode ); + break; case REDUCE_C: - upc_all_reduceC((shared char *)reduceArr, (shared char*)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode ); - break; + upc_all_reduceC((shared char *)reduceArr, (shared char*)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode ); + break; case PREFIX_REDUCE_C: - upc_all_prefix_reduceC((shared char *)&(distArr[THREADS*offset]), (shared char *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode ); - break; + upc_all_prefix_reduceC((shared char *)&(distArr[THREADS*offset]), (shared char *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode ); + break; case REDUCE_UC: - upc_all_reduceUC((shared unsigned char *)reduceArr, (shared unsigned char *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode ); - break; + upc_all_reduceUC((shared unsigned char *)reduceArr, (shared unsigned char *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode ); + break; case PREFIX_REDUCE_UC: - upc_all_prefix_reduceUC((shared unsigned char *)&(distArr[THREADS*offset]), (shared unsigned char *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode ); - break; + upc_all_prefix_reduceUC((shared unsigned char *)&(distArr[THREADS*offset]), (shared unsigned char *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode ); + break; case REDUCE_S: - upc_all_reduceS((shared short *)reduceArr, (shared short *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode ); - break; + upc_all_reduceS((shared short *)reduceArr, (shared short *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode ); + break; case PREFIX_REDUCE_S: - upc_all_prefix_reduceS((shared short *)&(distArr[THREADS*offset]), (shared short *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode ); - break; + upc_all_prefix_reduceS((shared short *)&(distArr[THREADS*offset]), (shared short *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode ); + break; case REDUCE_US: - upc_all_reduceUS((shared unsigned short *)reduceArr, (shared unsigned short *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode ); - break; + upc_all_reduceUS((shared unsigned short *)reduceArr, (shared unsigned short *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode ); + break; case PREFIX_REDUCE_US: - upc_all_prefix_reduceUS((shared unsigned short *)&(distArr[THREADS*offset]), (shared unsigned short *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode ); - break; + upc_all_prefix_reduceUS((shared unsigned short *)&(distArr[THREADS*offset]), (shared unsigned short *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode ); + break; case REDUCE_I: - upc_all_reduceI((shared int *)reduceArr, (shared int *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode ); - break; + upc_all_reduceI((shared int *)reduceArr, (shared int *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode ); + break; case PREFIX_REDUCE_I: - upc_all_prefix_reduceI((shared int *)&(distArr[THREADS*offset]), (shared int *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode ); - break; + upc_all_prefix_reduceI((shared int *)&(distArr[THREADS*offset]), (shared int *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode ); + break; case REDUCE_UI: - upc_all_reduceUI((shared unsigned int *)reduceArr, (shared unsigned int *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode ); - break; + upc_all_reduceUI((shared unsigned int *)reduceArr, (shared unsigned int *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode ); + break; case PREFIX_REDUCE_UI: - upc_all_prefix_reduceUI((shared unsigned int *)&(distArr[THREADS*offset]), (shared unsigned int *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode ); - break; + upc_all_prefix_reduceUI((shared unsigned int *)&(distArr[THREADS*offset]), (shared unsigned int *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode ); + break; case REDUCE_L: - upc_all_reduceL((shared long *)reduceArr, (shared long *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode ); - break; + upc_all_reduceL((shared long *)reduceArr, (shared long *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode ); + break; case PREFIX_REDUCE_L: - upc_all_prefix_reduceL((shared long *)&(distArr[THREADS*offset]), (shared long *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode ); - break; + upc_all_prefix_reduceL((shared long *)&(distArr[THREADS*offset]), (shared long *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode ); + break; case REDUCE_UL: - upc_all_reduceUL((shared unsigned long *)reduceArr, (shared unsigned long *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode ); - break; + upc_all_reduceUL((shared unsigned long *)reduceArr, (shared unsigned long *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode ); + break; case PREFIX_REDUCE_UL: - upc_all_prefix_reduceUL((shared unsigned long *)&(distArr[THREADS*offset]), (shared unsigned long *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode ); - break; + upc_all_prefix_reduceUL((shared unsigned long *)&(distArr[THREADS*offset]), (shared unsigned long *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode ); + break; case REDUCE_F: - upc_all_reduceF((shared float *)reduceArr, (shared float *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode ); - break; + upc_all_reduceF((shared float *)reduceArr, (shared float *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode ); + break; case PREFIX_REDUCE_F: - upc_all_prefix_reduceF((shared float *)&(distArr[THREADS*offset]), (shared float *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode ); - break; + upc_all_prefix_reduceF((shared float *)&(distArr[THREADS*offset]), (shared float *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode ); + break; case REDUCE_D: - upc_all_reduceD((shared double *)reduceArr, (shared double *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode ); - break; + upc_all_reduceD((shared double *)reduceArr, (shared double *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode ); + break; case PREFIX_REDUCE_D: - upc_all_prefix_reduceD((shared double *)&(distArr[THREADS*offset]), (shared double *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode ); - break; + upc_all_prefix_reduceD((shared double *)&(distArr[THREADS*offset]), (shared double *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode ); + break; case REDUCE_LD: - upc_all_reduceLD((shared long double *)reduceArr, (shared long double *)&(distArr[THREADS*offset]), - reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode ); - break; + upc_all_reduceLD((shared long double *)reduceArr, (shared long double *)&(distArr[THREADS*offset]), + reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode ); + break; case PREFIX_REDUCE_LD: - upc_all_prefix_reduceLD((shared long double *)&(distArr[THREADS*offset]),(shared long double *)&(prefixReduceArr[THREADS*offset]), - reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode ); - break; + upc_all_prefix_reduceLD((shared long double *)&(distArr[THREADS*offset]),(shared long double *)&(prefixReduceArr[THREADS*offset]), + reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode ); + break; case BARRIER: - upc_barrier; - break; + upc_barrier; + break; case MEMGET: - if (!MYTHREAD) - upc_memget((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize); - break; + if (!MYTHREAD) + upc_memget((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize); + break; case LMEMGET: - if (!MYTHREAD) - upc_memget((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); - break; - #ifdef ASYNC_MEM_TEST + if (!MYTHREAD) + upc_memget((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); + break; +#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; + 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 + 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; + if (!MYTHREAD){ + upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize); + upc_waitsynci(); + } + break; case AILMEMGET: - if (!MYTHREAD){ - upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); - upc_waitsynci(); - } - break; - #endif + if (!MYTHREAD){ + upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize); + upc_waitsynci(); + } + break; +#endif case MEMPUT: - if (!MYTHREAD) - upc_memput(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize); - break; + if (!MYTHREAD) + upc_memput(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize); + break; case LMEMPUT: - if (!MYTHREAD) - upc_memput(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); - break; - #ifdef ASYNC_MEM_TEST + if (!MYTHREAD) + upc_memput(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); + break; +#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; + 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 + 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; + if (!MYTHREAD){ + upc_memput_asynci(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize); + upc_waitsynci(); + } + break; case AILMEMPUT: - if (!MYTHREAD){ - upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); - upc_waitsynci(); - } - break; - #endif + if (!MYTHREAD){ + upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize); + upc_waitsynci(); + } + break; +#endif case MEMCPY: - if (!MYTHREAD) - upc_memcpy(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); - break; + if (!MYTHREAD) + upc_memcpy(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + break; case LMEMCPY: - if (!MYTHREAD) - upc_memcpy(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); - break; - #ifdef ASYNC_MEM_TEST + if (!MYTHREAD) + upc_memcpy(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + break; +#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; + 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 + 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; + if (!MYTHREAD){ + upc_memcpy_asynci(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + upc_waitsynci(); + } + break; case AILMEMCPY: - if (!MYTHREAD){ - upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); - upc_waitsynci(); - } - break; - #endif + if (!MYTHREAD){ + upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize); + upc_waitsynci(); + } + break; +#endif case SMEMCPY: - if (!MYTHREAD) - memcpy(p2pLocalArr2+offset,p2pLocalArr+offset,cursize); - break; + if (!MYTHREAD) + memcpy(p2pLocalArr2+offset,p2pLocalArr+offset,cursize); + break; case MEMMOVE: - if (!MYTHREAD) - memmove(p2pLocalArr2+offset,p2pLocalArr+offset,cursize); - break; + if (!MYTHREAD) + memmove(p2pLocalArr2+offset,p2pLocalArr+offset,cursize); + break; case ALLALLOC: - mem_alloc_tests_pointer = upc_all_alloc(THREADS,cursize); - break; + mem_alloc_tests_pointer = upc_all_alloc(THREADS,cursize); + break; case FREE: - if(!MYTHREAD) - upc_free(mem_alloc_tests_pointer); - break; + if(!MYTHREAD) + upc_free(mem_alloc_tests_pointer); + break; default: - break; + break; } return; }