20120112, 13:25  #1 
Einyen
Dec 2003
Denmark
6552_{8} Posts 
compiling GMPECM
I am wondering what "make ecmparams; make" actually does?
I did it twice right after each other on 2 versions of GMPECM compiled with exact same options and nothing else was running on the machine, but the values in ecmparams.h is still quite different, like MUL_NTT_THRESHOLD and POLYEVALT_NTT_THRESHOLD: Code:
#define TUNE_MULREDC_THRESH 20 #define TUNE_SQRREDC_THRESH 1 #define MPZMOD_THRESHOLD 60 #define REDC_THRESHOLD 511 #define MPN_MUL_LO_THRESHOLD_TABLE {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 14, 1, 1, 18, 18, 18, 18, 20} #define NTT_GFP_TWIDDLE_DIF_BREAKOVER 17 #define NTT_GFP_TWIDDLE_DIT_BREAKOVER 17 #define MUL_NTT_THRESHOLD 512 #define PREREVERTDIVISION_NTT_THRESHOLD 32 #define POLYINVERT_NTT_THRESHOLD 512 #define POLYEVALT_NTT_THRESHOLD 4096 #define MPZSPV_NORMALISE_STRIDE 128 Code:
#define TUNE_MULREDC_THRESH 20 #define TUNE_SQRREDC_THRESH 16 #define MPZMOD_THRESHOLD 54 #define REDC_THRESHOLD 512 #define MPN_MUL_LO_THRESHOLD_TABLE {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 15, 1, 1, 15, 18, 20} #define NTT_GFP_TWIDDLE_DIF_BREAKOVER 17 #define NTT_GFP_TWIDDLE_DIT_BREAKOVER 17 #define MUL_NTT_THRESHOLD 32768 #define PREREVERTDIVISION_NTT_THRESHOLD 32 #define POLYINVERT_NTT_THRESHOLD 512 #define POLYEVALT_NTT_THRESHOLD 256 #define MPZSPV_NORMALISE_STRIDE 64 Last fiddled with by ATH on 20120112 at 13:26 
20120112, 17:44  #2 
"Nancy"
Aug 2002
Alexandria
9A3_{16} Posts 
The nonNTT and NTT variants of the convolution product have essentially the same asymptotic complexity, so the graphs of their time as function of input size intersect at a very acute angle. Hence small variations in the timings can disturb the resulting threshold a lot.

20120112, 18:13  #3 
Einyen
Dec 2003
Denmark
2·17·101 Posts 
So these "large" variations will not affect performance of GMPECM ? Like one of the versions being slower.

20120406, 00:32  #4 
Sep 2008
Kansas
111011010110_{2} Posts 
I thought ECM 6.4.2 addressed the speed regression problem? Appears to still be around for powerpc64.
For ECM 6.3 I get. Code:
GMPECM 6.3 [configured with GMP 5.0.2 and enableasmredc] [ECM] Input number is 1369...9 (114 digits) Using B1=11000000, B2=35133391030, polynomial Dickson(12), sigma=3266242007 Step 1 took 71183ms Step 2 took 44681ms Code:
GMPECM 6.4.2 [configured with GMP 5.0.2, enableasmredc] [ECM] Input number is 1369...9 (114 digits) Using B1=11000000, B2=35133391030, polynomial Dickson(12), sigma=2279026585 Step 1 took 75026ms Step 2 took 61388ms 
20120406, 00:38  #5 
"Nancy"
Aug 2002
Alexandria
2,467 Posts 
I'm not very familiar with the changes that went into 6.4. I'll forward this to Paul, maybe they have a G5 system somewhere to test where the speed regression entered the code.

20130227, 22:28  #6  
Sep 2008
Kansas
2×3^{2}×211 Posts 
Quote:
Code:
m4 I../ DOPERATION_mulredc1 `test f mulredc1.asm  echo './'`mulredc1.asm >mulredc1.s /bin/sh ../libtool mode=compile gcc4.2 m64 c o mulredc1.lo mulredc1.s libtool: compile: gcc4.2 m64 c mulredc1.s o mulredc1.o mulredc1.s:40:Invalid mnemonic 'tocbase,' mulredc1.s:41:Unknown pseudoop: .size mulredc1.s:41:Rest of line ignored. 1st junk character valued 95 (_). mulredc1.s:58:Unknown pseudoop: .size mulredc1.s:58:Rest of line ignored. 1st junk character valued 46 (.). make[2]: *** [mulredc1.lo] Error 1 Code:
GMPECM 6.4.2 [configured with GMP 5.1.1, enableasmredc] [ECM] Input number is 15556590125084447640042979376106655611645478466484332304839633936078668267149399297288829856548038837496970338619173620375749 (125 digits) Using B1=11000000, B2=35133391030, polynomial Dickson(12), sigma=3074875970 Step 1 took 86990ms Step 2 took 64229ms Code:
GMPECM 6.4.4 [configured with GMP 5.1.1] [ECM] Input number is 15556590125084447640042979376106655611645478466484332304839633936078668267149399297288829856548038837496970338619173620375749 (125 digits) Using B1=11000000, B2=35133391030, polynomial Dickson(12), sigma=1609157141 Step 1 took 93428ms Step 2 took 48039ms 

20130301, 01:18  #7 
Sep 2008
Kansas
2·3^{2}·211 Posts 
As a followup, 6.3 is still the fastest on a G5 (powerpc64).
Code:
GMPECM 6.3 [configured with GMP 5.1.1 and enableasmredc] [ECM] Input number is 15556590125084447640042979376106655611645478466484332304839633936078668267149399297288829856548038837496970338619173620375749 (125 digits) Using B1=11000000, B2=35133391030, polynomial Dickson(12), sigma=4239757077 Step 1 took 82115ms Step 2 took 46385ms 
20130308, 15:39  #8 
"Nancy"
Aug 2002
Alexandria
2,467 Posts 
RichD,
can you try compiling the asm code with a newer version of gcc than 4.2? It works on, e.g., gcc110.fsffrance.org with 4.7.2. The speed regression may be due to not using the asm mulredc; or maybe the distributed parameters are nonoptimal. Getting the asm to work would be the first step, though. Alex 
20130308, 19:43  #9  
Mar 2013
3 Posts 
Quote:
We certainly need more details to fix this, but you may just try configuring with disableshared (which should be slightly faster anyway), but still enableasmredc. What does ./config.guess (and uname a) give? Can you upload the output of a ./configure run, and (afterwards) the file config.log? (Btw., isn't MacOS X on PowerPC 32bit only? AFAIK you may use some advanced features of 64bit PowerPC CPUs on it, but the OS and the applications are still 32bit.) 

20130309, 00:22  #10  
Sep 2008
Kansas
2×3^{2}×211 Posts 
Quote:
I'll look around for a later Xcode (gcc) version that supports Apple PPC. It is a sunset system. I hope I'm not consuming too many resources on a dying system but I thought this problem might bleed over to other powerpc64 systems. BTW, the enableasmredc was active in ECM 6.4.2. Oh, I see leif has a followup for me. 

20130309, 01:47  #11  
Mar 2013
3 Posts 
Quote:
Even if Apple would change their mind and decided to provide such, it wouldn't help here (at least not with the assembler errors). AFAIK the latest Apple GCC for PPC is version 4.2.1 (Apple Inc. build 5577). And I'm pretty sure now disableshared enableasmredc won't work for you either (with 6.4.4) on Darwin, as the PowerPC64 assembly code is ELFonly now, assuming Darwin on PowerPC was always 32bit, hence not using it; sorry. 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Help needed compiling GMPECM  M0CZY  GMPECM  76  20090929 15:48 
Compiling my first program by using GMP  Raman  Programming  3  20090214 02:17 
Compiling Phrot  rogue  Sierpinski/Riesel Base 5  142  20090109 03:42 
Compiling 24.14  CBoland  Software  6  20070801 00:11 
Compiling new version of GMPECM  M0CZY  GMPECM  3  20060527 09:54 