Commit 0764ee9a authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix per-thread array creation

use omp_get_max_threads outside parallel environment, not
omp_get_num_threads (which is 1).
parent 82f06978
......@@ -279,7 +279,7 @@ public:
real_number particles_positions[],
std::unique_ptr<real_number[]> particles_current_rhs[], const int nb_rhs,
partsize_t inout_index_particles[]){
TIMEZONE("compute_distr");
TIMEZONE("p2p_distr_mpi::compute_distr");
// Some processes might not be involved
if(nb_processes_involved <= my_rank){
......@@ -558,8 +558,8 @@ public:
lock_free_bool_array cells_locker(512);
std::vector<std::unique_ptr<computer_class>> computer_for_all_threads(omp_get_num_threads()-1);
for(int idxThread = 1 ; idxThread < omp_get_num_threads() ; ++idxThread){
std::vector<std::unique_ptr<computer_class>> computer_for_all_threads(omp_get_max_threads()-1);
for(int idxThread = 1 ; idxThread < omp_get_max_threads() ; ++idxThread){
computer_for_all_threads[idxThread-1].reset(new computer_class(in_computer));
}
......
Markdown is supported
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