Skip to content
Snippets Groups Projects
Commit 55e7e718 authored by Marcin Kirsz's avatar Marcin Kirsz
Browse files

Better handling of -u flag with MPI build

parent fd1f9ca5
No related branches found
No related tags found
2 merge requests!5MPI version of tadah,!3MPI version of Tadah
Pipeline #43315 failed
...@@ -33,6 +33,14 @@ void TadahCLI::subcommand_train() { ...@@ -33,6 +33,14 @@ void TadahCLI::subcommand_train() {
std::cout << "Minimum number of cpus for an mpi version is 2" << std::endl; std::cout << "Minimum number of cpus for an mpi version is 2" << std::endl;
return; return;
} }
if (train->count("--uncertainty")) {
if (rank==0) {
std::cout << "-----------------------------------------------------" << std::endl;
std::cout << "The --uncertainty flag is not supported by MPI build." << std::endl;
std::cout << "-----------------------------------------------" << std::endl;
}
return;
}
#endif #endif
CLI::Timer timer_tot {"Training", CLI::Timer::Big}; CLI::Timer timer_tot {"Training", CLI::Timer::Big};
...@@ -326,21 +334,16 @@ void TadahCLI::subcommand_train() { ...@@ -326,21 +334,16 @@ void TadahCLI::subcommand_train() {
std::ofstream outfile; std::ofstream outfile;
outfile.open ("pot.tadah"); outfile.open ("pot.tadah");
outfile << param_file << std::endl;; outfile << param_file << std::endl;;
// TODO What about uncertainty when MPI is enabled?
#ifndef TADAH_BUILD_MPI
if(train->count("--uncertainty")) { if(train->count("--uncertainty")) {
#ifdef TADAH_BUILD_MPI
throw std::runtime_error("--uncertainty flag is not supported by Tadah! MPI build");
#else
t_type weights = model->get_weights(); t_type weights = model->get_weights();
t_type unc = model->get_weights_uncertainty(); t_type unc = model->get_weights_uncertainty();
Output(param_file,false).print_train_unc(weights, unc); Output(param_file,false).print_train_unc(weights, unc);
#endif
} }
#endif
if (is_verbose()) std::cout << timer_tot.to_string() << std::endl; if (is_verbose()) std::cout << timer_tot.to_string() << std::endl;
//
} }
} }
...@@ -397,8 +400,6 @@ void TadahCLI::subcommand_predict() { ...@@ -397,8 +400,6 @@ void TadahCLI::subcommand_predict() {
DescriptorsCalc<> dc(pot_config,*DCS.d2b,*DCS.d3b,*DCS.dmb, DescriptorsCalc<> dc(pot_config,*DCS.d2b,*DCS.d3b,*DCS.dmb,
*DCS.c2b,*DCS.c3b,*DCS.cmb); *DCS.c2b,*DCS.c3b,*DCS.cmb);
if (is_verbose()) std::cout << "Prediction start..." << std::flush; if (is_verbose()) std::cout << "Prediction start..." << std::flush;
DM_Function_Base *fb = CONFIG::factory<DM_Function_Base,Config&>( DM_Function_Base *fb = CONFIG::factory<DM_Function_Base,Config&>(
pot_config.get<std::string>("MODEL",1),pot_config); pot_config.get<std::string>("MODEL",1),pot_config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment