Commit bf677dfc authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Merge branch 'master' of gitlab.mpcdf.mpg.de:tpurcell/cpp_sisso into joss

parents 0e1f18af 50ea6832
......@@ -348,15 +348,38 @@ build-gnu-gcov:
reports:
cobertura: build_gcov/coverage.xml
build-gnu-lcov:
stage: build
script:
- python -m venv cpp_sisso_gnu_lcov_env
- source cpp_sisso_gnu_lcov_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:`pwd`/cpp_sisso_gnu_lcov_env/lib/python3.7/site-packages/
- mkdir build_lcov/
- cd build_lcov/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_BUILD_TYPE="Coverage" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_lcov/ ../
- make install
- make coverage_html
- cd ../
artifacts:
when: always
paths:
- build_lcov/coverage_html
- cpp_sisso_gnu_lcov_env/
pages:
stage: doc_builds
dependencies:
- build-gnu-lcov
script:
- source cpp_sisso_gnu_param_py_env/bin/activate
- source cpp_sisso_gnu_lcov_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_gnu_param_py_env/lib/python3.7/site-packages/
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:`pwd`/cpp_sisso_gnu_lcov_env/lib/python3.7/site-packages/
- cd docs/
- make html
- mv _build/html/ ../public
- cd ../
- mv build_lcov/coverage_html/ public/coverage/
artifacts:
paths:
- public
......
......@@ -40,13 +40,6 @@ std::array<int, 2> MPI_Interface::get_start_end_from_list(const int sz, const in
std::shared_ptr<MPI_Interface> mpi_setup::comm;
void mpi_setup::init_mpi_env(int& argc, char **&argv)
{
if(env == 0)
env = new boost::mpi::environment(argc, argv);
comm = std::make_shared<MPI_Interface>();
}
void mpi_setup::init_mpi_env()
{
if(env == 0)
......
......@@ -45,16 +45,16 @@ public:
/**
* @brief Unique int tag generator
*
* @param[in] procSend sending process
* @param[in] procRecv receiving process
* @param[in] maxOffest number of different communication processes possible between two processes within the same operation
* @param[in] offest the assigned offset corresponding to a single communication within the same operation
* @param[in] proc_send sending process
* @param[in] proc_recv receiving process
* @param[in] max_offset number of different communication processes possible between two processes within the same operation
* @param[in] offset the assigned offset corresponding to a single communication within the same operation
*
* @return A unique tag to send information between two processes
*/
int cantor_tag_gen(const unsigned int procSend, const unsigned int procRecv, const unsigned int maxOffest, const unsigned int offest)
int cantor_tag_gen(const unsigned int proc_send, const unsigned int proc_recv, const unsigned int max_offset, const unsigned int offset)
{
return (int((procSend + procRecv) * (procSend + procSend +1) / 2) + procRecv) * maxOffest + offest;
return (int((proc_send + proc_recv) * (proc_send + proc_send +1) / 2) + proc_recv) * max_offset + offset;
}
/**
......@@ -74,14 +74,6 @@ namespace mpi_setup
static mpi::environment* env = 0; //!< The MPI environment
extern std::shared_ptr<MPI_Interface> comm; //!< The MPI communicator
/**
* @brief Initialize MPI enviroment
*
* @param argc from command line
* @param argv from command line
*/
void init_mpi_env(int& argc, char **&argv);
/**
* @brief Initialize MPI enviroment
*
......
......@@ -178,7 +178,7 @@ FeatureSpace::FeatureSpace(
);
std::vector<int> inds = util_funcs::argsort<int>(feat_n_params);
std::vector<node_ptr>phi_copy(n_feat_in_rung);
std::copy_n(_phi.begin() + _start_rung.back(), n_feat_in_rung, phi_copy.begin());
std::copy_n(_phi.begin() + _start_rung[rr], n_feat_in_rung, phi_copy.begin());
std::transform(
inds.begin(),
inds.end(),
......@@ -187,10 +187,10 @@ FeatureSpace::FeatureSpace(
);
// Reindex the features to match the sorted order
int cur_ind = _start_rung.back();
int cur_ind = _start_rung[rr];
std::for_each(
_phi.begin() + _start_rung.back(),
_phi.begin() + _start_rung.back() + n_feat_in_rung,
_phi.begin() + _start_rung[rr],
_phi.begin() + _start_rung[rr] + n_feat_in_rung,
[&cur_ind](node_ptr feat){feat->reindex(cur_ind); ++cur_ind;}
);
......@@ -201,6 +201,7 @@ FeatureSpace::FeatureSpace(
}
#endif
_scores.resize(_n_feat);
initialize_fs_output_files();
}
FeatureSpace::FeatureSpace(
......@@ -353,6 +354,7 @@ FeatureSpace::FeatureSpace(
#endif
_scores.resize(_n_feat);
initialize_fs_output_files();
}
py::list FeatureSpace::phi0_py()
......
......@@ -146,6 +146,8 @@ def read_csv(
# Load csv file
if not isinstance(df, pd.DataFrame):
df = pd.read_csv(str(df), index_col=0)
else:
df = df.copy()
# Extract the Property and Task Columns
prop, prop_label, prop_unit = extract_col(df, prop_key)
......
......@@ -84,6 +84,8 @@ def test_feature_space():
pass
feat_space = FeatureSpace(inputs)
assert feat_space.phi0[0].expr == inputs.phi_0[0].expr
feat_space.sis(inputs.prop_train)
assert feat_space.phi_selected[0].postfix_expr == "1|0|add|sq"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment