mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2020-11-30, 16:32   #78
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by bsquared View Post
In my tinyecm code (< 64 bits) where there are just a few fixed and very small B1 values, I found that in a few cases the cost of PRAC(p1*p2) is cheaper than PRAC(p1) + PRAC(p2). It isn't practical to test combinations of primes like this in real time for arbitrary (and larger) B1. But I wonder if it is worth compiling a list of prime pairs that are cheaper when combined below bounds like 1M, 3M, 11M, etc.
Ran a quick test attempting to pair primes < 1M. There are ~5k pairs that are cheaper this way, sometimes dramatically so1. But there are ~78k primes below this bound so the total cost savings is a fraction of a percent.

edit: nevermind - this is not valid. Have to check that the chain actually works! conclusion is unchanged - finding cheaper pairs doesn't seem worthwhile.
Code:
prime 9769 * 9781 cost = 103.5 
prime 9769 cost = 109.0 
prime 9781 cost = 103.5 
(sum 212.5, savings 109.0 @ prac v=0.620181980807)

Last fiddled with by bsquared on 2020-11-30 at 19:31 Reason: further analysis
bsquared is offline   Reply With Quote
Old 2020-12-08, 16:41   #79
mathwiz
 
Mar 2019

24×32 Posts
Default

If I do a "git pull" on the latest code, and then "make COMPILER=gcc SKYLAKEX=1", I'm getting a bunch of linker errors:

Code:
gcc -g -O3 -mavx -march=skylake-avx512 -DSKYLAKEX -Wall  -I. -I../../gmp-6.2.1 -c -o vec_common.o vec_common.c
gcc -g -O3 -mavx -march=skylake-avx512 -DSKYLAKEX -Wall  -I. -I../../gmp-6.2.1 -c -o calc.o calc.c
gcc -g -O3 -mavx -march=skylake-avx512 -DSKYLAKEX -Wall  -I. -I../../gmp-6.2.1 -c -o queue.o queue.c
rm -f libavxecm.a
ar r libavxecm.a eratosthenes/presieve.o eratosthenes/count.o eratosthenes/offsets.o eratosthenes/primes.o eratosthenes/roots.o eratosthenes/linesieve.o eratosthenes/soe.o eratosthenes/tiny.o eratosthenes/worker.o eratosthenes/soe_util.o eratosthenes/wrapper.o threadpool.o main.o ecm.o util.o vecarith.o vecarith52.o vec_common.o calc.o queue.o
ar: creating libavxecm.a
ranlib libavxecm.a
gcc -g -O3 -mavx -march=skylake-avx512 -DSKYLAKEX -Wall  -I. -I../../gmp-6.2.1 eratosthenes/presieve.o eratosthenes/count.o eratosthenes/offsets.o eratosthenes/primes.o eratosthenes/roots.o eratosthenes/linesieve.o eratosthenes/soe.o eratosthenes/tiny.o eratosthenes/worker.o eratosthenes/soe_util.o eratosthenes/wrapper.o threadpool.o main.o ecm.o util.o vecarith.o vecarith52.o vec_common.o calc.o queue.o -o avx-ecm libavxecm.a -L../../gmp-6.2.1/.libs -lm -lgmp -lpthread
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:323: multiple definition of `nmasks'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:323: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:341: multiple definition of `szSOEp'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:341: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:340: multiple definition of `spSOEprimes'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:340: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:337: multiple definition of `P_MAX'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:337: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:336: multiple definition of `P_MIN'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:336: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:335: multiple definition of `NUM_P'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:335: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:334: multiple definition of `PRIMES'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:334: first defined here
/usr/bin/ld: eratosthenes/count.o:/tmp/avx-ecm/eratosthenes/soe.h:330: multiple definition of `SOE_VFLAG'; eratosthenes/presieve.o:/tmp/avx-ecm/eratosthenes/soe.h:330: first defined here
mathwiz is offline   Reply With Quote
Old 2020-12-08, 16:47   #80
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by mathwiz View Post
If I do a "git pull" on the latest code, and then "make COMPILER=gcc SKYLAKEX=1", I'm getting a bunch of linker errors:
Those are very similar errors to what is happening here, with someone trying to compile YAFU using gcc 10.2.0. Are you using the same version of gcc, by any chance?

As with yafu, I see no problems with gcc 7.3.0 or icc 18.0.3.

[edit]
I know that defining globals in header files is frowned upon, but I didn't know it was an error as long as the header is only included once. That is why they are protected with the #ifndef X #define X macros. Could that have changed with the latest gcc? Maybe putting a -std=c11 in the make would help?

Last fiddled with by bsquared on 2020-12-08 at 17:02
bsquared is offline   Reply With Quote
Old 2020-12-08, 17:16   #81
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2×33×67 Posts
Default

Just to note, gcc 8.3.0 (Debian) and 9.3.0 (Ubuntu) worked fine for YAFU (wip), last time I upgraded all my machines.


Note: I will probably move this to the other thread later, since it's not really about AVX-ECM.

Last fiddled with by EdH on 2020-12-08 at 17:19
EdH is offline   Reply With Quote
Old 2020-12-08, 21:36   #82
mathwiz
 
Mar 2019

24×32 Posts
Default

Quote:
Originally Posted by EdH View Post
Just to note, gcc 8.3.0 (Debian) and 9.3.0 (Ubuntu) worked fine for YAFU (wip), last time I upgraded all my machines.


Note: I will probably move this to the other thread later, since it's not really about AVX-ECM.
Indeed, using gcc-8 instead of my default (gcc-10) appears to work fine.
mathwiz is offline   Reply With Quote
Old 2020-12-08, 21:51   #83
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101001010112 Posts
Default

Quote:
Originally Posted by mathwiz View Post
Indeed, using gcc-8 instead of my default (gcc-10) appears to work fine.
Good to know, thanks.

I've asked a question about this over in the programming thread; maybe more people read that and someone might know what's going on. I've browsed the gcc changelog but nothing jumps out at me as a possible cause of this behavior. No time at the moment to dig deeper... hoping that someone smarter than me can bail me out here.
bsquared is offline   Reply With Quote
Reply

Thread Tools


All times are UTC. The time now is 07:33.

Sun Feb 28 07:33:23 UTC 2021 up 87 days, 3:44, 0 users, load averages: 1.26, 1.32, 1.38

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.