Log In | Get Help   
Home My Page Projects Code Snippets Project Openings UPC Operations Microbenchmarking Suite
Summary Activity Tracker Lists Docs News SCM Files
[uoms] Annotation of /trunk/uoms/src/UOMS.upc
[uoms] / trunk / uoms / src / UOMS.upc Repository:
ViewVC logotype

Annotation of /trunk/uoms/src/UOMS.upc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (view) (download)

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 :     /* (UPCPU­Project -> 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 <sched.h>
51 :     #include <stdio.h>
52 :     #include <stdlib.h>
53 :     #include <time.h>
54 :     #include <sys/utsname.h>
55 :     #include <sys/time.h>
56 :     #include <values.h>
57 :     #include <stdio.h>
58 :     #include <unistd.h>
59 :     #include <math.h>
60 :     #include <string.h>
61 :    
62 :     /* UPC */
63 :     #include <upc.h>
64 :     #include <upc_collective.h>
65 :    
66 :     /* Timers */
67 :     #include "timers.h"
68 :    
69 :     #include "defines.h"
70 :     #include "headers.h"
71 :    
72 :     FILE* unit;
73 :    
74 :     /*
75 :     Distributed array used in various benchmarks
76 :     */
77 :     shared char *distArr;
78 :    
79 :     /*
80 :     Broadcast array
81 :     */
82 :     shared [] char *broadcastArr;
83 :    
84 :     /*
85 :     Scatter array
86 :     */
87 :     shared [] char *scatterArr;
88 :    
89 :     /*
90 :     Gather array
91 :     */
92 :     shared [] char *gatherArr;
93 :    
94 :     /*
95 :     Gatherall array
96 :     */
97 :     shared char *gatherallArr;
98 :    
99 :     /*
100 :     Exchange array
101 :     */
102 :     shared char *exchangeArr;
103 :    
104 :     /*
105 :     Permute array
106 :     */
107 :     shared char *permuteArr;
108 :    
109 :     /*
110 :     Reduce array (will store only 1 element)
111 :     */
112 :     shared [] char *reduceArr;
113 :    
114 :     /*
115 :     Prefix reduce array
116 :     */
117 :     shared char *prefixReduceArr;
118 :    
119 :     /*
120 :     Pointer for memory allocation and freeing test
121 :     */
122 :     shared char *mem_alloc_tests_pointer;
123 :    
124 :     /*
125 :     Arrays for p2p benchmarking
126 :     */
127 :     shared char *p2pDistArr;
128 :     shared char *p2pDistArr2;
129 :     char *p2pLocalArr;
130 :     char *p2pLocalArr2;
131 :    
132 :     shared double b;// for reduction result
133 :     shared int perm[THREADS]; //for permutation
134 : dalvarez 7 shared long threads_times[THREADS]; //for timing
135 : dalvarez 1
136 :     long *sizes;
137 :     int num_sizes = 0;
138 :    
139 :     int *bm_list;
140 :     int num_bms = 0;
141 :     char * valid_bms[NUM_BMS];
142 :    
143 :     int cache_invalidation = 0;
144 :    
145 :     upc_op_t reduce_op = UPC_ADD;
146 :     char * char_reduce_op = "UPC_ADD";
147 :    
148 :     int warmup;
149 :    
150 :     upc_flag_t sync_mode = UPC_IN_ALLSYNC | UPC_OUT_ALLSYNC;
151 :     char * char_sync_mode = "UPC_IN_ALLSYNC|UPC_OUT_ALLSYNC";
152 :    
153 :     int main(int argc, char **argv)
154 :     /*
155 :    
156 :     Input variables:
157 :    
158 :     -argc (type int)
159 :     Number of command line arguments
160 :    
161 :     -argv (type char **)
162 :     List of command line arguments
163 :    
164 :     Return value (type int)
165 :     0 always
166 :    
167 :     */
168 :     {
169 :    
170 :     init(argc, argv);
171 :    
172 :     if (!MYTHREAD)
173 :     UOMS_general_info();
174 :    
175 :     for(int i = 0; i < num_bms; i++){
176 :     if(p2poperation(bm_list[i]) == 0){
177 :     bench(bm_list[i]);
178 :     }
179 :     else{
180 :     if (THREADS == 2){
181 :     affinity_bench(bm_list[i]);
182 :     }
183 :     else{
184 :     if(MYTHREAD == 0){
185 :     fprintf(unit,"\n#---------------------------------------------------\n");
186 :     fprintf(unit,"# Skipping benchmark %s. To run it use only 2 threads.\n",valid_bms[bm_list[i]]);
187 :     fprintf(unit,"#---------------------------------------------------\n\n");
188 :     }
189 :     }
190 :     }
191 :     }
192 :    
193 :     if(unit != stdout && unit != stderr){
194 :     fclose(unit);
195 :     }
196 :    
197 :     return 0;
198 :     }
199 :    
200 :    
201 :    
202 :     int p2poperation(int operation_code) {
203 :     switch (operation_code) {
204 :     case LMEMCPY:
205 :     case MEMCPY:
206 :     case LMEMGET:
207 :     case MEMGET:
208 :     case LMEMPUT:
209 :     case MEMPUT:
210 :     #ifdef ASYNC_MEM_TEST
211 :     case ALMEMCPY:
212 :     case AMEMCPY:
213 :     case ALMEMGET:
214 :     case AMEMGET:
215 :     case ALMEMPUT:
216 :     case AMEMPUT:
217 :     #endif
218 : dalvarez 7 #ifdef ASYNCI_MEM_TEST
219 :     case AILMEMCPY:
220 :     case AIMEMCPY:
221 :     case AILMEMGET:
222 :     case AIMEMGET:
223 :     case AILMEMPUT:
224 :     case AIMEMPUT:
225 :     #endif
226 : dalvarez 1 case SMEMCPY:
227 :     case MEMMOVE:
228 :     return 1;
229 :     default:
230 :     break;
231 :     }
232 :     return 0;
233 :     }
234 :    
235 :     /*
236 :     Generic bench function
237 :     */
238 :     void bench(int operation_code) {
239 :    
240 :     long int cursize;
241 :     long int niterations, iter;
242 :     uint64_t start, end;
243 :     uint64_t minTime, totalTime, maxTime, prevMinTime;
244 :    
245 :     if (!MYTHREAD)
246 :     UOMS_function_info(operation_code,THREADS,operation_header(operation_code));
247 :    
248 :     int global_iter;
249 :     int initial_iter = (warmup)?0:1;
250 :    
251 :     int mem_is_ok;
252 :    
253 :     for(global_iter = initial_iter; global_iter <2; global_iter++) {
254 :    
255 :     prevMinTime = 0;
256 :    
257 :     /*
258 :     Benchmarking coll with cursize-size and niterations-iterations
259 :     */
260 :     for(int cursize_index=0;cursize_index<num_sizes;cursize_index++){
261 :    
262 :     cursize = sizes[cursize_index];
263 :    
264 :     /*
265 :     Skip test that do not achieve the minimum size
266 :     */
267 :     if(cursize <= 0){
268 :     continue;
269 :     }
270 :     else if(operation_code == REDUCE_C || operation_code == PREFIX_REDUCE_C){
271 :     if(cursize<sizeof(char)){
272 :     continue;
273 :     }
274 :     }
275 :     else if(operation_code == REDUCE_UC || operation_code == PREFIX_REDUCE_UC){
276 :     if(cursize<sizeof(unsigned char)){
277 :     continue;
278 :     }
279 :     }
280 :     else if(operation_code == REDUCE_S || operation_code == PREFIX_REDUCE_S){
281 :     if(cursize<sizeof(short)){
282 :     continue;
283 :     }
284 :     }
285 :     else if(operation_code == REDUCE_US || operation_code == PREFIX_REDUCE_US){
286 :     if(cursize<sizeof(unsigned short)){
287 :     continue;
288 :     }
289 :     }
290 :     else if(operation_code == REDUCE_I || operation_code == PREFIX_REDUCE_I){
291 :     if(cursize<sizeof(int)){
292 :     continue;
293 :     }
294 :     }
295 :     else if(operation_code == REDUCE_UI || operation_code == PREFIX_REDUCE_UI){
296 :     if(cursize<sizeof(unsigned int)){
297 :     continue;
298 :     }
299 :     }
300 :     else if(operation_code == REDUCE_L || operation_code == PREFIX_REDUCE_L){
301 :     if(cursize<sizeof(long)){
302 :     continue;
303 :     }
304 :     }
305 :     else if(operation_code == REDUCE_UL || operation_code == PREFIX_REDUCE_UL){
306 :     if(cursize<sizeof(unsigned long)){
307 :     continue;
308 :     }
309 :     }
310 :     else if(operation_code == REDUCE_F || operation_code == PREFIX_REDUCE_F){
311 :     if(cursize<sizeof(float)){
312 :     continue;
313 :     }
314 :     }
315 :     else if(operation_code == REDUCE_D || operation_code == PREFIX_REDUCE_D){
316 :     if(cursize<sizeof(double)){
317 :     continue;
318 :     }
319 :     }
320 :     else if(operation_code == REDUCE_LD || operation_code == PREFIX_REDUCE_LD){
321 :     if(cursize<sizeof(long double)){
322 :     continue;
323 :     }
324 :     }
325 :    
326 :     long int nbuckets;
327 :     niterations = niters(cursize);
328 :    
329 :     if(cache_invalidation == 1){
330 :     nbuckets=niterations;
331 :     }
332 :     else{
333 :     nbuckets=1;
334 :     }
335 :    
336 :     if(allocate_arrays(operation_code,cursize,nbuckets) == -1) // Unsuccesfully allocation
337 :     continue;
338 :    
339 :     upc_barrier;
340 :    
341 :     minTime=MAXLONG;
342 :     maxTime=0L;
343 :     totalTime=0L;
344 :    
345 :     uint64_t tmax;
346 :    
347 :     for(iter=0;iter<niterations;iter++){
348 :    
349 :     /*
350 :     For this benchmark the array should be allocated per iteration
351 :     */
352 :     if(operation_code == FREE){
353 :     mem_alloc_tests_pointer = upc_all_alloc(THREADS,cursize);
354 :     UPCMEM_OK(mem_alloc_tests_pointer);
355 :     if(mem_is_ok == -1)
356 :     continue;
357 :     }
358 :    
359 :     upc_barrier;
360 :    
361 :     start = getTicks();
362 :     function(operation_code,cursize,(iter%nbuckets)*cursize);
363 :     upc_barrier;
364 :     end = getTicks() - start;
365 :    
366 :     if(operation_code == ALLALLOC){
367 :     UPCMEM_OK(mem_alloc_tests_pointer);
368 :     if(mem_is_ok == -1)
369 :     continue;
370 :     upc_barrier;
371 :     if(MYTHREAD == 0)
372 :     upc_free(mem_alloc_tests_pointer);
373 :     }
374 :    
375 : dalvarez 7 threads_times[MYTHREAD]=end;
376 : dalvarez 1 upc_barrier;
377 :     if (MYTHREAD == 0) {
378 :     int i;
379 :     tmax = 0L;
380 :     for(i=0;i<THREADS;i++) {
381 : dalvarez 7 if (threads_times[i]>tmax)
382 :     tmax=threads_times[i];
383 : dalvarez 1 }
384 :     }
385 :     end=tmax;
386 :    
387 :     totalTime+=end;
388 :    
389 :     //in order to avoid irregular latencies for short messages
390 :     if (end<minTime)
391 :     minTime = ((end<prevMinTime)&&(cursize<32*1024))?prevMinTime:end;
392 :     if (end>maxTime)
393 :     maxTime = end;
394 :     }
395 :    
396 :     upc_barrier;
397 :    
398 :     free_arrays(operation_code);
399 :    
400 :     if(global_iter)
401 :     print_performance_data(operation_code,cursize,niterations,minTime,maxTime,totalTime);
402 :     prevMinTime = minTime;
403 :    
404 :     upc_barrier;
405 :    
406 :     if(operation_code == BARRIER){
407 :     break;
408 :     }
409 :    
410 :     }
411 :    
412 :     }//fi global_iter
413 :    
414 :     return;
415 :    
416 :     }
417 :    
418 :    
419 :    
420 :     /*
421 :     Call the corresponding function
422 :     */
423 :     void function(int operation_code, long int cursize,long int offset){
424 :    
425 :     switch (operation_code) {
426 :     case BROADCAST:
427 :     upc_all_broadcast(&(distArr[THREADS*offset]),&(broadcastArr[offset]), cursize, sync_mode);
428 :     break;
429 :     case SCATTER:
430 :     upc_all_scatter(&(distArr[THREADS*offset]),&(scatterArr[THREADS*offset]), cursize, sync_mode);
431 :     break;
432 :     case GATHER:
433 :     upc_all_gather( &(gatherArr[THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode);
434 :     break;
435 :     case GATHERALL:
436 :     upc_all_gather_all( &(gatherallArr[THREADS*THREADS*offset]),&(distArr[THREADS*offset]), cursize, sync_mode);
437 :     break;
438 :     case EXCHANGE:
439 :     upc_all_exchange(&(exchangeArr[THREADS*THREADS*offset]), &(distArr[THREADS*THREADS*offset]), cursize, sync_mode );
440 :     break;
441 :     case PERMUTE:
442 :     upc_all_permute(&(permuteArr[THREADS*offset]), &(distArr[THREADS*offset]), perm, cursize, sync_mode );
443 :     break;
444 :     case REDUCE_C:
445 :     upc_all_reduceC((shared char *)reduceArr, (shared char*)&(distArr[THREADS*offset]),
446 :     reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode );
447 :     break;
448 :     case PREFIX_REDUCE_C:
449 :     upc_all_prefix_reduceC((shared char *)&(distArr[THREADS*offset]), (shared char *)&(prefixReduceArr[THREADS*offset]),
450 :     reduce_op, (cursize/sizeof(char))*THREADS, cursize/sizeof(char), NULL, sync_mode );
451 :     break;
452 :     case REDUCE_UC:
453 :     upc_all_reduceUC((shared unsigned char *)reduceArr, (shared unsigned char *)&(distArr[THREADS*offset]),
454 :     reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode );
455 :     break;
456 :     case PREFIX_REDUCE_UC:
457 :     upc_all_prefix_reduceUC((shared unsigned char *)&(distArr[THREADS*offset]), (shared unsigned char *)&(prefixReduceArr[THREADS*offset]),
458 :     reduce_op, (cursize/sizeof(unsigned char))*THREADS, cursize/sizeof(unsigned char), NULL, sync_mode );
459 :     break;
460 :     case REDUCE_S:
461 :     upc_all_reduceS((shared short *)reduceArr, (shared short *)&(distArr[THREADS*offset]),
462 :     reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode );
463 :     break;
464 :     case PREFIX_REDUCE_S:
465 :     upc_all_prefix_reduceS((shared short *)&(distArr[THREADS*offset]), (shared short *)&(prefixReduceArr[THREADS*offset]),
466 :     reduce_op, (cursize/sizeof(short))*THREADS, cursize/sizeof(short), NULL, sync_mode );
467 :     break;
468 :     case REDUCE_US:
469 :     upc_all_reduceUS((shared unsigned short *)reduceArr, (shared unsigned short *)&(distArr[THREADS*offset]),
470 :     reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode );
471 :     break;
472 :     case PREFIX_REDUCE_US:
473 :     upc_all_prefix_reduceUS((shared unsigned short *)&(distArr[THREADS*offset]), (shared unsigned short *)&(prefixReduceArr[THREADS*offset]),
474 :     reduce_op, (cursize/sizeof(unsigned short))*THREADS, cursize/sizeof(unsigned short), NULL, sync_mode );
475 :     break;
476 :     case REDUCE_I:
477 :     upc_all_reduceI((shared int *)reduceArr, (shared int *)&(distArr[THREADS*offset]),
478 :     reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode );
479 :     break;
480 :     case PREFIX_REDUCE_I:
481 :     upc_all_prefix_reduceI((shared int *)&(distArr[THREADS*offset]), (shared int *)&(prefixReduceArr[THREADS*offset]),
482 :     reduce_op, (cursize/sizeof(int))*THREADS, cursize/sizeof(int), NULL, sync_mode );
483 :     break;
484 :     case REDUCE_UI:
485 :     upc_all_reduceUI((shared unsigned int *)reduceArr, (shared unsigned int *)&(distArr[THREADS*offset]),
486 :     reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode );
487 :     break;
488 :     case PREFIX_REDUCE_UI:
489 :     upc_all_prefix_reduceUI((shared unsigned int *)&(distArr[THREADS*offset]), (shared unsigned int *)&(prefixReduceArr[THREADS*offset]),
490 :     reduce_op, (cursize/sizeof(unsigned int))*THREADS, cursize/sizeof(unsigned int), NULL, sync_mode );
491 :     break;
492 :     case REDUCE_L:
493 :     upc_all_reduceL((shared long *)reduceArr, (shared long *)&(distArr[THREADS*offset]),
494 :     reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode );
495 :     break;
496 :     case PREFIX_REDUCE_L:
497 :     upc_all_prefix_reduceL((shared long *)&(distArr[THREADS*offset]), (shared long *)&(prefixReduceArr[THREADS*offset]),
498 :     reduce_op, (cursize/sizeof(long))*THREADS, cursize/sizeof(long), NULL, sync_mode );
499 :     break;
500 :     case REDUCE_UL:
501 :     upc_all_reduceUL((shared unsigned long *)reduceArr, (shared unsigned long *)&(distArr[THREADS*offset]),
502 :     reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode );
503 :     break;
504 :     case PREFIX_REDUCE_UL:
505 :     upc_all_prefix_reduceUL((shared unsigned long *)&(distArr[THREADS*offset]), (shared unsigned long *)&(prefixReduceArr[THREADS*offset]),
506 :     reduce_op, (cursize/sizeof(unsigned long))*THREADS, cursize/sizeof(unsigned long), NULL, sync_mode );
507 :     break;
508 :     case REDUCE_F:
509 :     upc_all_reduceF((shared float *)reduceArr, (shared float *)&(distArr[THREADS*offset]),
510 :     reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode );
511 :     break;
512 :     case PREFIX_REDUCE_F:
513 :     upc_all_prefix_reduceF((shared float *)&(distArr[THREADS*offset]), (shared float *)&(prefixReduceArr[THREADS*offset]),
514 :     reduce_op, (cursize/sizeof(float))*THREADS, cursize/sizeof(float), NULL, sync_mode );
515 :     break;
516 :     case REDUCE_D:
517 :     upc_all_reduceD((shared double *)reduceArr, (shared double *)&(distArr[THREADS*offset]),
518 :     reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode );
519 :     break;
520 :     case PREFIX_REDUCE_D:
521 :     upc_all_prefix_reduceD((shared double *)&(distArr[THREADS*offset]), (shared double *)&(prefixReduceArr[THREADS*offset]),
522 :     reduce_op, (cursize/sizeof(double))*THREADS, cursize/sizeof(double), NULL, sync_mode );
523 :     break;
524 :     case REDUCE_LD:
525 :     upc_all_reduceLD((shared long double *)reduceArr, (shared long double *)&(distArr[THREADS*offset]),
526 :     reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode );
527 :     break;
528 :     case PREFIX_REDUCE_LD:
529 :     upc_all_prefix_reduceLD((shared long double *)&(distArr[THREADS*offset]),(shared long double *)&(prefixReduceArr[THREADS*offset]),
530 :     reduce_op, (cursize/sizeof(long double))*THREADS, cursize/sizeof(long double), NULL, sync_mode );
531 :     break;
532 :     case BARRIER:
533 :     upc_barrier;
534 :     break;
535 :     case MEMGET:
536 :     if (!MYTHREAD)
537 :     upc_memget((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize);
538 :     break;
539 :     case LMEMGET:
540 :     if (!MYTHREAD)
541 :     upc_memget((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize);
542 :     break;
543 :     #ifdef ASYNC_MEM_TEST
544 :     case AMEMGET:
545 :     if (!MYTHREAD){
546 : dalvarez 7 upc_handle_t handler = upc_memget_async((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize);
547 :     upc_waitsync(handler);
548 :     }
549 :     break;
550 :     case ALMEMGET:
551 :     if (!MYTHREAD){
552 :     upc_handle_t handler = upc_memget_async((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize);
553 :     upc_waitsync(handler);
554 :     }
555 :     break;
556 :     #endif
557 :     #ifdef ASYNCI_MEM_TEST
558 :     case AIMEMGET:
559 :     if (!MYTHREAD){
560 : dalvarez 1 upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize);
561 :     upc_waitsynci();
562 :     }
563 :     break;
564 : dalvarez 7 case AILMEMGET:
565 : dalvarez 1 if (!MYTHREAD){
566 :     upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize);
567 :     upc_waitsynci();
568 :     }
569 :     break;
570 :     #endif
571 :     case MEMPUT:
572 :     if (!MYTHREAD)
573 :     upc_memput(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize);
574 :     break;
575 :     case LMEMPUT:
576 :     if (!MYTHREAD)
577 :     upc_memput(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize);
578 :     break;
579 :     #ifdef ASYNC_MEM_TEST
580 :     case AMEMPUT:
581 :     if (!MYTHREAD){
582 : dalvarez 7 upc_handle_t handler = upc_memput_async(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize);
583 :     upc_waitsync(handler);
584 :     }
585 :     break;
586 :     case ALMEMPUT:
587 :     if (!MYTHREAD){
588 :     upc_handle_t handler = upc_memput_async(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize);
589 :     upc_waitsync(handler);
590 :     }
591 :     break;
592 :     #endif
593 :     #ifdef ASYNCI_MEM_TEST
594 :     case AIMEMPUT:
595 :     if (!MYTHREAD){
596 : dalvarez 1 upc_memput_asynci(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize);
597 :     upc_waitsynci();
598 :     }
599 :     break;
600 : dalvarez 7 case AILMEMPUT:
601 : dalvarez 1 if (!MYTHREAD){
602 :     upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize);
603 :     upc_waitsynci();
604 :     }
605 :     break;
606 :     #endif
607 :     case MEMCPY:
608 :     if (!MYTHREAD)
609 :     upc_memcpy(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
610 :     break;
611 :     case LMEMCPY:
612 :     if (!MYTHREAD)
613 :     upc_memcpy(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
614 :     break;
615 :     #ifdef ASYNC_MEM_TEST
616 :     case AMEMCPY:
617 :     if (!MYTHREAD){
618 : dalvarez 7 upc_handle_t handler = upc_memcpy_async(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
619 :     upc_waitsync(handler);
620 :     }
621 :     break;
622 :     case ALMEMCPY:
623 :     if (!MYTHREAD){
624 :     upc_handle_t handler = upc_memcpy_async(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
625 :     upc_waitsync(handler);
626 :     }
627 :     break;
628 :     #endif
629 :     #ifdef ASYNCI_MEM_TEST
630 :     case AIMEMCPY:
631 :     if (!MYTHREAD){
632 : dalvarez 1 upc_memcpy_asynci(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
633 :     upc_waitsynci();
634 :     }
635 :     break;
636 : dalvarez 7 case AILMEMCPY:
637 : dalvarez 1 if (!MYTHREAD){
638 :     upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
639 :     upc_waitsynci();
640 :     }
641 :     break;
642 :     #endif
643 :     case SMEMCPY:
644 :     if (!MYTHREAD)
645 :     memcpy(p2pLocalArr2+offset,p2pLocalArr+offset,cursize);
646 :     break;
647 :     case MEMMOVE:
648 :     if (!MYTHREAD)
649 :     memmove(p2pLocalArr2+offset,p2pLocalArr+offset,cursize);
650 :     break;
651 :     case ALLALLOC:
652 :     mem_alloc_tests_pointer = upc_all_alloc(THREADS,cursize);
653 :     break;
654 :     case FREE:
655 :     if(!MYTHREAD)
656 :     upc_free(mem_alloc_tests_pointer);
657 :     break;
658 :    
659 :     default:
660 :     break;
661 :     }
662 :     return;
663 :     }
664 :    

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge