Skip to content

Commit c4435e6

Browse files
committed
Merge branch 'release/v0.7.0'
2 parents 51bf150 + 7a8f6af commit c4435e6

21 files changed

Lines changed: 465 additions & 52 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _Please do not send pull requests to the `master` branch which is reserved for r
2424

2525
### Compilers
2626

27-
Intel ICPC v16 and later
27+
Intel ICPC v16.0.3 and later
2828

2929
Clang v3.5 and later (need 3.8 and later for OpenMP)
3030

@@ -52,7 +52,7 @@ When you file an issue, please go though the following checklist:
5252
2. Give a description of the target platform (CPU, network, compiler). Please give the full CPU part description, using for example `cat /proc/cpuinfo | grep 'model name' | uniq` (Linux) or `sysctl machdep.cpu.brand_string` (macOS) and the full output the `--version` option of your compiler.
5353
3. Give the exact `configure` command used.
5454
4. Attach `config.log`.
55-
5. Attach `config.summary`.
55+
5. Attach `grid.config.summary`.
5656
6. Attach the output of `make V=1`.
5757
7. Describe the issue and any previous attempt to solve it. If relevant, show how to reproduce the issue using a minimal working example.
5858

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
]#!/usr/bin/env bash
22

3-
EIGEN_URL='http://bitbucket.org/eigen/eigen/get/3.2.9.tar.bz2'
3+
EIGEN_URL='http://bitbucket.org/eigen/eigen/get/3.3.3.tar.bz2'
44

55
echo "-- deploying Eigen source..."
66
wget ${EIGEN_URL} --no-check-certificate

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
AC_PREREQ([2.63])
2-
AC_INIT([Grid], [0.6.0-dev], [https://github.com/paboyle/Grid], [Grid])
2+
AC_INIT([Grid], [0.7.0], [https://github.com/paboyle/Grid], [Grid])
33
AC_CANONICAL_BUILD
44
AC_CANONICAL_HOST
55
AC_CANONICAL_TARGET
6-
AM_INIT_AUTOMAKE(subdir-objects)
6+
AM_INIT_AUTOMAKE([subdir-objects 1.13])
77
AM_EXTRA_RECURSIVE_TARGETS([tests bench])
88
AC_CONFIG_MACRO_DIR([m4])
99
AC_CONFIG_SRCDIR([lib/Grid.h])
@@ -29,6 +29,7 @@ AC_DEFINE_UNQUOTED([GXX_VERSION],["$GXX_VERSION"],
2929

3030
CXXFLAGS="-O3 $CXXFLAGS"
3131

32+
3233
############### Checks for typedefs, structures, and compiler characteristics
3334
AC_TYPE_SIZE_T
3435
AC_TYPE_UINT32_T

lib/json/json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SOFTWARE.
2828

2929
#ifndef NLOHMANN_JSON_HPP
3030
#define NLOHMANN_JSON_HPP
31-
31+
#include <Grid/DisableWarnings.h>
3232
#include <algorithm> // all_of, for_each, transform
3333
#include <array> // array
3434
#include <cassert> // assert

lib/log/Log.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ directory
3030
*************************************************************************************/
3131
/* END LEGAL */
3232
#include <Grid/GridCore.h>
33+
#include <Grid/util/CompilerCompatible.h>
3334

3435
#include <cxxabi.h>
3536
#include <memory>

lib/qcd/action/fermion/FermionOperatorImpl.h

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,32 @@ namespace QCD {
220220

221221
inline void DoubleStore(GridBase *GaugeGrid,
222222
DoubledGaugeField &Uds,
223-
const GaugeField &Umu) {
223+
const GaugeField &Umu)
224+
{
225+
typedef typename Simd::scalar_type scalar_type;
226+
224227
conformable(Uds._grid, GaugeGrid);
225228
conformable(Umu._grid, GaugeGrid);
229+
226230
GaugeLinkField U(GaugeGrid);
227231
GaugeLinkField tmp(GaugeGrid);
232+
228233
Lattice<iScalar<vInteger> > coor(GaugeGrid);
229234
for (int mu = 0; mu < Nd; mu++) {
230-
LatticeCoordinate(coor, mu);
235+
236+
auto pha = Params.boundary_phases[mu];
237+
scalar_type phase( real(pha),imag(pha) );
238+
231239
int Lmu = GaugeGrid->GlobalDimensions()[mu] - 1;
240+
241+
LatticeCoordinate(coor, mu);
242+
232243
U = PeekIndex<LorentzIndex>(Umu, mu);
233-
tmp = where(coor == Lmu, Params.boundary_phases[mu] * U, U);
244+
tmp = where(coor == Lmu, phase * U, U);
234245
PokeIndex<LorentzIndex>(Uds, tmp, mu);
246+
235247
U = adj(Cshift(U, mu, -1));
236-
U = where(coor == 0, Params.boundary_phases[mu] * U, U);
248+
U = where(coor == 0, conjugate(phase) * U, U);
237249
PokeIndex<LorentzIndex>(Uds, U, mu + 4);
238250
}
239251
}
@@ -251,11 +263,11 @@ namespace QCD {
251263
tmp = zero;
252264

253265
parallel_for(int sss=0;sss<tmp._grid->oSites();sss++){
254-
int sU=sss;
255-
for(int s=0;s<Ls;s++){
256-
int sF = s+Ls*sU;
257-
tmp[sU] = tmp[sU]+ traceIndex<SpinIndex>(outerProduct(Btilde[sF],Atilde[sF])); // ordering here
258-
}
266+
int sU=sss;
267+
for(int s=0;s<Ls;s++){
268+
int sF = s+Ls*sU;
269+
tmp[sU] = tmp[sU]+ traceIndex<SpinIndex>(outerProduct(Btilde[sF],Atilde[sF])); // ordering here
270+
}
259271
}
260272
PokeIndex<LorentzIndex>(mat,tmp,mu);
261273

lib/serialisation/JSON_IO.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ JSONWriter::~JSONWriter(void)
4040
delete_comma();
4141
ss_ << "}";
4242

43-
cout << ss_.str() << endl;
4443
// write prettified JSON to file
4544
std::ofstream os(fileName_);
4645
os << std::setw(2) << json::parse(ss_.str()) << std::endl;
@@ -95,7 +94,7 @@ JSONReader::JSONReader(const string &fileName)
9594

9695
// test
9796
// serialize to standard output
98-
std::cout << "JSONReader::JSONReader : " << jobject_ << endl;
97+
//std::cout << "JSONReader::JSONReader : " << jobject_ << endl;
9998
jcur_ = jobject_;
10099
}
101100

@@ -113,7 +112,7 @@ bool JSONReader::push(const string &s)
113112
std::cout << "out of range: " << e.what() << '\n';
114113
return false;
115114
}
116-
cout << "JSONReader::push : " << s << " : "<< jcur_ << endl;
115+
//cout << "JSONReader::push : " << s << " : "<< jcur_ << endl;
117116
}
118117
else
119118
{
@@ -134,7 +133,7 @@ void JSONReader::pop(void)
134133
else
135134
do_pop.pop_back();
136135

137-
cout << "JSONReader::pop : " << jcur_ << endl;
136+
//cout << "JSONReader::pop : " << jcur_ << endl;
138137
}
139138

140139
bool JSONReader::nextElement(const std::string &s)
@@ -157,14 +156,14 @@ bool JSONReader::nextElement(const std::string &s)
157156
template <>
158157
void JSONReader::readDefault(const string &s, string &output)
159158
{
160-
cout << "JSONReader::readDefault(string) : " << s<< " " << jcur_ << endl;
159+
//cout << "JSONReader::readDefault(string) : " << s<< " " << jcur_ << endl;
161160
if (s.size()){
162-
std::cout << "String: "<< jcur_[s] << std::endl;
161+
//std::cout << "String: "<< jcur_[s] << std::endl;
163162
output = jcur_[s];
164163
}
165164
else
166165
{
167-
std::cout << "String: "<< jcur_ << std::endl;
166+
//std::cout << "String: "<< jcur_ << std::endl;
168167
output = jcur_;
169168
}
170169
}

lib/serialisation/JSON_IO.h

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*************************************************************************************
22
3-
Grid physics library, www.github.com/paboyle/Grid
3+
Grid physics library, www.github.com/paboyle/Grid
44
55
Source file: ./lib/serialisation/JSON_IO.h
66
@@ -43,10 +43,10 @@ using json = nlohmann::json;
4343

4444
namespace Grid
4545
{
46-
46+
4747
class JSONWriter: public Writer<JSONWriter>
4848
{
49-
49+
5050
public:
5151
JSONWriter(const std::string &fileName);
5252
virtual ~JSONWriter(void);
@@ -55,6 +55,8 @@ namespace Grid
5555
template <typename U>
5656
void writeDefault(const std::string &s, const U &x);
5757
template <typename U>
58+
void writeDefault(const std::string &s, const std::complex<U> &x);
59+
template <typename U>
5860
void writeDefault(const std::string &s, const std::vector<U> &x);
5961

6062
template<std::size_t N>
@@ -65,7 +67,7 @@ namespace Grid
6567
std::string fileName_;
6668
std::ostringstream ss_;
6769
};
68-
70+
6971
class JSONReader: public Reader<JSONReader>
7072
{
7173
public:
@@ -77,6 +79,8 @@ namespace Grid
7779
template <typename U>
7880
void readDefault(const std::string &s, U &output);
7981
template <typename U>
82+
void readDefault(const std::string &s, std::complex<U> &output);
83+
template <typename U>
8084
void readDefault(const std::string &s, std::vector<U> &output);
8185
private:
8286
json jobject_; // main object
@@ -97,11 +101,12 @@ namespace Grid
97101
struct isWriter< JSONWriter > {
98102
static const bool value = true;
99103
};
100-
104+
101105
// Writer template implementation ////////////////////////////////////////////
102106
template <typename U>
103107
void JSONWriter::writeDefault(const std::string &s, const U &x)
104108
{
109+
//std::cout << "JSONReader::writeDefault(U) : " << s << std::endl;
105110
std::ostringstream os;
106111
os << std::boolalpha << x;
107112
if (s.size())
@@ -110,9 +115,23 @@ namespace Grid
110115
ss_ << os.str() << " ," ;
111116
}
112117

118+
template <typename U>
119+
void JSONWriter::writeDefault(const std::string &s, const std::complex<U> &x)
120+
{
121+
//std::cout << "JSONReader::writeDefault(complex) : " << s << std::endl;
122+
std::ostringstream os;
123+
os << "["<< std::boolalpha << x.real() << ", " << x.imag() << "]";
124+
if (s.size())
125+
ss_ << "\""<< s << "\" : " << os.str() << " ," ;
126+
else
127+
ss_ << os.str() << " ," ;
128+
}
129+
113130
template <typename U>
114131
void JSONWriter::writeDefault(const std::string &s, const std::vector<U> &x)
115132
{
133+
//std::cout << "JSONReader::writeDefault(vec U) : " << s << std::endl;
134+
116135
if (s.size())
117136
ss_ << " \""<<s<<"\" : [";
118137
else
@@ -124,59 +143,77 @@ namespace Grid
124143
delete_comma();
125144
ss_<< "],";
126145
}
127-
146+
128147
template<std::size_t N>
129148
void JSONWriter::writeDefault(const std::string &s, const char(&x)[N]){
149+
//std::cout << "JSONReader::writeDefault(char U) : " << s << std::endl;
150+
130151
if (s.size())
131152
ss_ << "\""<< s << "\" : \"" << x << "\" ," ;
132153
else
133-
ss_ << "\"" << x << "\" ," ;
154+
ss_ << "\"" << x << "\" ," ;
134155
}
135156

136157
// Reader template implementation ////////////////////////////////////////////
137158
template <typename U>
138159
void JSONReader::readDefault(const std::string &s, U &output)
139160
{
140-
std::cout << "JSONReader::readDefault(U) : " << s << " : "<< jcur_ << std::endl;
141-
161+
//std::cout << "JSONReader::readDefault(U) : " << s << " : "<< jcur_ << std::endl;
162+
142163
if (s.size()){
143-
std::cout << "String: "<< jcur_[s] << std::endl;
164+
//std::cout << "String: "<< jcur_[s] << std::endl;
144165
output = jcur_[s];
145166
}
146167
else
147168
{
148-
std::cout << "String: "<< jcur_ << std::endl;
149-
output = jcur_;
169+
//std::cout << "String: "<< jcur_ << std::endl;
170+
output = jcur_;
150171
}
151172

152173

153174
}
154-
175+
176+
template <typename U>
177+
void JSONReader::readDefault(const std::string &s, std::complex<U> &output)
178+
{
179+
U tmp1, tmp2;
180+
//std::cout << "JSONReader::readDefault( complex U) : " << s << " : "<< jcur_ << std::endl;
181+
json j = jcur_;
182+
json::iterator it = j.begin();
183+
jcur_ = *it;
184+
read("", tmp1);
185+
it++;
186+
jcur_ = *it;
187+
read("", tmp2);
188+
output = std::complex<U>(tmp1,tmp2);
189+
}
190+
191+
155192
template <>
156193
void JSONReader::readDefault(const std::string &s, std::string &output);
157-
194+
158195
template <typename U>
159196
void JSONReader::readDefault(const std::string &s, std::vector<U> &output)
160197
{
161198
std::string buf;
162199
unsigned int i = 0;
163-
std::cout << "JSONReader::readDefault(vec) : " << jcur_ << std::endl;
200+
//std::cout << "JSONReader::readDefault(vec) : " << jcur_ << std::endl;
164201
if (s.size())
165202
push(s);
166-
203+
167204
json j = jcur_;
168205
for (json::iterator it = j.begin(); it != j.end(); ++it) {
169206
jcur_ = *it;
170-
std::cout << "Value: " << it.value() << "\n";
207+
//std::cout << "Value: " << it.value() << "\n";
171208
output.resize(i + 1);
172209
read("", output[i++]);
173210
}
174-
211+
175212

176213
jcur_ = j;
177214
if (s.size())
178215
pop();
179216
}
180-
217+
181218
}
182219
#endif

0 commit comments

Comments
 (0)