mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2013-12-23, 00:43   #1
f1pokerspeed
 
Jun 2012

2×53 Posts
Default Windows batch file for NFS - any help?

This is what I have so far, and this absolutely does not work.

Code:
@ECHO OFF

REM Get number to factor
SET num = Enter number:
ECHO num > worktodo.ini

REM Run msieve polsel stage 1
START /wait "MSIEVE Poly Select Stage 1" chdir "msieve.exe" -np1 -nps

REM Best polys selected to optimize roots
set numcols = Enter number of columns per line in msieve.dat.ms:
START /wait "sort" chdir "sort.exe" -g -k numcols > msieve.dat.ms
START /wait "head" chdir "head.exe" -10000 > msieve.dat.ms

REM Root optimization
START /wait "MSIEVE Poly Select Stage 2" chdir "msieve.exe" -npr

REM File movement
copy msieve.p fms
cd fms
ren msieve.p n.p

REM factmsieve completes factorization
START /wait "Sieve & Linear Algebra via factmsieve" chdir "factmsieve.py" n
I get "file not found" errors. The batch file is in the same directory as the msieve binary, ggnfs binaries, the GnuWin32 ports of sort and head, and "fms" folder with factmsieve.py in. The SET commands also get skipped....

Last fiddled with by f1pokerspeed on 2013-12-23 at 00:45
f1pokerspeed is offline   Reply With Quote
Old 2013-12-23, 13:13   #2
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

factmsieve.py can take care of polynomial selection, too. I'd recommend you read Jeff Gilchrist's excellent Beginners Guide to NFS factoring using GGNFS and MSIEVE

Last fiddled with by Mini-Geek on 2013-12-23 at 13:14
Mini-Geek is offline   Reply With Quote
Old 2013-12-23, 19:10   #3
f1pokerspeed
 
Jun 2012

2·53 Posts
Default

I read the guide but the thing is... factmsieve does all poly select stages at once (size & root optimization) - so you lose throughput. I wanted to use a batch file so I didn't have to do it all manually.
f1pokerspeed is offline   Reply With Quote
Old 2013-12-23, 19:43   #4
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

22×1,433 Posts
Default

Have you tried it with echo on? Does SET work with echo off?
henryzz is online now   Reply With Quote
Old 2013-12-23, 20:08   #5
kracker
ἀβουλία
 
kracker's Avatar
 
"Mr. Meeseeks"
Jan 2012
California, USA

41708 Posts
Default

Take the @echo off off and see what the error really is.

Last fiddled with by kracker on 2013-12-23 at 20:46
kracker is offline   Reply With Quote
Old 2013-12-23, 22:28   #6
f1pokerspeed
 
Jun 2012

2×53 Posts
Default

Well, I get the "System cannot find the path specified" error... which is odd, as the path is the current working directory (with all the binaries...) Would putting chdir in speech marks help?

It also skips over the get input section at the SET command, which is annoying... then writes the string "num" to worktodo.ini, so I probably need to make that %num.
f1pokerspeed is offline   Reply With Quote
Old 2013-12-24, 01:17   #7
potonono
 
potonono's Avatar
 
Jun 2005
USA, IL

193 Posts
Default

How about below?

Quote:
echo off
cls

REM ----- Get number to msieve from user
SET /P num="Enter msieve worktodo number:"
ECHO %num% > worktodo.ini

REM ----- Run msieve polsel stage 1
START /wait "MSIEVE Poly Select Stage 1" "msieve.exe" -np1 -nps

REM ----- Best polys selected to optimize roots
SET /P numcols="Enter number of columns per line for sort and head:"
START /wait "sort" "sort.exe" -g -k %numcols% > msieve.dat.ms
START /wait "head" "head.exe" -10000 > msieve.dat.ms

REM ----- Root optimization
START /wait "MSIEVE Poly Select Stage 2" "msieve.exe" -npr

REM ----- File movement
copy msieve.p fms
cd fms
ren msieve.p n.p

REM ----- factmsieve completes factorization
START /wait "Sieve & Linear Algebra via factmsieve" "factmsieve.py" n

echo done
pause
I don't know what the sort and head programs do. You might also want to use >> instead of > unless you really do want the head program to overwrite the sort program results being output to the msieve.dat.ms file.

Last fiddled with by potonono on 2013-12-24 at 01:28
potonono is offline   Reply With Quote
Old 2013-12-24, 17:49   #8
f1pokerspeed
 
Jun 2012

2·53 Posts
Default

Thank you, that works great!
f1pokerspeed is offline   Reply With Quote
Old 2013-12-24, 18:08   #9
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,163 Posts
Default

Be careful, in a command prompt the windows 'sort' program is made to come first in the path, and it doesn't understand the -g and -k options. It doesn't matter if all your binaries are in the same directory, but I often want only one copy somewhere.
jasonp is offline   Reply With Quote
Old 2013-12-24, 18:21   #10
f1pokerspeed
 
Jun 2012

2·53 Posts
Default

I'm using the GNUWin tools - so basically it's Linux sort and head.
f1pokerspeed is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch File Issue, Perhaps storm5510 Programming 3 2018-01-18 04:44
P95 - Windows 7 - Unable to open log file ThomRuley PrimeNet 2 2017-01-15 20:43
Batch jobs using AWS Batch GP2 Cloud Computing 1 2016-12-07 11:31
Missing Help File in Windows pintoj Information & Answers 2 2009-06-18 17:12
batch file em99010pepe No Prime Left Behind 7 2008-03-15 10:53

All times are UTC. The time now is 09:20.

Fri Oct 23 09:20:06 UTC 2020 up 43 days, 6:31, 0 users, load averages: 2.04, 1.61, 1.68

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.