mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-18 09:45:55 +01:00
64 bit safe offsets
This commit is contained in:
parent
a479325349
commit
b8654be0ef
@ -261,7 +261,7 @@ class BinaryIO {
|
|||||||
GridBase *grid,
|
GridBase *grid,
|
||||||
std::vector<fobj> &iodata,
|
std::vector<fobj> &iodata,
|
||||||
std::string file,
|
std::string file,
|
||||||
int offset,
|
Integer offset,
|
||||||
const std::string &format, int control,
|
const std::string &format, int control,
|
||||||
uint32_t &nersc_csum,
|
uint32_t &nersc_csum,
|
||||||
uint32_t &scidac_csuma,
|
uint32_t &scidac_csuma,
|
||||||
@ -445,6 +445,9 @@ class BinaryIO {
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
std::cout << GridLogMessage << "C++ write I/O " << file << " : "
|
||||||
|
<< iodata.size() * sizeof(fobj) << " bytes" << std::endl;
|
||||||
|
|
||||||
std::ofstream fout;
|
std::ofstream fout;
|
||||||
fout.exceptions ( std::fstream::failbit | std::fstream::badbit );
|
fout.exceptions ( std::fstream::failbit | std::fstream::badbit );
|
||||||
try {
|
try {
|
||||||
@ -459,13 +462,19 @@ class BinaryIO {
|
|||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
std::cout << GridLogMessage<< "C++ write I/O "<< file<<" : "
|
|
||||||
<< iodata.size()*sizeof(fobj)<<" bytes"<<std::endl;
|
|
||||||
|
|
||||||
if ( control & BINARYIO_MASTER_APPEND ) {
|
if ( control & BINARYIO_MASTER_APPEND ) {
|
||||||
|
try {
|
||||||
fout.seekp(0,fout.end);
|
fout.seekp(0,fout.end);
|
||||||
|
} catch (const std::fstream::failure& exc) {
|
||||||
|
std::cout << "Exception in seeking file end " << file << std::endl;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
fout.seekp(offset+myrank*lsites*sizeof(fobj));
|
fout.seekp(offset+myrank*lsites*sizeof(fobj));
|
||||||
|
} catch (const std::fstream::failure& exc) {
|
||||||
|
std::cout << "Exception in seeking file " << file <<" offset "<< offset << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -480,7 +489,6 @@ class BinaryIO {
|
|||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
fout.close();
|
fout.close();
|
||||||
}
|
}
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
@ -515,7 +523,7 @@ class BinaryIO {
|
|||||||
static inline void readLatticeObject(Lattice<vobj> &Umu,
|
static inline void readLatticeObject(Lattice<vobj> &Umu,
|
||||||
std::string file,
|
std::string file,
|
||||||
munger munge,
|
munger munge,
|
||||||
int offset,
|
Integer offset,
|
||||||
const std::string &format,
|
const std::string &format,
|
||||||
uint32_t &nersc_csum,
|
uint32_t &nersc_csum,
|
||||||
uint32_t &scidac_csuma,
|
uint32_t &scidac_csuma,
|
||||||
@ -552,7 +560,7 @@ class BinaryIO {
|
|||||||
static inline void writeLatticeObject(Lattice<vobj> &Umu,
|
static inline void writeLatticeObject(Lattice<vobj> &Umu,
|
||||||
std::string file,
|
std::string file,
|
||||||
munger munge,
|
munger munge,
|
||||||
int offset,
|
Integer offset,
|
||||||
const std::string &format,
|
const std::string &format,
|
||||||
uint32_t &nersc_csum,
|
uint32_t &nersc_csum,
|
||||||
uint32_t &scidac_csuma,
|
uint32_t &scidac_csuma,
|
||||||
@ -589,7 +597,7 @@ class BinaryIO {
|
|||||||
static inline void readRNG(GridSerialRNG &serial,
|
static inline void readRNG(GridSerialRNG &serial,
|
||||||
GridParallelRNG ¶llel,
|
GridParallelRNG ¶llel,
|
||||||
std::string file,
|
std::string file,
|
||||||
int offset,
|
Integer offset,
|
||||||
uint32_t &nersc_csum,
|
uint32_t &nersc_csum,
|
||||||
uint32_t &scidac_csuma,
|
uint32_t &scidac_csuma,
|
||||||
uint32_t &scidac_csumb)
|
uint32_t &scidac_csumb)
|
||||||
@ -651,7 +659,7 @@ class BinaryIO {
|
|||||||
static inline void writeRNG(GridSerialRNG &serial,
|
static inline void writeRNG(GridSerialRNG &serial,
|
||||||
GridParallelRNG ¶llel,
|
GridParallelRNG ¶llel,
|
||||||
std::string file,
|
std::string file,
|
||||||
int offset,
|
Integer offset,
|
||||||
uint32_t &nersc_csum,
|
uint32_t &nersc_csum,
|
||||||
uint32_t &scidac_csuma,
|
uint32_t &scidac_csuma,
|
||||||
uint32_t &scidac_csumb)
|
uint32_t &scidac_csumb)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user