HISKP-LQCD / sLapH-contractions

Stochastic LapH contraction program
GNU General Public License v3.0
3 stars 3 forks source link

example input file for vdaggerv creation #107

Closed pittlerf closed 5 years ago

kostrzewa commented 5 years ago

Thanks, could you add some comments please?

pittlerf commented 5 years ago

Thanks, could you add some comments please?

Yeah, sure, sorry that I have not done it yet.

kostrzewa commented 5 years ago

@pittlerf I've made a minor modif. Is the output_path actually required?

pittlerf commented 5 years ago

@pittlerf I've made a minor modif. Is the output_path actually required?

Yes, I think that is required.

kostrzewa commented 5 years ago

Why is that?

kostrzewa commented 5 years ago

So we have:

void OperatorFactory::build_vdaggerv(const std::string &filename,
                                     const int config,
                                     const GlobalData &gd) {
  const ssize_t dim_row = 3 * Lx * Ly * Lz; 
  const int id_unity = operator_lookuptable.index_of_unity;

  // prepare full path for writing
  std::string const full_path =
      (boost::format("/%s/cnfg%04d/") % path_vdaggerv % config).str();

  // check if directory exists
  if ((handling_vdaggerv == "write") && (access(full_path.c_str(), 0) != 0)) {
    std::cout << "\tdirectory " << full_path.c_str()
              << " does not exist and will be created";
    boost::filesystem::path dir(full_path.c_str());
    if (!boost::filesystem::create_directories(dir))
      std::cout << "\tSuccess" << std::endl;
    else
      std::cout << "\tFailure" << std::endl;
  }

which means that only path_vdaggerv is actually required, correct?

pittlerf commented 5 years ago

So we have:

void OperatorFactory::build_vdaggerv(const std::string &filename,
                                     const int config,
                                     const GlobalData &gd) {
  const ssize_t dim_row = 3 * Lx * Ly * Lz; 
  const int id_unity = operator_lookuptable.index_of_unity;

  // prepare full path for writing
  std::string const full_path =
      (boost::format("/%s/cnfg%04d/") % path_vdaggerv % config).str();

  // check if directory exists
  if ((handling_vdaggerv == "write") && (access(full_path.c_str(), 0) != 0)) {
    std::cout << "\tdirectory " << full_path.c_str()
              << " does not exist and will be created";
    boost::filesystem::path dir(full_path.c_str());
    if (!boost::filesystem::create_directories(dir))
      std::cout << "\tSuccess" << std::endl;
    else
      std::cout << "\tFailure" << std::endl;
  }

which means that only path_vdaggerv is actually required, correct?

Ah, yes, that would require only for the contractions