Skip to content

Commit

Permalink
First release of lliki.py for clLucas
Browse files Browse the repository at this point in the history
  • Loading branch information
teknohog committed Sep 21, 2013
1 parent a4c85b3 commit 47d742e
Show file tree
Hide file tree
Showing 5 changed files with 462 additions and 48 deletions.
59 changes: 11 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,21 @@ Scripts for working with prime number search
These are written in standard Python without any external libraries. I
have only tested these on Linux, but there should be no OS limitations.

Currently, these tools comprise automatic work handlers so that
certain third-party software (that do the actual computation) can
access Primenet (mersenne.org):


mfloop.py
---------

Automatic work assignment and submission script for mfakto and
possibly other similar applications.

Mfakto does trial division of Mersenne numbers with OpenCL, so it can
speed up this stage greatly with GPUs. It relies on manual work
assignment and submission from/to http://www.mersenne.org/. mfloop.py
automates this, so mfakto can keep working indefinitely.

This script is intended to run in parallel with mfakto. It uses
lockfiles to avoid conflicts when accessing files. A typical command
line would be

mfloop.py -u teknohog -p salasana -n 10 -t 7200 -e 70

This would attempt updates every 2 hours, aiming to keep 10
assignments in worktodo.txt. The upper limit of exponent range is
increased to 70 (if lower than that). Also,

* Use -t 0 for a single update without looping.

* Use -n 0 to finish work and not get any new assignments.
For trial factoring with mfakto (should work with mfaktc too)

Optionally, it can also use gpu72.com for work assignments. The
results are still submitted to mersenne.org, so you need login
credentials for both sites, for example:

mfloop.py -u teknohog -p merspass -U teknohog -P gpupass
lliki.py
--------

In this case, there is a hardcoded minimum of 72 for the upper limit
of the exponent range. If a fetch from gpu72.com fails, it will try
primenet instead.

Run mfloop.py -h for more details on options.

Some of the ideas are adapted from http://www.gpu72.com/spider/.

More on mfakto:

http://mersenneforum.org/showthread.php?t=15646

http://mersenneforum.org/mfakto/

https://github.com/Bdot42/mfakto
For Lucas-Lehmer primality testing with clLucas (also CUDALucas)


Future plans
Expand All @@ -64,11 +32,6 @@ Future plans
vs. more complicated configuration and less control over individual
GPUs.

* Other work types besides trial factoring. This should be trivial to
implement, at least with similar worktodo.txt/results.txt formats...

* .. but the only other major application seems to be CUDALucas, which
accepts work as a commandline option. A Python wrapper for this
should be relatively simple, as the network part is already done. I
do not have Nvidia cards, though, but I am seriously considering to
get one for this, despite my firm opensource stance :-j
* Merge the two scripts, as they share a lot of code - though there
are lots of small differences all over, so the result may turn out
quite ugly.
64 changes: 64 additions & 0 deletions cllucas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

# by teknohog

# A more advanced example of running clLucas and lliki.py in a
# continuous loop.

# Please check this script carefully before use, as the optimal
# settings (THREADS, aticonfig) depend on the GPU, and there are other
# custom settings like the working directory and LD_LIBRARY_PATH.

BASEOPTS="-u user -p pass"
WORKOPTS="-n 2"
FLUSH=false

# 2097152 and 4194304 fft work best.(-f)
# http://mersenneforum.org/showpost.php?p=350303&postcount=64
# Fewer threads seem to speed up large FFTs slightly
function set_fft () {
if [ $MERSENNE -ge 38000000 ]; then
FFT=4194304
THREADS=128
else
FFT=2097152
THREADS=256
fi
}

while getopts f opt; do
case $opt in
f)
FLUSH=true
;;
esac
done

# Finish current work without getting any new
if $FLUSH; then
WORKOPTS="-n 0"
fi

cd distr.projects/clLucas.1.0/

export LD_LIBRARY_PATH=~/sources/clFFT/src/library/

# Device numbering as in cgminer
DEVICE=0
aticonfig --adapter=0 --odsc=1000,1500

while true; do
# Quick file operations first...
eval $(lliki.py -N)

# ...then leave networking in the background.
lliki.py $BASEOPTS $WORKOPTS -d &

set_fft

if [ -n "$MERSENNE" ]; then
./clLucas -aggressive -d $DEVICE -f $FFT -threads $THREADS $MERSENNE
else
break
fi
done
Loading

0 comments on commit 47d742e

Please sign in to comment.