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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/tcgmsg/ipcv5.0/copyall.save.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
#if HAVE_STDIO_H
 
6
#   include <stdio.h>
 
7
#endif
 
8
#if HAVE_MEMORY_H
 
9
#   include <memory.h>
 
10
#endif
 
11
 
 
12
 
 
13
/**
 
14
 * A copy optimized for DESTINATIONS in shared memory that
 
15
 * are aligned and data is to be read by other processes.
 
16
 * 
 
17
 * Both prefetch and poststore the destination.
 
18
 */
 
19
void copyto(const unsigned char *src, unsigned char *dest, long n)
 
20
{
 
21
    if (n < 128 || (dest - src) & 7) {
 
22
 
 
23
        /* small n, or
 
24
           not possible to get src and dest even word aligned */
 
25
 
 
26
        memcpy(dest, src, (size_t) n);
 
27
        return;
 
28
    }
 
29
 
 
30
    /* Read ahead so that dest is aligned on a page boundary */
 
31
 
 
32
    {
 
33
        register long nbytes = (127 & (unsigned long) dest);
 
34
        if (nbytes > 0) nbytes = 128 - nbytes;
 
35
        if (nbytes > n) nbytes = n;
 
36
        n -= nbytes;
 
37
 
 
38
        while (nbytes--)
 
39
            *dest++ = *src++;
 
40
 
 
41
        if (n == 0) return;
 
42
    }
 
43
 
 
44
    {
 
45
        /* src is at least word aligned and dest is subpage aligned */
 
46
 
 
47
        register long npage = n>>7;
 
48
        register const unsigned long *from = (unsigned long *) src;
 
49
        register unsigned long *to = (unsigned long *) dest;
 
50
        register unsigned long a, b, c, d, e, f, g, h;
 
51
 
 
52
        src  += npage<<7;
 
53
        dest += npage<<7;
 
54
        n    -= npage<<7;
 
55
 
 
56
        /*    _pcsp(to+16, "ex", "nbl");
 
57
              _pcsp(to+32, "ex", "nbl");
 
58
              _pcsp(to+48, "ex", "nbl"); */
 
59
 
 
60
        while (npage--) {
 
61
 
 
62
            /*       _pcsp(to+64, "ex", "nbl"); */
 
63
 
 
64
            a = from[0];
 
65
            b = from[1];
 
66
            c = from[2];
 
67
            d = from[3];
 
68
            e = from[4];
 
69
            f = from[5];
 
70
            g = from[6];
 
71
            h = from[7];
 
72
            to[0] = a;
 
73
            to[1] = b;
 
74
            to[2] = c;
 
75
            to[3] = d;
 
76
            to[4] = e;
 
77
            to[5] = f;
 
78
            to[6] = g;
 
79
            to[7] = h;
 
80
 
 
81
            a = from[8];
 
82
            b = from[9];
 
83
            c = from[10];
 
84
            d = from[11];
 
85
            e = from[12];
 
86
            f = from[13];
 
87
            g = from[14];
 
88
            h = from[15];
 
89
            to[8]  = a;
 
90
            to[9]  = b;
 
91
            to[10] = c;
 
92
            to[11] = d;
 
93
            to[12] = e;
 
94
            to[13] = f;
 
95
            to[14] = g;
 
96
            to[15] = h;
 
97
 
 
98
            /*       _pstsp((char *) to); */
 
99
 
 
100
            to += 16; from+= 16;
 
101
        }
 
102
    }
 
103
 
 
104
    {
 
105
        register long nbytes = n;
 
106
        register const unsigned char *from = (unsigned char *) src;
 
107
        register unsigned char *to = (unsigned char *) dest;
 
108
 
 
109
        while (nbytes--)
 
110
            *to++ = *from++;
 
111
    }
 
112
}
 
113
 
 
114
 
 
115
/**
 
116
 * A copy optimized for SOURCES in shared memory that are aligned.
 
117
 * 
 
118
 * Prefetch sources only.
 
119
 */
 
120
void copyfrom(const unsigned char *src, unsigned char *dest, long n)
 
121
{
 
122
    if (n < 128 || (dest - src) & 7) {
 
123
 
 
124
        /* small n, or
 
125
           not possible to get src and dest even word aligned */
 
126
 
 
127
        memcpy(dest, src, (size_t) n);
 
128
        return;
 
129
    }
 
130
 
 
131
    /* Read ahead so that src is aligned on a page boundary */
 
132
 
 
133
    {
 
134
        register long nbytes = (127 & (unsigned long) src);
 
135
        if (nbytes > 0) nbytes = 128 - nbytes;
 
136
        if (nbytes > n) nbytes = n;
 
137
        n -= nbytes;
 
138
 
 
139
        while (nbytes--)
 
140
            *dest++ = *src++;
 
141
 
 
142
        if (n == 0) return;
 
143
    }
 
144
 
 
145
    {
 
146
        /* dest is at least word aligned and src is subpage aligned */
 
147
 
 
148
        register long npage = n>>7;
 
149
        register const unsigned long *from = (unsigned long *) src;
 
150
        register unsigned long *to = (unsigned long *) dest;
 
151
        register unsigned long a, b, c, d, e, f, g, h;
 
152
 
 
153
        src  += npage<<7;
 
154
        dest += npage<<7;
 
155
        n    -= npage<<7;
 
156
 
 
157
        /*    _pcsp(from+16, "ro", "nbl");
 
158
              _pcsp(from+32, "ro", "nbl");
 
159
              _pcsp(from+48, "ro", "nbl"); */
 
160
 
 
161
        while (npage--) {
 
162
 
 
163
            /*      _pcsp(from+64, "ro", "nbl"); */
 
164
 
 
165
            a = from[0];
 
166
            b = from[1];
 
167
            c = from[2];
 
168
            d = from[3];
 
169
            e = from[4];
 
170
            f = from[5];
 
171
            g = from[6];
 
172
            h = from[7];
 
173
            to[0] = a;
 
174
            to[1] = b;
 
175
            to[2] = c;
 
176
            to[3] = d;
 
177
            to[4] = e;
 
178
            to[5] = f;
 
179
            to[6] = g;
 
180
            to[7] = h;
 
181
 
 
182
            a = from[8];
 
183
            b = from[9];
 
184
            c = from[10];
 
185
            d = from[11];
 
186
            e = from[12];
 
187
            f = from[13];
 
188
            g = from[14];
 
189
            h = from[15];
 
190
            to[8]  = a;
 
191
            to[9]  = b;
 
192
            to[10] = c;
 
193
            to[11] = d;
 
194
            to[12] = e;
 
195
            to[13] = f;
 
196
            to[14] = g;
 
197
            to[15] = h;
 
198
 
 
199
            /*       _pstsp((char *) to); */
 
200
 
 
201
            to += 16; from+= 16;
 
202
        }
 
203
    }
 
204
 
 
205
    {
 
206
        register long nbytes = n;
 
207
        register const unsigned char *from = (unsigned char *) src;
 
208
        register unsigned char *to = (unsigned char *) dest;
 
209
 
 
210
        while (nbytes--)
 
211
            *to++ = *from++;
 
212
    }
 
213
}