diff --git a/src/descriptor_identifier/SISSORegressor.cpp b/src/descriptor_identifier/SISSORegressor.cpp index fbfa62713c43ab6cb02bd24ff4e8d221b2f9253f..d2d16340eeeee169e62d38424f85d754ff72bb23 100644 --- a/src/descriptor_identifier/SISSORegressor.cpp +++ b/src/descriptor_identifier/SISSORegressor.cpp @@ -78,15 +78,39 @@ void SISSORegressor::set_error(std::vector<int>& inds, double* coeffs) void SISSORegressor::fit() { std::vector<double> residual(_n_samp); + std::clock_t start; + double duration; + start = std::clock(); _feat_space->sis(_prop); + _mpi_comm->barrier(); + duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; + if(_mpi_comm->rank() == 0) + std::cout << "Time for SIS: " << duration << std::endl; + + start = std::clock(); std::vector<node_ptr> min_node(1, _feat_space->phi_selected()[0]); _models.push_back(Model(_prop, min_node)); _models[_models.size() - 1].copy_error(residual.data()); + _mpi_comm->barrier(); + duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; + if(_mpi_comm->rank() == 0) + std::cout << "Time for Model: " << duration << std::endl; for(int dd = 2; dd <= _n_dim; ++dd) { + start = std::clock(); _feat_space->sis(residual); + _mpi_comm->barrier(); + duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; + if(_mpi_comm->rank() == 0) + std::cout << "Time for SIS: " << duration << std::endl; + start = std::clock(); l0_norm(residual, dd); + _mpi_comm->barrier(); + duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; + if(_mpi_comm->rank() == 0) + std::cout << "Time for l0-norm: " << duration << std::endl; + _models[_models.size() - 1].copy_error(residual.data()); } } diff --git a/src/descriptor_identifier/SISSORegressor.hpp b/src/descriptor_identifier/SISSORegressor.hpp index 018e75e18dc09251c4ccae62bffe74f80293b14f..8e3da96b771c6fae042ac4f98ec25d2453c66adc 100644 --- a/src/descriptor_identifier/SISSORegressor.hpp +++ b/src/descriptor_identifier/SISSORegressor.hpp @@ -3,6 +3,7 @@ #include <feature_creation/feature_space/FeatureSpace.hpp> #include <descriptor_identifier/Model/Model.hpp> +#include <ctime> /** * @brief SISSO Regressor class, to find the best models, and store them @@ -124,4 +125,4 @@ public: }; -#endif \ No newline at end of file +#endif diff --git a/src/feature_creation/feature_space/FeatureSpace.cpp b/src/feature_creation/feature_space/FeatureSpace.cpp index 956c33971243d32d1a0b93a474aeaa8456766b37..b9951fce31e9a5d5ff8cc3d4ec554410a44901c0 100644 --- a/src/feature_creation/feature_space/FeatureSpace.cpp +++ b/src/feature_creation/feature_space/FeatureSpace.cpp @@ -131,7 +131,6 @@ void FeatureSpace::generate_feature_space() std::vector<std::vector<node_ptr>> next_phi_gathered; mpi::all_gather(*_mpi_comm, next_phi, next_phi_gathered); - std::cout << nn << " set values" << std::endl; for(auto& next_phi_vec : next_phi_gathered) { _phi.reserve(_phi.size() + next_phi_vec.size()); diff --git a/src/inputs/InputParser.cpp b/src/inputs/InputParser.cpp index aedc51314b2c994398b876ecea1cf1da326c159c..082a5b0e951885f6521d0f954d4e80a75883cb24 100644 --- a/src/inputs/InputParser.cpp +++ b/src/inputs/InputParser.cpp @@ -132,7 +132,6 @@ void InputParser::generate_feature_space(std::shared_ptr<MPI_Interface> comm) } node_value_arrs::setup_values_arr(_prop.size(), std::min(_max_rung, 2), headers.size(), _opset); - std::cout << node_value_arrs::get_max_number_features(_opset, _max_rung, headers.size()) << std::endl; std::vector<node_ptr> phi_0; for(int ff = 0; ff < headers.size(); ++ff) phi_0.push_back(std::make_shared<FeatureNode>(ff, headers[ff], data[ff], units[ff])); diff --git a/src/main.cpp b/src/main.cpp index aaa1a63432880ee6b5cb1c7d205a8f0b52fc3b33..404f958775cbf05bbca971cdb21de79973f52dc9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,13 +25,17 @@ int main(int argc, char const *argv[]) //construct the parser and pass it to the inputs boost::property_tree::ptree propTree; boost::property_tree::json_parser::read_json(filename,propTree); + std::clock_t start; + start = std::clock(); InputParser IP(propTree, filename, comm); - boost::filesystem::remove(filename); - if(comm->rank() == 0) boost::filesystem::remove(filename); - std::cout << "FEAT_MADE" << std::endl; + comm->barrier(); + duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; + if(comm->rank() == 0) + std::cout<< "time input_parsing/Feature space generation: "<< duration << std::endl; + SISSORegressor sisso(IP._feat_space, IP._prop, IP._n_dim); sisso.fit();