Commit fd652f58 authored by gbalduzz's avatar gbalduzz
Browse files

Remove opening of configuration files from stdout.

parent 447fc045
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class HDF5Reader {
public:
  typedef H5::H5File file_type;

  HDF5Reader() : my_file(NULL), my_paths(0) {}
  HDF5Reader(bool verbose = true) : my_file(NULL), my_paths(0), verbose_(verbose) {}
  ~HDF5Reader();

  bool is_reader() {
@@ -99,6 +99,8 @@ private:

  H5::H5File* my_file;
  std::vector<std::string> my_paths;

  bool verbose_;
};

template <typename arbitrary_struct_t>
+10 −5
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ public:
  typedef H5::H5File file_type;

public:
  HDF5Writer() : my_file(NULL), my_group(0), my_paths(0) {}
  HDF5Writer(bool verbose = true)
      : my_file(NULL), my_group(0), my_paths(0), verbose_(verbose) {}
  ~HDF5Writer();

  bool is_reader() {
@@ -122,6 +123,8 @@ private:

  std::vector<H5::Group*> my_group;
  std::vector<std::string> my_paths;

  bool verbose_;
};

template <typename arbitrary_struct_t>
@@ -349,6 +352,7 @@ void HDF5Writer::execute(func::function<scalar_type, domain_type>& f) {
  if (f.size() == 0)
    return;

  if (verbose_)
    std::cout << "\t starts writing function : " << f.get_name() << "\n";

  execute(f.get_name(), f);
@@ -359,6 +363,7 @@ void HDF5Writer::execute(func::function<std::complex<scalar_type>, domain_type>&
  if (f.size() == 0)
    return;

  if (verbose_)
    std::cout << "\t starts writing function : " << f.get_name() << "\n";

  execute(f.get_name(), f);
+6 −2
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ void StdThreadQmciClusterSolver<QmciSolver>::writeConfigurations() const {
  try {
    const std::string out_name = parameters.get_directory_config_write() + "/process_" +
                                 std::to_string(concurrency.id()) + ".hdf5";
    io::HDF5Writer writer;
    io::HDF5Writer writer(false);
    writer.open_file(out_name);
    for (int id = 0; id < config_dump_.size(); ++id)
      writer.execute("configuration_" + std::to_string(id), config_dump_[id]);
@@ -388,10 +388,14 @@ void StdThreadQmciClusterSolver<QmciSolver>::readConfigurations() {

    const std::string inp_name = parameters.get_directory_config_read() + "/process_" +
                                 std::to_string(id_to_read) + ".hdf5";
    io::HDF5Reader reader;
    io::HDF5Reader reader(false);
    reader.open_file(inp_name);
    for (int id = 0; id < config_dump_.size(); ++id)
      reader.execute("configuration_" + std::to_string(id), config_dump_[id]);

    if (concurrency.id() == 0) {
      std::cout << "Read configuration from " << parameters.get_directory_config_read() << ".\n";
    }
  }
  catch (std::exception& err) {
    std::cerr << err.what() << "\nCould not read the configuration.\n";
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ void HDF5Reader::open_file(std::string file_name) {
      std::cout << "\n\n\tcannot open file : " << file_name << "\n";
      throw std::runtime_error(__FUNCTION__);
    }
    else {
    else if (verbose_) {
      std::cout << "\n\n\topening file : " << file_name << "\n";
    }
  }
+2 −2

File changed.

Contains only whitespace changes.