openmp

Is there a way that OpenMP can operate on Qt spanwed threads?

I'm trying to parallelize a number-crunching part of an application to make use of a quad-core architecture using OpenMP and GCC 4.2 on Mac OS 10.5. But what I think the problem is that this application uses Qt for the GUI and I'm trying to fork the worker threads on a secondary thread created by Qt which causes the program to crash - bu...

OMPTL in Visual Studio?

I was trying to use the OMPTL in Visual Studio. As far as I understand it, I only need to set the /openmp option, in order for the OMPTL to use the multi-threaded implementation of some stl functions. When I don't use /openmp everything is fine and OMPTL maps the functions to their normal stl counter parts, without multi-threading. With...

Linking problem using OpenMp with ctypes.

Hi there, I have a c99 function that uses openmp, which works as expected. I also wrote a ptyhon interface using ctypes which causes the problem. Ctypes/python can not find the library for openmp. Here is the error massage: File "foo.py", line 2, in <module> foobar=cdll.LoadLibrary("./libfoo.so") File "/usr/lib/python2.6/ctypes/_...

OpenMP - executing threads on chunks

Hi, I have the following piece of code, which I want to make parallel in a certain way. I am making a mistake, and hence not all threads are running the loop as I thought it should. It would be great if somebody could help me out identifying that mistake. This is a code to calculate histograms. #pragma omp parallel default(shared) pri...

OpenMP, C++ and Iterators.

To loop over elements of a container, I would typically use an iterator, like so: container<type> myContainer; // fill up the container container<type>::iterator it; for(it=myContainer.begin(); it!=myContainer.end(); ++it) { //do stuff to the elements of the container } Now, if I want to parallelize the loop using OpenMP, I might t...

Multiple levels of parallelism using OpenMP - Possible? Smart? Practical?

I am currently working on a C++ sparse matrix/math/iterative solver library, for a simulation tool I manage. I would have preferred to use an existing package, however, after extensive investigation, none were found that were appropriate for our simulator (we looked at flens, it++, PetSC, eigen, and several others). The good news is my...

OpenMP & MPI explanation

A few minutes ago I stumbled upon some text, which reminded me of something that has been wondering my mind for a while, but I had nowhere to ask. So, in hope this may be the place, where people have hands on experience with both, I was wondering if someone could explain what is the difference between OpenMP and MPI ? I've read the Wik...

Using openMP in the cuda host code?

It it possible to use openMP pragmas in the CUDA-Files (not in the kernel code)? I will combine gpu and cpu computation. But nvvc compiler fails with "cannot find Unknown option 'openmp' ", if i am linking the porgram with a opnemp option (under linux) A wayaround is to use openMP-statments only in c/c++ files. ...

C++ OpenMP variable visibility in parallel tasks

Don't understand, where do I get this wrong. If compiled without openmp support, the code works correctly. But with openmp variables seem to get wrong visibility. I had the following intention. Each thread has its own max_private in which it finds the local maximum. Then a global maximum is found in a critical section. #include <iostre...

variable "undeclared" in "#pragma" command?

I'm compiling a branch of the Blender 3D modeling program from source (using SCONS), on a Fedora 8 box, and am running into an error that I didn't encounter compiling the same source on a CentOS 5 box, and I'm thinking it has to do with the variable definition. The error is: source/blender/blenkernel/intern/implicit.c: In function ‘mul_...

OpenMP error message

I got the following output with error message while executing the program that uses openmp in VS2008 C++ thread number: 0 thread number: 1 Fatal User Error 1002: 'for' loop executed with inconsistent parameters between threads My program does the following: omp_set_dynamic(0); omp_set_num_threads(2); int i = 0; int st...

Problem with the timmings of a program that uses 1-8 threads on a server that has 4 Dual Core Cpu's?

Hello, I am runig a program on a server at my university that has 4 Dual-Core AMD Opteron(tm) Processor 2210 HE and the O.S. is Linux version 2.6.27.25-78.2.56.fc9.x86_64. My program implements Conways Game of Life and it runs using pthreads and openmp. I timed the parrallel part of the program using the getimeofday() function using 1-8...

Can't bring Java window to front when busy

Hi! I have written an image processing application with the GUI part written in Java and the number crunching part is written in C and is called via JNI. My problem is that it takes 20 - 30 seconds for the application to process an image, and during this time the application disappears from the Task Switcher (the Alt-Tab thingy) and it...

Openmp usage in C++ object constructors

Hello Can I use openmp in C++ objects' constructors? What will be done, when there will be a global static object with such constructor? ...

How not to wait for other threads in OpenMP?

Hi I am considering using OpenMP for multithreading in C++. But I wonder if there is a way tell a thread not to wait for other concurrent thread and continue with my program? (Maybe I can cancel/kill other threads?) I am aware of the existence of "nowait" clause, but I want the decision of "wait" or "not to wait" to be done dynamically...

Using the boost random number generator with OpenMP

I would like to parallelize my boost random number generator code in C++ with OpenMP. I'd like to do it in way that is both efficient and thread safe. Can someone give me pointers on how this is done? I am currently enclosing what I have below; this is clearly not thread safe since the static variable in the sampleNormal function is like...

boost or openMP for multithreading?

Hi, i have to parallize some code and a fried of mine suggested using boost for it. Right now i have a look into openMP and i am wondering what you think is better for that task. ...

Debugging multithreaded code with gdb but no access to private variables?

Hey guys. My program uses OpenMP at a few parts to do multithreading. It works for the most part, but occasionally stalls and just sits there. So I run it in the debugger, and I find the area it is stalling at. Then I try to examine the current variables, and I get this: 169 if(0<=myPtr[3] && myPtr[3]<=1){//Reassign the velocities....

using openmp with a makefile and g++

I am building a large project with a makefile that was originally built with icpc, and now I need to get it running with g++. When it compiles the file that uses openmp, it uses the -c flag, and doesn't use any libraries, so it ends up being serial instead of openmp. All of the examples I am seeing aren't using this -c flag. Is there s...

What is OpenMP?

What's a high-level description of OpenMP? The Wikipedia article states that "OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform shared memory multiprocessing programming in C, C++ and Fortran on many architectures, including Unix and Microsoft Windows platforms. It consists of a se...