mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 04:25:29 -04:00
Consolidating number of threads and thread number queries into the openmp interface header (#2809)
This commit is contained in:
parent
fb65dfd53c
commit
53363da3cc
5 changed files with 34 additions and 47 deletions
17
src/plot.cpp
17
src/plot.cpp
|
|
@ -23,6 +23,7 @@
|
|||
#include "openmc/material.h"
|
||||
#include "openmc/mesh.h"
|
||||
#include "openmc/message_passing.h"
|
||||
#include "openmc/openmp_interface.h"
|
||||
#include "openmc/output.h"
|
||||
#include "openmc/particle.h"
|
||||
#include "openmc/progress_bar.h"
|
||||
|
|
@ -1218,11 +1219,7 @@ void ProjectionPlot::create_output() const
|
|||
* Note that a vector of vectors is required rather than a 2-tensor,
|
||||
* since the stack size varies within each column.
|
||||
*/
|
||||
#ifdef _OPENMP
|
||||
const int n_threads = omp_get_max_threads();
|
||||
#else
|
||||
const int n_threads = 1;
|
||||
#endif
|
||||
const int n_threads = num_threads();
|
||||
std::vector<std::vector<std::vector<TrackSegment>>> this_line_segments(
|
||||
n_threads);
|
||||
for (int t = 0; t < n_threads; ++t) {
|
||||
|
|
@ -1234,14 +1231,8 @@ void ProjectionPlot::create_output() const
|
|||
|
||||
#pragma omp parallel
|
||||
{
|
||||
|
||||
#ifdef _OPENMP
|
||||
const int n_threads = omp_get_max_threads();
|
||||
const int tid = omp_get_thread_num();
|
||||
#else
|
||||
int n_threads = 1;
|
||||
int tid = 0;
|
||||
#endif
|
||||
const int n_threads = num_threads();
|
||||
const int tid = thread_num();
|
||||
|
||||
SourceSite s; // Where particle starts from (camera)
|
||||
s.E = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue