openmp

What is easier to learn and debug OpenMP or MPI?

与世无争的帅哥 提交于 2019-12-21 16:18:12
问题 I have a number crunching C/C++ application. It is basically a main loop for different data sets. We got access to a 100 node cluster with openmp and mpi available. I would like to speedup the application but I am an absolut newbie for both mpi and openmp. I just wonder what is the easiest one to learn and to debug even if the performance is not the best. I also wonder what is the most adequate for my main loop application. Thanks 回答1: If your program is just one big loop using OpenMP can be

Why must loop variables be signed in a parallel for?

北慕城南 提交于 2019-12-21 12:30:47
问题 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 "the iteration variable must be a signed integer." Is this also true in the GCC implementation? Is it specified in the OpenMP standard? If so, is there a reason for this requirement? (It doesn't matter much as the expected dimensions are far smaller than INT_MAX , but it does cost me some casts.

Is grouping parallelised in data.table 1.12.0?

烂漫一生 提交于 2019-12-21 09:34:10
问题 In the changelog of data.table v1.12.0 I noticed the following: Subsetting, ordering and grouping now use more parallelism I tested if I could speed-up some grouping but without any success. I made several different tests and I always get identical results. Is grouping actually parallelised? Maybe I do not properly use the thread options? As you can see data.table has been compiled with openmp otherwise setDTthread print a message to tell the user that there is no support of openmp . Here a

c++: OpenMP and non-random-access STL containers - a possible workaround

自作多情 提交于 2019-12-21 09:16:11
问题 So on SO, and the Internets in general, there is much confusion and frustration about how to make OpenMP's easy-to-use #pragma directives cooperate with C++'s equally easy-to-use STL containers. Everyone talks about work-arounds for STL vector , but what about non-random access / bi-directional containers, like map , list , set , etc. ? I encountered this problem and devised a very simple, obvious workaround. I present it here for STL map , but it is clearly generalizable. Serial version: for

What is the benefit of '#pragma omp master' as opposed to '#pragma omp single'?

℡╲_俬逩灬. 提交于 2019-12-21 07:25:40
问题 In OpenMP any code inside a #pragma omp master directive is executed by a single thread (the master), without an implied barrier at end of the region. (See section on MASTER directive in the LLNL OpenMP tutorial). This seems equivalent to #pragma omp single nowait (with the exception that rather than the 'master', any thread may execute the single region). Under what circumstances, if any, is it beneficial to use #pragma omp master ? 回答1: Though a single nowait construct is most of the time

Producer-Consumer using OpenMP-Tasks

半腔热情 提交于 2019-12-21 05:02:32
问题 I'm trying to implement a parallel algorithm using tasks within OpenMP. The parallel programming pattern is based on the producer-consumer idea, but since the consumer process is slower than the producer, I want to use a few producers and several consumers. The main idea is to create as many OS threads as producers and then each of these will create tasks to be done in parallel (by the consumers). Every producer will be associated with a proportional number of consumers (i.e numCheckers

Using openMP to get the index of minimum element parallelly

与世无争的帅哥 提交于 2019-12-21 02:34:35
问题 I tried to write this code float* theArray; // the array to find the minimum value int index, i; float thisValue, min; index = 0; min = theArray[0]; #pragma omp parallel for reduction(min:min_dist) for (i=1; i<size; i++) { thisValue = theArray[i]; if (thisValue < min) { /* find the min and its array index */ min = thisValue; index = i; } } return(index); However this one is not outputting correct answers. Seems the min is OK but the correct index has been destroyed by threads. I also tried

Does Qt support OpenMP?

五迷三道 提交于 2019-12-20 21:41:06
问题 I am using OpenMP in my Visual Studio projects and currently thinking very seriously in changing to QT creator. (Doesn't Visual Studio suck?,I expect much more from Microsoft) But anyway... Does QT creator support OpenMP? In case of that, what should I do to enable it? Or maybe is enabled by default? Do I need to do something special? Thanks for your advices. Ignacio. 回答1: Does QT creator support OpenMP? As someone else mentioned, it's not Qt itself that support OpenMP but the compiler. What

openmp parallel for loop with two or more reductions

柔情痞子 提交于 2019-12-20 18:32:16
问题 Hi just wondering if this is the right way to go going about having a regular for loop but with two reductions , is this the right approach below? Would this work with more then two reductions as well. Is there a better way to do this? also is there any chance to integrate this with an MPI_ALLREDUCE command? heres the psuedo code #pragma omp parallel for \ default(shared) private(i) \ //todo first reduction(+:sum) //todo second reduction(+:result) for loop i < n; i ++; { y = fun(x,z,i) sum +=

openmp parallel for loop with two or more reductions

核能气质少年 提交于 2019-12-20 18:31:04
问题 Hi just wondering if this is the right way to go going about having a regular for loop but with two reductions , is this the right approach below? Would this work with more then two reductions as well. Is there a better way to do this? also is there any chance to integrate this with an MPI_ALLREDUCE command? heres the psuedo code #pragma omp parallel for \ default(shared) private(i) \ //todo first reduction(+:sum) //todo second reduction(+:result) for loop i < n; i ++; { y = fun(x,z,i) sum +=