LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-02-2003, 08:25 AM   #1
xudeyong
LQ Newbie
 
Registered: May 2003
Posts: 5

Rep: Reputation: 0
codes run slower on the faster machine


Hi everyone,

We have same codes run the two machine(both linux): Pentium III 1.0GHZ and Xeon 1.8GHZ, and we expect to see faster run on Xeon machine since it has faster CPU and more memory.

1 Our code is Fortran code, we use f2c to convert the codes to C codes first, then use GCC to compile them. Codes run well on both machines, but it just runs slower on the faster machine(Xeon 1.8GHZ).

2 Then we use G77 to compile and link, there is no error when we do so, but we get incorrect results on both machines.

3 When we test some very simple codes on both machines compiled by G77 or GCC with f2c, the results show that :
codes run faster on faster machine(Xeon1.8GHZ) if compiled by G77, otherwise they run slower on faster machine(Xeon1.8GHZ) if compiled by GCC with f2c.

Is something wrong with software or CPU structure ??

Deyong
 
Old 05-02-2003, 08:54 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Moved to the Programming forum.
 
Old 05-02-2003, 09:03 AM   #3
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Might be because clock speed is not everything. Not being too familiar with architectures, it'd be hard to say why it's faster on one of them - it depends a lot on what kind of code it is. Cache size could make a huge (order of magnitude) difference if you're doing a lot of memory references, for example. If you have a program that does lots of memory I/O, a 1Mhz processor with a nice big L1/L2 cache will perform faster than a 2Ghz processor with no cache.

So in a way, you may be comparing apples with oranges (or with Intels )
 
Old 05-02-2003, 10:29 AM   #4
kenulla
LQ Newbie
 
Registered: Apr 2003
Posts: 13

Rep: Reputation: 0
many possibilities, process of elimination may help.
 
Old 05-02-2003, 10:49 AM   #5
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Do you use any flags to compile with gcc?
I wouldn't even know which ones to use for a xeon cpu.Information about xeon and gcc is sketchy at best.
 
Old 05-02-2003, 01:40 PM   #6
xudeyong
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
No flag specified when I compile them, but i don't know if they have default flags for gcc. as I said, when testing on small simple code, faster machine is faster.

i just compile them like below

f2c -ARw8 -a -Nn802 -Nx400 eee.f // get eee.c
gcc -c eee.c
gcc -o eee.k eee.o
 
Old 05-02-2003, 01:44 PM   #7
xudeyong
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
1 Here is the memory information for Xeon machine:


total: used: free: shared: buffers: cached:
Mem: 3901734912 3860303872 41431040 0 279900160 3145240576
Swap: 2097405952 0 2097405952
MemTotal: 3810288 kB
MemFree: 40460 kB
MemShared: 0 kB
Buffers: 273340 kB
Cached: 3071524 kB
SwapCached: 0 kB
Active: 1193668 kB
Inact_dirty: 1765368 kB
Inact_clean: 607340 kB
Inact_target: 713272 kB
HighTotal: 2949056 kB
HighFree: 1220 kB
LowTotal: 861232 kB
LowFree: 39240 kB
SwapTotal: 2048248 kB
SwapFree: 2048248 kB
Committed_AS: 41956 kB


2 Here is memroy information for Pentium III machine:

total: used: free: shared: buffers: cached:
Mem: 1585274880 1538879488 46395392 0 273469440 1156812800
Swap: 2097405952 647168 2096758784
MemTotal: 1548120 kB
MemFree: 45308 kB
MemShared: 0 kB
Buffers: 267060 kB
Cached: 1129656 kB
SwapCached: 44 kB
Active: 757132 kB
Inact_dirty: 645680 kB
Inact_clean: 35588 kB
Inact_target: 287680 kB
HighTotal: 655352 kB
HighFree: 15364 kB
LowTotal: 892768 kB
LowFree: 29944 kB
SwapTotal: 2048248 kB
SwapFree: 2047616 kB
Committed_AS: 90624 kB
 
Old 05-03-2003, 03:39 AM   #8
Shak
Member
 
Registered: May 2002
Location: Huddersfield
Distribution: Redhat (7.2, 7.3, 8.0), Debian, Slackware, Gentoo, FreeBSD
Posts: 169

Rep: Reputation: 30
Maybe using the Intel (I believe it may be non-free, I got a free copy on a magazine a while ago) may make a difference? I'm not sure it will make a difference but it might be worth a try if you're really bothered

Shak
 
Old 05-03-2003, 03:02 PM   #9
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
http://freshmeat.net/articles/view/730/ take a look at this article there is part for optimizizng for diffrent processsors
 
Old 05-03-2003, 03:08 PM   #10
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Thanks a lot - whats in there about xeon cpu's?
 
Old 05-03-2003, 03:27 PM   #11
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
a option to optimez code for xenon
 
Old 05-03-2003, 03:35 PM   #12
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Sorry - I am slow.What is in there about xeon cpu's????
 
Old 05-03-2003, 05:09 PM   #13
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
i am just telling him/her to use that option maybe he/she will have faster codes
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux faster or slower? Dummy-in-Linux Linux - Newbie 5 10-17-2004 11:26 PM
Best linux setup for a slower machine? Acelius Linux - Laptop and Netbook 16 08-13-2004 09:56 PM
Would slackware make my machine faster? engnyr Slackware 8 09-02-2003 08:07 PM
ADSL slower in Linux, faster in Windzo linuxfond Linux - Newbie 4 07-19-2003 08:51 AM
Dialup from RH72 slower than from Win2K on same machine ellisdodge Linux - Networking 4 08-09-2002 11:39 AM


All times are GMT -5. The time now is 04:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration