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] Diff of /trunk/uoms/src/UOMS.upc
[uoms] / trunk / uoms / src / UOMS.upc Repository:
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6, Wed Apr 14 07:40:20 2010 UTC revision 7, Fri Apr 23 09:49:46 2010 UTC
# Line 61  Line 61 
61    
62  /* UPC */  /* UPC */
63  #include <upc.h>  #include <upc.h>
 #include <upc_strict.h>  
64  #include <upc_collective.h>  #include <upc_collective.h>
65    
66  /* Timers */  /* Timers */
# Line 132  Line 131 
131    
132  shared                double b;// for reduction result  shared                double b;// for reduction result
133  shared                int    perm[THREADS]; //for permutation  shared                int    perm[THREADS]; //for permutation
134  shared                long   times[THREADS]; //for timing  shared                long   threads_times[THREADS]; //for timing
135    
136  long *sizes;  long *sizes;
137  int num_sizes = 0;  int num_sizes = 0;
# Line 216  Line 215 
215                  case ALMEMPUT:                  case ALMEMPUT:
216                  case AMEMPUT:                  case AMEMPUT:
217                  #endif                  #endif
218                    #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                  case SMEMCPY:                  case SMEMCPY:
227                  case MEMMOVE:                  case MEMMOVE:
228                  return 1;                  return 1;
# Line 365  Line 372 
372                                                  upc_free(mem_alloc_tests_pointer);                                                  upc_free(mem_alloc_tests_pointer);
373                                  }                                  }
374    
375                                  times[MYTHREAD]=end;                                  threads_times[MYTHREAD]=end;
376                                  upc_barrier;                                  upc_barrier;
377                                  if (MYTHREAD == 0) {                                  if (MYTHREAD == 0) {
378                                          int i;                                          int i;
379                                          tmax = 0L;                                          tmax = 0L;
380                                          for(i=0;i<THREADS;i++) {                                          for(i=0;i<THREADS;i++) {
381                                                  if (times[i]>tmax)                                                  if (threads_times[i]>tmax)
382                                                          tmax=times[i];                                                          tmax=threads_times[i];
383                                          }                                          }
384                                  }                                  }
385                                  end=tmax;                                  end=tmax;
# Line 536  Line 543 
543                  #ifdef ASYNC_MEM_TEST                  #ifdef ASYNC_MEM_TEST
544                  case AMEMGET:                  case AMEMGET:
545                  if (!MYTHREAD){                  if (!MYTHREAD){
546                            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                          upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize);                          upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[1+THREADS*offset]),cursize);
561                          upc_waitsynci();                          upc_waitsynci();
562                  }                  }
563                  break;                  break;
564                  case ALMEMGET:                  case AILMEMGET:
565                  if (!MYTHREAD){                  if (!MYTHREAD){
566                          upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize);                          upc_memget_asynci((p2pLocalArr+offset),&(p2pDistArr[THREADS*offset]),cursize);
567                          upc_waitsynci();                          upc_waitsynci();
# Line 558  Line 579 
579                  #ifdef ASYNC_MEM_TEST                  #ifdef ASYNC_MEM_TEST
580                  case AMEMPUT:                  case AMEMPUT:
581                  if (!MYTHREAD){                  if (!MYTHREAD){
582                            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                          upc_memput_asynci(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize);                          upc_memput_asynci(&(p2pDistArr[1+THREADS*offset]),p2pLocalArr+offset,cursize);
597                          upc_waitsynci();                          upc_waitsynci();
598                  }                  }
599                  break;                  break;
600                  case ALMEMPUT:                  case AILMEMPUT:
601                  if (!MYTHREAD){                  if (!MYTHREAD){
602                          upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize);                          upc_memput_asynci(&(p2pDistArr[THREADS*offset]),p2pLocalArr+offset,cursize);
603                          upc_waitsynci();                          upc_waitsynci();
# Line 580  Line 615 
615                  #ifdef ASYNC_MEM_TEST                  #ifdef ASYNC_MEM_TEST
616                  case AMEMCPY:                  case AMEMCPY:
617                  if (!MYTHREAD){                  if (!MYTHREAD){
618                            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                          upc_memcpy_asynci(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);                          upc_memcpy_asynci(&(p2pDistArr[1+THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
633                          upc_waitsynci();                          upc_waitsynci();
634                  }                  }
635                  break;                  break;
636                  case ALMEMCPY:                  case AILMEMCPY:
637                  if (!MYTHREAD){                  if (!MYTHREAD){
638                          upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);                          upc_memcpy_asynci(&(p2pDistArr[THREADS*offset]),&(p2pDistArr2[THREADS*offset]),cursize);
639                          upc_waitsynci();                          upc_waitsynci();

Legend:
Removed from v.6  
changed lines
  Added in v.7

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

Powered By FusionForge