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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/src/progress/fence.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
#if HAVE_CONFIG_H
 
2
#   include "config.h"
 
3
#endif
 
4
 
 
5
#include "armcip.h"
 
6
#include "armci.h"
 
7
#include "copy.h"
 
8
#if HAVE_STDIO_H
 
9
#   include <stdio.h>
 
10
#endif
 
11
#if defined(PVM)
 
12
#   include <pvm3.h>
 
13
#elif defined(TCGMSG)
 
14
#   include <tcgmsg.h>
 
15
#elif defined(BGML)
 
16
#   include "bgml.h"
 
17
#else
 
18
#   include <mpi.h>
 
19
#endif
 
20
 
 
21
char *_armci_fence_arr;
 
22
 
 
23
void armci_init_fence()
 
24
{
 
25
#if defined (DATA_SERVER) || defined(PORTALS)
 
26
#if defined(THREAD_SAFE)
 
27
     _armci_fence_arr = calloc(armci_nproc*armci_user_threads.max,1);
 
28
#else
 
29
     _armci_fence_arr=calloc(armci_nproc,1);
 
30
#endif
 
31
     if(!_armci_fence_arr)
 
32
         armci_die("armci_init_fence: calloc failed",0);
 
33
#endif
 
34
}
 
35
 
 
36
void armci_finalize_fence()
 
37
{
 
38
#if defined (DATA_SERVER) || defined(PORTALS)
 
39
     free(_armci_fence_arr);
 
40
     _armci_fence_arr = NULL;
 
41
#endif
 
42
}
 
43
 
 
44
#ifdef PORTALS
 
45
void armci_update_fence_array(int proc, int inc)
 
46
{
 
47
    if (inc)
 
48
        FENCE_ARR(proc)++;
 
49
    else
 
50
        FENCE_ARR(proc)--;
 
51
}
 
52
#endif
 
53
 
 
54
 
 
55
void PARMCI_Fence(int proc)
 
56
{
 
57
#if defined(DATA_SERVER) && !(defined(GM) && defined(ACK_FENCE))
 
58
     if(FENCE_ARR(proc) && (armci_nclus >1)){
 
59
 
 
60
           int cluster = armci_clus_id(proc);
 
61
           int master = armci_clus_info[cluster].master;
 
62
 
 
63
           armci_rem_ack(cluster);
 
64
 
 
65
           bzero(&FENCE_ARR(master),
 
66
                   armci_clus_info[cluster].nslave);
 
67
     }
 
68
#elif defined(ARMCIX)
 
69
     ARMCIX_Fence (proc);
 
70
#elif defined(BGML)
 
71
     BGML_WaitProc(proc);
 
72
     MEM_FENCE;
 
73
#else
 
74
     FENCE_NODE(proc);
 
75
     MEM_FENCE;
 
76
#endif
 
77
}
 
78
 
 
79
 
 
80
void PARMCI_AllFence()
 
81
{
 
82
#if defined(ARMCIX)
 
83
    ARMCIX_AllFence ();
 
84
#elif defined(BGML)
 
85
    BGML_WaitAll();
 
86
#elif defined(LAPI) || defined(CLUSTER)
 
87
    int p;
 
88
 
 
89
    for(p = 0;p < armci_nproc; p++) {
 
90
        PARMCI_Fence(p); 
 
91
    }
 
92
#endif
 
93
    MEM_FENCE;
 
94
}
 
95
 
 
96
void PARMCI_Barrier()
 
97
{
 
98
    if (armci_nproc==1)
 
99
        return;
 
100
#if defined(BGML)
 
101
    BGML_WaitAll();
 
102
    bgml_barrier(3);
 
103
#else
 
104
    PARMCI_AllFence();
 
105
#  ifdef MPI
 
106
    MPI_Barrier(ARMCI_COMM_WORLD);
 
107
#  else
 
108
    {
 
109
       long type=ARMCI_TAG;
 
110
       tcg_synch(type);
 
111
    }
 
112
#  endif
 
113
#endif
 
114
    MEM_FENCE;
 
115
}