Very Basic Query

General OpenMP discussion

Very Basic Query

Postby Rajesh1978 » Mon Jun 24, 2013 5:56 am

Hi,
can open MP be used only in case of loops?

Do open MP have timers associated with threads ( I wanted to compare with ACE thread frame work where Reactors are associated with timers)
Rajesh1978
 
Posts: 5
Joined: Sun Apr 21, 2013 11:21 pm

Re: Very Basic Query

Postby zerothi » Mon Jun 24, 2013 8:08 am

1) No, you can use the "sections" extension which splits serial code into threaded code segments.

2) Yes, and no, I don't see anything wrong with creating an array the size of your threads and save to each thread-ID the timer, in this way you should be able to get the thread time (however, I have never tried this)
zerothi
 
Posts: 3
Joined: Fri Jun 07, 2013 12:25 pm

Re: Very Basic Query

Postby MarkB » Mon Jun 24, 2013 9:32 am

zerothi wrote:1) No, you can use the "sections" extension which splits serial code into threaded code segments.


There is also a task-based model in OpenMP (the task directive), or you can program threads fairly directly using a parallel region, synchronisation constructs and runtime library routines.

zerothi wrote:2) Yes, and no, I don't see anything wrong with creating an array the size of your threads and save to each thread-ID the timer, in this way you should be able to get the thread time (however, I have never tried this)


This would work fine: OpenMP threads are not explicitly objects, and they have no timer associated with them, but you can use the omp_get_wtime() routine to create you own timer data structures.
MarkB
 
Posts: 428
Joined: Thu Jan 08, 2009 10:12 am

Re: Very Basic Query

Postby Rajesh1978 » Tue Jun 25, 2013 1:14 am

Timers I mean for to handle the timeouts.
Suppose you associate a thread with timer and set the timeout to 30.
So after each 30 second the time out will happen and a particular task can be done at that timeout.

Is there anything like this in OMP.
Rajesh1978
 
Posts: 5
Joined: Sun Apr 21, 2013 11:21 pm

Re: Very Basic Query

Postby MarkB » Tue Jun 25, 2013 3:26 am

Rajesh1978 wrote:Timers I mean for to handle the timeouts.
Suppose you associate a thread with timer and set the timeout to 30.
So after each 30 second the time out will happen and a particular task can be done at that timeout.

Is there anything like this in OMP.


No, OpenMP has no features like that.
MarkB
 
Posts: 428
Joined: Thu Jan 08, 2009 10:12 am


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests

cron