MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / run_splashsurf_impl

Function run_splashsurf_impl

splashsurf/src/cli.rs:105–147  ·  view source on GitHub ↗
(args: I)

Source from the content-addressed store, hash-verified

103}
104
105fn run_splashsurf_impl<I, T>(args: I) -> Result<(), anyhow::Error>
106where
107 I: IntoIterator<Item = T>,
108 T: Into<std::ffi::OsString> + Clone,
109{
110 let cmd_args = CommandlineArgs::parse_from(args);
111
112 let verbosity = VerbosityLevel::from(cmd_args.verbosity);
113 let is_quiet = cmd_args.quiet;
114
115 logging::initialize_logging(verbosity, is_quiet).context("Failed to initialize logging")?;
116 logging::log_program_info();
117
118 // Delegate to subcommands
119 let result = match &cmd_args.subcommand {
120 Subcommand::Reconstruct(cmd_args) => reconstruct::reconstruct_subcommand(cmd_args),
121 Subcommand::Convert(cmd_args) => convert::convert_subcommand(cmd_args),
122 };
123
124 // Write coarse_prof stats using log::info
125 info!("Timings:");
126 splashsurf_lib::profiling::write_to_string()
127 .unwrap()
128 .split("\n")
129 .filter(|l| !l.is_empty())
130 .for_each(|l| info!("{}", l));
131
132 // Print memory stats if available
133 if let Some(peak_allocation_bytes) = GLOBAL_ALLOCATOR.get_peak_allocated_memory() {
134 info!(
135 "Peak memory usage: {} bytes ({:.2}MB)",
136 peak_allocation_bytes,
137 peak_allocation_bytes as f64 * 1e-6
138 );
139 }
140
141 info!(
142 "Finished at {}.",
143 chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Micros, false)
144 );
145
146 result
147}
148
149#[derive(Copy, Clone, Debug)]
150pub(crate) enum VerbosityLevel {

Callers 1

run_splashsurfFunction · 0.85

Calls 8

initialize_loggingFunction · 0.85
log_program_infoFunction · 0.85
reconstruct_subcommandFunction · 0.85
convert_subcommandFunction · 0.85
write_to_stringFunction · 0.85
for_eachMethod · 0.80
is_emptyMethod · 0.80

Tested by

no test coverage detected