Tagged Questions
6
votes
8answers
805 views
How to properly choose rng seed for parallel processes
I'm currently working on a C/C++ project where I'm using a random number generator (gsl or boost). The whole idea can be simplified to a non-trivial stochastic process which basically receives a seed, ...
2
votes
1answer
2k views
Aborting execution of all processes in MPI
The problem is to search a password into a big file of size about 10GB using MPI. I divided the file between different processes of chunk size of (Total number of bytes in file / P) where p is the ...
0
votes
1answer
73 views
CUDA reduction to find the maximum of an array
I am doing the Udacity course on parallel programming (homework 3) and can not figure out why I can't get the maximum in the array using parallel reduction (Udacity forums yet to provide solution). I ...
0
votes
1answer
22 views
Why does this MPI code execute out of order? [duplicate]
I'm trying to create a "Hello, world!" application in (Open)MPI such that each process will print out in order.
My idea was to have the first process send a message to the second when it's finished, ...
2
votes
0answers
48 views
Spawning a bunch of tasks at once, recursively, in OpenMP
What I'm trying to do is spawn N tasks at once, by recursively dividing the iteration space with the help of tasks, in order to spawn the 'real' tasks quicker.
I can do this linearly with a loop, ...
1
vote
2answers
19 views
numactl --hardware showing incorrect information
I am working on a NUMA computer. It has two nodes with 16GB ram on each node. When I am running a large program, I used both htop and numactl --hardware to observe the memory consumption. However I ...
0
votes
0answers
23 views
gsl openmp failed integration
This is my first post on here, so go easy on me!
I have a very strange problem. I've written a c code that converts particle data to grid data (the data comes from a cosmological simulation). In ...
0
votes
0answers
25 views
Basic 2d decomposition into sub 2d array using Scatterv and Gatherv MPI
I am having problems to decompose a 2D array among processes where each process will have 2D subarrays.
I am not sure whether my scattering is correct or not. Because I am not getting any error for ...
0
votes
0answers
32 views
#pragma omp parallel num_threads is not working
#include<omp.h>
#include<stdio.h>
#include<stdlib.h>
void main(int argc, int *argv[]){
#pragma omp parallel num_threads(3)
{
int tid = ...
0
votes
0answers
23 views
Does GMP serialize my multi-threaded code?
I compute the pi number according to concurrent pi algorithm from learning go. Now what I do differently is split the amount of work in large blocks that are then calculated in parallel on 2 mapping ...
0
votes
0answers
46 views
C - OpenMP, MPI, Serial Program [migrated]
I'm part of a Computational Science course and come from a non-programming background, so please forgive me my ignorance. I'm working on a set of code in C to numerically solve the Navier Stokes ...
2
votes
2answers
70 views
How to automatically calculate the block and grid size of a 2D image in CUDA?
I have known the ideas of block and grid in cuda, and I'm wondering if there is any helper function well written that can help me determine the best block and grid size for any given 2D image.
For ...
12
votes
6answers
69 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
1answer
75 views
Unable to avoid child processes from inheriting the cpu affinity of parent
I am wanting to affinitize the parent process to a particular core. In the code below, the variable core is a user supplied argument. Following that, I want to create NUM_CHILDREN processes and each ...
2
votes
1answer
21 views
MPI Triangular Topology
I have some computation to do over an (upper-)triangular matrix and I was thinking using MPI for that. It seems that it would be convenient to define a proper topology for that. The Cartesian topology ...
0
votes
0answers
40 views
Why does #pragma omp taskwait not schedule available tasks to a certain thread (no nested parallelism)?
I saw this very good explanation about OpenMP tasks from Hristo Iliev: Difference between section and task openmp. However I'm still having problems with understanding some code that I wrote for ...
1
vote
1answer
40 views
Beginner in OpenMP - Problems in cicle
I am a beginner in OpenMP and i am trying to parallelize the following function:
void calc(double *x, int *l[N], int d[N], double *z){
#pragma omp parallel for
for(int i=0; i<N; i++){
...
2
votes
1answer
66 views
Is there any difference between variables in a private clause and variables defined within a parallel region in OpenMP?
I was wondering if there is any reason for preferring the private(var) clause in OpenMP over the local definition of (private) variables, e.g.
int var;
#pragma omp parallel private(var)
{
...
}
...
0
votes
0answers
27 views
Can't parallelize operation with OpenMP [duplicate]
i am working on a project that i am trying to use parallel programming with OpenMP. the part is using one of OpenCV functions for image left and right, i want it to happen in parallel inside visual ...
1
vote
2answers
53 views
How to design a datastructure that spits out one available space for each thread in CUDA
In my Project with CUDA I need to have a data structure(available to all threads in the block)that is similar a "stash". In this stash there are multiple spaces which could be either empty or full. I ...
0
votes
1answer
71 views
Parallelizing prime generator in c++
This is a prime generator program, it works fine when number of processors int numProc is 1, but if user sepcifies that there are multiple processors, i want to use a parallellized version of primes, ...
0
votes
0answers
24 views
Metis rectangular partitioning
I'm currently using mites to partition a uniform rectangular 2d mesh that has different wight for each element. I'm calling METIS_PartMeshNodal or METIS_PartMeshDual, and that is working perfect. ...
4
votes
4answers
1k views
Why must loop variables be signed in a parallel for?
I'm just learning OpenMP from online tutorials and resources. I want to square a matrix (multiply it with itself) using a parallel for loop. In IBM compiler documentation, I found the requirement that ...
0
votes
1answer
157 views
CUDA Unified Memory Working (in specific, cudaMallocManaged();)
I recently have been playing around with CUDA, and was hoping to try out the unified memory model. I tried playing with sample code, and strangely, when launching the kernel, no values seemed to be ...
2
votes
1answer
294 views
Cholesky decomposition with OpenMP
I have a project where we solve the inverse of large (over 3000x3000) positive definite dense matrices using Cholesky Decomposition. The project is in Java and we use are using the CERN Colt BLAS ...
0
votes
1answer
2k views
MPI on PBS cluster Hello World
I am using mpiexec to run a couple of hello world executables. They each run, but the number of processes is always 1 where it looks like there should be 4 processes. Does someone understand why? ...
0
votes
1answer
73 views
Benchmarking, sequential x parallel program. Sublinear speedup?
Update2. Solved! This is memory issue. Some benching about it here:
http://dontpad.com/bench_mem
Update. My goal is to achieve best throughput. All my results are here.
Sequential Results:
...
15
votes
1answer
4k views
Difference between section and task openmp
What is the difference in OpenMP between :
#pragma omp parallel sections
{
#pragma omp section
{
fct1();
}
#pragma omp section
{
...
1
vote
1answer
53 views
Dijkstra Algorithm OpenMP Slower than Single Thread
I'm trying to parallelise Dijkstra's Algorithm using OpenMP but the serial version runs x40 times faster. I might be missing a concept or doing something wrong. I'm new to parallelism and OpenMP. Can ...
-1
votes
2answers
41 views
Converting a Parallel array to a Structure in C
I'm having tons of trouble converting a program that has a parallel array into a program that needs to be a structure.
Here is the original program
#include<stdio.h>
#include<time.h>
...
-1
votes
1answer
62 views
wrong results private array openmp
I am trying to write a code in C using openmp that runs on my dual core machine and that reads int values from an array and puts the results in an other array but i am getting wrong results. This is ...
3
votes
1answer
67 views
openMP: use of global variable in child functions
I've been trying to parallelize a C program using OpenMP, and it's like this:
#include<omp.h>
#include<stdio.h>
int test, result;
#pragma omp threadprivate(test, result)
void add(void)
...
-2
votes
1answer
114 views
Parallelizing matrix times a vector by columns and by rows with OpenMP
For some homework I have, I need to implement the multiplication of a matrix by a vector, parallelizing it by rows and by columns. I do understand the row version, but I am a little confused in the ...
0
votes
3answers
61 views
how to not block parent with waitpid
I need to create a program that creates n number of processes and displays information. When each process ends, I am to print it's PID and the exit status. The way I am doing it, the parent program ...
0
votes
0answers
37 views
How to gather matrix in root 0, only its original rows and cols size that is MyNoofRows and MyNoofcols
How to gather blocks of matrix in root process. I tried using gather with the data type blocktype declared below but it didn't work.
int sqr=sqrt(p);
modval = n % sqr;
divval = n/sqr;
...
0
votes
1answer
403 views
Accelerate a C program using pthreads
I'm new here, and also I'm relatively new in programming in general. I' ve writen a program in C and I need to accelerate it using pthreads. I've tried to do so using OpenMP, but I don't know how to ...
1
vote
1answer
25 views
Gathering and organazing vectors using MPI
I would like to gather data from arrays of double and organize them at the same time. Say we have 2 MPI ranks:
if(rank == 0)
P = {0,1,4,5,8,9};
else
P = {2,3,6,7,10,11};
How could I gather ...
1
vote
1answer
78 views
USRPs parallel control in Matlab
I would like to thank to everyone in ahead for reading this. I have a very specific issue. I need to control three USRPs simultaneously from Matlab. Here is my serial solution:
`frameLength=180;
...
0
votes
1answer
29 views
MPI library - problems saving values on array
I am trying to save values on an array at a process, specifically at number 0. So, I made a condition to save these values if its rank is 0:
int main(int argc, char *argv[])
{
int rank,numprocs;
...
0
votes
1answer
42 views
OpenMP not working in C
I'm using Mac OS X and followed the directions here (http://hpc.sourceforge.net) to install gcc.
I have the following simple program in C:
#include <stdio.h>
#include <stdlib.h>
#include ...
0
votes
1answer
86 views
Parallel for loops in MPI?
I've never used MPI before nor taken a formal course on parallel programming. I'm an applied math student working on a large project that consists of a series of for loops. In each for loop, the ...
1
vote
2answers
64 views
Parallel programming in C with no threads or high-level libraries [closed]
I'm playing a bit with parallel programming in C; Hence whatever solution I see in the articles I'm reading are built on top of Threads or stuff like OpenMP, MPI, Select on Windows or Fork on *nix; I ...
0
votes
2answers
49 views
Doing a section with one thread and a for-loop with multiple threads
I am using OpenMP and I want to spawn threads such that one thread executes one piece of code and finishes, in parallel with N threads running the iterations of a parallel-for loop.
Execution should ...
-1
votes
1answer
94 views
How to safely parallel the for-loop with memcpy inside
I am developing a originally serial code in KSVD package to support OpenMP. The original code, which serves like im2col in MATLAB and extracts patches from the image, is shown as follows:
/* n ...
1
vote
2answers
367 views
Eclipse PTP OpenMPI parallel run/debug
Can someone give instructions on how to run/debug an OpenMPI (C/C++/Fortran) program in Eclipse PTP using the actual parallel run/debug modes on a local machine?
I've set a local connection in the ...
0
votes
2answers
87 views
Why is my MPI program outputting incorrectly
I am a newbie in MPI and I have a homework, I am not asking for you to solve it, I only need a hint on why my program is malfunctioning.
Here is the problem
Write a MPI C program that simulates a ...
0
votes
2answers
63 views
MPI Segmentation fault when using MPI_Bcast
I'm trying to calculate the difference between the speedup and efficiency of broadcasting an array of 1 million integers to all processes using MPI_Bcast and the usual MPI_send and MPI_Recv. But I ...
0
votes
1answer
90 views
How to offload particular thread of a single app to particular Xeon Phi cores?
Suppose I have a single c/c++ app running on the host. there are few threads running on the host CPU and 50 threads running on the Xeon Phi cores.
How can I make sure that each of these 50 runs on ...
3
votes
1answer
148 views
Is there a simulator/emulator of Xeon Phi?
I am going to offload some computation to Xeon Phi but would like to test different APIs and different apporached to the parallel programming first.
Is there a simulator / emulator for Xeon Phi ...
0
votes
1answer
40 views
Why is my MPI program not printing as it is supposed to be
I am trying to let one process handle all the printtf operations so the printing happens in the order i want. I am trying to store the data that process 1 generate and let process 0 print the data ...