mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GPU Computing (https://www.mersenneforum.org/forumdisplay.php?f=92)
-   -   mfaktc: a CUDA program for Mersenne prefactoring (https://www.mersenneforum.org/showthread.php?t=12827)

chris2be8 2011-09-07 09:04

The first thing to check is if the lines end with CRLF instead of just LF. Try running dos2unix against a copy of worktodo.txt and see if it changes size. If it does try running with the new file.

Chris K

Dubslow 2011-09-07 19:59

Thanks, I've noticed that Windows doesn't separate lines written while in Linux, so I'll give it a shot (although you'd think opening it in nano or gedit would change it back to linux format). What are CRLF and LF? (I imagine they're part of the difference between dos and unix?)

James Heinrich 2011-09-07 20:53

[QUOTE=Dubslow;271107]What are CRLF and LF?[/QUOTE]There is of course a whole [url=http://en.wikipedia.org/wiki/Newline]Wikipedia article on the subject[/url], but in short:

CR = Carriage Return = ASCII character 13, sometimes written as \r
LF = Line Feed = ASCII character 10, sometimes written as \n

Quoting the footnote of the Wikipedia article:[quote]The origin of the older computer term "CRLF" - which redirects to this Newline article - or "Carriage Return [and] Line Feed", derives from standard manual typewriter design, whereby at the end of a line of text the typist pushes a lever at the left end of the carriage to return it to position for beginning the next line. In so doing, a mechanism also rolls the typewriter's platen by one line, advancing ("feeding") the paper to the correct position.[/quote]

Unix uses LF to separate lines.
Mac uses CR to separate lines.
Windows uses CR+LF to separate lines.

If you open a Unix or Mac file in Notepad, for example, it's looking for CR+LF characters to separate the lines, and doesn't find them, so assumes it's all one line. If you open a Windows file on a Mac or Unix machine, you'll get proper line separation, but with an extra (possibly invisible) character at the beginning or end of each line. Of course, any of the better text editors on any platform are aware of the various newline variants and will display all files properly, and also not break them when re-saving them.

Xyzzy 2011-09-07 20:56

1 Attachment(s)
"DOS"[CODE]$ cat test.txt | od -c
0000000 a \r \n b \r \n c
0000007[/CODE]"Unix"[code]$ cat test.txt | tr -d '\r' | od -c
0000000 a \n b \n c
0000005
[/code]

Christenson 2011-09-07 22:36

Oliver (the Judger) and I are discussing the parser right now, and we intend to make it ignore blank lines in the next version.

Dubslow 2011-09-09 05:10

Speaking of which, is there any easy way to see what the latest release is? Also, thanks for all the tips, very useful, and also helps me understand why 1. I don't have this problem with M/Prime/95 and 2. Why all the read me files and such with mfaktc came out all wrong in notepad.
Thanks guys!

Christenson 2011-09-09 11:37

Latest release is mfaktc0.17. Oliver is working on 0.18pre6.

Xyzzy 2011-09-09 14:11

[QUOTE]Speaking of which, is there any easy way to see what the latest release is?[/QUOTE][url]http://www.mersenneforum.org/mfaktc/[/url]

TheJudger 2011-09-09 15:28

Hello,

[QUOTE=Dubslow;271257]2. Why all the read me files and such with mfaktc came out all wrong in notepad.
Thanks guys![/QUOTE]

Again LF vs. CRLF. On Windows you can try wordpad instead of notepad.

[url]http://www.mersennewiki.org/index.php/Mfaktc[/url]
[url]http://www.mersenneforum.org/mfaktc/[/url]

Christenson 2011-09-09 18:09

[QUOTE=Xyzzy;271298][url]http://www.mersenneforum.org/mfaktc/[/url][/QUOTE]

That link looks a bit hard to find...what page is it on?

cheesehead 2011-09-10 01:18

[QUOTE=Christenson;271320]That link looks a bit hard to find...what page is it on?[/QUOTE][url]http://www.mersenneforum.org/mfaktc/[/url] [i]is[/i] the page, on which are links to two .gz and two .zip files containing the four diffferent flavors of the latest release.


All times are UTC. The time now is 23:14.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.