diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77c7ae77bb066ac2829d31e2112c6e7eb38de8b0..07b8d40b3f9568272037890576bf8b0d15d15b3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -170,26 +170,7 @@ test-intel-bin-param: - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH - export OMP_NUM_THREADS=1 - cd tests/exec_test/default/ - - mpiexec -n 1 ../../../intel_param_py/bin/sisso++ - - python ../check_model.py - - cd ../classification/ - - mpiexec -n 1 ../../../intel_param_py/bin/sisso++ - - python check_model.py - - cd ../gen_proj - - mpiexec -n 2 ../../../intel_param_py/bin/sisso++ - - python ../check_model.py - - cd ../log_reg - - mpiexec -n 2 ../../../intel_param_py/bin/sisso++ - - python check_model.py - - cd ../max_corr - - mpiexec -n 2 ../../../intel_param_py/bin/sisso++ - - python ../check_model.py - - cd ../param - - mpiexec -n 2 ../../../intel_param_py/bin/sisso++ - - python ../check_model.py - - cd ../reparam - - mpiexec -n 2 ../../../intel_param_py/bin/sisso++ - - python check_model.py + - for direc in ../*/; do cd $direc; mpiexec -n 1 ../../../intel_param_py/bin/sisso++; python check_model.py; done - cd ../../../ test-intel-bin-base: @@ -206,19 +187,7 @@ test-intel-bin-base: - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH - export OMP_NUM_THREADS=1 - cd tests/exec_test/default/ - - mpiexec -n 1 ../../../intel_py/bin/sisso++ - - python ../check_model.py - - cd ../classification/ - - mpiexec -n 1 ../../../intel_py/bin/sisso++ - - python check_model.py - - cd ../gen_proj - - mpiexec -n 2 ../../../intel_py/bin/sisso++ - - python ../check_model.py - - cd ../log_reg - - mpiexec -n 2 ../../../intel_py/bin/sisso++ - - python check_model.py - - cd ../max_corr - - mpiexec -n 2 ../../../intel_py/bin/sisso++ + - for direc in ../*/; do cd $direc; if [[ $direc != *"param"* ]]; then mpiexec -n 1 ../../../intel_py/bin/sisso++; python check_model.py; fi; done - cd ../../../ build-gnu-base: @@ -343,26 +312,7 @@ test-gnu-bin-param: - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_gnu_param_py_env/lib/python3.7/site-packages/ - export OMP_NUM_THREADS=1 - cd tests/exec_test/default/ - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python ../check_model.py - - cd ../classification/ - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python check_model.py - - cd ../gen_proj - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python ../check_model.py - - cd ../log_reg - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python check_model.py - - cd ../max_corr - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python ../check_model.py - - cd ../param - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python ../check_model.py - - cd ../reparam - - mpiexec -n 1 ../../../gnu_param_py/bin/sisso++ - - python check_model.py + - for direc in ../*/; do cd $direc; mpiexec -n 1 ../../../gnu_param_py/bin/sisso++; python check_model.py; done - cd ../../../ test-gnu-bin-base: @@ -375,20 +325,7 @@ test-gnu-bin-base: - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_gnu_py_env/lib/python3.7/site-packages/ - export OMP_NUM_THREADS=1 - cd tests/exec_test/default/ - - mpiexec -n 1 ../../../gnu_py/bin/sisso++ - - python ../check_model.py - - cd ../classification/ - - mpiexec -n 1 ../../../gnu_py/bin/sisso++ - - python check_model.py - - cd ../gen_proj - - mpiexec -n 1 ../../../gnu_py/bin/sisso++ - - python ../check_model.py - - cd ../log_reg - - mpiexec -n 1 ../../../gnu_py/bin/sisso++ - - python check_model.py - - cd ../max_corr - - mpiexec -n 1 ../../../gnu_py/bin/sisso++ - - python ../check_model.py + - for direc in ../*/; do cd $direc; if [[ $direc != *"param"* ]]; then mpiexec -n 1 ../../../gnu_py/bin/sisso++; python check_model.py; fi; done - cd ../../../ build-gnu-gcov: diff --git a/src/inputs/InputParser.cpp b/src/inputs/InputParser.cpp index b0bdcad34d56316b36211ea1a15668808e5374a1..399704f64cb6cfdf1684565c0d248c5c46487b4b 100644 --- a/src/inputs/InputParser.cpp +++ b/src/inputs/InputParser.cpp @@ -280,7 +280,22 @@ InputParser::InputParser(pt::ptree ip, std::string fn, std::shared_ptr<MPI_Inter InputParser::InputParser(std::string fn) : InputParser(get_prop_tree(fn, mpi_setup::comm), fn, mpi_setup::comm) -{} +{ + if(_mpi_comm->rank() == 0) + { + std::vector<std::string> filepath = str_utils::split_string_trim(fn, "/"); + std::string(fn); + if(filepath.size() > 1) + { + fn = str_utils::join("/", filepath.data(), filepath.size() - 1) + "/stripped_" + filepath.back(); + } + else + { + fn = "stripped_" + fn; + } + boost::filesystem::remove(fn); + } +} void InputParser::generate_phi_0( std::vector<std::string> headers, @@ -862,7 +877,7 @@ void strip_comments(std::string& filename) filename = new_fn; } -pt::ptree get_prop_tree(std::string fn, std::shared_ptr<MPI_Interface> mpi_comm) +pt::ptree get_prop_tree(std::string fn, std::shared_ptr<MPI_Interface>& mpi_comm) { if(mpi_comm->rank() == 0) { @@ -888,10 +903,5 @@ pt::ptree get_prop_tree(std::string fn, std::shared_ptr<MPI_Interface> mpi_comm) mpi_comm->barrier(); - if(mpi_comm->rank() == 0) - { - boost::filesystem::remove(fn); - } - return prop_tree; } diff --git a/src/inputs/InputParser.hpp b/src/inputs/InputParser.hpp index 7ddd2322b2dc9a9c8a4d519b29e111a6c3056b9f..6cc3f1c05a147dc876fd7248ce5495cf6b586999 100644 --- a/src/inputs/InputParser.hpp +++ b/src/inputs/InputParser.hpp @@ -1077,7 +1077,7 @@ std::vector<T> as_vector(pt::ptree const &pt) * * @return The property tree representation of the json file */ -pt::ptree get_prop_tree(std::string fn, std::shared_ptr<MPI_Interface> mpi_comm); +pt::ptree get_prop_tree(std::string fn, std::shared_ptr<MPI_Interface>& mpi_comm); #endif