LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   codes run slower on the faster machine (https://www.linuxquestions.org/questions/programming-9/codes-run-slower-on-the-faster-machine-57813/)

xudeyong 05-02-2003 08:25 AM

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

mcleodnine 05-02-2003 08:54 AM

Moved to the Programming forum.

wapcaplet 05-02-2003 09:03 AM

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 :) )

kenulla 05-02-2003 10:29 AM

many possibilities, process of elimination may help.

crashmeister 05-02-2003 10:49 AM

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.

xudeyong 05-02-2003 01:40 PM

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

xudeyong 05-02-2003 01:44 PM

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

Shak 05-03-2003 03:39 AM

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

nakkaya 05-03-2003 03:02 PM

http://freshmeat.net/articles/view/730/ take a look at this article there is part for optimizizng for diffrent processsors

crashmeister 05-03-2003 03:08 PM

Thanks a lot - whats in there about xeon cpu's?

nakkaya 05-03-2003 03:27 PM

a option to optimez code for xenon

crashmeister 05-03-2003 03:35 PM

Sorry - I am slow.What is in there about xeon cpu's????

nakkaya 05-03-2003 05:09 PM

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


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