Is OpenMP Event Driven

General OpenMP discussion

Is OpenMP Event Driven

Postby nishudesh » Fri Jul 11, 2008 4:37 am

Hi all,

Sorry my previous message went in as a Guest ... Kindly reply to this thread

I have an application which is using shared memory region across various processes. Data enters through point A, it verifies data and puts into the shared memory which is read by other program B. The problem is program B is reading after a specific interval based on a timer. In reading it has to verify whether the data is available or not, if yes then continue, if no then go back to sleep. Even if I go in a while loop my memory CPU utilization goes high, if I go for timer based approach it causes an unnecessary delay. So I have decided to switch it onto a event driven model which is really giving me a good performance in terms of latency and CPU. I have come across OpenMP and would like to know whether OpenMP will fulfill my following expectations.

1) A thread/process are able to share data across multiple shared memories.
2) A thread/process is notified when a data has been inserted into shared memory (across multiple shared memory).

Also can anyone tell me how OpenMP has some other features which can really help me in the above mentioned scenarios?

Re: Is OpenMP Event Driven

Postby wirawan0 » Tue Jul 15, 2008 9:09 am

I am pretty sure that OpenMP is not an event-based programming facility. It is a simplified way for us to do "parallel programming" on a shared memory architecture (CMIIW). The point is that you have a single program who has parts that can be parallelized. This is primarily true for loops (especially loops that takes a long time to evaluate in each iteration). There is also function parallelization in OpenMP that you can use to perform different functions in parallel (somewhat like what you described below), yet it is not quite what you are looking for. One thing to remember is that OpenMP program is basically a single program, with certain subtasks in it done in parallel.

From your posting it seems like you have two programs talking to each other. You may want to use shared memory (shm) facility for this purpose. Regarding the notification event, I am not sure how to proceed. Others may help with that.

Re: Is OpenMP Event Driven

Postby Hello World » Wed Aug 13, 2008 11:16 pm

OpenMP is not event driven. However, if you like, you can develop a tool for event driven in OpenMP. However, it may be not worth due to overhead.

The alternative is to apply system call (or system API) for "event driven". "Parallel event" is a component for supercomputing in 80s and 90s. Paralle event is a useful concept. People still use it, but not in OpenMP. For example, the site ... putingblog

uses parallel event to develop highly efficient parallel packages.
Hello World

Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 2 guests