mersenneforum.org New feature in my ECM applet
 Register FAQ Search Today's Posts Mark Forums Read

 2010-03-16, 04:31 #45 bsquared     "Ben" Feb 2007 D4A16 Posts 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
 2010-03-16, 12:33 #46 alpertron     Aug 2002 Buenos Aires, Argentina 25018 Posts 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.
 2010-03-16, 13:54 #47 alpertron     Aug 2002 Buenos Aires, Argentina 5·269 Posts 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.(fake:0) at java.awt.Frame.(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.
2010-03-16, 13:58   #48
bsquared

"Ben"
Feb 2007

2·35·7 Posts

Quote:
 Originally Posted by alpertron 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...

 2010-03-16, 14:07 #49 alpertron     Aug 2002 Buenos Aires, Argentina 101010000012 Posts 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
 2010-04-03, 08:34 #50 Andi47     Oct 2004 Austria 1001101100102 Posts Small feature request: Please increase the size of the window where the applet says "factoring: " 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).
 2010-04-03, 16:28 #51 alpertron     Aug 2002 Buenos Aires, Argentina 54116 Posts 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.
 2010-04-06, 11:15 #52 ThiloHarich     Nov 2005 11001012 Posts @ 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?
 2010-04-06, 12:39 #53 10metreh     Nov 2008 232210 Posts There is an option in yafu.ini to use more than 1 thread: threads=.
2010-04-06, 13:30   #54
bsquared

"Ben"
Feb 2007

2·35·7 Posts

Quote:
 Originally Posted by ThiloHarich @ 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
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

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

 2010-04-06, 14:57 #55 alpertron     Aug 2002 Buenos Aires, Argentina 54116 Posts 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

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Programming 19 2019-11-08 22:31 ET_ Lone Mersenne Hunters 69 2014-06-01 17:34 3.14159 Miscellaneous Math 7 2010-06-01 01:29 alpertron Factoring 14 2006-01-01 04:00 jinydu Lounge 2 2004-05-05 08:33

All times are UTC. The time now is 13:18.

Sun Apr 11 13:18:30 UTC 2021 up 3 days, 7:59, 1 user, load averages: 1.81, 1.57, 1.45