General Discussions

High Performance Computing – CPUFreak91

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
What kinds of HPC projects have you guys worked on? Have you used any code that makes use of the omp atomic mode (prevents the OS from interrupting the thread) in C++ or an equivalent in a different language? What have you used them for?

#pragma omp atomic
{
/* Do stuff */
}

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Any fool can know, the point is to understand. -- Albert Einstein

My Programming and Hacker/Geek related Blog

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
I have not. That reminds me of early computing when you could write a program that would cause the monitor to refresh too fast and actually physically melt because it got too hot.
PFC

Member

Posts: 29
From: Canada
Registered: 10-16-2007
hmm....
not too sure what that does?
when would you want to use that?

------------------
Heart of a Warrior

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by pfc:
hmm....
not too sure what that does?
when would you want to use that?


Atomic mode could be used for something like I/O or some critical calculation that you don't want interrrupted by the OS.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Any fool can know, the point is to understand. -- Albert Einstein

My Programming and Hacker/Geek related Blog

supercoder

Member

Posts: 37
From:
Registered: 08-20-2007
i would think this would have to be compiled into the kernel, I don't think most os's would allow this, do you know what os supports it?

my prof mentioned a real-time os (unlike ms, linix, unix, mac, etc..) that runs the linux os as just a user process (kinda treats it like a program). so you are presented with the linux os to do all your developement and use it as normal. but since behind the scene you have the REAL os, which you can send your time critical code to run on you get real-time perks like guaranteed execution times, which other os's cannot give.

I found an article on the real time os
http://www.linuxjournal.com/article/232

------------------
>>>--supercoder--<<<

[This message has been edited by supercoder (edited December 07, 2007).]

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by supercoder:
i would think this would have to be compiled into the kernel, I don't think most os's would allow this, do you know what os supports it?


No I'm not sure. The more I look around, the more I see a lack of evidence that supports this (or maybe it's because i'm not too familiar with multithreaded programming.
I did find this:
Synchronization clauses
critical section: the enclosed code block will be executed by all threads but only one thread at a time, not simultaneously executed. It is often used to protect shared data from race condition.
atomic: similar to critical section, but advise the compiler to use special hardware instructions for better performance. Compilers may choose to ignore this suggestion from users and use critical section instead.
ordered: the structure block is executed in the order in which iterations would be executed in a sequential loop
barrier: each thread waits until all of the other threads of a team have reached this point. A work-sharing construct has an implicit barrier synchronization at the end.
nowait: specifies that threads completing assigned work can proceed. In the absence of this clause, threads would encounter a barrier synchronization at the end of the work sharing construct by default.

I wonder if "special hardware instructions for better performance" means the OS can't interrupt it. (Since performance decreases every time the OS interrupts the thread).

[/B][/QUOTE]
my prof mentioned a real-time os (unlike ms, linix, unix, mac, etc..) that runs the linux os as just a user process (kinda treats it like a program). so you are presented with the linux os to do all your developement and use it as normal. but since behind the scene you have the REAL os, which you can send your time critical code to run on you get real-time perks like guaranteed execution times, which other os's cannot give.
[/B][/QUOTE]
That's interesting (thanks for the link). There are 3 current day implementations of Real-Time Linux:

I wonder how the atomic synchronization clause works on these kernels/kernel extensions.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Any fool can know, the point is to understand. -- Albert Einstein

My Programming and Hacker/Geek related Blog

[This message has been edited by CPUFreak91 (edited December 12, 2007).]