| 19 | using MIdx = typename M::MIdx; |
| 20 | |
| 21 | std::string GetFormat(std::string path, std::string format) { |
| 22 | const auto ext = util::SplitExt(path)[1]; |
| 23 | if (format == "auto") { |
| 24 | if (ext == ".h5") { |
| 25 | format = "h5"; |
| 26 | } else if (ext == ".raw") { |
| 27 | format = "raw"; |
| 28 | } else { |
| 29 | fassert(false, util::Format("Unknown extension '{}' of '{}'", ext, path)); |
| 30 | } |
| 31 | } |
| 32 | return format; |
| 33 | } |
| 34 | |
| 35 | void Run(M& m, Vars& var) { |
| 36 | auto sem = m.GetSem(__func__); |