6,728 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
96
views
What is the difference between the values obtained from sched_getcpu() and getcpu(int*, int*) from sched.h?
Here is a minimal working c++ example to show what I mean:
#include <sched.h>
#include <iostream>
#include <sstream>
#include <omp.h>
int main(int argc, char** argv) {
#pragma ...
1
vote
2
answers
171
views
How to recognize the main thread in an OpenMP program?
OpenMP uses its own scheme for numbering threads staring from 0 for the master thread. A master thread is the thread that initiated a parallel region, which is the main program thread in the following ...
-1
votes
0
answers
51
views
OpenMP schedule(dynamic) fails in RcppEigen on macOS Sequoia 15.6.1 (symbol not found in flat namespace)
I am running a straightforward parallelized computation using RcppEigen and OpenMP.
Here is a minimal reproducible example of the code:
// [[Rcpp::depends(RcppEigen)]]
// [[Rcpp::plugins(openmp)]]
#...
2
votes
1
answer
150
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
98
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
142
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
97
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 ...
1
vote
1
answer
118
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. ...
3
votes
2
answers
193
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
96
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
86
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
130
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
112
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
150
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
167
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 ...