1 |
/*****************************************************************************/ |
/******************************************************************************/ |
2 |
/* */ |
/* */ |
3 |
/* Copyright (c) 2008, 2009, 2010 */ |
/* Copyright (c) 2008, 2009, 2010 */ |
4 |
/* Computer Architecture Group (CAG) */ |
/* Computer Architecture Group (CAG) */ |
24 |
/* You should have received a copy of the GNU Lesser General Public License */ |
/* You should have received a copy of the GNU Lesser General Public License */ |
25 |
/* along with UOMS. If not, see <http://www.gnu.org/licenses/>. */ |
/* along with UOMS. If not, see <http://www.gnu.org/licenses/>. */ |
26 |
/* */ |
/* */ |
27 |
/*****************************************************************************/ |
/******************************************************************************/ |
28 |
|
|
29 |
/*****************************************************************************/ |
/******************************************************************************/ |
30 |
/* */ |
/* */ |
31 |
/* FUNDING: This development has been funded by Hewlett-Packard Spain */ |
/* FUNDING: This development has been funded by Hewlett-Packard Spain */ |
32 |
/* */ |
/* */ |
35 |
/* Subproject: */ |
/* Subproject: */ |
36 |
/* Improving UPC Usability and Performance in Constellation Systems: */ |
/* Improving UPC Usability and Performance in Constellation Systems: */ |
37 |
/* Implementation/Extensions of UPC Libraries. */ |
/* Implementation/Extensions of UPC Libraries. */ |
38 |
/* (UPCPUProject -> UPC Performance and Usability Project) */ |
/* (UPCPUProject -> UPC Performance and Usability Project) */ |
39 |
/* */ |
/* */ |
40 |
/*****************************************************************************/ |
/******************************************************************************/ |
41 |
|
|
42 |
/***************************************************************************** |
/****************************************************************************** |
43 |
|
|
44 |
For further documentation, see |
For further documentation, see |
45 |
|
|
46 |
[1] Files under doc/ |
[1] Files under doc/ |
47 |
|
|
48 |
******************************************************************************/ |
*******************************************************************************/ |
49 |
|
|
50 |
#include <upc.h> |
#include <upc.h> |
51 |
#include <stdlib.h> |
#include <stdlib.h> |
149 |
Setup collective arrays |
Setup collective arrays |
150 |
*/ |
*/ |
151 |
else{ |
else{ |
152 |
|
|
153 |
size_t dist_blk_size = 0; |
size_t dist_blk_size = 0; |
154 |
size_t num_dist_blk = 0; |
size_t num_dist_blk = 0; |
155 |
if(operation_code == BROADCAST){ |
if(operation_code == FORALL_R){ |
156 |
|
dist_blk_size = cursize; |
157 |
|
num_dist_blk = THREADS*nbuckets; |
158 |
|
} |
159 |
|
else if(operation_code == FORALL_W){ |
160 |
|
dist_blk_size = cursize; |
161 |
|
num_dist_blk = THREADS*nbuckets; |
162 |
|
} |
163 |
|
else if(operation_code == FORALL_RW){ |
164 |
|
dist_blk_size = cursize; |
165 |
|
num_dist_blk = THREADS*nbuckets; |
166 |
|
} |
167 |
|
else if(operation_code == FOR_R){ |
168 |
|
dist_blk_size = cursize; |
169 |
|
num_dist_blk = THREADS*nbuckets; |
170 |
|
} |
171 |
|
else if(operation_code == FOR_W){ |
172 |
|
dist_blk_size = cursize; |
173 |
|
num_dist_blk = THREADS*nbuckets; |
174 |
|
} |
175 |
|
else if(operation_code == FOR_RW){ |
176 |
|
dist_blk_size = cursize; |
177 |
|
num_dist_blk = THREADS*nbuckets; |
178 |
|
} |
179 |
|
else if(operation_code == BROADCAST){ |
180 |
dist_blk_size = cursize; |
dist_blk_size = cursize; |
181 |
num_dist_blk = THREADS*nbuckets; |
num_dist_blk = THREADS*nbuckets; |
182 |
broadcastArr = upc_all_alloc(1,nbytes); |
broadcastArr = upc_all_alloc(1,nbytes); |