mersenneforum.org  

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

Reply
 
Thread Tools
Old 2016-02-06, 04:16   #23
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22×31×79 Posts
Default

Quote:
Originally Posted by Batalov View Post
How about this (in get_fft_radices.c, lines 1443-1446):
Code:
                case 7 :
                        numrad = 6; rvec[0] = 16; rvec[1] =  8; rvec[2] =  8; rvec[3] =  8; rvec[4] =  8; rvec[5] = 16; break;
          #ifndef USE_ONLY_LARGE_LEAD_RADICES
                case 7 :
                        numrad = 5; rvec[0] =  8; rvec[1] = 16; rvec[2] = 16; rvec[3] = 32; rvec[4] = 16; break;

[linux1@rhel7-3 build]$ gcc -Os ../src/get_fft_radices.c
../src/get_fft_radices.c: In function ‘get_fft_radices’:
../src/get_fft_radices.c:1446:3: error: duplicate case value
   case 7 :
   ^
../src/get_fft_radices.c:1443:3: error: previously used here
   case 7 :
   ^
Their gcc compiler is a bit stricter than on x86_64 (I've built it before -- no problems were reported, only warnings).
Yes, that bug in the unthreaded scalar-C builds has been fixed in my dev-branch code, users who run into it should just 'do the needful' in their local copy of the file.

Quote:
A bit later (in TRICKY section)
Code:
../src/util.c: In function ‘print_host_info’:
../src/util.c:1071:106: error: ‘OS_BITS’ undeclared (first use in this function)
so add -DOS_BITS=64 to the compiler line.

After polishing these two little blemishes, runs like a clock.
As long as it's a 64-bit OS - that would be 'yes' - your hack is fine. Note OS_BITS is set (or better, attempted-to-set) in platform.h - you can turn on a bunch of diagnostics for that file by adding -DPLATFORM_DEBUG to your compile command, say for just a single tiny source file like br.c.
ewmayer is offline   Reply With Quote
Old 2016-02-06, 19:03   #24
alexvong1995
 
Dec 2014

2516 Posts
Default

I managed to set up a s390x chroot! So I don't need to rely on QEMU image anymore (They are pretty hard to find and make). I can now build a "fresh" debian rootfs from scratch.

For curious people, this is how it is done (the following commands need root privilege):
Code:
# apt-get install binfmt-support qemu qemu-user-static
Then, manually download debootstrap and install it by
Code:
# dpkg -i debootstrap_1.0.73~bpo8+1_all.deb
Note we cannot install the latest version because it has a bug which prevents the two-stage bootstrap from working. (It takes me a looong time to figure this out, the error message isn't so obvious.)
Code:
qemu-debootstrap --arch=s390x --include=emacs-nox,less,build-essential,autogen --variant=buildd sid debian-s390x
and we are done! You can now chroot into the chroot. This should works for any architecture that is supported by QEMU user mode emulation. In particular, armel (used by your phone) is supported.
alexvong1995 is offline   Reply With Quote
Old 2016-02-07, 02:41   #25
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

23·7·163 Posts
Wink

I dropped my compilation yesterday, but today I tried some more...

#define COMPILER_TYPE_GCC 1

in ../src/platform.h

And Bob's your mother's closest living relative or something like that...
Batalov is offline   Reply With Quote
Old 2016-02-07, 04:46   #26
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22×31×79 Posts
Default

OK, I got both un-and-multithreaded builds (all manual compile and link) to work, via the following hacks to platform.h:

o Got rid of these undefs at top - these (duh!) make it impossible for use of PLATFORM_DEBUG as intended, no clue WTF I was thinking with these undefs:

#undef PLATFORM_DEBUG
#undef OS_DEBUG
#undef OS_BITS_DEBUG
#undef CPU_DEBUG
#undef CMPLR_DEBUG

o Instead of initially undefing the following 3 things I now init them to 'unknown' (the not-defined CPU_NAME was hosing the util.c compile):

#define CPU_TYPE "Unknown CPU type"
#define CPU_NAME "Unknown CPU name"
#define CPU_SUBTYPE_NAME "Unknown CPU subtype"

o Changed

#ifndef CPU_TYPE
#error platform.h : CPU_TYPE not defined!
#endif

to a #warning. (OS_TYPE and COMPILER_TYPE are still required to be defined during preprocessing of the platform.h file, though.)

o Added a #elif for the case of Unknown hardware platform, but under Linux/GCC.

Fiddled version of the header attached. I only did a pair of quick spot-checks of the 2 binaries @FFT length 128K via './Mlucas -fftlen 128 -iters 100' in each of my 2 build dirs (one for unthreaded, one with pthreading). All the normal Linux thread-affinity stuff seems to be working, though no clue how much || scaling one can expect in these puny guest-accounts. (My virtual setup shows just 2 cores.)
Attached Files
File Type: gz platform.h.gz (10.6 KB, 152 views)
ewmayer is offline   Reply With Quote
Old 2016-02-07, 12:29   #27
alexvong1995
 
Dec 2014

37 Posts
Default

Hi Ernst,

I have added 2 new CPU_TYPE CPU_IS_S390 and CPU_IS_S390X to platform.h, does it passes the spot-check and self-test on your VM? The platform.h I use is the old one on my repo, not the one you have just posted . I will rebase my change on the latest platform.h if it works.

By the way, could you post the latest version of get_fft_radices.c on your dev branch? I think I run into the duplicate case problem reported by Batalov when building with singlethread.

Thanks people!
Attached Files
File Type: bz2 platform.h.bz2 (10.0 KB, 119 views)
alexvong1995 is offline   Reply With Quote
Old 2016-02-07, 21:27   #28
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22·31·79 Posts
Default

Hi, Alex - I will diff your platform.h and try it on the Cloud when I'm home later today and have a secure connection.

Being paranoid I manage my dev-branch code privately, so here is the current version of the file you asked for - should be a drop-in replacement (md5 of the *gz = db5d2504d58897229d0366f4749b4131):
Attached Files
File Type: gz get_fft_radices.c.gz (14.7 KB, 128 views)

Last fiddled with by ewmayer on 2016-02-08 at 04:09
ewmayer is offline   Reply With Quote
Old 2016-02-07, 21:34   #29
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

979610 Posts
Default

Also, do we have any easy way of determining what underlying compute hardware is being used, or is the whole point of the 'generic' cloud setup to obfuscate that?

My gcc predefines-dump shows no obvious clues to the CPU type.
ewmayer is offline   Reply With Quote
Old 2016-02-08, 07:45   #30
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22·31·79 Posts
Default

Quote:
Originally Posted by alexvong1995 View Post
Hi Ernst,

I have added 2 new CPU_TYPE CPU_IS_S390 and CPU_IS_S390X to platform.h, does it passes the spot-check and self-test on your VM? The platform.h I use is the old one on my repo, not the one you have just posted . I will rebase my change on the latest platform.h if it works.

By the way, could you post the latest version of get_fft_radices.c on your dev branch? I think I run into the duplicate case problem reported by Batalov when building with singlethread.

Thanks people!
Alex, I integrated your additions into my latest, and also made a few tweaks to my yesterday work - the 3 predefines to "Unknown" (in place of the previous #undef) I used lead to preprocessor warnings on platforms where the variables do end being set to a specific platform-associated value:
Code:
../platform.h:1222:10: warning: 'CPU_NAME' macro redefined
        #define CPU_NAME "x86_64"
                ^
../platform.h:130:9: note: previous definition is here
#define CPU_NAME                        "Unknown CPU name"
so I fiddled those to set to the "unknown" values only if they are still undef'd by the time we reach the end of the platform.h file.

But note I fubared my key-creation on the cloud, so to save time was using Serge's already-setup image with his unzip of the 14.1 packaged code. He has since blown his stuff away. If your instance is still up, could you try auto-build with the merged platform.h file attached below?

Thanks, and happy lunar new year! I guess the celebrations have already started in Asia. (Or will within the next few hours.)
Attached Files
File Type: gz platform.h.gz (10.8 KB, 124 views)
ewmayer is offline   Reply With Quote
Old 2016-02-08, 09:18   #31
Lorenzo
 
Lorenzo's Avatar
 
Aug 2010
Republic of Belarus

2·5·17 Posts
Default

After i replaced platform.h:

Code:
[linux1@lorenzoibm mlucas-14.1]$ ./mlucas

    Mlucas 14.1

    http://hogranch.com/mayer/README.html

INFO: testing qfloat routines...
CPU Family = S390x, OS = Linux, 64-bit Version, compiled with Gnu C [or other compatible], Version 4.8.5 20150623 (Red Hat 4.8.5-4).
INFO: Using inline-macro form of MUL_LOHI64.
INFO: MLUCAS_PATH is set to ""
INFO: using 53-bit-significand form of floating-double rounding constant for scalar-mode DNINT emulation. 
INFO: testing IMUL routines...
INFO: System has 2 available processor cores.
INFO: testing FFT radix tables...
 looking for number of threads to use in nthreads.ini file...
Using NTHREADS = #CPUs = 2.
 looking for worktodo.ini file...
 worktodo.ini file found...checking next exponent in range...
ERROR: at line 245 of file ./src/get_preferred_fft_radix.c
Assertion failed: CONFIGFILE = mlucas.cfg: open failed!
Lorenzo is offline   Reply With Quote
Old 2016-02-08, 10:53   #32
Lorenzo
 
Lorenzo's Avatar
 
Aug 2010
Republic of Belarus

2×5×17 Posts
Default

Ohhh.Sorry. It's working!!! Amazing!!!
P.S. Forgot about perfomance tunes (mlucas -s m).
Lorenzo is offline   Reply With Quote
Old 2016-02-08, 11:07   #33
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

25·149 Posts
Default

Quote:
Originally Posted by Lorenzo View Post
Ohhh.Sorry. It's working!!! Amazing!!!
P.S. Forgot about perfomance tunes (mlucas -s m).
Can you tell us anything about its performances? I guess it's running with 2 threads...

Luigi
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mlucas and mprime on the same box daxmick Software 5 2018-01-05 09:48
Mlucas on ubuntu Damian Mlucas 17 2017-11-13 18:12
Mlucas version 17 ewmayer Mlucas 3 2017-06-17 11:18
Mlucas on Sparc - Unregistered Mlucas 0 2009-10-27 20:35
mlucas on sun delta_t Mlucas 14 2007-10-04 05:45

All times are UTC. The time now is 23:38.

Fri Oct 30 23:38:45 UTC 2020 up 50 days, 20:49, 2 users, load averages: 2.10, 2.13, 2.08

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.