All Questions
16 questions
0
votes
0
answers
119
views
How to use #pragma omp task with #pragma omp simd
I want to write a parallel program that computes a perimeter, area and diagonal of multiple rectangles. The way I thought is to use a functional parallelism to build my program.
First, the perimeter, ...
1
vote
1
answer
142
views
What are usecases of MPI_Pack/MPI_Unpack?
What is the purpose of using MPI_Pack/MPI_Unpack? Is it better than working with mpi structure types or derived types?
1
vote
0
answers
58
views
How to run 2 parallel processes in C? [duplicate]
I try to run 2 parallel processes
i have a global variable x = 0
process A: increase global variable x by 1
process B: print x
I followed this example How to run two child processes simultaneously in ...
0
votes
1
answer
84
views
How to print dsyev (or LAPACK in general) function progress?
I am using dsyev with Intel MKL in C.
I am diagonalizing a 20_000 x 20_000 real symmetric matrix of doubles.
I want to know how much time is left from the dsyev call, or roughly where it is.
I compile ...
0
votes
0
answers
397
views
FFMPEG Concurrent Video Decoding
So, right now my program is decoding an input video sequentially and doing math on each frame to determine black frames. I feel like decoding the video frames concurrently could greatly improve the ...
2
votes
1
answer
1k
views
Efficient Parallel algorithm for array filtering
Given a very large array I want to select only the elements that match some condition. I know a priori the number of elements that will be matched. My current pseucode is:
filter(list):
out = list ...
0
votes
1
answer
272
views
Concurrent update to dynamic array in C with OpenMP
Suppose many threads try to append elements at the end of a dynamically allocated array. If there is not enough room, the array must be reallocated, but then its address in memory may change, and ...
1
vote
1
answer
50
views
How to get one correct value from a function which is parallelized by multi-threads
For faster calculation, trying to make my method parallelized by 4 threads. Where threads are making 4 separate calculation whether I was expecting concurrent operation and on single variable.
#...
-1
votes
1
answer
465
views
CMPXCHG and critical section implementation
The CMPXCHG statement works as follows:
CMPXCHG (common, old, new):
int temp
temp <- common
if common = old then
common <- new
return temp
What is the simplest ...
0
votes
1
answer
79
views
Deadlock in multithreading
I have deadlock in this code. It sometimes works and sometimes doesn't.
I have the below simple code with 3 threads, and mutex. I want for every thread to wait and then after all are waited, signal ...
17
votes
6
answers
13k
views
How to achieve multitasking in a microcontroller?
I wrote a program for a wrist watch utilizing a 8051 micro-controller using Embedded (C). There are a total of 6 7-segment displays as such:
_______________________
| | | ...
1
vote
1
answer
2k
views
MPI sending messages with MPI_Send and MPI_Reduce
so I am learning about parallel programming and am writing a program to calculate a global sum of a list of numbers. The list is split up into several sublists (depending on how many cores I have), ...
5
votes
3
answers
4k
views
OpenMP Parallel for-loop showing little performance increase
I am in the process of learning how to use OpenMP in C, and as a HelloWorld exercise I am writing a program to count primes. I then parallelise this as follows:
int numprimes = 0;
#pragma omp ...
3
votes
1
answer
733
views
Race condition scenario
I have a question regarding a race condition scenario. The question:
Consider the following two threads, to be run concurrently in a shared
memory (all variables are shared between the two threads)...
3
votes
2
answers
14k
views
How to run two child processes simultaneously in C?
So I'm getting into Concurrent Programming, but for some reason I can't even get the basics to work. I have a file called fork.c, which contains a method main. In this method main I fork twice, into ...