![]() |
![]() |
#34 | |
Mar 2006
23×59 Posts |
![]() Quote:
Well, the next thing to try is to: Set NICE_PATH to different values, I'm not sure which one to put here and change the Popen line to: p = subprocess.Popen(args.split(' '), shell=True, **al) And also, can you add the following two lines right above the Popen line: Code:
print('-> args: {0:s}', str(args)) print('-> al: {0:s}', str(al)) |
|
![]() |
![]() |
![]() |
#35 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
![]()
http://en.wikipedia.org/wiki/Shebang_(Unix)
http://docs.python.org/tutorial/inte...python-scripts Quote:
Code:
bill@Gravemind:~/yafu/ecm∰∂ grep "NICE_PATH" ecm.py NICE_PATH = '' #'/usr/bin/nice -19' pass #al['preexec_fn'] = NICE_PATH bill@Gravemind:~/yafu/ecm∰∂ grep -B 2 "Popen" ecm.py print('-> args: {0:s}', str(args)) print('-> al: {0:s}', str(al)) p = subprocess.Popen(args.split(' '), shell=True, **al) #p = subprocess.Popen(args.split(' '), **al) #p = subprocess.Popen([ex] + args.split(' '), **al) #p = subprocess.Popen(cs.split(' '), **al) bill@Gravemind:~/yafu/ecm∰∂ ./ecm.py -c 7553 -one -threads 4 -out EMS.job 43000000 < num -> ___________________________________________________________________ -> | Running ecm.py, a Python driver for distributing GMP-ECM work | -> | on a single machine. It is Copyright, 2011, David Cleaver and | -> | is a conversion of factmsieve.py that is Copyright, 2010, Brian | -> | Gladman. Version 0.08 (Python 2.6 or later) 19th Oct 2011. | -> |_________________________________________________________________| -> Number(s) to factor: -> 96829488818499592481168771836336683023181156945795350980834458372199490598743221067775290195641203125439681639536219726888871822435629511515837059837171813128663335953886175536897367740550240372528813404899458874513057418332695709006061299277468749241875966062032012477732299909160292749026996368849279816035027111164073836173908645011 (335 digits) ->============================================================================= -> Working on number: 96829488818499592481168771836336683023181156945795350980834458372199490598743221067775290195641203125439681639536219726888871822435629511515837059837171813128663335953886175536897367740550240372528813404899458874513057418332695709006061299277468749241875966062032012477732299909160292749026996368849279816035027111164073836173908645011 (335 digits) -> Found previous job file job3362.txt, will resume work... -> *** Already completed 0 curves on this number... -> *** Will run 7553 more curves. -> Currently working on: job3362.txt -> Starting 4 instances of GMP-ECM... -> ./ecm -one -c 1889 43000000 < job3362.txt > job3362_t00.txt -> args: {0:s} -one -c 1889 43000000 -> al: {0:s} {'executable': '../ecm', 'stdin': <_io.TextIOWrapper name='job3362.txt' mode='r' encoding='UTF-8'>, 'stdout': <_io.TextIOWrapper name='job3362_t00.txt' mode='w' encoding='UTF-8'>} Traceback (most recent call last): File "./ecm.py", line 1227, in <module> start_ecm_threads() File "./ecm.py", line 524, in start_ecm_threads procs.append(run_exe(ECM, ecm_args2, in_file = ecm_job, out_file = file_name, wait = False)) File "./ecm.py", line 327, in run_exe p = subprocess.Popen(args.split(' '), shell=True, **al) File "/usr/lib/python3.2/subprocess.py", line 736, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.2/subprocess.py", line 1330, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 13] Permission denied Code:
ECM_PATH = '.' #... ECM = 'ecm' if sys.platform.startswith('win'): EXE_SUFFIX = '.exe' else: EXE_SUFFIX = '' NICE_PATH = '' ECM = './' + ECM #... ex = (ECM_PATH + exe + EXE_SUFFIX) al['executable'] = ex Last fiddled with by Dubslow on 2012-09-22 at 21:57 |
|
![]() |
![]() |
![]() |
#36 | |
Mar 2006
23·59 Posts |
![]() Quote:
![]() For the path argument, if ecm is in the same folder, I have always used "./" and not ".". This should be all you need to change to get the ecm executable working. As for nice, I would suggest the following: NICE_PATH = '/usr/bin/nice -n 19' |
|
![]() |
![]() |
![]() |
#37 | |
Mar 2006
23×59 Posts |
![]()
Announcing ecm.py version 0.10, the changes are:
Quote:
|
|
![]() |
![]() |
![]() |
#38 |
Apr 2012
367 Posts |
![]()
Thanks WraithX.
|
![]() |
![]() |
![]() |
#39 |
"Ed Hall"
Dec 2009
Adirondack Mtns
E2B16 Posts |
![]()
Is it possible to convert ecm.py such that it will operate across other machines?
I'm toying with several ideas along this line, but unsure whether to look into the workings of the script myself or not. I'm not well versed in Python and could possibly use this as a way to learn some. Anyway, as it runs, everything is done within the original terminal. Could the separate threads be run in separate terminals, such as called by gnome-terminal? If so, could these threads be run as ssh connections on remote machines? Or, if run as totally independent processes on the alternate machines, would there be a way of catching a factor, if found on one of the other machines? Would the data transfer overhead or the variance in thread processing negate any possible gains of creating several threads across differing equipment types? Additionally, if the above is at least a possibility, would there be a way to scale the work allocated such that faster machines get a bigger allocation? Thanks for any ideas (and especially for a great script)... Last fiddled with by EdH on 2013-05-05 at 03:17 |
![]() |
![]() |
![]() |
#40 | |
"Frank <^>"
Dec 2004
CDP Janesville
84A16 Posts |
![]() Quote:
I have my network setup with a master server here on my machine, with two dedicated machines that boot up with a slave server/client setup. That way, even if I have trouble with the network or this machine, the ECM boxes keep on running. The network overhead is miniscule, and you can just load up a bunch of low priority work along with your higher priority work, that way if something factors, there's some fall back work. If you go with v2.0, the backend for the server is a simple text file, no DB engine required. And the clients keep the workload balanced, since each can run independently, no manual intervention required.... |
|
![]() |
![]() |
![]() |
#41 |
Sep 2009
977 Posts |
![]()
Agreed, ECMNet is pretty good, even on a single host
![]() I'm sticking to 2.x due to the lack of dependency on a SQL engine. |
![]() |
![]() |
![]() |
#42 | |
Bamboozled!
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across
295B16 Posts |
![]() Quote:
If you would like assistance setting up ECMNET clients and/or master server and/or slave server just ask. My fee is very reasonable: a few curves contributed to 83.217.167.177:8194 ![]() Paul |
|
![]() |
![]() |
![]() |
#43 |
Feb 2005
Colorado
2·5·59 Posts |
![]() |
![]() |
![]() |
![]() |
#44 |
"Ed Hall"
Dec 2009
Adirondack Mtns
70538 Posts |
![]()
Thanks!
I will definitely look into this. Currently, I have scripts across several machines that "wait" for sieving assignments from one of them. The assignments are initiated by a script running Aliqueit on a separate machine. However, there is just too much wasted time in between sieving assignments. I had considered adjusting the waiting machines to do some ECM work during the off times. And, then I thought of expanding the ecm.py script that the Aliqueit machine runs. Perhaps ECMNET is what I'm looking for, since you mention being able to add in other jobs between assignments, as well. I was running curves on the c173 from 4788 continuously on all the machines until my attention span waned after a couple months. (The paint just wouldn't dry...) Then, I wrote all the sieving scripts and am running those, but looking for something else... Unfortunately, I have a lot of non-math/computer stuff building up to keep me busy, so the more automated, the better. |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Python Coding Help? | kelzo | Programming | 3 | 2016-11-27 05:16 |
PHP vs. Python vs. C (all with GMP) | daxmick | Programming | 2 | 2014-02-10 01:45 |
Python... | Xyzzy | Programming | 20 | 2009-09-08 15:51 |
using libecm from python | yqiang | GMP-ECM | 2 | 2007-04-22 00:14 |
Help w/ python. | a216vcti | Programming | 7 | 2005-10-30 00:37 |