mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software > Mlucas

Reply
 
Thread Tools
Old 2006-01-15, 16:57   #1
shackan
 
Jan 2006

510 Posts
Default Mlucas problems on Linux Alpha

Hi, this is my first post here.
I was trying to run the Mlucas software on a dual Alpha machine running linux

pd@shell bin $ uname -a
Linux shell 2.4.31 #10 SMP Thu Jul 21 14:49:25 CEST 2005 alpha EV67 GNU/Linux


the first thing I did was downloading the precompiled alpha binary from Ernst Mayer's site: http://www.hogranch.com/mayer/README.html.
Here's where the problems begin:

pd@shell bin $ ls -al Mlucas_alfa
-rwxr-xr-x 1 pd users 1462864 Jan 15 14:10 Mlucas_alfa
pd@shell bin $ Mlucas_alfa
-bash: /home/pd/bin/Mlucas_alfa: cannot execute binary file


even if the file appears to be a regular linux executable

pd@shell bin $ file Mlucas_alfa
Mlucas_alfa: COFF format alpha executable paged not stripped - version 3.13-14


so I tried to compile from source instead, and the following errors arose (I'm using the latest sources from the aforementioned site)

pd@shell Mlucas_src $ gcc -O3 *.c -o Mlucas -lm
radix24_ditN_cy_dif1.c:1376:3: warning: no newline at end of file
/tmp/ccIeycj4.o(.text+0x1898): In function `qfmul':
: undefined reference to `__UMULH'
/tmp/ccIeycj4.o(.text+0x18b8): In function `qfmul':
: undefined reference to `__UMULH'
collect2: ld returned 1 exit status


ps: I don't have the compaq C compiler on this machine.

hopefully somebody here knows what I'm missing (and why the binary refuses to run).

regards,
Paul
shackan is offline   Reply With Quote
Old 2006-01-15, 18:25   #2
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

33×389 Posts
Default

Quote:
Originally Posted by shackan
Hi, this is my first post here.
I was trying to run the Mlucas software on a dual Alpha machine running linux

pd@shell bin $ uname -a
Linux shell 2.4.31 #10 SMP Thu Jul 21 14:49:25 CEST 2005 alpha EV67 GNU/Linux


the first thing I did was downloading the precompiled alpha binary from Ernst Mayer's site: http://www.hogranch.com/mayer/README.html.
Here's where the problems begin:

pd@shell bin $ ls -al Mlucas_alfa
-rwxr-xr-x 1 pd users 1462864 Jan 15 14:10 Mlucas_alfa
pd@shell bin $ Mlucas_alfa
-bash: /home/pd/bin/Mlucas_alfa: cannot execute binary file


even if the file appears to be a regular linux executable

pd@shell bin $ file Mlucas_alfa
Mlucas_alfa: COFF format alpha executable paged not stripped - version 3.13-14


so I tried to compile from source instead, and the following errors arose (I'm using the latest sources from the aforementioned site)

pd@shell Mlucas_src $ gcc -O3 *.c -o Mlucas -lm
radix24_ditN_cy_dif1.c:1376:3: warning: no newline at end of file
/tmp/ccIeycj4.o(.text+0x1898): In function `qfmul':
: undefined reference to `__UMULH'
/tmp/ccIeycj4.o(.text+0x18b8): In function `qfmul':
: undefined reference to `__UMULH'
collect2: ld returned 1 exit status


ps: I don't have the compaq C compiler on this machine.

hopefully somebody here knows what I'm missing (and why the binary refuses to run).

regards,
Paul
Is . in your $PATH ?

What happens if you type "./Mlucas_alfa"

Paul
xilman is offline   Reply With Quote
Old 2006-01-15, 18:54   #3
shackan
 
Jan 2006

5 Posts
Default

Quote:
Is . in your $PATH ?
yes

Quote:
What happens if you type "./Mlucas_alfa"

pd@shell pd $ cd bin
pd@shell bin $ ./Mlucas_alfa
-bash: ./Mlucas_alfa: cannot execute binary file
shackan is offline   Reply With Quote
Old 2006-01-15, 19:30   #4
gribozavr
 
gribozavr's Avatar
 
Mar 2005
Internet; Ukraine, Kiev

11×37 Posts
Default

Maybe, administrator has mounted /home with noexec?
But on x86 I get "permission denied" in that case... maybe alpha is different?
gribozavr is offline   Reply With Quote
Old 2006-01-15, 20:25   #5
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

>Mlucas_alfa: COFF format alpha executable paged not stripped - version 3.13-14

Does Alpha linux use the COFF format for executables? I thought it'd use ELF... but maybe Tru64 uses COFF. Try the file command on a known good executable, i.e. /bin/ls. If that is ELF, you probably have to compile yourself.

Alex

Last fiddled with by akruppa on 2006-01-16 at 07:51
akruppa is offline   Reply With Quote
Old 2006-01-15, 20:54   #6
shackan
 
Jan 2006

516 Posts
Default

yes, probably the file format is at fault, but I can't compile it either (read first post).
shackan is offline   Reply With Quote
Old 2006-01-15, 23:58   #7
shackan
 
Jan 2006

516 Posts
Default

I did it, it took me a minute to spot an (apparent) mistake in the code, the lines:


#elif(defined(__GNUC__))
#define UMULH(x, y) \


(lines 166-167 of qfloat.c), had to be replaced by


#elif(defined(__GNUC__))
#define __UMULH(x, y) \


I'm going to contact the author to see if the problem lies in my build enviroment or in Mlucas.

happy number crunching to everybody!
shackan is offline   Reply With Quote
Old 2006-01-16, 22:29   #8
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

265008 Posts
Default

Quote:
Originally Posted by shackan
I did it, it took me a minute to spot an (apparent) mistake in the code, the lines:


#elif(defined(__GNUC__))
#define UMULH(x, y) \


(lines 166-167 of qfloat.c), had to be replaced by


#elif(defined(__GNUC__))
#define __UMULH(x, y) \


I'm going to contact the author to see if the problem lies in my build enviroment or in Mlucas.
Indeed, it's a bug in the source - I didn't do a gcc build on Alpha/Linux prior to the last source release, since I've never found gcc to do a decent job at generating optimized code. I've made sure the above bug is not present in the code that will go into the Mlucas 3.0 release.

As for your situation, did the code build and run through self-tests (Mlucas -s m) successfully once you patched the above problem? If so, could you post the resulting mlucas.cfg file (just the FFT-length/timing lines at bottom) and your basic system specs? You can compare those data to the ones I give for Alpha on the README page to gauge how much performance gcc may be leaving on the table, as it were.

Lastly, if you have any way of getting a 30-day trial license for the DEC/Compaq/HP C compiler I would recommend that, since you're likely to get a much better-performing binary from it.

People more versed in the issue of exe-file formats will have to address that - the prebuilt binaries I posted for Alpha seem to run on most of the major linux distribs, but there are some (BSD, and yours - which distrib are you running, BTW? Your uname -a output doesn't tell me anything about the precise flavor of Linux) that apparently expect a different binary file format.
ewmayer is offline   Reply With Quote
Old 2006-01-17, 19:07   #9
shackan
 
Jan 2006

5 Posts
Default

Thanks for your answer,
self tests worked fine, here are the timings

Quote:
576 0 # sec/iter = 0.113; radices = 9 8 16 16 16
640 0 # sec/iter = 0.127; radices = 5 16 16 16 16
704 0 # sec/iter = 0.160; radices = 11 8 16 16 16
768 0 # sec/iter = 0.150; radices = 6 16 16 16 16
832 0 # sec/iter = 0.192; radices = 13 8 16 16 16
896 0 # sec/iter = 0.187; radices = 7 16 16 16 16
960 0 # sec/iter = 0.214; radices = 15 8 16 16 16
1024 0 # sec/iter = 0.207; radices = 8 8 8 8 8 16
1152 0 # sec/iter = 0.242; radices = 9 8 8 8 8 16
1280 0 # sec/iter = 0.271; radices = 10 8 8 8 8 16
1408 0 # sec/iter = 0.338; radices = 11 8 8 8 8 16
1536 0 # sec/iter = 0.323; radices = 12 8 8 8 8 16
1664 0 # sec/iter = 0.407; radices = 13 8 8 8 8 16
1792 0 # sec/iter = 0.407; radices = 14 8 8 8 8 16
1920 0 # sec/iter = 0.456; radices = 15 8 8 8 8 16
2048 0 # sec/iter = 0.444; radices = 8 8 8 8 16 16
and comparing with your results, the gcc's binary seems TWICE as slow?! Heck I knew gcc wasn't the best at optimizing (caveat: maybe some compiler switch could have helped a bit, I just used a plain '-O3'), but this is really bad, especially considering the hardware setup seems similar..

Code:
pd@shell mlucas $ cat /proc/cpuinfo
cpu                     : Alpha
cpu model               : EV67
cpu variation           : 7
cpu revision            : 0
cpu serial number       :
system type             : Tsunami
system variation        : Catamaran
system revision         : 0
system serial number    : AY12214322
cycle frequency [Hz]    : 666666666
timer frequency [Hz]    : 1024.00
page size [bytes]       : 8192
phys. address bits      : 44
max. addr. space #      : 255
BogoMIPS                : 1204.44
kernel unaligned acc    : 0 (pc=0,va=0)
user unaligned acc      : 6 (pc=12001b358,va=11fffbef4)
platform string         : COMPAQ AlphaServer DS20E 666 MHz
cpus detected           : 2
cpus active             : 2
cpu active mask         : 0000000000000003
Maybe your version is using _both_ cpus (and therefore the twofold speed improvement) ? But since Mlucas is not a multithreaded application (afaik), I highly doubt this is the case...

As for the last question this machine runs Gentoo (well, not the best choice if you ask me...) and apparently it refuses to run every executable but ELF-format files. Since it's unlikely for me to get a copy of ccc, what about shipping the binary as an ELF file along with the COFF executable for TruUnix ?

thanks again,
regards

Last fiddled with by shackan on 2006-01-17 at 19:08
shackan is offline   Reply With Quote
Old 2006-01-17, 20:04   #10
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

26×181 Posts
Default

Thanks for the timings, shackan. Actually, the performance of your gcc-built binary is not that bad - since your machine's clock speed is 2/3 that of the 1GHz ev68 I used for the timings on the Mlucas README page, you need to multiply the latter by 1.5 to get a fair comparison. Based on that, your binary is only about 15% slower on a per-cycle basis than the one built using the native C compiler - not bad at all. Note also that in the gcc builds (of this and other floating-point-heavy codes) I've done, I've found nothing that significantly improves on the simple -O3 optimization flag, same as you used. If anyone can suggest other flags they think would help, please let us know.

The DEC C manpages (at least the ones installed on the systems I do my builds on) indicate that COFF is the only available output format for that compiler. I'll look around a bit more online to see if I can find some more information about ELF-format binaries - maybe there's some kind of post-build translation tool available.
ewmayer is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Off to Alpha Centauri Bb ! ? Uncwilly Lounge 66 2012-10-24 17:36
Linux sucks - linker problems Prime95 Linux 6 2010-12-20 19:39
Wolfram Alpha Mini-Geek Lounge 25 2009-05-23 11:03
Defendmyname, Linux problems need help! defendmyname Linux 2 2008-12-16 12:03
Q: Mlucas on Linux on Alpha hardware - Problems ??? MartinHvidberg Mlucas 9 2003-07-21 18:58

All times are UTC. The time now is 05:57.

Thu Jan 21 05:57:50 UTC 2021 up 49 days, 2:09, 0 users, load averages: 1.12, 1.41, 1.60

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.