Commit 16e0d698 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Use a runtime configuration option to skip FRFME if already computed

parent f17ebcb1
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -339,6 +339,19 @@ void frfme(string data_file, string output_path) {
      regex_search(str_target, m, re);
      int ixi = stoi(m.str());
      string tedf_name = output_path + "/" + namef + ".hd5";
      // Check for run-time options
      while (last_read_line < line_count) {
	str_target = file_lines[last_read_line++];
	if (str_target.size() > 12) {
	  if (str_target.substr(0, 12).compare("PRECOMPUTED=") == 0) {
	    string precomp_name = output_path + "/" + str_target.substr(12, str_target.size()) + ".hd5";
	    // TODO: check that the file exists and it is suitable for the calculation.
	    message = "INFO: using precomputed file " + precomp_name + "\n";
	    logger.log(message);
	    return;
	  }
	}
      }
      ScattererConfiguration *tedf = ScattererConfiguration::from_binary(tedf_name, "HDF5");
      if (tedf != NULL) {
#ifdef USE_NVTX