* [Xenomai-help] Xenomai and OpenMP
@ 2009-03-06 15:27 M. Koehrer
2009-03-06 15:34 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: M. Koehrer @ 2009-03-06 15:27 UTC (permalink / raw)
To: xenomai
Hi everybody,
is it possible to use OpenMP with Xenomai Realtime threads?
I have a Intel QuadCore CPU running. Currently I use the native skin to create multiple threads to run on multiple CPU cores.
That works perfectly.
However for some computations, a more local parallel computation could be great.
And OpenMP provides exactly the right thing here.
My question is now: Is it possible to use OpenMP with Xenomai real time tasks?
How can I define the worker threads of OpenMP to be real time threads? What about the priority of these threads?
Thanks for all feedback on this questions.
Regards
Mathias
--
Mathias Koehrer
mathias_koehrer@domain.hid
Erwischt! Bei Arcor sehen Sie die besten Promi-Bilder riesengroß und in Top-Qualität. Hier finden Sie die schönsten Schnappschüsse auf dem roten Teppich, lernen die Frauen des Womanizers Boris Becker kennen und schauen den Royals ins Wohnzimmer. Viel Spaß auf Ihrer virtuellen Reise durch die Welt der Stars und Sternchen: http://vip.arcor.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Xenomai and OpenMP
2009-03-06 15:27 [Xenomai-help] Xenomai and OpenMP M. Koehrer
@ 2009-03-06 15:34 ` Gilles Chanteperdrix
2009-03-06 16:26 ` Eric Noulard
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-06 15:34 UTC (permalink / raw)
To: M. Koehrer; +Cc: xenomai
M. Koehrer wrote:
> Hi everybody,
>
> is it possible to use OpenMP with Xenomai Realtime threads? I have a
> Intel QuadCore CPU running. Currently I use the native skin to create
> multiple threads to run on multiple CPU cores. That works perfectly.
> However for some computations, a more local parallel computation
> could be great. And OpenMP provides exactly the right thing here. My
> question is now: Is it possible to use OpenMP with Xenomai real time
> tasks? How can I define the worker threads of OpenMP to be real time
> threads? What about the priority of these threads?
I do not know what OpenMP is, but if it uses the posix API, the first
step to make it work with Xenomai is to try and compile it with xenomai
posix skin. Then, all threads created by this openmp compiled for
xenomai posix skin will be real-time threads, and the priority of these
threads will be the one chosen by the pthread_att_setschedparam or
pthread_setschedparam services.
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Xenomai and OpenMP
2009-03-06 15:34 ` Gilles Chanteperdrix
@ 2009-03-06 16:26 ` Eric Noulard
2009-03-06 16:41 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Eric Noulard @ 2009-03-06 16:26 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai, M. Koehrer
2009/3/6 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>:
> M. Koehrer wrote:
>> Hi everybody,
>>
>> is it possible to use OpenMP with Xenomai Realtime threads? I have a
>> Intel QuadCore CPU running. Currently I use the native skin to create
>> multiple threads to run on multiple CPU cores. That works perfectly.
>> However for some computations, a more local parallel computation
>> could be great. And OpenMP provides exactly the right thing here. My
>> question is now: Is it possible to use OpenMP with Xenomai real time
>> tasks? How can I define the worker threads of OpenMP to be real time
>> threads? What about the priority of these threads?
>
> I do not know what OpenMP is,
OpenMP is a proposed standard for shared-memory parallel programming:
http://openmp.org.
The idea is to indicate to the OpenMP-aware compiler which part
of your code may be parallelized with #pragma omp <something>
those pragma should be ignored by non OpenMP-aware compiler
making the parallelized code more portable.
GCC 4.2 and up support OpenMP pragma if you use the
-fopenmp
command line switch.
> but if it uses the posix API, the first
> step to make it work with Xenomai is to try and compile it with xenomai
> posix skin. Then, all threads created by this openmp compiled for
> xenomai posix skin will be real-time threads, and the priority of these
> threads will be the one chosen by the pthread_att_setschedparam or
> pthread_setschedparam services.
The OpenMP parallel model concerning threads is a so-called
fork/join model. The compiler insert the code that
creates the threads (and eventually join them)
at appropriate places for you.
The work is then distributed to those "worker" threads.
The code use to handle those mechanism is NOT under user control,
user only insert OpenMP pragmas.
In GCC there is a supporting library "libgomp" used:
http://gcc.gnu.org/viewcvs/trunk/libgomp/
the lib seems to be using pthread, but this as to be checked carefully.
Thus I would bet that somewhere in libgomp you'll find the pthread_xxxx
calls corresponding to the OpenMP handled threads.
I think in order to make the OpenMP thread Xenomai one's you'll have
to find WHERE (in the libgomp code) they are created and may
WHEN they are launched, in order to be sure the libgomp created
threand will be Xenomai tasks.
The solution used by other compiler to support OpenMP may be different,
so the Xenomai+OpenMP support may be different for other compiler.
--
Erk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Xenomai and OpenMP
2009-03-06 16:26 ` Eric Noulard
@ 2009-03-06 16:41 ` Gilles Chanteperdrix
0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-06 16:41 UTC (permalink / raw)
To: Eric Noulard; +Cc: xenomai, M. Koehrer
Eric Noulard wrote:
> 2009/3/6 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>:
>> M. Koehrer wrote:
>>> Hi everybody,
>>>
>>> is it possible to use OpenMP with Xenomai Realtime threads? I have a
>>> Intel QuadCore CPU running. Currently I use the native skin to create
>>> multiple threads to run on multiple CPU cores. That works perfectly.
>>> However for some computations, a more local parallel computation
>>> could be great. And OpenMP provides exactly the right thing here. My
>>> question is now: Is it possible to use OpenMP with Xenomai real time
>>> tasks? How can I define the worker threads of OpenMP to be real time
>>> threads? What about the priority of these threads?
>> I do not know what OpenMP is,
>
> OpenMP is a proposed standard for shared-memory parallel programming:
> http://openmp.org.
>
> The idea is to indicate to the OpenMP-aware compiler which part
> of your code may be parallelized with #pragma omp <something>
> those pragma should be ignored by non OpenMP-aware compiler
> making the parallelized code more portable.
>
> GCC 4.2 and up support OpenMP pragma if you use the
> -fopenmp
> command line switch.
>
>> but if it uses the posix API, the first
>> step to make it work with Xenomai is to try and compile it with xenomai
>> posix skin. Then, all threads created by this openmp compiled for
>> xenomai posix skin will be real-time threads, and the priority of these
>> threads will be the one chosen by the pthread_att_setschedparam or
>> pthread_setschedparam services.
>
> The OpenMP parallel model concerning threads is a so-called
> fork/join model. The compiler insert the code that
> creates the threads (and eventually join them)
> at appropriate places for you.
> The work is then distributed to those "worker" threads.
> The code use to handle those mechanism is NOT under user control,
> user only insert OpenMP pragmas.
>
> In GCC there is a supporting library "libgomp" used:
> http://gcc.gnu.org/viewcvs/trunk/libgomp/
>
> the lib seems to be using pthread, but this as to be checked carefully.
> Thus I would bet that somewhere in libgomp you'll find the pthread_xxxx
> calls corresponding to the OpenMP handled threads.
>
> I think in order to make the OpenMP thread Xenomai one's you'll have
> to find WHERE (in the libgomp code) they are created and may
> WHEN they are launched, in order to be sure the libgomp created
> threand will be Xenomai tasks.
>
> The solution used by other compiler to support OpenMP may be different,
> so the Xenomai+OpenMP support may be different for other compiler.
if the libgomp uses posix, recompiling it for xenomai posix skin should
be enough.
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-06 16:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-06 15:27 [Xenomai-help] Xenomai and OpenMP M. Koehrer
2009-03-06 15:34 ` Gilles Chanteperdrix
2009-03-06 16:26 ` Eric Noulard
2009-03-06 16:41 ` Gilles Chanteperdrix
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.