mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2010-03-16, 04:31   #45
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

343610 Posts
Default

Ok, I got it to compile using your command line. Apparently going to object files first and then linking is a problem.

Running ./ecm ecm uses the ecm class's main function as an entry point, where you had a couple batch factor calls commented out. I know practically zero java, but took a guess, uncommented one of the calls, and ran it. The program ran for a while but produced no output at all. I then borrowed the system.out.println syntax from somewhere else in the code and added the following to line 1295 of ecm.java (just below the call to SIQS.FactoringSIQS)
Code:
System.out.println("Time in siqs = "+timeSIQS);
Now it runs and prints a time consistent with the command line "time" function, assuming some ecm is done first (but which is invisible, still). I don't know if any factors were produced or if they are correct (I assume they are), but here are some timings (in seconds) on my Phenom II 955 at 3.2 GHz:

Code:
input           alpertron    yafu-1.17
10^59+213         7.35       4.04
10^71-1           75.9       32.3
10^79+5923        543.9      200.1
I used this compile line:

Code:
gcj expression.java ecm.java Siqs.java -O3 -fno-bounds-check -fno-store-check -lgij -o ecm
The comparison maybe isn't completely fair, since I know that I get 64 bit code (and the extra registers that come with it) from gcc for yafu builds, but I have no idea if gcj produces 64 bit machine code.

The OS is 64 bit ubuntu-9.

Last fiddled with by bsquared on 2010-03-16 at 04:52 Reason: extra info
bsquared is offline   Reply With Quote
Old 2010-03-16, 12:33   #46
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

54816 Posts
Default

I changed the source code in order to be able to start the applet as an application, so now java ecm shows the factorization panel.

The result of the compilation with gcj using the parameters you cite above cannot execute. I receive the same message:

"The application failed to initialize properly (0xc0000005). Click on OK to terminate the application."

So I updated the file ecm.zip with the new source codes so you can try it by downloading from the Web server.
alpertron is offline   Reply With Quote
Old 2010-03-16, 13:54   #47
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

23·132 Posts
Default

After reading the gcj documentation I used the command line:

Code:
gcj --main=ecm expression.java ecm.java Siqs.java -O3 -fno-bounds-check -fno-store-check -o ecm
and it generated a ecm.exe file, but when I run it, the following text appears:

Code:
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at java.awt.Toolkit.getDefaultToolkit(fake:0)
   at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(fake:0)
   at java.awt.Window.<init>(fake:0)
   at java.awt.Frame.<init>(fake:0)
   at ecm.main(fake:0)
Caused by: java.lang.ClassNotFoundException:
   at java.lang.Class.forName(fake:0)
   at java.awt.Toolkit.getDefaultToolkit(fake:0)
   ...4 more
So it appears that gcj is very difficult to use.
alpertron is offline   Reply With Quote
Old 2010-03-16, 13:58   #48
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101011011002 Posts
Default

Quote:
Originally Posted by alpertron View Post
So it appears that gcj is very difficult to use.

No argument there!

I tried downloading ecm.zip again, but the timestamps are the same as from a few days ago, and running java ecm in windows throws a bunch of errors...
bsquared is offline   Reply With Quote
Old 2010-03-16, 14:07   #49
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

135210 Posts
Default

I've just downloaded ecm.zip from the Web server ( http://www.alpertron.com.ar/ecm.zip) and unzipped it into a new directory. I compiled the three files and the command java ecm command works successfully on Windows XP.

It is possible that the old ecm.zip was cached in your computer. Please delete that file (or erase the browse cache) and then download it again.

FYI, these are the timestamps of the different files. You can have the times changed since you are in another time zone (here it is UTC-3).

Code:
16/03/2010  09:07           233.330 ecm.java
14/03/2010  23:29            22.427 expression.java
15/03/2010  15:05           141.575 Siqs.java

Last fiddled with by alpertron on 2010-03-16 at 14:10
alpertron is offline   Reply With Quote
Old 2010-04-03, 08:34   #50
Andi47
 
Andi47's Avatar
 
Oct 2004
Austria

9B216 Posts
Default

Small feature request: Please increase the size of the window where the applet says "factoring: <bignum>" and gives the number of ECM curves and the probability to find a factor of certain size (if it exists). When I enter a big number (say ~250 digits) just to run a quick ECM and to see which factors are in the databases which are accessed by your applet, the output exceeds the window size and thus I don't see the probability estimation (and for bigger numbers not even the curve count).
Andi47 is offline   Reply With Quote
Old 2010-04-03, 16:28   #51
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

23×132 Posts
Default

If you try to factor big numbers, you can use the scroll bar in order to see these probabilities. I selected the applet size in order to be shown correctly on 800x600 pixels.
alpertron is offline   Reply With Quote
Old 2010-04-06, 11:15   #52
ThiloHarich
 
ThiloHarich's Avatar
 
Nov 2005

11001012 Posts
Default

@ alpertron I made the experience for my java SIQS that the code produced by gjc is not faster then executing it in the JVM 1.6 (even with no bouns check) see http://www.mersenneforum.org/showpos...2&postcount=42.
How were your timings?
The applet uses Threads. Does YAFU also uses parallelization?
ThiloHarich is offline   Reply With Quote
Old 2010-04-06, 12:39   #53
10metreh
 
10metreh's Avatar
 
Nov 2008

2×33×43 Posts
Default

There is an option in yafu.ini to use more than 1 thread: threads=<number>.
10metreh is offline   Reply With Quote
Old 2010-04-06, 13:30   #54
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

22·859 Posts
Default

Quote:
Originally Posted by ThiloHarich View Post
@ alpertron I made the experience for my java SIQS that the code produced by gjc is not faster then executing it in the JVM 1.6 (even with no bouns check) see http://www.mersenneforum.org/showpos...2&postcount=42.
How were your timings?
The applet uses Threads. Does YAFU also uses parallelization?
I did see a speedup using gcj to compile the applet. This was using the following gcc version:

Code:
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
and compiling with: gcj expression.java ecm.java Siqs.java -O3 -o ecm
adding -fno-bounds-check -fno-store-check actually made the binary *slower*, as I recall.

Here are some timings, in seconds.

Code:
input	         gcj -O3	java ecm
10^59+213	 6.5	        7.9
10^71-1	         65.5	        74
Dario, how do I enable threading in the applet, and specify the number of threads to use?

Last fiddled with by bsquared on 2010-04-06 at 13:32
bsquared is offline   Reply With Quote
Old 2010-04-06, 14:57   #55
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

23·132 Posts
Default

Just search the string int numberThreads = 1; in the file ecm.java and then change the number of threads.

BTW I was able to reduce the memory requirement by half when using ECM (but the timings were not changed). This is important because the applets are limited on the amount of memory they can use. The next step is to replace trial division in SIQS by Pollard Rho and to change the single large prime SIQS variation to the double large prime SIQS which appears to make the algorithm a lot faster for inputs larger than 75 digits.

Last fiddled with by alpertron on 2010-04-06 at 15:02
alpertron is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java applet alternative a1call Programming 19 2019-11-08 22:31
New online applet for factorization ET_ Lone Mersenne Hunters 69 2014-06-01 17:34
A strange applet: 3.14159 Miscellaneous Math 7 2010-06-01 01:29
Faster factorization applet alpertron Factoring 14 2006-01-01 04:00
Binomial Expansion Applet jinydu Lounge 2 2004-05-05 08:33

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

Fri May 7 16:23:37 UTC 2021 up 29 days, 11:04, 1 user, load averages: 4.03, 3.64, 3.57

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.