~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/tcgmsg/capi.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

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
/** @file
 
6
 * This header file declares the public C API to tcgmsg.
 
7
 */
 
8
 
 
9
#include <string.h>
 
10
#include <stdlib.h>
 
11
 
 
12
#include "sndrcv.h"
 
13
 
 
14
void tcg_alt_pbegin(int *argc, char **argv[])
 
15
{
 
16
    tcgi_pbegin(*argc, *argv);
 
17
}
 
18
 
 
19
 
 
20
void tcg_brdcst(long type, void *buf, long lenbuf, long originator)
 
21
{
 
22
    long atype = type;
 
23
    long alenbuf = lenbuf;
 
24
    long aoriginator = originator;
 
25
 
 
26
    BRDCST_(&atype, buf, &alenbuf, &aoriginator);
 
27
}
 
28
 
 
29
 
 
30
void tcg_dgop(long type, double *x, long n, char *op)
 
31
{
 
32
    long atype = type;
 
33
    long an = n;
 
34
    double *ax;
 
35
    int i;
 
36
 
 
37
    ax = (double*)malloc(n * sizeof(double));
 
38
    for (i=0; i<n; ++i) {
 
39
        ax[i] = (double)x[i];
 
40
    }
 
41
    DGOP_(&atype, ax, &an, op, strlen(op));
 
42
    for (i=0; i<n; ++i) {
 
43
        x[i] = (double)ax[i];
 
44
    }
 
45
    free(ax);
 
46
}
 
47
 
 
48
 
 
49
double tcg_drand48()
 
50
{
 
51
    return ( (double) random() ) * 4.6566128752458e-10;
 
52
}
 
53
 
 
54
 
 
55
void tcg_igop(long type, long *x, long n, char *op)
 
56
{
 
57
    long atype = type;
 
58
    long an = n;
 
59
    long *ax;
 
60
    int i;
 
61
 
 
62
    ax = (long*)malloc(n * sizeof(long));
 
63
    for (i=0; i<n; ++i) {
 
64
        ax[i] = (long)x[i];
 
65
    }
 
66
    IGOP_(&atype, ax, &an, op, strlen(op));
 
67
    for (i=0; i<n; ++i) {
 
68
        x[i] = (long)ax[i];
 
69
    }
 
70
    free(ax);
 
71
}
 
72
 
 
73
 
 
74
void tcg_llog()
 
75
{
 
76
    LLOG_();
 
77
}
 
78
 
 
79
 
 
80
long tcg_mdtob(long n)
 
81
{
 
82
    long an = n;
 
83
 
 
84
    return MDTOB_(&an);
 
85
}
 
86
 
 
87
 
 
88
long tcg_mdtoi(long n)
 
89
{
 
90
    long an = n;
 
91
 
 
92
    return MDTOI_(&an);
 
93
}
 
94
 
 
95
 
 
96
long tcg_mitob(long n)
 
97
{
 
98
    long an = n;
 
99
 
 
100
    return MITOB_(&an);
 
101
}
 
102
 
 
103
 
 
104
long tcg_mitod(long n)
 
105
{
 
106
    long an = n;
 
107
 
 
108
    return MITOD_(&an);
 
109
}
 
110
 
 
111
 
 
112
long tcg_mtime()
 
113
{
 
114
    return MTIME_();
 
115
}
 
116
 
 
117
 
 
118
long tcg_niceftn(long ival)
 
119
{
 
120
    long aival = ival;
 
121
 
 
122
    return NICEFTN_(&aival);
 
123
}
 
124
 
 
125
 
 
126
long tcg_nnodes()
 
127
{
 
128
    return NNODES_();
 
129
}
 
130
 
 
131
 
 
132
long tcg_nodeid()
 
133
{
 
134
    return NODEID_();
 
135
}
 
136
 
 
137
 
 
138
long tcg_nxtval(long mproc)
 
139
{
 
140
    long amproc = mproc;
 
141
 
 
142
    return NXTVAL_(&amproc);
 
143
}
 
144
 
 
145
 
 
146
void tcg_error(char *msg, long code)
 
147
{
 
148
    long acode = code;
 
149
 
 
150
    Error(msg, acode);
 
151
}
 
152
 
 
153
 
 
154
void tcg_pbegin(int argc, char **argv)
 
155
{
 
156
    tcgi_pbegin(argc,argv);
 
157
}
 
158
 
 
159
 
 
160
void tcg_pbeginf()
 
161
{
 
162
    PBEGINF_();
 
163
}
 
164
 
 
165
 
 
166
void tcg_pbginf()
 
167
{
 
168
    PBGINF_();
 
169
}
 
170
 
 
171
 
 
172
void tcg_pend()
 
173
{
 
174
    PEND_();
 
175
}
 
176
 
 
177
 
 
178
void tcg_pfcopy(long type, long node0, char *fname)
 
179
{
 
180
    long atype = type;
 
181
    long anode0 = node0;
 
182
 
 
183
    PFILECOPY_(&atype, &anode0, fname);
 
184
}
 
185
 
 
186
 
 
187
long tcg_probe(long type, long node)
 
188
{
 
189
    long atype = type;
 
190
    long anode = node;
 
191
 
 
192
    return PROBE_(&atype, &anode);
 
193
}
 
194
 
 
195
 
 
196
void tcg_rcv(long type, void *buf, long lenbuf, long *lenmes,
 
197
        long nodeselect, long *nodefrom, long sync)
 
198
{
 
199
    long atype = type;
 
200
    long alenbuf = lenbuf;
 
201
    long alenmes = *lenmes;
 
202
    long anodeselect = nodeselect;
 
203
    long anodefrom = *nodefrom;
 
204
    long async = sync;
 
205
 
 
206
    RCV_(&atype, buf, &alenbuf, &alenmes, &anodeselect, &anodefrom, &async);
 
207
 
 
208
    *lenmes = alenmes;
 
209
    *nodefrom = anodefrom;
 
210
}
 
211
 
 
212
 
 
213
void tcg_setdbg(long value)
 
214
{
 
215
    long avalue = value;
 
216
 
 
217
    SETDBG_(&avalue);
 
218
}
 
219
 
 
220
 
 
221
void tcg_snd(long type, void *buf, long lenbuf, long node, long sync)
 
222
{
 
223
    long atype = type;
 
224
    long alenbuf = lenbuf;
 
225
    long anode = node;
 
226
    long async = sync;
 
227
 
 
228
    SND_(&atype, buf, &alenbuf, &anode, &async);
 
229
}
 
230
 
 
231
 
 
232
void tcg_srand48(long seed)
 
233
{
 
234
    unsigned int aseed = seed;
 
235
 
 
236
    srandom(aseed);
 
237
}
 
238
 
 
239
 
 
240
void tcg_stats()
 
241
{
 
242
    STATS_();
 
243
}
 
244
 
 
245
 
 
246
void tcg_synch(long type)
 
247
{
 
248
    long atype = type;
 
249
 
 
250
    SYNCH_(&atype);
 
251
}
 
252
 
 
253
 
 
254
long tcg_ready()
 
255
{
 
256
    return TCGREADY_();
 
257
}
 
258
 
 
259
 
 
260
double tcg_time()
 
261
{
 
262
    return TCGTIME_();
 
263
}
 
264
 
 
265
 
 
266
void tcg_waitcom(long node)
 
267
{
 
268
    long anode = node;
 
269
 
 
270
    WAITCOM_(&anode);
 
271
}