Skip to main content
1 vote
1 answer
53 views

OpenMP thread affinity not working in Rcpp package: "Affinity not supported on this configuration"

I'm developing an R package using Rcpp with OpenMP for parallelization. I'm facing an issue where threads are randomly spread across CPU cores, leading often to threads beeing scheduled primarily on ...
roh's user avatar
  • 11
1 vote
1 answer
65 views

OpenMP directive in constexpr functions

According to OpenMP specification (2.1. Directive Format) Directives may not appear in constexpr functions or in constant expressions. Variadic parameter packs cannot be expanded into a directive or ...
Chameleon's user avatar
  • 2,177
0 votes
0 answers
45 views

Does "pragma omp parallel for" only allow specific syntax in for loops? [duplicate]

In gcc (GCC) 14.2.0 the following program int main(int argc, char *argv[]) { #pragma omp parallel for for (int i{0}; i < 1; ++i) { } return 0; } does compile with g++ main.cpp (without ...
phinz's user avatar
  • 1,481
1 vote
0 answers
35 views

Setting the stack size for nested parallel regions with Open MP (Fortran)

I'm using Open MP with Fortran 08 (compiled with GFortran) to create nested parallel regions (in my case, a 3-level nest). Before running my executable, I set some Linux environment variables to ...
Frank's user avatar
  • 11
1 vote
0 answers
60 views

Variable declaration in fortran : Pros and Cons between declaration in a block construct or copy in a private OMP Parallel clause?

I wrote these two programs to test OMP PARALLEL: 1 : my_idx is declared at the beginning of the program and after a private copy for eah thread is done. program my_pgm use omp_lib implicit ...
Stef1611's user avatar
  • 2,461
0 votes
0 answers
39 views

Problem with construction BLOCK and openmp in gfortran

I wrote the following program : program my_pgm use omp_lib implicit none CALL OMP_set_dynamic(.FALSE.) CALL OMP_set_num_threads(2) !$OMP PARALLEL DEFAULT(SHARED) ...
Stef1611's user avatar
  • 2,461
1 vote
1 answer
82 views

Why do OpenMP programs run faster on a single process than on multiple processes?

The task was to implement various matrix multiplication algorithms using OpenMP. It turned out that with num_threads(1), the program runs faster than with any other number of threads. Is this due to ...
Илья Анненков's user avatar
2 votes
2 answers
78 views

Standard way of calling math functions in C when using OpenMP & its offloading feature(s)?

I am writing some code in C in which I want to add the optional ability to have certain sections of the code accelerated using OpenMP, and with an additional optional ability to have them accelerated ...
Matthew G.'s user avatar
4 votes
4 answers
283 views

Optimize a separable convolution for SIMD friendly and efficiency

I implemented a simple 2d separable convolution code: void SeparableConvolution2D(const float * restrict mI, float * restrict mO, float * restrict mB, int numRows, int numCols, const float * restrict ...
Royi's user avatar
  • 5,103
0 votes
1 answer
83 views

Getting multiple outputs on Open MPI C++ Code

The following code gives multiple outputs Sum of first 100000 natural numbers: 5000050000 Sum of first 100000 natural numbers: 5000050000 Sum of first 100000 natural numbers: 5000050000 Sum of ...
Anjeneya Swami Kare's user avatar
2 votes
1 answer
89 views

How to declare an OpenMP reduction for a std::vector inside a struct?

I'm trying to perform an std::vector sum reduction with an OpenMP reduction declaration for it: // g++ -fopenmp MRE.cpp -o MRE #include <vector> #include <algorithm> #include <omp.h> ...
Stefan de Souza's user avatar
0 votes
1 answer
45 views

Openmp lastprivate confusing result

I am getting following results roughly 20% of the execution with the given code and lastprivate clause is not working as expected. Pls note that end value of b should be 50 however at times it is not ...
Muhammad Arshad Islam's user avatar
1 vote
0 answers
68 views

loop parallelization with omp

Good morning, I was trying to parallelize a loop with OMP in a program I created for a flood simulator with the goal of achieving a performance boost. The loop I want to parallelize is as follows: #...
NaeSs's user avatar
  • 11
1 vote
3 answers
123 views

Parallel loop in Fortran using OpenMP

I'm exploring OpenMP in Fortran, using the Mandelbrot algorithm as an example: !$omp parallel do reduction(+:iters) do iy=0,30 do ix=0,70 c = cmplx(xmin+stepx*ix, ymin+stepy*iy, qp) ...
Raf's user avatar
  • 1,779
0 votes
1 answer
75 views

File writing while compiling with flag -fopenmp

I'm trying to write to file a certain value, calculated with some parallelized operations using Eigen, in particular with the flag -fopenmp. I've written a code that works perfectly with -g -o, but I'...
Fra_liturri's user avatar

15 30 50 per page
1
2 3 4 5
448