mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Logging tweak
This commit is contained in:
parent
7eda54bb87
commit
43bd918a47
@ -233,7 +233,7 @@ public:
|
|||||||
|
|
||||||
template<typename Scalar_, int NumIndices_>
|
template<typename Scalar_, int NumIndices_>
|
||||||
void NamedTensor<Scalar_, NumIndices_>::WriteTemporary(const std::string filename) const {
|
void NamedTensor<Scalar_, NumIndices_>::WriteTemporary(const std::string filename) const {
|
||||||
std::cout << GridLogMessage << "Writing NamedTensor to \"" << filename << "\"" << std::endl;
|
LOG(Message) << "Writing NamedTensor to \"" << filename << "\"" << std::endl;
|
||||||
std::ofstream w(filename, std::ios::binary);
|
std::ofstream w(filename, std::ios::binary);
|
||||||
// total number of elements
|
// total number of elements
|
||||||
uint32_t ul = htonl( static_cast<uint32_t>( this->size() ) );
|
uint32_t ul = htonl( static_cast<uint32_t>( this->size() ) );
|
||||||
@ -277,7 +277,7 @@ void NamedTensor<Scalar_, NumIndices_>::WriteTemporary(const std::string filenam
|
|||||||
|
|
||||||
template<typename Scalar_, int NumIndices_>
|
template<typename Scalar_, int NumIndices_>
|
||||||
void NamedTensor<Scalar_, NumIndices_>::ReadTemporary(const std::string filename) {
|
void NamedTensor<Scalar_, NumIndices_>::ReadTemporary(const std::string filename) {
|
||||||
std::cout << GridLogMessage << "Reading NamedTensor from \"" << filename << "\"" << std::endl;
|
LOG(Message) << "Reading NamedTensor from \"" << filename << "\"" << std::endl;
|
||||||
std::ifstream r(filename, std::ios::binary);
|
std::ifstream r(filename, std::ios::binary);
|
||||||
// total number of elements
|
// total number of elements
|
||||||
uint32_t ul;
|
uint32_t ul;
|
||||||
@ -328,9 +328,9 @@ void NamedTensor<Scalar_, NumIndices_>::ReadTemporary(const std::string filename
|
|||||||
|
|
||||||
template<typename Scalar_, int NumIndices_>
|
template<typename Scalar_, int NumIndices_>
|
||||||
void NamedTensor<Scalar_, NumIndices_>::save(const std::string filename) const {
|
void NamedTensor<Scalar_, NumIndices_>::save(const std::string filename) const {
|
||||||
std::cout << GridLogMessage << "Writing NamedTensor to \"" << filename << "\"" << std::endl;
|
LOG(Message) << "Writing NamedTensor to \"" << filename << "\"" << std::endl;
|
||||||
#ifndef HAVE_HDF5
|
#ifndef HAVE_HDF5
|
||||||
std::cout << GridErrorMessage << "Error: I/O for NamedTensor requires HDF5" << std::endl;
|
LOG(Message) << "Error: I/O for NamedTensor requires HDF5" << std::endl;
|
||||||
#else
|
#else
|
||||||
Hdf5Writer w(filename);
|
Hdf5Writer w(filename);
|
||||||
//w << this->NumIndices << this->dimensions() << this->IndexNames;
|
//w << this->NumIndices << this->dimensions() << this->IndexNames;
|
||||||
@ -343,9 +343,9 @@ void NamedTensor<Scalar_, NumIndices_>::save(const std::string filename) const {
|
|||||||
|
|
||||||
template<typename Scalar_, int NumIndices_>
|
template<typename Scalar_, int NumIndices_>
|
||||||
void NamedTensor<Scalar_, NumIndices_>::load(const std::string filename) {
|
void NamedTensor<Scalar_, NumIndices_>::load(const std::string filename) {
|
||||||
std::cout << GridLogMessage << "Reading NamedTensor from \"" << filename << "\"" << std::endl;
|
LOG(Message) << "Reading NamedTensor from \"" << filename << "\"" << std::endl;
|
||||||
#ifndef HAVE_HDF5
|
#ifndef HAVE_HDF5
|
||||||
std::cout << GridErrorMessage << "Error: I/O for NamedTensor requires HDF5" << std::endl;
|
LOG(Message) << "Error: I/O for NamedTensor requires HDF5" << std::endl;
|
||||||
#else
|
#else
|
||||||
Hdf5Reader r(filename);
|
Hdf5Reader r(filename);
|
||||||
typename ET::Dimensions d;
|
typename ET::Dimensions d;
|
||||||
|
@ -320,7 +320,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Debug only - test of Eigen::Tensor
|
// Debug only - test of Eigen::Tensor
|
||||||
if( DebugEigenTest() ) return 0;
|
//if( DebugEigenTest() ) return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Decode command-line parameters. 1st one is which test to run
|
// Decode command-line parameters. 1st one is which test to run
|
||||||
|
Loading…
x
Reference in New Issue
Block a user