~ubuntu-branches/ubuntu/saucy/nwchem/saucy

« back to all changes in this revision

Viewing changes to src/tools/ga-4-3/armci/examples/features/non-blocking/simple/simple.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2012-02-09 20:02:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120209200241-jgk03qfsphal4ug2
Tags: 6.1-1
* New upstream release.

[ Michael Banck ]
* debian/patches/02_makefile_flags.patch: Updated.
* debian/patches/02_makefile_flags.patch: Use internal blas and lapack code.
* debian/patches/02_makefile_flags.patch: Define GCC4 for LINUX and LINUX64
  (Closes: #632611 and LP: #791308).
* debian/control (Build-Depends): Added openssh-client.
* debian/rules (USE_SCALAPACK, SCALAPACK): Removed variables (Closes:
  #654658).
* debian/rules (LIBDIR, USE_MPIF4, ARMCI_NETWORK): New variables.
* debian/TODO: New file.
* debian/control (Build-Depends): Removed libblas-dev, liblapack-dev and
  libscalapack-mpi-dev.
* debian/patches/04_show_testsuite_diff_output.patch: New patch, shows the
  diff output for failed tests.
* debian/patches/series: Adjusted.
* debian/testsuite: Optionally run all tests if "all" is passed as option.
* debian/rules: Run debian/testsuite with "all" if DEB_BUILD_OPTIONS
  contains "checkall".

[ Daniel Leidert ]
* debian/control: Used wrap-and-sort. Added Vcs-Svn and Vcs-Browser fields.
  (Priority): Moved to extra according to policy section 2.5.
  (Standards-Version): Bumped to 3.9.2.
  (Description): Fixed a typo.
* debian/watch: Added.
* debian/patches/03_hurd-i386_define_path_max.patch: Added.
  - Define MAX_PATH if not defines to fix FTBFS on hurd.
* debian/patches/series: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id$ */
 
2
 
 
3
#include <stdio.h>
 
4
#include <stdlib.h>
 
5
#include <unistd.h>
 
6
 
 
7
#include "mp3.h"
 
8
#include "armci.h"
 
9
 
 
10
int me,nprocs;
 
11
int LOOP=10;
 
12
int main(int argc, char **argv)
 
13
{
 
14
int i;
 
15
double **myptrs;
 
16
double t0,t1,tnbget=0,tnbwait=0,t2=0;
 
17
    MP_INIT(argc,argv);
 
18
    MP_PROCS(&nprocs);
 
19
    if (nprocs==1)
 
20
    {
 
21
        fprintf(stderr,"You must use more than 1 process for this test.  Exiting gently.");
 
22
        return 0;
 
23
    }
 
24
    MP_MYID(&me);
 
25
    myptrs = (double **)malloc(sizeof(double *)*nprocs);
 
26
    ARMCI_Init();
 
27
    ARMCI_Malloc((void **)myptrs,LOOP*sizeof(double)); 
 
28
    MP_BARRIER();
 
29
    if(me==0){
 
30
       for(i=0;i<10;i++){
 
31
         ARMCI_Get(myptrs[me]+i,myptrs[me+1]+i,sizeof(double),me+1);
 
32
       }
 
33
       t0 = MP_TIMER(); 
 
34
       for(i=0;i<LOOP;i++){
 
35
         ARMCI_Get(myptrs[me]+i,myptrs[me+1]+i,sizeof(double),me+1);
 
36
       }
 
37
       t1 = MP_TIMER(); 
 
38
       printf("\nGet Latency=%lf\n",1e6*(t1-t0)/LOOP);fflush(stdout);
 
39
       t1=t0=0;
 
40
       for(i=0;i<LOOP;i++){
 
41
         armci_hdl_t nbh;
 
42
         ARMCI_INIT_HANDLE(&nbh);
 
43
         t0 = MP_TIMER(); 
 
44
         ARMCI_NbGet(myptrs[me]+i,myptrs[me+1]+i,sizeof(double),me+1,&nbh);
 
45
         t1 = MP_TIMER(); 
 
46
         ARMCI_Wait(&nbh);
 
47
         t2 = MP_TIMER();
 
48
         tnbget+=(t1-t0);
 
49
         tnbwait+=(t2-t1);
 
50
       }
 
51
       printf("\nNb Get Latency=%lf Nb Wait=%lf\n",1e6*tnbget/LOOP,1e6*tnbwait/LOOP);fflush(stdout);
 
52
    }
 
53
    else
 
54
      sleep(1);
 
55
    MP_BARRIER();
 
56
    ARMCI_Finalize();
 
57
    MP_FINALIZE();
 
58
    return 0;
 
59
}