From 860bcaf07fabc80c71da099058f182b210f12771 Mon Sep 17 00:00:00 2001 From: Matt Lyon Date: Fri, 26 Nov 2021 12:27:48 +0000 Subject: [PATCH] fix --- src/Model.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Model.cpp b/src/Model.cpp index 5a21ce3..97ab589 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -23,6 +23,12 @@ namespace vargwas { void Model::run() { + std::string chromosome; + uint32_t position; + std::string rsid; + std::vector alleles; + std::vector> probs; + std::vector dosages; spdlog::info("Using {} thread(s)", _threads); omp_set_num_threads(_threads); @@ -56,16 +62,9 @@ void Model::run() { file << "chr\tpos\trsid\toa\tea\tn\teaf\tbeta\tse\tt\tp\ttheta\tphi_x1\tse_x1\tphi_x2\tse_x2\tphi_f\tphi_p" << std::endl; file.flush(); -#pragma omp parallel default(none) shared(file, X1, X2, y) +#pragma omp parallel default(none) shared(file, X1, X2, y) private(chromosome, position, rsid, alleles, probs, dosages) { #pragma omp master - std::string chromosome; - uint32_t position; - std::string rsid; - std::vector alleles; - std::vector> probs; - std::vector dosages; - // Read variant-by-variant while (_bgen_parser.read_variant(&chromosome, &position, &rsid, &alleles)) {