1 : |
dalvarez |
1 |
/*****************************************************************************/
|
2 : |
|
|
/* */
|
3 : |
|
|
/* Copyright (c) 2008, 2009, 2010 */
|
4 : |
|
|
/* Computer Architecture Group (CAG) */
|
5 : |
|
|
/* University of A Coruña, Spain */
|
6 : |
|
|
/* (http://gac.des.udc.es) */
|
7 : |
|
|
/* Galicia Supercomputing Center (CESGA) */
|
8 : |
|
|
/* (http://www.cesga.es) */
|
9 : |
|
|
/* Hewlett-Packard Spain (HP) */
|
10 : |
|
|
/* (http://www.hp.es) */
|
11 : |
|
|
/* */
|
12 : |
|
|
/* This file is part of UPC Operations Microbenchmarking Suite (UOMS). */
|
13 : |
|
|
/* */
|
14 : |
|
|
/* UOMS is free software: you can redistribute it and/or modify */
|
15 : |
|
|
/* it under the terms of the GNU Lesser General Public License as published */
|
16 : |
|
|
/* by the Free Software Foundation, either version 3 of the License, or */
|
17 : |
|
|
/* (at your option) any later version. */
|
18 : |
|
|
/* */
|
19 : |
|
|
/* UOMS is distributed in the hope that it will be useful, */
|
20 : |
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
21 : |
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
22 : |
|
|
/* GNU Lesser General Public License for more details. */
|
23 : |
|
|
/* */
|
24 : |
|
|
/* 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/>. */
|
26 : |
|
|
/* */
|
27 : |
|
|
/*****************************************************************************/
|
28 : |
|
|
|
29 : |
|
|
/*****************************************************************************/
|
30 : |
|
|
/* */
|
31 : |
|
|
/* FUNDING: This development has been funded by Hewlett-Packard Spain */
|
32 : |
|
|
/* */
|
33 : |
|
|
/* Project Name: */
|
34 : |
|
|
/* UPCHACO (2008-2011) */
|
35 : |
|
|
/* Subproject: */
|
36 : |
|
|
/* Improving UPC Usability and Performance in Constellation Systems: */
|
37 : |
|
|
/* Implementation/Extensions of UPC Libraries. */
|
38 : |
|
|
/* (UPCPUProject -> UPC Performance and Usability Project) */
|
39 : |
|
|
/* */
|
40 : |
|
|
/*****************************************************************************/
|
41 : |
|
|
|
42 : |
|
|
/*****************************************************************************
|
43 : |
|
|
|
44 : |
|
|
For further documentation, see
|
45 : |
|
|
|
46 : |
|
|
[1] Files under doc/
|
47 : |
|
|
|
48 : |
|
|
******************************************************************************/
|
49 : |
|
|
|
50 : |
|
|
#include <upc.h>
|
51 : |
|
|
#include <stdlib.h>
|
52 : |
|
|
#include <stdio.h>
|
53 : |
|
|
#include "defines.h" |
54 : |
|
|
#include "headers.h" |
55 : |
|
|
|
56 : |
|
|
/*
|
57 : |
|
|
Distributed array used in various benchmarks
|
58 : |
|
|
*/
|
59 : |
|
|
extern shared char *distArr;
|
60 : |
|
|
|
61 : |
|
|
/*
|
62 : |
|
|
Broadcast array
|
63 : |
|
|
*/
|
64 : |
|
|
extern shared [] char *broadcastArr;
|
65 : |
|
|
|
66 : |
|
|
/*
|
67 : |
|
|
Scatter array
|
68 : |
|
|
*/
|
69 : |
|
|
extern shared [] char *scatterArr;
|
70 : |
|
|
|
71 : |
|
|
/*
|
72 : |
|
|
Gather array
|
73 : |
|
|
*/
|
74 : |
|
|
extern shared [] char *gatherArr;
|
75 : |
|
|
|
76 : |
|
|
/*
|
77 : |
|
|
Gatherall array
|
78 : |
|
|
*/
|
79 : |
|
|
extern shared char *gatherallArr;
|
80 : |
|
|
|
81 : |
|
|
/*
|
82 : |
|
|
Exchange array
|
83 : |
|
|
*/
|
84 : |
|
|
extern shared char *exchangeArr;
|
85 : |
|
|
|
86 : |
|
|
/*
|
87 : |
|
|
Permute array
|
88 : |
|
|
*/
|
89 : |
|
|
extern shared char *permuteArr;
|
90 : |
|
|
|
91 : |
|
|
/*
|
92 : |
|
|
Reduce array (will store only 1 element)
|
93 : |
|
|
*/
|
94 : |
|
|
extern shared [] char *reduceArr;
|
95 : |
|
|
|
96 : |
|
|
/*
|
97 : |
|
|
Prefix reduce array
|
98 : |
|
|
*/
|
99 : |
|
|
extern shared char *prefixReduceArr;
|
100 : |
|
|
|
101 : |
|
|
/*
|
102 : |
|
|
Pointer for memory allocation and freeing test
|
103 : |
|
|
*/
|
104 : |
|
|
extern shared char *mem_alloc_tests_pointer;
|
105 : |
|
|
|
106 : |
|
|
/*
|
107 : |
|
|
Arrays for p2p benchmarking
|
108 : |
|
|
*/
|
109 : |
|
|
extern shared char *p2pDistArr;
|
110 : |
|
|
extern shared char *p2pDistArr2;
|
111 : |
|
|
extern char *p2pLocalArr;
|
112 : |
|
|
extern char *p2pLocalArr2;
|
113 : |
|
|
|
114 : |
|
|
int allocate_arrays(int operation_code, long int cursize, long int nbuckets){
|
115 : |
|
|
|
116 : |
|
|
size_t nbytes = cursize*nbuckets;
|
117 : |
|
|
int mem_is_ok;
|
118 : |
|
|
|
119 : |
|
|
/*
|
120 : |
|
|
Setup p2p arrays
|
121 : |
|
|
*/
|
122 : |
|
|
if (p2poperation(operation_code)) {
|
123 : |
|
|
p2pLocalArr = (char *) malloc(nbytes);
|
124 : |
|
|
MEM_OK(p2pLocalArr);
|
125 : |
|
|
if(mem_is_ok == -1) return -1;
|
126 : |
|
|
if(operation_code == SMEMCPY || operation_code == MEMMOVE){
|
127 : |
|
|
p2pLocalArr2 = (char *) malloc(nbytes);
|
128 : |
|
|
MEM_OK(p2pLocalArr2);
|
129 : |
|
|
if(mem_is_ok == -1) return -1;
|
130 : |
|
|
}
|
131 : |
|
|
else{
|
132 : |
|
|
p2pDistArr = upc_all_alloc(THREADS,nbytes);
|
133 : |
|
|
UPCMEM_OK(p2pDistArr);
|
134 : |
|
|
if(mem_is_ok == -1) return -1;
|
135 : |
dalvarez |
7 |
#if defined (ASYNC_MEM_TEST) || defined (ASYNCI_MEM_TEST)
|
136 : |
dalvarez |
1 |
if(operation_code == MEMCPY || operation_code == LMEMCPY ||
|
137 : |
dalvarez |
7 |
operation_code == AMEMCPY || operation_code == ALMEMCPY ||
|
138 : |
|
|
operation_code == AIMEMCPY || operation_code == AILMEMCPY){
|
139 : |
dalvarez |
1 |
#else
|
140 : |
|
|
if(operation_code == MEMCPY || operation_code == LMEMCPY){
|
141 : |
|
|
#endif
|
142 : |
|
|
p2pDistArr2 = upc_all_alloc(THREADS,nbytes);
|
143 : |
|
|
UPCMEM_OK(p2pDistArr);
|
144 : |
|
|
if(mem_is_ok == -1) return -1;
|
145 : |
|
|
}
|
146 : |
|
|
}
|
147 : |
|
|
}
|
148 : |
|
|
/*
|
149 : |
|
|
Setup collective arrays
|
150 : |
|
|
*/
|
151 : |
|
|
else{
|
152 : |
|
|
size_t dist_blk_size = 0;
|
153 : |
|
|
size_t num_dist_blk = 0;
|
154 : |
|
|
if(operation_code == BROADCAST){
|
155 : |
|
|
dist_blk_size = cursize;
|
156 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
157 : |
|
|
broadcastArr = upc_all_alloc(1,nbytes);
|
158 : |
|
|
UPCMEM_OK(broadcastArr);
|
159 : |
|
|
if(mem_is_ok == -1) return -1;
|
160 : |
|
|
}
|
161 : |
|
|
else if(operation_code == SCATTER){
|
162 : |
|
|
dist_blk_size = cursize;
|
163 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
164 : |
|
|
scatterArr = upc_all_alloc(1,nbytes*THREADS);
|
165 : |
|
|
UPCMEM_OK(scatterArr);
|
166 : |
|
|
if(mem_is_ok == -1) return -1;
|
167 : |
|
|
}
|
168 : |
|
|
else if(operation_code == GATHER){
|
169 : |
|
|
dist_blk_size = cursize;
|
170 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
171 : |
|
|
gatherArr = upc_all_alloc(1,nbytes*THREADS);
|
172 : |
|
|
UPCMEM_OK(gatherArr);
|
173 : |
|
|
if(mem_is_ok == -1) return -1;
|
174 : |
|
|
}
|
175 : |
|
|
else if(operation_code == GATHERALL){
|
176 : |
|
|
dist_blk_size = cursize;
|
177 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
178 : |
|
|
gatherallArr = upc_all_alloc(num_dist_blk,cursize*THREADS);
|
179 : |
|
|
UPCMEM_OK(gatherallArr);
|
180 : |
|
|
if(mem_is_ok == -1) return -1;
|
181 : |
|
|
}
|
182 : |
|
|
else if(operation_code == EXCHANGE){
|
183 : |
|
|
dist_blk_size = cursize*THREADS;
|
184 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
185 : |
|
|
exchangeArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
186 : |
|
|
UPCMEM_OK(exchangeArr);
|
187 : |
|
|
if(mem_is_ok == -1) return -1;
|
188 : |
|
|
}
|
189 : |
|
|
else if(operation_code == PERMUTE){
|
190 : |
|
|
dist_blk_size = cursize;
|
191 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
192 : |
|
|
permuteArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
193 : |
|
|
UPCMEM_OK(permuteArr);
|
194 : |
|
|
if(mem_is_ok == -1) return -1;
|
195 : |
|
|
}
|
196 : |
|
|
else if(operation_code == REDUCE_C){
|
197 : |
|
|
dist_blk_size = cursize;
|
198 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
199 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(char));
|
200 : |
|
|
UPCMEM_OK(reduceArr);
|
201 : |
|
|
if(mem_is_ok == -1) return -1;
|
202 : |
|
|
}
|
203 : |
|
|
else if(operation_code == PREFIX_REDUCE_C){
|
204 : |
|
|
dist_blk_size = cursize;
|
205 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
206 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
207 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
208 : |
|
|
if(mem_is_ok == -1) return -1;
|
209 : |
|
|
}
|
210 : |
|
|
else if(operation_code == REDUCE_UC){
|
211 : |
|
|
dist_blk_size = cursize;
|
212 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
213 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(unsigned char));
|
214 : |
|
|
UPCMEM_OK(reduceArr);
|
215 : |
|
|
if(mem_is_ok == -1) return -1;
|
216 : |
|
|
}
|
217 : |
|
|
else if(operation_code == PREFIX_REDUCE_UC){
|
218 : |
|
|
dist_blk_size = cursize;
|
219 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
220 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
221 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
222 : |
|
|
if(mem_is_ok == -1) return -1;
|
223 : |
|
|
}
|
224 : |
|
|
else if(operation_code == REDUCE_S){
|
225 : |
|
|
dist_blk_size = cursize;
|
226 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
227 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(short));
|
228 : |
|
|
UPCMEM_OK(reduceArr);
|
229 : |
|
|
if(mem_is_ok == -1) return -1;
|
230 : |
|
|
}
|
231 : |
|
|
else if(operation_code == PREFIX_REDUCE_S){
|
232 : |
|
|
dist_blk_size = cursize;
|
233 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
234 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
235 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
236 : |
|
|
if(mem_is_ok == -1) return -1;
|
237 : |
|
|
}
|
238 : |
|
|
else if(operation_code == REDUCE_US){
|
239 : |
|
|
dist_blk_size = cursize;
|
240 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
241 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(unsigned short));
|
242 : |
|
|
UPCMEM_OK(reduceArr);
|
243 : |
|
|
if(mem_is_ok == -1) return -1;
|
244 : |
|
|
}
|
245 : |
|
|
else if(operation_code == PREFIX_REDUCE_US){
|
246 : |
|
|
dist_blk_size = cursize;
|
247 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
248 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
249 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
250 : |
|
|
if(mem_is_ok == -1) return -1;
|
251 : |
|
|
}
|
252 : |
|
|
else if(operation_code == REDUCE_I){
|
253 : |
|
|
dist_blk_size = cursize;
|
254 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
255 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(int));
|
256 : |
|
|
UPCMEM_OK(reduceArr);
|
257 : |
|
|
if(mem_is_ok == -1) return -1;
|
258 : |
|
|
}
|
259 : |
|
|
else if(operation_code == PREFIX_REDUCE_I){
|
260 : |
|
|
dist_blk_size = cursize;
|
261 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
262 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
263 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
264 : |
|
|
if(mem_is_ok == -1) return -1;
|
265 : |
|
|
}
|
266 : |
|
|
else if(operation_code == REDUCE_UI){
|
267 : |
|
|
dist_blk_size = cursize;
|
268 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
269 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(unsigned int));
|
270 : |
|
|
UPCMEM_OK(reduceArr);
|
271 : |
|
|
if(mem_is_ok == -1) return -1;
|
272 : |
|
|
}
|
273 : |
|
|
else if(operation_code == PREFIX_REDUCE_UI){
|
274 : |
|
|
dist_blk_size = cursize;
|
275 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
276 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
277 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
278 : |
|
|
if(mem_is_ok == -1) return -1;
|
279 : |
|
|
}
|
280 : |
|
|
else if(operation_code == REDUCE_L){
|
281 : |
|
|
dist_blk_size = cursize;
|
282 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
283 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(long));
|
284 : |
|
|
UPCMEM_OK(reduceArr);
|
285 : |
|
|
if(mem_is_ok == -1) return -1;
|
286 : |
|
|
}
|
287 : |
|
|
else if(operation_code == PREFIX_REDUCE_L){
|
288 : |
|
|
dist_blk_size = cursize;
|
289 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
290 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
291 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
292 : |
|
|
if(mem_is_ok == -1) return -1;
|
293 : |
|
|
}
|
294 : |
|
|
else if(operation_code == REDUCE_UL){
|
295 : |
|
|
dist_blk_size = cursize;
|
296 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
297 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(unsigned long));
|
298 : |
|
|
UPCMEM_OK(reduceArr);
|
299 : |
|
|
if(mem_is_ok == -1) return -1;
|
300 : |
|
|
}
|
301 : |
|
|
else if(operation_code == PREFIX_REDUCE_UL){
|
302 : |
|
|
dist_blk_size = cursize;
|
303 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
304 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
305 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
306 : |
|
|
if(mem_is_ok == -1) return -1;
|
307 : |
|
|
}
|
308 : |
|
|
else if(operation_code == REDUCE_F){
|
309 : |
|
|
dist_blk_size = cursize;
|
310 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
311 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(float));
|
312 : |
|
|
UPCMEM_OK(reduceArr);
|
313 : |
|
|
if(mem_is_ok == -1) return -1;
|
314 : |
|
|
}
|
315 : |
|
|
else if(operation_code == PREFIX_REDUCE_F){
|
316 : |
|
|
dist_blk_size = cursize;
|
317 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
318 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
319 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
320 : |
|
|
if(mem_is_ok == -1) return -1;
|
321 : |
|
|
}
|
322 : |
|
|
else if(operation_code == REDUCE_D){
|
323 : |
|
|
dist_blk_size = cursize;
|
324 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
325 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(double));
|
326 : |
|
|
UPCMEM_OK(reduceArr);
|
327 : |
|
|
if(mem_is_ok == -1) return -1;
|
328 : |
|
|
}
|
329 : |
|
|
else if(operation_code == PREFIX_REDUCE_D){
|
330 : |
|
|
dist_blk_size = cursize;
|
331 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
332 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
333 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
334 : |
|
|
if(mem_is_ok == -1) return -1;
|
335 : |
|
|
}
|
336 : |
|
|
else if(operation_code == REDUCE_LD){
|
337 : |
|
|
dist_blk_size = cursize;
|
338 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
339 : |
|
|
reduceArr = upc_all_alloc(1,sizeof(long double));
|
340 : |
|
|
UPCMEM_OK(reduceArr);
|
341 : |
|
|
if(mem_is_ok == -1) return -1;
|
342 : |
|
|
}
|
343 : |
|
|
else if(operation_code == PREFIX_REDUCE_LD){
|
344 : |
|
|
dist_blk_size = cursize;
|
345 : |
|
|
num_dist_blk = THREADS*nbuckets;
|
346 : |
|
|
prefixReduceArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
347 : |
|
|
UPCMEM_OK(prefixReduceArr);
|
348 : |
|
|
if(mem_is_ok == -1) return -1;
|
349 : |
|
|
}
|
350 : |
|
|
|
351 : |
|
|
if(operation_code != BARRIER &&
|
352 : |
|
|
operation_code != ALLALLOC &&
|
353 : |
|
|
operation_code != FREE){
|
354 : |
|
|
distArr = upc_all_alloc(num_dist_blk,dist_blk_size);
|
355 : |
|
|
UPCMEM_OK(distArr);
|
356 : |
|
|
if(mem_is_ok == -1) return -1;
|
357 : |
|
|
}
|
358 : |
|
|
|
359 : |
|
|
}
|
360 : |
|
|
|
361 : |
|
|
return 0;
|
362 : |
|
|
|
363 : |
|
|
}
|
364 : |
|
|
|
365 : |
|
|
void free_arrays(int operation_code){
|
366 : |
|
|
/*
|
367 : |
|
|
Free p2p arrays
|
368 : |
|
|
*/
|
369 : |
|
|
if (p2poperation(operation_code)) {
|
370 : |
|
|
free(p2pLocalArr);
|
371 : |
|
|
if(operation_code == SMEMCPY || operation_code == MEMMOVE){
|
372 : |
|
|
free(p2pLocalArr2);
|
373 : |
|
|
}
|
374 : |
|
|
else{
|
375 : |
|
|
if (MYTHREAD == 0){
|
376 : |
|
|
upc_free(p2pDistArr);
|
377 : |
dalvarez |
7 |
#if defined (ASYNC_MEM_TEST) || defined (ASYNCI_MEM_TEST)
|
378 : |
dalvarez |
1 |
if(operation_code == MEMCPY || operation_code == LMEMCPY ||
|
379 : |
dalvarez |
7 |
operation_code == AMEMCPY || operation_code == ALMEMCPY ||
|
380 : |
|
|
operation_code == AIMEMCPY || operation_code == AILMEMCPY){
|
381 : |
dalvarez |
1 |
#else
|
382 : |
|
|
if(operation_code == MEMCPY || operation_code == LMEMCPY){
|
383 : |
|
|
#endif
|
384 : |
|
|
upc_free(p2pDistArr2);
|
385 : |
|
|
}
|
386 : |
|
|
}
|
387 : |
|
|
}
|
388 : |
|
|
}
|
389 : |
|
|
/*
|
390 : |
|
|
Free collective arrays
|
391 : |
|
|
*/
|
392 : |
|
|
else{
|
393 : |
|
|
if(MYTHREAD == 0){
|
394 : |
|
|
if(operation_code == BROADCAST){
|
395 : |
|
|
upc_free(broadcastArr);
|
396 : |
|
|
}
|
397 : |
|
|
else if(operation_code == SCATTER){
|
398 : |
|
|
upc_free(scatterArr);
|
399 : |
|
|
}
|
400 : |
|
|
else if(operation_code == GATHER){
|
401 : |
|
|
upc_free(gatherArr);
|
402 : |
|
|
}
|
403 : |
|
|
else if(operation_code == GATHERALL){
|
404 : |
|
|
upc_free(gatherallArr);
|
405 : |
|
|
}
|
406 : |
|
|
else if(operation_code == EXCHANGE){
|
407 : |
|
|
upc_free(exchangeArr);
|
408 : |
|
|
}
|
409 : |
|
|
else if(operation_code == PERMUTE){
|
410 : |
|
|
upc_free(permuteArr);
|
411 : |
|
|
}
|
412 : |
|
|
else if(operation_code == REDUCE_C
|
413 : |
|
|
|| operation_code == REDUCE_UC
|
414 : |
|
|
|| operation_code == REDUCE_S
|
415 : |
|
|
|| operation_code == REDUCE_US
|
416 : |
|
|
|| operation_code == REDUCE_I
|
417 : |
|
|
|| operation_code == REDUCE_UI
|
418 : |
|
|
|| operation_code == REDUCE_L
|
419 : |
|
|
|| operation_code == REDUCE_UL
|
420 : |
|
|
|| operation_code == REDUCE_F
|
421 : |
|
|
|| operation_code == REDUCE_D
|
422 : |
|
|
|| operation_code == REDUCE_LD){
|
423 : |
|
|
upc_free(reduceArr);
|
424 : |
|
|
}
|
425 : |
|
|
else if(operation_code == PREFIX_REDUCE_C
|
426 : |
|
|
|| operation_code == PREFIX_REDUCE_UC
|
427 : |
|
|
|| operation_code == PREFIX_REDUCE_S
|
428 : |
|
|
|| operation_code == PREFIX_REDUCE_US
|
429 : |
|
|
|| operation_code == PREFIX_REDUCE_I
|
430 : |
|
|
|| operation_code == PREFIX_REDUCE_UI
|
431 : |
|
|
|| operation_code == PREFIX_REDUCE_L
|
432 : |
|
|
|| operation_code == PREFIX_REDUCE_UL
|
433 : |
|
|
|| operation_code == PREFIX_REDUCE_F
|
434 : |
|
|
|| operation_code == PREFIX_REDUCE_D
|
435 : |
|
|
|| operation_code == PREFIX_REDUCE_LD){
|
436 : |
|
|
upc_free(prefixReduceArr);
|
437 : |
|
|
}
|
438 : |
|
|
|
439 : |
|
|
if(operation_code != BARRIER &&
|
440 : |
|
|
operation_code != ALLALLOC &&
|
441 : |
|
|
operation_code != FREE){
|
442 : |
|
|
upc_free(distArr);
|
443 : |
|
|
}
|
444 : |
|
|
}
|
445 : |
|
|
}
|
446 : |
|
|
}
|