Skip to content

Commit

Permalink
Update thread handling in RcppParallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mmollina committed Feb 12, 2024
1 parent 109ffd2 commit 6197faf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
6 changes: 2 additions & 4 deletions R/pairwise_rf.R
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ est_pairwise_rf2 <- function(input.seq,
count.matrix.number = count.matrix.number,
count.matrix.pos = count.matrix.pos,
count.matrix.length = count.matrix.length,
tol = tol, threads = ncpus)
tol = tol)
res[res == -1] = NA
colnames(res) = c("Sh_P1","Sh_P2","rf","LOD_rf","LOD_ph")
if (verbose) {
Expand Down Expand Up @@ -508,8 +508,7 @@ paralell_pairwise_discrete_rcpp <- function(mrk.pairs,
count.matrix.number,
count.matrix.pos,
count.matrix.length,
tol = .Machine$double.eps^0.25,
threads)
tol = .Machine$double.eps^0.25)
{
res <- .Call("pairwise_rf_estimation_disc_rcpp",
as.matrix(mrk.pairs),
Expand All @@ -524,7 +523,6 @@ paralell_pairwise_discrete_rcpp <- function(mrk.pairs,
count.matrix.pos,
count.matrix.length,
tol = tol,
threads = threads,
PACKAGE = "mappoly")
return(res)
## return(lapply(res, format_rf))
Expand Down
2 changes: 1 addition & 1 deletion man/add_md_markers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/paralell_pairwise_discrete_rcpp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RcppExport SEXP est_map_hmm_highprec(void *, void *, void *, void *, void *, voi
RcppExport SEXP get_counts_single_parent_cpp(void *, void *, void *, void *, void *, void *);
RcppExport SEXP loglike_hmm(void *, void *, void *, void *, void *, void *);
RcppExport SEXP pairwise_rf_estimation_disc(void *, void *, void *, void *, void *, void *, void *);
RcppExport SEXP pairwise_rf_estimation_disc_rcpp(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
RcppExport SEXP pairwise_rf_estimation_disc_rcpp(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
RcppExport SEXP pairwise_rf_estimation_prob(void *, void *, void *, void *, void *, void *, void *, void *);
RcppExport SEXP poly_hmm_est_CPP(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);

Expand All @@ -94,7 +94,7 @@ static const R_CallMethodDef CallEntries[] = {
{"get_counts_single_parent_cpp", (DL_FUNC) &get_counts_single_parent_cpp, 6},
{"loglike_hmm", (DL_FUNC) &loglike_hmm, 6},
{"pairwise_rf_estimation_disc", (DL_FUNC) &pairwise_rf_estimation_disc, 7},
{"pairwise_rf_estimation_disc_rcpp", (DL_FUNC) &pairwise_rf_estimation_disc_rcpp, 13},
{"pairwise_rf_estimation_disc_rcpp", (DL_FUNC) &pairwise_rf_estimation_disc_rcpp, 12},
{"pairwise_rf_estimation_prob", (DL_FUNC) &pairwise_rf_estimation_prob, 8},
{"poly_hmm_est_CPP", (DL_FUNC) &poly_hmm_est_CPP, 13},
{NULL, NULL, 0}
Expand Down
4 changes: 1 addition & 3 deletions src/pairwise_estimation_rcppparallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ RcppExport SEXP pairwise_rf_estimation_disc_rcpp(SEXP mrk_pairs_R,
SEXP count_matrix_number_R,
SEXP count_matrix_pos_R,
SEXP count_matrix_length_R,
SEXP tol_R,
SEXP threads_R)
SEXP tol_R)
{
NumericMatrix mrk_pairs = mrk_pairs_R;
NumericMatrix geno = geno_R;
Expand All @@ -432,7 +431,6 @@ RcppExport SEXP pairwise_rf_estimation_disc_rcpp(SEXP mrk_pairs_R,
NumericMatrix out(mrk_pairs.ncol(), 5);
int m = as<int>(m_R);
double tol = as<double>(tol_R);
int threads = as<int>(threads_R);
int n_ind = geno.ncol();

rf_two_point_parallel RF_two_point_parallel(mrk_pairs, geno, dP, dQ, count_vector,
Expand Down

0 comments on commit 6197faf

Please sign in to comment.