Questions tagged [openmp]
OpenMP is a cross-platform multi-threading API which allows fine-grained task parallelization and synchronization using special compiler directives.
6,539
questions
0
votes
1
answer
656
views
OpenMP Threads not fully utilize CPU cores on new machine
I have a multi-threaded application that solves huge matrix in parallel. I recently changed my laptop and start getting some weird behavior on the new laptop. The processor in the old laptop was 11th ...
0
votes
0
answers
33
views
Passing OpenMP flag for all files affects results
I am restructuring a complex numerical Fortran code to use CMake. I realized that, when requested, the OpenMP flag is passed to all files, even those that do not need it (i.e. no omp constructs).
...
0
votes
1
answer
87
views
Parallelisation in nested loops with OPENMP
I'm trying to parallelize to this function in C using openmp but nothing seems to work out , I'm aware there are dependencies in the iterations and the two lines also but I'm stuck, can someone help ...
1
vote
0
answers
96
views
Why do printf calls help improving execution time?
I am implementing a sparse matrix-multivector multiplication in OpenMP and I've noticed that including a few printf calls in a pre-processing function, not parallelized, increments a lot the GFLOPS ...
0
votes
1
answer
119
views
how can I get a simd subroutine in gfortran?
I am trying to deal with some calculation, and I am encountered with some problem when dealing with simd direcitves in gfortran in codeblocks in Windows 10. I composed the following codes as a ...
0
votes
0
answers
91
views
OpenMP Runtimes
Can anyone recommend a compiler and runtime that will support OpenMP and OpenMP offload on RISC-V processors? I am not interested in running Linux on the RISC-V processors due to overhead and am ...
0
votes
2
answers
100
views
Slurm jobs result in abnormal execution times
I have a job script as such,
#!/bin/bash
#SBATCH -p cs
#SBATCH -e %j.err
#SBATCH --time=40:00
#SBATCH --output=slurm-%j.out
#SBATCH --cpus-per-task=2
#SBATCH --nodes=1
#SBATCH --ntasks=1
# ...
0
votes
0
answers
134
views
How to optimize n-body simulation for small system with OpenMP
I'm trying to parallelize classical molecular dynamics using OpenMP.
The challenge is that I need to sequentially run many simulations of small systems (<100 atoms) rather then run single large ...
0
votes
1
answer
234
views
slurm job script for iterative loops
I use a bash script like this,
for i in 0 1 2 3 4 5 do
export OMP_NUM_THREADS=$((2 **i))
&& ./debug > ./logs/112500/exp$1/log-$((2 **i)).txt
done
Now I need to run this script 32 ...
0
votes
0
answers
59
views
OpenMP: correct way to call nested functions
My code has the following structure. So basically I have some small functions, which are used later in a wrapper / bigger procedure and also used in main.
I would like to parallelise it with OMP. My ...
0
votes
1
answer
56
views
OpenMP fibonacci function and use of firstprivate
Why is firstprivate used in the below code snippet from here? Removing firstprivate does not seem to have any effect on the final result. My understanding of firstprivate is that the value of the ...
1
vote
0
answers
63
views
Make combinations (Lexicographical order) running in omp parallel in C language?
I need help. I couldn't get this combination generation algorithm (in lexicographic order) to work in parallel. The algorithm is taken from the Rosettacode site, the link is: https://rosettacode.org/...
0
votes
0
answers
194
views
Clang compiled from source cannot find -lomp
I've compiled LLVM from source including clang and openmp. When I try to compile a simple C program using openmp with the produced clang binary though I get /usr/bin/ld: cannot find -lomp: No such ...
0
votes
2
answers
107
views
efficiency of Open MP with fortran 90?
Hi all and thanks to those who will get a look to my question.
I have a subroutine which I try to use open MP to do what I want but it seems my code is faster without.
the problem I have a big list of ...
0
votes
0
answers
239
views
Performance profiling multitheaded OMP C++ in Visual Studio
I'm currently profiling a heavily multi-threaded C++ currently running under Visual Studio 2017. Looking at the results under task manager, my program is keeping all CPU cores and threads running at a ...
0
votes
1
answer
63
views
OpenMP critical section matrix multiplication
First of all I know the example is not a noticeable improvement from a single threaded execution. I am learning the basic of OpenMP and I dont know why it doesnt work as I expected.
So, I am ...
0
votes
1
answer
67
views
OMP loop dependency -
I try to parallelize the following code
double a = 1.5;
double b = 2.5;
double *arr = ...;
for (i = 0; i < N; ++i)
{
arr[i] = b;
b *= a;
}
I have tried different constellations of ...
0
votes
0
answers
31
views
Using OpenMP parallel 'for' directive on nested for loops
I have a Nx*Ny long vector phi which I want to perform some operations on to obtain d_phi. Basically each line adds together a linear combination of some of the columns of phi according to the ...
0
votes
0
answers
19
views
Can we extract device/kernel code from a .ll file(LLVM IR) in openmp application?
I am trying to write a simple addition application using OpenMP in which I want to offload the computation on GPU. My kernel code is present in a kernel.ll file in LLVM Intermediate Representation. ...
0
votes
0
answers
73
views
Clear unordered map before running parallel creation of adjacent list - OpenMP C++
I'm trying to make a benchmark that measures the time taken to create the adjacent list of a graph, given its list of edges using OpenMP with different number of threads.
In order to do so I have to ...
1
vote
1
answer
60
views
How should i ovverride the GCC runtime compiler options for specific GPU
Using the GCC compiler and OpenMP programming, I’m now working on a project that offloads data to an Nvidia GPU. I needed some help in figuring out an issue .
The default setup uses a virtual GPU that ...
0
votes
0
answers
55
views
Odeint integration and parallel computing with openmp
I am trying to implement the three body problem integration in c++ with odeint but, to evolve, the system takes much time (about 10 h for just 50 years of integration of the system), so I would like ...
2
votes
1
answer
110
views
Enabling OpenMP tool with callbacks in a C++ code
I'm developing a small OpenMP tool library that will allow me to utilise OpenMP callbacks. This library is written entirely in C. I can compile and link it into my user code. To compile the library I ...
0
votes
0
answers
36
views
Why does this cmake code work with a hardcoded path, but not with a computed one of the same value? [duplicate]
System info
macos 12.5.1
Compiler Apple clang 14.0.0
Cmake version 3.24.2 from brew
OpenMP version 15.0.7 from brew, this installs the library in /opt/homebrew/opt/libomp/
The problem
I am debugging ...
0
votes
2
answers
49
views
Can I use a temporary 2D-array to avoid data dependency in OpenMP?
I have a piece of code like this:
int n=5;
Eigen::VectorXd vec(n);
vec.setZero();
for(int i=0;i<100;i++)
{
int idx = i%n;
vec(idx)+=(i/n);
}
std::cout<<vec<<endl;
I would like ...
0
votes
1
answer
183
views
Can Intel oneTBB co-exist with OpenMP?
I have a quick theoretical question. Can Intel oneTBB (Thread Building Blocks) co-exist with OpenMP (Open MultiProcessing) in one code base? Both are parallel runtimes for shared memory architectures. ...
0
votes
0
answers
101
views
Why does my sudoku solver work in serial but not in parallel using openMP?
I am writing a code that solves a NxN soduku puzzle in parallel using openMP. The code works fine when i compile without -fopenmp option, but when I compile with -fopenmp I get weird results.
Here is ...
0
votes
1
answer
69
views
OpenMP - Nested parallel for loops within sections
I have a time integration for loop, within which (to find the values of the arrays at the next time step) I am computing three equations essentially and each of the three equations are independent of ...
2
votes
1
answer
94
views
fortran triply nested do loop omp parallelization false sharing removal
I have the following fortran subroutine, which gprof shows that it consumes > 50% of the time and is by far the most expensive part of the code.
Initially I received it without any OpenMP directive....
0
votes
0
answers
45
views
Performance using OpenMP doesn't increase beyond 2 threads
I've created an implementation of the naive N-body problem with N^2 time complexity using c++ and I've tried to parallelize it using OpenMP. For example, running the program 5 times with 1000 bodies, ...
0
votes
0
answers
128
views
CMake - allow mingw with OpenMP and opencv
I try to set up a C++ environment for working with images (using opencv) and parallel computing. The main problem is that I can't success to link all the pieces together. As a mention, I use mingw ...
0
votes
0
answers
52
views
intelMKL - ZGEMM calls inside OMP parallel do region
I have matrices of maximum shape (2500 x 2500) , to be multiplied by vectors of maximum shape (2500, ), the result having of course a maximum shape of (2500, ).
These are all complex*16 datatype ...
0
votes
0
answers
52
views
does this triply nested do loop produce false sharing in OpenMP Fortran?
I am trying to parallelize a code I inherited from someone.
I am still learning about OpenMP.
I know that if multiple threads bounce back and fort a cache line and at least one of them writes to it, ...
0
votes
0
answers
114
views
can't compile c++ program with OpenMP
I'm a newbie so please forgive me my primitive developer language :)
I´m trying to compile a C++ program in Visual Studio Code and it works fine for me, but when i try to run the exe file on different ...
0
votes
0
answers
71
views
OpenMP C++ handles complex for loop parallelism
I am working on this legacy C++ code and trying to apply OpenMP to the code. The code has many for loop calculations which involves many element indexes stored in global variables. I am struggling to ...
0
votes
0
answers
157
views
Version node not found for symbol when static linking libgomp.a compiled with fPIC
I'm trying to recompile gcc/gfortran with -fPIC so that I will be able to statically link the libraries with position-independent compiled objects using
# gcc/gfortran configured and compiled with
./...
1
vote
1
answer
57
views
What is the "_8" postfix that is appended when linking openmp library fortran calls?
I'm compiling and trying to link together a couple of libraries, one issue that seems to arise is that a call to openmp in Fortran, like for example.
!$ CALL omp_set_num_threads(foo)
ends up ...
0
votes
1
answer
50
views
I am trying to compile a C/C++ program with OPENMP in linux and I have the following error message
The error message is:
error: ‘threadprivate’ ‘ramseries::ErrorWriter::activated_’ directive not in ‘ramseries::ErrorWriter’ definition
I can compile my program in windows but not in linux
Is it not ...
1
vote
1
answer
46
views
Why does this code for chain matrix multiplication return a segmentation fault?
I was writing a program to execute chain matrix multiplication for number of rows and columns being random numbers greater than 1000. The program performs chain matrix multiplication for 10 matrices ...
1
vote
1
answer
169
views
Performance MPI and MPI+OpenMP. Speedup and efficiency
The program I used to measure performance has an implementation in MPI and one with OpenMP+MPI where 2 threads and 4 threads are used to parallelize the loop present in the program. The program ...
0
votes
1
answer
134
views
Parallelization of an openMP nested do loop using ifort
I have a nested do loop in an openmp fortran 77 code that I am unable to parallelize, when doing the command export OMP_NUM_THREADS=14, the more threads I add the worse the results, when its " 1 &...
2
votes
0
answers
228
views
OpenMP: why is my parallel code is SLOWER than serial code? using FFTW
I have a code that uses FFT heavily, and a quick profiling shows indeed that the computer spends a significant portion of wall-clock time in my FFT functions. I have a simple attempt of using openMP ...
4
votes
1
answer
206
views
Intel MKL multi-threaded matrix-vector multiplication sgemv() slow after little breaks
I need to run a multi-threaded matrix-vector multiplication every 500 microseconds. The matrix is the same, the vector changes every time.
I use Intels sgemv() in the MKL on a 64-core AMD CPU. If I ...
2
votes
1
answer
85
views
How to generate the same random number sequence within each thread?
I have a code that converts an image with 32 output layers, from an AI segmentation model output, into a single layer where each pixel in each layer has a probability proportional to its score to make ...
1
vote
2
answers
104
views
OMP Atomic Assignment to Pointer Location and Pointer Increment
I have a need (particle binning) for multiple threads in a OMP SMP parallel region to determine which array to write data to and then increment a counter to track how much data has been written. The ...
-1
votes
1
answer
88
views
Problem with outer loop vectorization using OpenMP in C
I am lerning how to use OpenMP to make a code use muttiple processors. Recently, I tried to make my Ewald Summation Fourier part parallel using OpenMP. Below is the function named ...
0
votes
1
answer
27
views
Array overwriting(?) in OpenMP
As an introduction to OpenMP, I'm trying to print a list of prime numbers.
// compile: gcc primes.c -fopenmp -o primes
#include <stdio.h> //printf()
#include <stdlib.h> //atoi() and ...
-1
votes
1
answer
67
views
Optimizing huge graph traversal with OpenMP
I am trying to optimize this function which according to the perf tool is the bottleneck of archiving close to linear scaling. The performance gets worse when the number of threads go up, when I drill ...
0
votes
1
answer
96
views
Compiled successfully, but no console output
I'm trying to use LLVM on windows.
I've installed llvm-mingw(https://github.com/mstorsjo/llvm-mingw/releases/tag/20220906), and it works like a charm.
Everything works well, but pthread and openmp.
...
2
votes
0
answers
83
views
Restrictions for Fortran loops associated with the worksharing or simd loop constructs
OpenMP for Fortran has a few loop-related constructs like the work-sharing do loop construct, simd loop construct etc. These constructs can have one or more Fortran loops related to them. The latter ...