Skip to content

Commit

Permalink
Merge pull request #30 from PROBIC/parallelism-fixes
Browse files Browse the repository at this point in the history
Parallelism & CI fixes
  • Loading branch information
tmaklin authored Aug 15, 2024
2 parents f496317 + 61f4ec3 commit c537327
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/make_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build_linux-x86_64:
runs-on: ubuntu-latest
container: phusion/holy-build-box-64:3.0.2
container: phusion/holy-build-box:4.0.1
steps:
- name: Install wget
id: install-wget
Expand Down Expand Up @@ -125,4 +125,4 @@ jobs:
fail_on_unmatched_files: true
generate_release_notes: true
files: |
mSWEEP-*.tar.gz
mSWEEP-*.tar.gz
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ if (DEFINED CMAKE_TELESCOPE_LIBRARY AND DEFINED CMAKE_TELESCOPE_HEADERS)
else()
FetchContent_Declare(telescope
GIT_REPOSITORY https://github.com/tmaklin/telescope.git
GIT_TAG v0.7.0-prerelease
GIT_TAG v0.7.3
PREFIX "external"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/telescope"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/telescope"
Expand Down
1 change: 0 additions & 1 deletion include/Likelihood.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class LL_WOR21 : public Likelihood<T> {
const seamat::DenseMatrix<T> &precalc_lls_mat = this->precalc_lls(masked_group_sizes, n_masked_groups);

this->log_likelihoods.resize(n_masked_groups, num_ecs, std::log(this->zero_inflation));
#pragma omp parallel for schedule(static) shared(precalc_lls_mat)
for (size_t j = 0; j < num_ecs; ++j) {
size_t groups_pos = 0;
for (size_t i = 0; i < n_groups; ++i) {
Expand Down
3 changes: 3 additions & 0 deletions src/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void Sample::dirichlet_kld(const std::vector<double> &log_ec_hit_counts) {
size_t cols = this->get_probs().get_cols();

std::vector<double> alphas(rows, 0.0);
#pragma omp parallel for schedule(static)
for (size_t i = 0; i < rows; ++i) {
for (size_t j = 0; j < cols; ++j) {
size_t num_hits = std::round(std::exp(log_ec_hit_counts[j]));
Expand All @@ -111,11 +112,13 @@ void Sample::dirichlet_kld(const std::vector<double> &log_ec_hit_counts) {
}

double alpha0 = 0.0;
#pragma omp parallel for schedule(static) reduction(+:alpha0)
for (size_t i = 0; i < rows; ++i) {
alpha0 += alphas[i];
}

this->log_KLDs.resize(rows);
#pragma omp parallel for schedule(static)
for (size_t i = 0; i < rows; ++i) {
double log_theta = std::log(alphas[i]) - std::log(alpha0);
double alpha_k = alphas[rows - 1];
Expand Down

0 comments on commit c537327

Please sign in to comment.