#include #define N 10000000 #define M 4000000 int main(void) { for ( int i = 0; i < N; ++i ) { #if !defined(GLOBAL_ALLOC) && !defined(LOCAL_ALLOC) shared int* temp = (shared int*)upc_all_alloc(M, sizeof(int)); upc_barrier; if ( MYTHREAD == 0 ) upc_free(temp); upc_barrier; #endif #ifdef GLOBAL_ALLOC shared int* temp = (shared int*)upc_global_alloc(M, sizeof(int)); upc_barrier; upc_free(temp); upc_barrier; #endif #ifdef LOCAL_ALLOC shared [] int* ltemp = (shared [] int*)upc_alloc(M*sizeof(int)); upc_barrier; upc_free(ltemp); upc_barrier; #endif } return 0; }