1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Csum in hex format

This commit is contained in:
Guido Cossu 2016-10-19 17:26:25 +01:00
parent 8c65bdf6d3
commit 590675e2ca
2 changed files with 53 additions and 51 deletions

View File

@ -317,8 +317,8 @@ namespace Grid {
//void SaveState(const std::string<char> &file);
//void LoadState(const std::string<char> &file);
template <class vobj,class distribution> inline void fill(Lattice<vobj> &l,std::vector<distribution> &dist){
template <class vobj, class distribution>
inline void fill(Lattice<vobj> &l, std::vector<distribution> &dist) {
typedef typename vobj::scalar_object scalar_object;
typedef typename vobj::scalar_type scalar_type;
typedef typename vobj::vector_type vector_type;
@ -329,20 +329,23 @@ namespace Grid {
int osites = _grid->oSites();
int words = sizeof(scalar_object) / sizeof(scalar_type);
PARALLEL_FOR_LOOP
for (int ss = 0; ss < osites; ss++) {
std::vector<scalar_object> buf(Nsimd);
for(int m=0;m<multiplicity;m++) {// Draw from same generator multiplicity times
for (int m = 0; m < multiplicity;
m++) { // Draw from same generator multiplicity times
int sm=multiplicity*ss+m; // Maps the generator site to the fine site
int sm = multiplicity * ss +
m; // Maps the generator site to the fine site
for (int si = 0; si < Nsimd; si++) {
int gdx = generator_idx(ss, si); // index of generator state
scalar_type *pointer = (scalar_type *)&buf[si];
dist[gdx].reset();
for (int idx = 0; idx < words; idx++) {
fillScalar(pointer[idx], dist[gdx], _generators[gdx]);
}
}
@ -361,7 +364,6 @@ PARALLEL_FOR_LOOP
fixedSeed src(seeds);
Seed(src);
}
};
template <class vobj> inline void random(GridParallelRNG &rng,Lattice<vobj> &l){

View File

@ -372,7 +372,7 @@ class BinaryIO {
if (grid->IsBoss())
fout.close();
std::cout << GridLogMessage << "RNG file checksum " << csum << std::endl;
std::cout << GridLogMessage << "RNG file checksum " << std::hex << csum << std::dec << std::endl;
return csum;
}
@ -423,7 +423,7 @@ class BinaryIO {
Uint32Checksum((uint32_t *)&saved[0],bytes,csum);
}
std::cout << GridLogMessage << "RNG file checksum " << csum << std::endl;
std::cout << GridLogMessage << "RNG file checksum " << std::hex << csum << std::dec << std::endl;
grid->Broadcast(0,(void *)&csum,sizeof(csum));