6,727 questions
2 votes
1 answer
141 views
How is a non-parallelized for loop inside an OpenMP parallel section executed?
Consider the following code: #pragma omp parallel for (int run = 0; run < 10; run++) { std::vector<int> out; #pragma omp for for (int i = 0; i < 1'000'000; i++) { ... } } ...
Best practices
0 votes
3 replies
94 views
Code design conundrum: runtime polymorphism, templates, compile times, and OpenMP
I'm struggling to finalise the design of my C++17 library. One of the primary goals is to use runtime polymorphism to allow users to extend or rewrite default features of the library for their own use ...
2 votes
1 answer
101 views
Does the construct `workshare` work with `do-concurrent`?
I'm one of the developers of the Lumen code: https://www.lumen-code.org/. That is computational code for condensed matter physics simulations. We are replacing FORALL with DO CONCURRENT, since FORALL ...
0 votes
1 answer
92 views
C++ segmentation fault when throwing in ordered OMP parallel for
the code below crashes with terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >' Aborted ...
2 votes
1 answer
108 views
OpenMP in C | How to keep private iterable after loop
So i'm working on some homework related to fixing som buggy code when i ran into an interesting problem. I don't think it was one of the indended bugs because the lecturer was confused by it as well. ...
0 votes
0 answers
32 views
Session aborted in stochastic simulation using Rcpp and OpenMP [duplicate]
Overview - simple actuarial model to perform a stochastic simulation on a group of individuals. How it works - In a nutshell, the sequential version works as follows: in each of the nRip iterations, ...
3 votes
2 answers
162 views
OpenMP tasks not working in a Fortran code with asymmetric loads
I am optimising a code already parallelised but not very optimised because of the very different duration of operations among the threads, even though all threads have a similar task to do. So I ...
0 votes
0 answers
69 views
Segmentation fault in Fortran OpenMP+OpenACC hybrid parallelization
I'm working on porting the CAMB (Cosmological Boltzmann code) to run with hybrid CPU+GPU parallelization using OpenMP and OpenACC with NVIDIA HPC SDK compilers. The code works perfectly when compiled ...
0 votes
0 answers
80 views
Android NDK Crash in libomp.so at __kmpc_barrier with FluidSynth and OpenMP
I'm developing an Android app using the NDK that plays MIDI files with FluidSynth, integrated with a Java frontend. The app crashes with a native crash in libomp.so at __kmpc_barrier, and I suspect it'...
3 votes
2 answers
128 views
How to do *user defined reduction* on *allocatable array* and *user reduction functions* with openMP in C?
I have written some programs with OMP reduction directive in Fortran and in C. But the data types were simple (int, float, arrays with fixed size, ...) and reduction-identifiers used were implicitly ...
2 votes
3 answers
110 views
Open-MP Parallel for (three-dimensional array)
We are working with the following code: int i, j, k; for (i = 2; i < n; i++){ // S1 for (j = 3; j < n - 3; j++){ // S2 for (k = 4; k < n - 4; k++){ // S3 A[...
1 vote
1 answer
129 views
Fortran OpenMP offloading painfully slow on NVIDIA architectures
I am currently trying to porting a big portion of a Fortran code to GPU devices with OpenMP. I have a working version for AMD, specifically for the MI300A which features unified shared memory. I ...
1 vote
1 answer
165 views
Is there a way to express dependency on the first iteration of the parallelized loop?
My program needs to perform some heavy calculations on all widgets in the box. The calculations are repeated an appreciable number of times processing multiple variations of each widget. All of the ...
0 votes
0 answers
102 views
Why does my Radix Sort with OpenMP+AVX not sort correctly, while the OpenMP-only version works?
I'm implementing a bitwise Radix Sort to sort an array of 64-bit unsigned integers (key_t is uint_fast64_t) that represent encoded points. I have two versions of the algorithm: One using OpenMP only ✅...
3 votes
1 answer
95 views
OpenMP atomic: Difference between write and update
I am reading the OMP documentation (6.0) about atomic operations. As I came across clauses I read about write and update. I understand the difference between the two: write is used to atomically ...