473,464 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

is it possible to switch on hyperthreading in cc?

Hi,

I am now writing a c-code, which is extremely computational extensive.

My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc
(latest version) to compile with the followings:

cc -c -O3 -mcpu=i686 $(FLIST)

when i run my program, (a.out), it takes a quite a bit of time to finish,
(around 2 hours each run, I need to run through many test cases.)

And i notice that my cpu load is only ~50% when my program is running.

is it possible to do some tricks on cc so that my code will use HT during
runtime?

Thanks.

Carson
Nov 14 '05 #1
4 1869
On Mon, 16 Aug 2004 00:08:28 GMT, "Carson" <ca****@ieee.org> wrote in
comp.lang.c:
Hi,

I am now writing a c-code, which is extremely computational extensive.

My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc
(latest version) to compile with the followings:

cc -c -O3 -mcpu=i686 $(FLIST)

when i run my program, (a.out), it takes a quite a bit of time to finish,
(around 2 hours each run, I need to run through many test cases.)

And i notice that my cpu load is only ~50% when my program is running.

is it possible to do some tricks on cc so that my code will use HT during
runtime?

Thanks.

Carson


There is no such thing as hyperthreading in C. There may or may not
be extensions available from your compiler or operating system, but
they have nothing to do with the standard C language. You need to ask
in a group that supports your compiler/OS combination.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #2
"Carson" <ca****@ieee.org> writes:
I am now writing a c-code, which is extremely computational extensive.

My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc
(latest version) to compile with the followings:

cc -c -O3 -mcpu=i686 $(FLIST)

when i run my program, (a.out), it takes a quite a bit of time to finish,
(around 2 hours each run, I need to run through many test cases.)

And i notice that my cpu load is only ~50% when my program is running.

is it possible to do some tricks on cc so that my code will use HT during
runtime?


That's really not a C language question; it's a question about your
compiler, so we can't help you here.

Cygwin's cc is really gcc. A Google search for "gcc hyperthreading"
might give you something useful. Failing that, try a gcc-specific
mailing list or newsgroup.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #3
In <0W*****************@newssvr21.news.prodigy.com> "Carson" <ca****@ieee.org> writes:
I am now writing a c-code, which is extremely computational extensive.

My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc
(latest version) to compile with the followings:

cc -c -O3 -mcpu=i686 $(FLIST)

when i run my program, (a.out), it takes a quite a bit of time to finish,
(around 2 hours each run, I need to run through many test cases.)

And i notice that my cpu load is only ~50% when my program is running.

is it possible to do some tricks on cc so that my code will use HT during
runtime?


If your CPU load is ~50% when your program is running, chances are that
hyperthreading is already activated and you may want to switch it off.

It is highly unlikely that this can be done with user mode code and
without rebooting your system. Your best chance is to do it with your
BIOS setup program, before booting the system.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #4
"Carson" <ca****@ieee.org> wrote in message
news:0W*****************@newssvr21.news.prodigy.co m...
Hi,

I am now writing a c-code, which is extremely computational extensive.

My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc
(latest version) to compile with the followings:

cc -c -O3 -mcpu=i686 $(FLIST)

when i run my program, (a.out), it takes a quite a bit of time to finish,
(around 2 hours each run, I need to run through many test cases.)

And i notice that my cpu load is only ~50% when my program is running.

is it possible to do some tricks on cc so that my code will use HT during runtime?

Thanks.

Carson


Hyperthreading means that the processor can execute two threads
simultaneously, so one thread only uses 50% of the total CPU capacity while
the other execution unit is idle. Therefore, a single-threaded program can
never use more than 50% CPU. You need to make your application
multi-threaded (two or more threads) in order take full advantage of your
CPU. If you split the computations into two equal parts, you can set off two
threads doing half the work each and the runtime should be close to half the
time.

I have never used cygwin cc so I do not know what kind of multi-threading
support it has. Alternatively, you could run two separate processes doing
half the work each. If it is relatively easy to split the computational
tasks, this solution will be easier to implement than multi-threading.

Dag
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BlackHawke | last post by:
Hello! I have a java application (a game) which is supposed to run as a server. It is on a dedicated machine with MP capabilities, but currently running 1 Xeon processor with hyperthreading. ...
5
by: Garry Hodgson | last post by:
a colleague of mine has seen an odd problem in some code of ours. we initially noticed it on webware, but in distilling a test case it seems to be strictly a python issue. in the real system, it...
1
by: smith | last post by:
I was recently set to release an app that used very common single instance code and hit the oddest issue. After many hours of full build tests I believe that it is duplicatable. Environment: ...
0
by: octaviansen | last post by:
Hi, I am experiencing some weird problems with an ASP.NET web application that is making use of System.Data.DataSet and System.Data.DataRow classes. On a machine with single CPU, the...
4
by: Firdousi Farozan Z | last post by:
Hi All, I have a Java multithreaded application, that makes several JNI calls (native code written in C++). I use database locks all through the C++ code for synchronization. With...
0
by: GeorgeB | last post by:
HI, I created an ASP.NET application which runs on win 2003 server and IIS6 with hyperthreading enabled. I keep getting the following error: Path: /Login.aspx. Source: System.Web at...
1
by: joerg | last post by:
Hello, we investigated a performance-drop while using DB2 V8.1 on a Linux-Server (SuSE - SLES) and Hyperthreading activated. (Dual XEON 2.4 2GB) The intraparallel-option is set and the client...
4
by: TGOS | last post by:
I was thinking about it for a while, a mutex written in C and without disabling any interrupts. Is it possible? typdef struct mutex { unsigned int owner1; unsigend int owner2; } *mutex; ...
1
by: smith | last post by:
I was recently set to release an app that used very common single instance code and hit the oddest issue. After many hours of full build tests I believe that it is duplicatable. Environment: ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.