![]() |
![]() |
#23 | |
Mar 2006
23·59 Posts |
![]() Quote:
Code:
RuntimeError: Exception occurred in preexec_fn. Code:
NICE_PATH = '' If that doesn't work I have some more things to try, but let's see where this gets us first. |
|
![]() |
![]() |
![]() |
#24 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3·29·83 Posts |
![]() Quote:
Code:
ECM = 'ecm' if sys.platform.startswith('win'): EXE_SUFFIX = '.exe' else: EXE_SUFFIX = '' NICE_PATH = '' ECM = './' + ECM Last fiddled with by Dubslow on 2012-09-17 at 04:57 Reason: [code] |
|
![]() |
![]() |
![]() |
#25 | ||
Mar 2006
47210 Posts |
![]() Quote:
Quote:
Come to think of it... Since this code mostly comes from factmsieve.py, I had never used or thought much about the NICE_PATH option. But thinking about it, I believe that you would set the NICE_PATH option to '/usr/bin/nice -19', instead of running with taskset/nice etc. Can you also give this a try? |
||
![]() |
![]() |
![]() |
#26 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
![]() Quote:
![]() No dice though. Code:
ECM = 'ecm' if sys.platform.startswith('win'): EXE_SUFFIX = '.exe' else: EXE_SUFFIX = '' NICE_PATH = '/usr/bin/nice -n 19' # No difference run this way or with '/usr/bin/nice 19' or 'nice -19' ECM = './' + ECM Code:
bill@Gravemind:~/yafu/ecm∰∂ which nice /usr/bin/nice [1]+ Done gedit ecm.py bill@Gravemind:~/yafu/ecm∰∂ less ~/.bash_history bill@Gravemind:~/yafu/ecm∰∂ taskset f ./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 Traceback (most recent call last): File "./ecm.py", line 1224, in <module> start_ecm_threads() File "./ecm.py", line 521, 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 325, in run_exe p = subprocess.Popen(args.split(' '), **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 1331, in _execute_child raise child_exception_type(err_msg) RuntimeError: Exception occurred in preexec_fn. |
|
![]() |
![]() |
![]() |
#27 |
Sep 2009
2,003 Posts |
![]()
What happens if you run it without the "taskset f" at the start of the command line?
Chris |
![]() |
![]() |
![]() |
#28 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
11100001101012 Posts |
![]() Quote:
Code:
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 Traceback (most recent call last): File "./ecm.py", line 1224, in <module> start_ecm_threads() File "./ecm.py", line 521, 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 325, in run_exe p = subprocess.Popen(args.split(' '), **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 1331, in _execute_child raise child_exception_type(err_msg) RuntimeError: Exception occurred in preexec_fn. |
|
![]() |
![]() |
![]() |
#29 | |
Mar 2006
7308 Posts |
![]() Quote:
Code:
/path/to/python ecm.py -c 7553 -one -threads 4 -out EMS.job 43000000 < num |
|
![]() |
![]() |
![]() |
#30 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
![]() Quote:
Code:
bill@Gravemind:~/yafu/ecm∰∂ /usr/bin/python3 ./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 Traceback (most recent call last): File "./ecm.py", line 1224, in <module> start_ecm_threads() File "./ecm.py", line 521, 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 325, in run_exe p = subprocess.Popen(args.split(' '), **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 1331, in _execute_child raise child_exception_type(err_msg) RuntimeError: Exception occurred in preexec_fn. |
|
![]() |
![]() |
![]() |
#31 | |
Mar 2006
7308 Posts |
![]() Quote:
With the following command line: ecm.py -c 7553 -one -threads 4 -out EMS.job 43000000 < num Set NICE_PATH = 'lambda:os.nice(20)' If that one does not work, then: With the following command line: ecm.py -c 7553 -one -threads 4 -out EMS.job 43000000 < num Code:
Set NICE_PATH = '' Change the following line in ecm.py from this: p = subprocess.Popen(args.split(' '), **al) To this: p = subprocess.Popen(args.split(' '), preexec_fn=lambda:os.nice(20), **al) |
|
![]() |
![]() |
![]() |
#32 | |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
160658 Posts |
![]() Quote:
First, I'm pretty sure /usr/bin/python3 won't make a difference. In Linux, the file type is NOT associated with the python executable; rather the shell (bash, in my and most cases) looks at the first line for the so-called "shebang" (I prefer "hashbang") which looks like `#! path-to-exe`; the shell then calls `path-to-exe $0 $@`, which is exactly the same as if I did it myself. In my case: Code:
bill@Gravemind:~/yafu/ecm∰∂ head -n 1 ecm.py #! /usr/bin/python3 As for the nice, when I tried it with NICE_PATH='' and without a nice command of my own, it still didn't work, even though it should have just started with normal priority; doesn't that mean that the problem isn't with nice-ing it? I'm less sure about this, so I'll try it with your suggestions. (I had no idea os has a nice(), though of course it makes sense ![]() Code:
~/yafu/ecm∰∂ cat ecm.py | grep NICE_PATH NICE_PATH = 'lambda: os.nice(20)' #'/usr/bin/nice -19' al['preexec_fn'] = NICE_PATH 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 Traceback (most recent call last): File "./ecm.py", line 1224, in <module> start_ecm_threads() File "./ecm.py", line 521, 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 325, in run_exe p = subprocess.Popen(args.split(' '), **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 1331, in _execute_child raise child_exception_type(err_msg) RuntimeError: Exception occurred in preexec_fn. Code:
bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "NICE_PATH" NICE_PATH = '' #'/usr/bin/nice -19' al['preexec_fn'] = NICE_PATH bill@Gravemind:~/yafu/ecm∰∂ man grep bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "NICE_PATH" NICE_PATH = '' #'/usr/bin/nice -19' al['preexec_fn'] = NICE_PATH bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "Popen" p = subprocess.Popen(args.split(' '), preexec_fn=lambda: os.nice(20), **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 Traceback (most recent call last): File "./ecm.py", line 1225, in <module> start_ecm_threads() File "./ecm.py", line 522, 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 325, in run_exe p = subprocess.Popen(args.split(' '), preexec_fn=lambda: os.nice(20), **al) TypeError: type object got multiple values for keyword argument 'preexec_fn' Code:
bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "NICE_PATH" NICE_PATH = '' #'/usr/bin/nice -19' pass #al['preexec_fn'] = NICE_PATH bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "Popen" p = subprocess.Popen(args.split(' '), preexec_fn=lambda: os.nice(20), **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 Traceback (most recent call last): File "./ecm.py", line 1225, in <module> start_ecm_threads() File "./ecm.py", line 522, 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 325, in run_exe p = subprocess.Popen(args.split(' '), preexec_fn=lambda: os.nice(20), **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 Last fiddled with by Dubslow on 2012-09-22 at 21:06 |
|
![]() |
![]() |
![]() |
#33 |
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
![]()
Char limit reached.
Code:
bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "NICE_PATH" NICE_PATH = '' #'/usr/bin/nice -19' pass #al['preexec_fn'] = NICE_PATH bill@Gravemind:~/yafu/ecm∰∂ cat ecm.py | grep "Popen" #p = subprocess.Popen(args.split(' '), preexec_fn=lambda: os.nice(20), **al) p = subprocess.Popen(args.split(' '), **al) # Don't bother with preexec #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 Traceback (most recent call last): File "./ecm.py", line 1225, in <module> start_ecm_threads() File "./ecm.py", line 522, 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 326, in run_exe p = subprocess.Popen(args.split(' '), **al) # Don't bother with preexec 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 Last fiddled with by Dubslow on 2012-09-22 at 21:12 |
![]() |
![]() |
![]() |
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 |