Check for missing thread count argument for -s/--threads (#3940)

This commit is contained in:
charliesheh 2026-05-18 11:35:56 -07:00 committed by GitHub
parent 195dff6d1d
commit beed56e6ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -300,6 +300,11 @@ int parse_command_line(int argc, char* argv[])
settings::run_mode = RunMode::VOLUME;
} else if (arg == "-s" || arg == "--threads") {
// Read number of threads
if (i + 1 >= argc) {
std::string msg {"Number of threads not specified."};
strcpy(openmc_err_msg, msg.c_str());
return OPENMC_E_INVALID_ARGUMENT;
}
i += 1;
#ifdef _OPENMP