![]() |
[QUOTE=Dubslow;296775]I mostly don't understand this. If the first program is not using the file in any way, how can it be unsafe to modify worktodo.txt?[/QUOTE]
Because you don't know when it might open it for reading/writing again. Think about it from the perspective of another program which has no knowledge of the state of the first program. Further, you're assuming that even if the first program doesn't have the file open that it is prepared to deal with the contents changing. [QUOTE=Dubslow;296775]Right, given that what I corrected was, in fact, a typo...[/QUOTE] Yes, I meant to write "worktodo.txt". [QUOTE=Dubslow;296775]But, in CUDALucas' case, we [i]do[/i] know exactly when CUDALucas will modify a file (and if it didn't delete test history, it wouldn't do any writing at all, just reading).[/QUOTE] Only by observing it's state. Much harder to do automatically. [QUOTE=Dubslow;296775]That's why I'm saying I don't like worktodo.add in this case, because CUDALucas doesn't fall into this class of program that requires worktodo.add. (That's why I've been continuing this debate -- because this is the CUDALucas thread, so I assumed we were excepting this class of program.) (This sort of reasoning also applies to Prime95 with all GIMPS worktypes except TF, which is why it frustrates me that I have to kill it to modify worktodo.txt.)[/QUOTE] But I would argue you have very particular desires, which not everyone shares. Thus, I think that worktodo.add functionality would be useful to many people. It doesn't have to be used, but it would be a good thing to have for many people. [QUOTE=Dubslow;296775]Additionally, with mfaktc, the added benefit (for me) of being able to modify worktodo.txt out of order (i.e. not with .add) outweighs the risk that mfaktc will write to worktodo.txt, given that factors are printed on screen (and the comment about deleting history also applies here). That's why I didn't like the talk about having mfakt* apply a lock indefinitely; at the very least I'd prefer that to be a disable-able option.[/QUOTE] But we come back to the "once a month bug". What you want to do will result in failure some times. Rarely, I agree, but sometimes. Sorry for berating this topic, but I've been taught (the hard way) to try to avoid such situations at all times. And, lastly, I think you misunderstand what was being discussed for the file locking for mfakt*. It was intended to exist only when the file was being modified, not all the time. However, as was pointed out, some use network file systems for their clusters, so file locking would not be a complete solution. |
[QUOTE=chalsall;296777]Because you don't know when it might open it for reading/writing again.
Think about it from the perspective of another program which has no knowledge of the state of the first program. Further, you're assuming that even if the first program doesn't have the file open that it is prepared to deal with the contents changing. Only by observing it's state. Much harder to do automatically. [/quote]Ah, okay. Another case of crossed based assumptions: I've been thinking that only I would be modifying worktodo.txt. I can see that if one were to design a spider to get work for mfat[co]/CuLu, then yes I see you would need worktodo.add anyways (and in that case you wouldn't be adding out of order). [QUOTE=chalsall;296777] But I would argue you have very particular desires, which not everyone shares. Thus, I think that worktodo.add functionality would be useful to many people. It doesn't have to be used, but it would be a good thing to have for many people.[/quote]Yes, all I ask is to be sure that "It doesn't have to be used" is true, hence my comment about disable-ability. [QUOTE=chalsall;296777] And, lastly, I think you misunderstand what was being discussed for the file locking for mfakt*. It was intended to exist only when the file was being modified, not all the time. However, as was pointed out, some use network file systems for their clusters, so file locking would not be a complete solution.[/QUOTE]Ah, okay. Whoops. Debate resolved with agreement! (I think!) :fusion: We need a high five smiley. |
[QUOTE=Dubslow;296782]Debate resolved with agreement! (I think!) :fusion:[/QUOTE]
Agreed. [QUOTE=Dubslow;296782]We need a high five smiley.[/QUOTE] How about :chalsall:? :wink: |
[QUOTE=LaurV;296588]Quote:
Originally Posted by [B]Dubslow[/B] [URL="http://www.mersenneforum.org/showthread.php?p=296584#post296584"][IMG]http://www.mersenneforum.org/images/buttons/viewpost.gif[/IMG][/URL] [I]Anyone want to run it through Prime95? (Edit: Expo is 26409557) [/I] I will queue it second on my list (after current DC expo finishes in 6-7 hours) on one core. ETA ~3 days. Should I automatically report it? Or check with you first? (in this case please remind me in few days, otherwise it may remain unreported).[/QUOTE] I finished and reported, the P95 residue is indeed different, something with 060CAD... |
[QUOTE=LaurV;296802]I finished and reported, the P95 residue is indeed different, something with 060CAD...[/QUOTE]
:smile: I remember thinking "heh, CAD, right up his alley" :razz: |
[QUOTE=Dubslow;296803]
I remember thinking "heh, CAD, right up his alley" :razz:[/QUOTE] :smile: That is why I remembered it, hehehe...., so original test was BAD! (not hex, but English). Now for all other users who are against out little truce: This is a perfect example of what we were talking before. If Dubslow would report it and I (again, not personally, but generally speaking) would get it assigned without all this communication between us, then most probably I would have been done the job with CudaLucas, wasting a day of computer power, for no credit given, and for no help for the project. If the things would turn out the other way around, like the original being correct and Dubslow's CL being wrong, again, reporting it (a bad residue) would not help the project, but would "hit" Dubslow (at least his pride :P), incresing his percent of bad reports. My twopences: whatever anyone say, reporting a DC mismatch without TC-ing it (by yourself or using a third), helps no one, nor the project. Of course, there are people who prefer to "set it and forget it", or better, "fire it and forget it". |
I like it for the speed of the TC -- there's no need to even put it on your list, and we find out two days later. I'd rather not wait three months or more for ANON to tell me if I'm right or not :P
|
[QUOTE=Brain;296743]I've had a dozen successfull matches but since 2.00 i've had 6 mismatches and only 2 matches. :-( All mismatches happened when CL started with fftlength=1572864 and increased after less than 100 iters to 1835008... Can anybody confirm this observation?
Additionally, when I insert a new expo to worktodo.txt (CL already running) it doesn't resume: cudalucas.ini is +1 to high in that case: Line 4 contains the next expo, cudalucas.ini says 4 but would require 3... Am I missing something?[/QUOTE] 2.00 has not been good for me, as well. I had a lot of mismatches with it. I've been too busy at work to troubleshoot the problem. 1.69 was very stable though. |
[QUOTE=flashjh;296886]2.00 has not been good for me, as well. I had a lot of mismatches with it. I've been too busy at work to troubleshoot the problem. 1.69 was very stable though.[/QUOTE]
I'm 100% with it. |
[QUOTE=Dubslow;296887]I'm 100% with it.[/QUOTE]
I think it's my cards. They're very good for TF, but CL requires *perfect* memory. When I get a card to test on I'll know for sure. The timing has a lot to do with it though, because 1.69 worked very well. I also had a power failure and CL hasn't worked well since, I think it may have ruined my cards. |
I still trust 2.00
We should keep investigating. My first GTX 560 Ti was perfect with 1.69. But when I switched to CL 2.00 I added a second GPU. Temp of perfect GPU#1 when up from 79°C up to 93°C and I got mismatches. This may or may not be the reason.
I'd like to read more of your stats as my good 2.00 DCs were all done with no FFT increase at startup. All bad experienced a FFT increase. Coincidence? [QUOTE=Dubslow;296887]I'm 100% with it.[/QUOTE] This means you have full trust? By the way, no overclocking here. |
All my tests have been done with a specified length, in a small range of expos so that the specified length is guaranteed not to cause problems. Within the range I have tested, I have more trust in CUDALucas then in the random 5 year old tests on PrimeNet. (Edit: Factory OC from 675 to 751 MHz for me, but I have not OCd it any further, and running temperatures never break 65C, sometimes less than 60C.)
|
[QUOTE=Dubslow;296933]All my tests have been done with a specified length, in a small range of expos so that the specified length is guaranteed not to cause problems. Within the range I have tested, I have more trust in CUDALucas then in the random 5 year old tests on PrimeNet. (Edit: Factory OC from 675 to 751 MHz for me, but I have not OCd it any further, and running temperatures never break 65C, sometimes less than 60C.)[/QUOTE]
My temps are probably the problem. I'll investigate more later. @Brain: what stats do you want to see? |
[QUOTE=flashjh;296945]My temps are probably the problem. I'll investigate more later.
@Brain: what stats do you want to see?[/QUOTE] The rule-of-thumb that I recall is that nVidia's are supposed to be safe north of 90C, maybe up to 100C; OTOH, word-of-mouth/rule-of-thumb is never very accurate, and of course, that's for playing video games, not error-sensitive computations. I'd say aim for 80, maybe 85, but anything beyond that is probably too much. |
[QUOTE=flashjh;296945]
@Brain: what stats do you want to see?[/QUOTE] I think of a table like this: Exponent Range (# Initial FFT length) # Final FFT length # Number of good DCs # Number of bad DCs (# Average GPU temp # Overclock in % # Non default CL options # more if useful) Here my latest results, not yet in the table format, 5 vs 6: [CODE] [LEFT]Verified test results ExponentUser nameComputer nameResidue Date found 27474101 Sebastian Hornbostel Manual testing 47ADA87EFB861DD7 2012-03-14 14:33 27663523 Sebastian Hornbostel Manual testing EB1F96542A321991 2012-04-05 19:34 27905873 Sebastian Hornbostel Manual testing 53BDB222E1A1380C 2012-04-14 19:15 29309279 Sebastian Hornbostel Manual testing 62028C534D442A33 2012-03-18 20:16 43758037 Sebastian Hornbostel Manual testing E88FA154335EA2C3 2012-04-01 19:36 [/LEFT] Unverified test results ExponentUser nameComputer nameResidueError code (if any)Date found 27227191 Sebastian Hornbostel Manual testing FC794386077112__ 2012-04-11 17:25 27637219 Sebastian Hornbostel Manual testing EE7092F4DAF5E5__ 2012-04-08 15:44 28850039 Sebastian Hornbostel Manual testing 1AEE3C955657DC__ 2012-04-18 16:12 28887407 Sebastian Hornbostel Manual testing B4A9E01183BD8A__ 2012-04-12 17:38 29359303 Sebastian Hornbostel Manual testing 183CD50CBDC04E__ 2012-03-22 21:15 29555363 Sebastian Hornbostel Manual testing B197F6DD572574__ 2012-04-18 16:12[/CODE]I had a driver failure which I suppose to have killed 2 DCs. |
[QUOTE=Dubslow;296946]The rule-of-thumb that I recall is that nVidia's are supposed to be safe north of 90C, maybe up to 100C; OTOH, word-of-mouth/rule-of-thumb is never very accurate, and of course, that's for playing video games, not error-sensitive computations. I'd say aim for 80, maybe 85, but anything beyond that is probably too much.[/QUOTE]
On my GTX 480's, anything at or below 95 C is normal. Around 100 C I start seeing problems. |
From my setup. The "must keep below temp" is 95degC. Above that and components are throttled.
-- Craig |
1 Attachment(s)
Ver 2.01
Fix caluclate raundoff err. [code] M( 26974951 )C, 0xe72576f52d2b0d8c, n = 1474560, CUDALucas v2.00 M( 26975743 )C, 0x67d12882dc466fd7, n = 1474560, CUDALucas v2.00 M( 26767891 )C, 0xbbeb0ad54a815dda, n = 1474560, CUDALucas v2.00 M( 26768243 )C, 0x3280d4e28ef0b188, n = 1474560, CUDALucas v2.00 M( 26822449 )C, 0xad9016be8bd360a9, n = 1474560, CUDALucas v2.00 M( 26823619 )C, 0xb989439408521303, n = 1474560, CUDALucas v2.00 M( 27722911 )C, 0x42c0350cdd3596a9, n = 1572864, CUDALucas v2.00 M( 27192083 )C, 0xc5ec2d3fd58a9ccf, n = 1474560, CUDALucas v2.00 M( 27192391 )C, 0xc882ca1522e59f5e, n = 1474560, CUDALucas v2.00 M( 27699043 )C, 0xd0eda360a4e70525, n = 1572864, CUDALucas v2.01 M( 27703817 )C, 0xd73a94c433bcd689, n = 1572864, CUDALucas v2.01 M( 27706841 )C, 0x6708a475e7e3db2b, n = 1572864, CUDALucas v2.01 M( 27707293 )C, 0xf82f49632f7b11c1, n = 1572864, CUDALucas v2.01 M( 27708413 )C, 0x78c5e390d697eec8, n = 1572864, CUDALucas v2.01 M( 27661351 )C, 0x13df0d77627419bc, n = 1572864, CUDALucas v2.01 [/code] All DC successfully. |
@msft: you are a sweet! thanks!
|
[QUOTE=msft;297083]Ver 2.01
Fix caluclate raundoff err. [code] M( 26974951 )C, 0xe72576f52d2b0d8c, n = 1474560, CUDALucas v2.00 M( 26975743 )C, 0x67d12882dc466fd7, n = 1474560, CUDALucas v2.00 M( 26767891 )C, 0xbbeb0ad54a815dda, n = 1474560, CUDALucas v2.00 M( 26768243 )C, 0x3280d4e28ef0b188, n = 1474560, CUDALucas v2.00 M( 26822449 )C, 0xad9016be8bd360a9, n = 1474560, CUDALucas v2.00 M( 26823619 )C, 0xb989439408521303, n = 1474560, CUDALucas v2.00 M( 27722911 )C, 0x42c0350cdd3596a9, n = 1572864, CUDALucas v2.00 M( 27192083 )C, 0xc5ec2d3fd58a9ccf, n = 1474560, CUDALucas v2.00 M( 27192391 )C, 0xc882ca1522e59f5e, n = 1474560, CUDALucas v2.00 M( 27699043 )C, 0xd0eda360a4e70525, n = 1572864, CUDALucas v2.01 M( 27703817 )C, 0xd73a94c433bcd689, n = 1572864, CUDALucas v2.01 M( 27706841 )C, 0x6708a475e7e3db2b, n = 1572864, CUDALucas v2.01 M( 27707293 )C, 0xf82f49632f7b11c1, n = 1572864, CUDALucas v2.01 M( 27708413 )C, 0x78c5e390d697eec8, n = 1572864, CUDALucas v2.01 M( 27661351 )C, 0x13df0d77627419bc, n = 1572864, CUDALucas v2.01 [/code] All DC successfully.[/QUOTE] Was it run with default settings or with fancy switches? Luigi |
[QUOTE=ET_;297092]Was it run with default settings or with fancy switches?
Luigi[/QUOTE] Sorry not keep recode. |
CUDALucas 2.01 x64 Binaries
1 Attachment(s)
[QUOTE=msft;297083]Ver 2.01
Fix caluclate [B]roundoff[/B] err. [code] M( 26974951 )C, 0xe72576f52d2b0d8c, n = 1474560, CUDALucas v2.00 M( 26975743 )C, 0x67d12882dc466fd7, n = 1474560, CUDALucas v2.00 M( 26767891 )C, 0xbbeb0ad54a815dda, n = 1474560, CUDALucas v2.00 M( 26768243 )C, 0x3280d4e28ef0b188, n = 1474560, CUDALucas v2.00 M( 26822449 )C, 0xad9016be8bd360a9, n = 1474560, CUDALucas v2.00 M( 26823619 )C, 0xb989439408521303, n = 1474560, CUDALucas v2.00 M( 27722911 )C, 0x42c0350cdd3596a9, n = 1572864, CUDALucas v2.00 M( 27192083 )C, 0xc5ec2d3fd58a9ccf, n = 1474560, CUDALucas v2.00 M( 27192391 )C, 0xc882ca1522e59f5e, n = 1474560, CUDALucas v2.00 M( 27699043 )C, 0xd0eda360a4e70525, n = 1572864, CUDALucas v2.01 M( 27703817 )C, 0xd73a94c433bcd689, n = 1572864, CUDALucas v2.01 M( 27706841 )C, 0x6708a475e7e3db2b, n = 1572864, CUDALucas v2.01 M( 27707293 )C, 0xf82f49632f7b11c1, n = 1572864, CUDALucas v2.01 M( 27708413 )C, 0x78c5e390d697eec8, n = 1572864, CUDALucas v2.01 M( 27661351 )C, 0x13df0d77627419bc, n = 1572864, CUDALucas v2.01 [/code] All DC successfully.[/QUOTE] Attached CL 2.01 x64 Binaries with makefile & souce (untested) 3.2 | 1.3 4.0 | 2.0 4.0 | 2.1 @msft: lines 313, 328, 335, 346 & 1165 need (float), can you add that to your soucre? Thanks. |
[QUOTE=flashjh;297125]@msft: lines 313, 328, 335, 346 & 1165 need (float), can you add that to your soucre? Thanks.[/QUOTE]
Fixed in the net version. Many thanks! |
2.01 status
How's 2.01 working for everyone?
Good DCs vs Bad DCs? Thanks! |
M( 3021377 )P, n = 163840, CUDALucas v2.01.
The performance is amazing - mean 0.328783 ms/iter. |
Hey LaurV/anybody else, I got another mismatch (still using 2.00). Could you run [URL="http://mersenne.org/report_exponent/?exp_lo=25831787"]M25831787[/URL] and tell me when you submit the result?
|
[QUOTE=Dubslow;299561]Hey LaurV/anybody else, I got another mismatch (still using 2.00). Could you run [URL="http://mersenne.org/report_exponent/?exp_lo=25831787"]M25831787[/URL] and tell me when you submit the result?[/QUOTE]
I'm running it now, I'll let you know. |
[QUOTE=Dubslow;299561]Hey LaurV...[/QUOTE]
Sorry, I am temporary out of the game, half of the resources are totally busy, and the other half are split down to pieces and spread through all the house, fact that is maximum pissing off Mrs LaurV... ([URL="http://www.mersenneforum.org/showpost.php?p=297948&postcount=888"]switching [/URL]to liquid cooling). |
Could someone help me understand what this code does?
[code]int _kbhit (void) { struct termios oldt, newt; int ch; int oldf; tcgetattr (STDIN_FILENO, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr (STDIN_FILENO, TCSANOW, &newt); oldf = fcntl (STDIN_FILENO, F_GETFL, 0); fcntl (STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK); ch = getchar (); tcsetattr (STDIN_FILENO, TCSANOW, &oldt); fcntl (STDIN_FILENO, F_SETFL, oldf); if (ch != EOF) { ungetc (ch, stdin); return 1; } return 0; }[/code] |
Looks like it checks if a key was pressed, and if so, put it back in the queue but signal the caller that a character can now be retrieved.
P.S. A copy of the normal term i/o handler is created except it is now non-blocking. If you ask for a char from normal code, it will sit doing nothing _until_ you press the key. Here, this routine will report to the caller - "there was no activity, carry on". |
[QUOTE=Batalov;299660]Looks like it checks if a key was pressed, and if so, put it back in the queue but signal the caller that a character can now be retrieved.[/QUOTE]Hmm... that's what the last few lines looked like, but I've never run across termios before... to that end, I'm going through [URL="http://blog.nelhage.com/2009/12/a-brief-introduction-to-termios/"]this[/URL] and its follow-ups; why not just do something like[code]char c = getchar(); if(c!=EOF) { ungetc(c, stdin); return 1;} else return 0;[/code] ...? In other words, what's the point of the termios stuff? I'll try and figure it out on my own, but I'm leaving soon for a couple of hours.
|
[QUOTE=Dubslow;299661] why not just do something like[code]char c = getchar(); if(c!=EOF) { ungetc(c, stdin); return 1;} else return 0;[/code] ...?[/QUOTE]
Because in that case (your code) the computer is locked until you decide to press the dammit key. The monkey bar joke. When I was child I did a lot of quarters with "I bet you a quarter you can't hang on it until I count to 10". Many of my friends took the bet, then I was counting very fast to 9, and going away living them hanging on the bar. Eventually they felt down and lost the bet, because they could not hold on it [U]until[/U] I counted to [U]10[/U]. The original code does a lot of work to modify the behavior of the getchar() routine to return immediately in case no key was already pressed, without waiting for the key, and if a key was pressed, to get its [U]scan code[/U], (accepting key combinations, like CTRL+ALT+F12), and terminate if ctrl+c was pressed. After the key is read, the old behavior (waiting for the key) is restored. Se for details [URL="http://www.daniweb.com/software-development/c/threads/147540/how-can-we-get-scan-code-in-c-using-gcc-compiler"]here[/URL] and [URL="http://www.daniweb.com/software-development/cpp/threads/331393/to-generate-keystrokes-using-c-linux-os"]here[/URL] (follow the fork link in that post). |
[QUOTE=LaurV;299670]Because in that case (your code) the computer is locked until you decide to press the dammit key. The monkey bar joke. When I was child I did a lot of quarters with "I bet you a quarter you can't hang on it until I count to 10". Many of my friends took the bet, then I was counting very fast to 9, and going away living them hanging on the bar. Eventually they felt down and lost the bet, because they could not hold on it [U]until[/U] I counted to [U]10[/U].
The original code does a lot of work to modify the behavior of the getchar() routine to return immediately in case no key was already pressed, without waiting for the key, and if a key was pressed, to get its [U]scan code[/U], (accepting key combinations, like CTRL+ALT+F12), and terminate if ctrl+c was pressed. After the key is read, the old behavior (waiting for the key) is restored. Se for details [URL="http://www.daniweb.com/software-development/c/threads/147540/how-can-we-get-scan-code-in-c-using-gcc-compiler"]here[/URL] and [URL="http://www.daniweb.com/software-development/cpp/threads/331393/to-generate-keystrokes-using-c-linux-os"]here[/URL] (follow the fork link in that post).[/QUOTE] Sweet! I knew there was a stupidly easy and obvious explanation :smile: I swear I'm not usually this dumb :razz: Edit: It seems to be formulaic enough that I can reuse it without a problem; it seems that actually understanding it will require quite a bit of time reading through 'man termios', which I'll do later. Thanks for the help, B&L. |
[QUOTE=Dubslow;299561]Hey LaurV/anybody else, I got another mismatch (still using 2.00). Could you run [URL="http://mersenne.org/report_exponent/?exp_lo=25831787"]M25831787[/URL] and tell me when you submit the result?[/QUOTE]
Original is correct. You want me to post the DC to PrimeNet? |
{sarcasm}
No, clearly, to make things right you should pass the residue to Dubslow, so that he could submit it as a CUDALucas residue. After all, the error was now corrected! {/sarcasm} Seriously, if you don't want people to make suggestions like the above you could PM each other. OTOH, if you value other people's opinions, you should simply let the server do its job of tallying correct and incorrect residues and enforce impartiality by assigning the double-check to a [B]random[/B] [strike]person[/strike] computer that is not going to have an preconceived agenda if it is right, or even "polite" to correct someone else's mistake ("What if I hurt his feelings by pointing out that his residue was incorrect? Ah, ah, ah, what should I do?!"). Dudes, grow up already - these are just numbers! You voluntarily turn yourselves into [URL="http://en.wikipedia.org/wiki/Human_computer"]human computers[/URL]. |
[QUOTE=Batalov;299740]{sarcasm}
No, clearly, to make things right you should pass the residue to Dubslow, so that he could submit it as a CUDALucas residue. After all, the error was now corrected! {/sarcasm} Seriously, if you don't want people to make suggestions like the above you could PM each other. OTOH, if you value other people's opinions, you should simply let the server do its job of tallying correct and incorrect residues and enforce impartiality by assigning the double-check to a [B]random[/B] [strike]person[/strike] computer that is not going to have an preconceived agenda if it is right, or even "polite" to correct someone else's mistake ("What if I hurt his feelings by pointing out that his residue was incorrect? Ah, ah, ah, what should I do?!"). Dudes, grow up already - these are just numbers! You voluntarily turn yourselves into [URL="http://en.wikipedia.org/wiki/Human_computer"]human computers[/URL].[/QUOTE] No problem either way... He asked someone to run a TC, and I did. I had no intention good or bad, I just want to know if he wants me to submit to PrimeNet or if he wants to run it again. I'm not sure where you perceieved a problem, but there is none. |
Submit the successful triple-check first.
If you submit the bad double-check first, then there is a window where the server will make the exponent available to some poor unsuspecting user for a triple-check. |
[QUOTE=Prime95;299744]Submit the successful triple-check first.
If you submit the bad double-check first, then there is a window where the server will make the exponent available to some poor unsuspecting user for a triple-check.[/QUOTE] Indeed. If you submit, nothing happens -- if I submit, I lose the assignment for the exponent. Hmm, I only just now read that I was wrong. I guess the lesson is don't upgrade drivers during a test... first mismatch I've had with 2.00. (Out of 8-10 or so. I'm not on 2.01 yet, though I will be soon.) |
[QUOTE=Dubslow;299659]Could someone help me understand what this code does?
[/QUOTE] [QUOTE=Batalov;299660]Looks like it checks if a key was pressed, and if so, put it back in the queue but signal the caller that a character can now be retrieved. P.S. A copy of the normal term i/o handler is created except it is now non-blocking. If you ask for a char from normal code, it will sit doing nothing _until_ you press the key. Here, this routine will report to the caller - "there was no activity, carry on".[/QUOTE] [QUOTE=LaurV;299670]Because in that case (your code) the computer is locked until you decide to press the dammit key. The monkey bar joke. When I was child I did a lot of quarters with "I bet you a quarter you can't hang on it until I count to 10". Many of my friends took the bet, then I was counting very fast to 9, and going away living them hanging on the bar. Eventually they felt down and lost the bet, because they could not hold on it [U]until[/U] I counted to [U]10[/U]. The original code does a lot of work to modify the behavior of the getchar() routine to return immediately in case no key was already pressed, without waiting for the key, and if a key was pressed, to get its [U]scan code[/U], (accepting key combinations, like CTRL+ALT+F12), and terminate if ctrl+c was pressed. After the key is read, the old behavior (waiting for the key) is restored. Se for details [URL="http://www.daniweb.com/software-development/c/threads/147540/how-can-we-get-scan-code-in-c-using-gcc-compiler"]here[/URL] and [URL="http://www.daniweb.com/software-development/cpp/threads/331393/to-generate-keystrokes-using-c-linux-os"]here[/URL] (follow the fork link in that post).[/QUOTE] If I only cared about the first character, could I do something like this? [code]char _kbhit (void) { struct termios oldt, newt; int ch; int oldf; tcgetattr (STDIN_FILENO, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr (STDIN_FILENO, TCSANOW, &newt); oldf = fcntl (STDIN_FILENO, F_GETFL, 0); fcntl (STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK); ch = getchar (); tcsetattr (STDIN_FILENO, TCSANOW, &oldt); fcntl (STDIN_FILENO, F_SETFL, oldf); if (ch != EOF) { [strike]ungetc (ch, stdin); return 1;[/strike] [U]return ch;[/U] } return 0; }[/code] And then instead of: [code] if( _kbhit() ) { char c = getchar(); /* do something */ } [/code] we could just do [code]if( char c=_khbit() ) { /* do something */ } [/code] |
You then may need to process all the characters, and return back to the OS the characters which are not yours. Otherwise you just hooked the kbd for yourself for as long as the program is running... In single task your modification would work perfect. Now imagine you have multitasking and some process in the background is calling kbhit in a loop (therefore discarding all the characters that enters the buffer of the peripheral). There will be no way for you to input something, in your foreground process (calculator, text editor, cmd line, whatever). Returning the character (instead of 1) is ok, and maybe useful, but "not putting it back in the buffer" is a bad practice. Some other guys in the system may need it.
edit: :threadhijacked: |
[QUOTE=LaurV;299788]You then may need to process all the characters, and return back to the OS the characters which are not yours. Otherwise you just hooked the kbd for yourself for as long as the program is running... In single task your modification would work perfect. Now imagine you have multitasking and some process in the background is calling kbhit in a loop (therefore discarding all the characters that enters the buffer of the peripheral). There will be no way for you to input something, in your foreground process (calculator, text editor, cmd line, whatever). Returning the character (instead of 1) is ok, and maybe useful, but "not putting it back in the buffer" is a bad practice. Some other guys in the system may need it.
edit: :threadhijacked:[/QUOTE] Well, we're talking about a terminal which is controlled by the program running. Even the first option, the guy calling kbhit() just re-gets the char anyways. (Perhaps a supermod could move these posts to the programming forum?) |
[QUOTE=Dubslow;299790]Well, we're talking about a terminal which is controlled by the program running. Even the first option, the guy calling kbhit() just re-gets the char anyways. (Perhaps a supermod could move these posts to the programming forum?)[/QUOTE]
There is only ONE kbd buffer. Your terminal uses it, as the text editor uses it, as the OS itself uses it. Same idea is used by programs like "snagit" or whatever, which defines "hotkeys". You press alt+f11 in any window you are, snagit pops up and copy the window content in a gif. Now assume snagit will read all the keys, and if it is not his key, just discard it. You won't be able to use the kbd anymore. |
[QUOTE=LaurV;299794]There is only ONE kbd buffer. Your terminal uses it, as the text editor uses it, as the OS itself uses it. Same idea is used by programs like "snagit" or whatever, which defines "hotkeys". You press alt+f11 in any window you are, snagit pops up and copy the window content in a gif. Now assume snagit will read all the keys, and if it is not his key, just discard it. You won't be able to use the kbd anymore.[/QUOTE]
What text-editor? I'm talking about the -k switch from CUDALucas, hence why I don't care about the characters after the first one. (or at least, how to port that code to MPrime). |
I was talking "generally". Put the char back into the buffer. Why this bothers you? Let the OS do whatever he likes with it (for example printing it on screen, otherwise you have even to print it by yourself). I don't know what you wanna do "particularly". Try experimenting. This is how you learn :D
Keep the version that works as you like. Now really a mod should move these posts... |
[QUOTE=Dubslow;299748]I guess the lesson is don't upgrade drivers during a test... first mismatch I've had with 2.00. (Out of 8-10 or so. I'm not on 2.01 yet, though I will be soon.)[/QUOTE]
Well, I accidentally installed another update during the next test and that [URL="http://mersenne.org/report_exponent/?exp_lo=25853563"]matched[/URL], so... cosmic ray? |
[QUOTE=Dubslow;299815]Well, I accidentally installed another update during the next test and that [URL="http://mersenne.org/report_exponent/?exp_lo=25853563"]matched[/URL], so... cosmic ray?[/QUOTE]
I had really bad luck with 2.00. 2.01 seems better for me, but I haven't done DC in a while since I moved all my cards to TF for a while. |
I've got a mismatch with 2.0 for 29668031.
Could someone run it with P95? Thanks, Andriy |
[QUOTE=apsen;299971]I've got a mismatch with 2.0 for 29668031.
Could someone run it with P95? Thanks, Andriy[/QUOTE] M29668031, Lucas-Lehmer test, Fri May 25 23:00 2012 |
[QUOTE=msft;297083]Ver 2.01
Fix caluclate raundoff err. [code] M( 26974951 )C, 0xe72576f52d2b0d8c, n = 1474560, CUDALucas v2.00 M( 26975743 )C, 0x67d12882dc466fd7, n = 1474560, CUDALucas v2.00 M( 26767891 )C, 0xbbeb0ad54a815dda, n = 1474560, CUDALucas v2.00 M( 26768243 )C, 0x3280d4e28ef0b188, n = 1474560, CUDALucas v2.00 M( 26822449 )C, 0xad9016be8bd360a9, n = 1474560, CUDALucas v2.00 M( 26823619 )C, 0xb989439408521303, n = 1474560, CUDALucas v2.00 M( 27722911 )C, 0x42c0350cdd3596a9, n = 1572864, CUDALucas v2.00 M( 27192083 )C, 0xc5ec2d3fd58a9ccf, n = 1474560, CUDALucas v2.00 M( 27192391 )C, 0xc882ca1522e59f5e, n = 1474560, CUDALucas v2.00 M( 27699043 )C, 0xd0eda360a4e70525, n = 1572864, CUDALucas v2.01 M( 27703817 )C, 0xd73a94c433bcd689, n = 1572864, CUDALucas v2.01 M( 27706841 )C, 0x6708a475e7e3db2b, n = 1572864, CUDALucas v2.01 M( 27707293 )C, 0xf82f49632f7b11c1, n = 1572864, CUDALucas v2.01 M( 27708413 )C, 0x78c5e390d697eec8, n = 1572864, CUDALucas v2.01 M( 27661351 )C, 0x13df0d77627419bc, n = 1572864, CUDALucas v2.01 [/code] All DC successfully.[/QUOTE] The 2.01 makefile no longer has -lcudart in it. [strike]Is that correct?[/strike] That is definitely [i]not[/i] correct. Then again, it probably only matters to me. |
[QUOTE=apsen;299971]I've got a mismatch with 2.0 for 29668031.
Could someone run it with P95? Thanks, Andriy[/QUOTE] Sending result to server: UID: KDGehman1978/i5-2500k_2, M29668031 is not prime. Res64: 846461BD45E022__ PrimeNet success code with additional info: LL test successfully completes double-check of M29668031 CPU credit is 29.5032 GHz-days. |
CUDALucas 2.02
1 Attachment(s)
Well, I've [URL="http://www.mersenneforum.org/showpost.php?p=296379&postcount=1231"]tinkered with CUDALucas[/URL] before, but this time I think it's a more worthwhile upgrade. In addition to standard worktodo.txt functionality as I have previously done, this version now supports proper .ini functionality, in the same vein as mfakt*. That is, almost all of the command line options can now be set via "CUDALucas.ini", so you don't have to remember the complicated command each time you restart it (or spam the up-arrow in my case :smile:). The best part is any command line options will override the values in CUDALucas.ini. I've tentatively labelled it 2.02.
I have not messed with [i]any[/i] of the computational code; any bugs that cause incorrect are also in 2.01. (I am not aware of any, for the record. I'm ~15/16 with 2.00 and 2.01.) There is an extra file, plus anyone compiling on Windows (flash!) should look at lines 32-40. In order to make gcc link function calls in a .cu file functions defined in a .c file, I had to add extern "C" -- no idea how MSVC will react. There is also a new Makefile, which corrects the thing I mentioned two posts above -- it also now includes warnings from nvcc. msft, I got these warnings when I compiled it: [code]nvcc -O2 -arch=sm_13 --compiler-options=-Wall -c CUDALucas.cu CUDALucas.cu: In function ‘void printbits(double*, int, int, int, int, double, double, int, int, char*)’: CUDALucas.cu:895:20: warning: zero-length gnu_printf format string CUDALucas.cu: In function ‘int check(int, char*)’: CUDALucas.cu:1161:19: warning: comparison between signed and unsigned integer expressions CUDALucas.cu: In function ‘void printbits(double*, int, int, int, int, double, double, int, int, char*)’: CUDALucas.cu:848:7: warning: ‘fp’ may be used uninitialized in this function[/code] I could probably fix those myself, but I didn't want to touch the code so I could make the statement above. The functions to read the ini file were taken from mfaktc and modified to my tastes, styled after Prime95's ini-reading functions. Note that the ini file name of "CUDALucas.ini" will clobber the old .ini file in Windows, where file names are not case sensitive (or so I hear). However, if anyone has a better idea before flash compiles, it's something like line 42 in CUDALucas.cu. As the computational stuff hasn't been touched, the checkpoint files are the same. However, your worktodo.txt will need to be reformatted to the "Test=" or "DoubleCheck=" format. Copy and pastes from GPU272 or PrimeNet/Manual will work just fine. Any bugs should obviously be reported, but this passed some basic testing, and I'm not too worried since the core of this code is already used in mfaktc. [code]bill@Gravemind:~/CUDALucas/test∰∂ cat CUDALucas.ini # You can use this file to customize CUDALucas without having to create a long # and complex command. I got tired of having to hit the up arrow a bunch of # times whenever I rebooted, so I created this. You can set most of the command # line options here; however, if you do use command line options, they will # override their corresponding value in this file. # CheckpointIterations is the same as the -c option; it determines how often # checkpoints are written and also how often CUDALucas prints to terminal. CheckpointIterations=10000 # This sets the name of the workfile used by CUDALucas. WorkFile=worktodo.txt # Polite is the same as the -polite option. If it's 1, each iteration is # polite. If it's (for example) 12, then every 12th iteration is polite. Thus # the higher the number, the less polite the program is. Set to 0 to turn off # completely. Polite!=0 will incur a slight performance drop, but the screen # should be more responsive. Trade responsiveness for performance. Polite=1 # CheckRoundoffAllIterations is the same as the -t option. When active, each # iteration's roundoff error is checked, at the price of a small performance # cost. I'm not sure how often it's checked otherwise. This is a binary option; # set to 1 to activate, 0 to de-activate. CheckRoundoffAllIterations=0 # SaveAllCheckpoints is the same as the -s option. When active, CUDALucas will # save each checkpoint separately in the folder specified in the "SaveFolder" # option below. This is a binary option; set to 1 to activate, 0 to de-activate. SaveAllCheckpoints=0 # This option is the name of the folder where the separate checkpoint files are # saved. This option is only checked if SaveAllCheckpoints is activated. SaveFolder=savefiles # Interactive is the same as the -k option. When active, you can press p, t, or # s to change the respective options while the program is running. P is polite, # t is CheckRoundoffAllIterations, and s is the SaveAllCheckpoints feature # below. This is a binary option; set to 1 to activate, 0 to de-activate. Interactive=0 # Threads is the same as the -threads option. This sets the number of threads # used in the FFTs. This must be 32, 64, 128, 256, 512, or 1024. (Some FFT # lengths have a higher minimum than 32.) Threads=256 # DeviceNumber is the same as the -d option. Use this to run CUDALucas on a GPU # other than "the first one". Only useful if you have more than one GPU. DeviceNumber=0 # FFTLength is the same as the -f option. If this is 0, CUDALucas will # autoselect a length for each exponent. Otherwise, you can set this with an # override length; this length will be used for all exponents in worktodo.txt, # which may not be optimal (or even possible). In the future, I would like to # both create a better FFT length selection function, as well as be able to # specify a length on an individual-exponent basis (probably through a field in # Test= in the work file). To see a list of reasonable FFT lengths, try running # "$ CUDALucas -cufftbench 32768 3276800 32768" which will test a large range. # In my personal experience on a GTX 460, I've found that for 26M exponents, # FFTLength=1474560 is a good length. (Technical note: FFT length must be a # multiple of 128*threads. See # http://www.mersenneforum.org/showpost.php?p=292776&postcount=959 ) FFTLength=0[/code] Edit: I probably should have put this in the attached ini file, but polite 0 is known to cause CUDALucas to take some small CPU time; polite 64 seems to be a [URL="http://www.mersenneforum.org/showpost.php?p=295993&postcount=1216"]good compromise[/URL]. Edit2: Forgot the todo list :razz: Here it is: 1) Add some sort of way to specify the FFT on a per-exponent basis, presumably through some field in "DoubleCheck=...". The Prime95 way of doing it would be rather tedious to parse... anyone have any ideas? 2) I'd like to refine the FFT autoselect function to do better; to that end, at some point over the summer I'll write a script to test a bunch of exponents and record the round off error, then distribute that around here to get as much hardware covered as possible. Then we'd use the data to either create a table of FFT lengths or a reasonably accurate regression of some sort. (Prime95 uses (very large) tables.) Edit3: Anyone who needs a Linux binary can of course just ask me. |
I'm running into a few issues compiling on Windows. I've been able to get around most, but here is the main stuff:
[CODE] parse.c(166) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(105) : see declaration of 'strcpy' parse.c(176) : warning C4127: conditional expression is constant parse.c(191) : error C3861: 'strncasecmp': identifier not found parse.c(192) : error C3861: 'strncasecmp': identifier not found parse.c(305) : warning C4127: conditional expression is constant parse.c(312) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(105) : see declaration of 'strcpy' make: *** [parse.x64.obj] Error 2 [/CODE] I'll look at it more tomorrow, but maybe you can identify the problem? |
[QUOTE=flashjh;300366]I'm running into a few issues compiling on Windows. I've been able to get around most, but here is the main stuff:
[CODE] parse.c(166) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(105) : see declaration of 'strcpy' parse.c(176) : warning C4127: conditional expression is constant parse.c(191) : error C3861: 'strncasecmp': identifier not found parse.c(192) : error C3861: 'strncasecmp': identifier not found parse.c(305) : warning C4127: conditional expression is constant parse.c(312) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(105) : see declaration of 'strcpy' make: *** [parse.x64.obj] Error 2 [/CODE] I'll look at it more tomorrow, but maybe you can identify the problem?[/QUOTE] Bluh, you'll have to ask TheJudger how he compiles mfaktc for Windows. I'll look through his code tomorrow and look for Windows ifdefs. Edit: Found one in compatability.h: #ifdef _MSC_VER; #define strncasecomp _strnicmp with the abuse of semicolon/newline. Next stop: makefile.win. |
[QUOTE=Dubslow;300369]Bluh, you'll have to ask TheJudger how he compiles mfaktc for Windows. I'll look through his code tomorrow and look for Windows ifdefs.
Edit: Found one in compatability.h: #ifdef _MSC_VER; #define strncasecomp _strnicmp with the abuse of semicolon/newline. Next stop: makefile.win.[/QUOTE] Probably should have them already, do you have a link to mfaktc source files? I'm pretty sure I need _strnicmp instead of strncasecomp and strcpy_s instead of strcpy, however, I don't know what to do with the 'conditional expression is constant'. |
1 Attachment(s)
[QUOTE=flashjh;300387]Probably should have them already, do you have a link to mfaktc source files?[/quote][url]http://mersenneforum.org/mfaktc/[/url] (The unqualified 0.18 would be the source.)
[QUOTE=flashjh;300387] I'm pretty sure I need _strnicmp instead of strncasecomp and strcpy_s instead of strcpy, [/quote] I don't see anywhere in the mfatkc source about strcpy_s, but I'll keep looking, and you certainly know better than me about MSVC :smile: Edit: [url]http://msdn.microsoft.com/en-us/library/8ef0s5kh(v=vs.80).aspx[/url] [quote=MS]For example, the strcpy function has no way of telling if the string that it is copying is too big for its destination buffer. However, its secure counterpart, strcpy_s, takes the size of the buffer as a parameter, so it can determine if a buffer overrun will occur. If you use strcpy_s to copy eleven characters into a ten-character buffer, that is an error on your part; strcpy_s cannot correct your mistake, but it can detect your error and inform you by invoking the invalid parameter handler.[/quote] strcpy_s has a different definition, requiring a third size argument; it's just meant to be a "catch stupid programmer error" thing. Since the code does a check for a long line anyways, the extra functionality is unnecessary. [code]bill@Gravemind:~/CUDALucas/test∰∂ cat parse.c #include <stdio.h> #include <string.h> #include <limits.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> [B]#ifdef _MSC_VER #define strncasecmp _strnicmp #define _CRT_SECURE_NO_WARNINGS #endif[/B] int isprime(unsigned int n) /* returns 0 if n is composite 1 if n is prime */ { unsigned int i; if(n<=1) return 0; if(n>2 && n%2==0)return 0; i=3; while(i*i <= n && i < 0x10000) { if(n%i==0)return 0; i+=2; } return 1; }[/code] [QUOTE=flashjh;300387]however, I don't know what to do with the 'conditional expression is constant'.[/QUOTE]Oh, that's just a while(1), that warning can be ignored. (Perhaps deleting the 1 and leaving the conditional blank will work?) Edit: Actually, in further looking, I actually have no clue why that loop is there at all. If the func finds a too-long line, then it reads in the characters until a control character then breaks? Wtf? PS I forgot to mention above, but the help message was moved from no-args to the -h arg. PPS Here's a slightly larger .ini file: [code]# Polite is the same as the -polite option. If it's 1, each iteration is # polite. If it's (for example) 12, then every 12th iteration is polite. Thus # the higher the number, the less polite the program is. Set to 0 to turn off # completely. Polite!=0 will incur a slight performance drop, but the screen # should be more responsive. Trade responsiveness for performance. [U](Note: # polite=0 is known to cause CUDALucas to use some extra CPU time; Polite=64 or # higher is a good compromise.)[/U] Polite=1[/code] flash, could you add this to your copy before you bundle the executable? The attached archive contains the modified parse.c and CUDALucas.ini. |
OT is moved to a [URL="http://www.mersenneforum.org/showthread.php?t=16859"]separate thread[/URL]
|
1 Attachment(s)
[QUOTE=Dubslow;300390][URL]http://mersenneforum.org/mfaktc/[/URL] (The unqualified 0.18 would be the source.)
I don't see anywhere in the mfatkc source about strcpy_s, but I'll keep looking, and you certainly know better than me about MSVC :smile: Edit: [URL]http://msdn.microsoft.com/en-us/library/8ef0s5kh(v=vs.80).aspx[/URL] strcpy_s has a different definition, requiring a third size argument; it's just meant to be a "catch stupid programmer error" thing. Since the code does a check for a long line anyways, the extra functionality is unnecessary. [code]bill@Gravemind:~/CUDALucas/test∰∂ cat parse.c #include <stdio.h> #include <string.h> #include <limits.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> [B]#ifdef _MSC_VER[/B] [B]#define strncasecmp _strnicmp[/B] [B]#define _CRT_SECURE_NO_WARNINGS[/B] [B]#endif[/B] int isprime(unsigned int n) /* returns 0 if n is composite 1 if n is prime */ { unsigned int i; if(n<=1) return 0; if(n>2 && n%2==0)return 0; i=3; while(i*i <= n && i < 0x10000) { if(n%i==0)return 0; i+=2; } return 1; }[/code] Oh, that's just a while(1), that warning can be ignored. (Perhaps deleting the 1 and leaving the conditional blank will work?) Edit: Actually, in further looking, I actually have no clue why that loop is there at all. If the func finds a too-long line, then it reads in the characters until a control character then breaks? Wtf? PS I forgot to mention above, but the help message was moved from no-args to the -h arg. PPS Here's a slightly larger .ini file: [code]# Polite is the same as the -polite option. If it's 1, each iteration is # polite. If it's (for example) 12, then every 12th iteration is polite. Thus # the higher the number, the less polite the program is. Set to 0 to turn off # completely. Polite!=0 will incur a slight performance drop, but the screen # should be more responsive. Trade responsiveness for performance. [U](Note:[/U] [U]# polite=0 is known to cause CUDALucas to use some extra CPU time; Polite=64 or[/U] [U]# higher is a good compromise.)[/U] Polite=1[/code] flash, could you add this to your copy before you bundle the executable? The attached archive contains the modified parse.c and CUDALucas.ini.[/QUOTE] Attached is CUDALucas 2.02 - UNTESTED. I included all the source files and the MAKEFILE for windows. I modified to 'safe' functions so MSVC would not complain**. The two while(1) lines cause a warning, but they're safe to ignore. No CUDA 3.2 because there were too many errors during compile for me to fix tonight. @Dubslow: This build is based on your newest archive from earlier this afternoon. **I can't test the changes because I remoted into my system to do the build and CuLu doesn't detect my nVidia card while in a remote session. I'll test it tomorrow; if anyone else can test it and let me know if it performs as expected, that would be great -- thanks. |
[QUOTE=flashjh;300789]Attached is CUDALucas 2.02 - UNTESTED. I included all the source files and the MAKEFILE for windows. I modified to 'safe' functions so MSVC would not complain**. The two while(1) lines cause a warning, but they're safe to ignore. No CUDA 3.2 because there were too many errors during compile for me to fix tonight.
@Dubslow: This build is based on your newest archive from earlier this afternoon. **I can't test the changes because I remoted into my system to do the build and CuLu doesn't detect my nVidia card while in a remote session. I'll test it tomorrow; if anyone else can test it and let me know if it performs as expected, that would be great -- thanks.[/QUOTE] Heehee, I've been modifying the source with trifling differences for much of the evening, and that DL was symlinked to my files. I'll see how late it was :smile: I've completed one expo with 2.02 myself, and another one due in a few hours. I'll come back and edit this post with a source archive that compiles "out of the box" on both Windows and Linux. Edit: Sheesh, where did you get that makefile? In all 2.x versions I've seen from msft, the makefiles he's included all had arch=sm_13 and -O2; this win makefile has a whole bunch of stuff that is (AFAICT) unnecessary. How did you even get it to compile with arch not sm_13? The change msft made in 2.01 requires sm_13 ([strike]at least nvcc threw me an error when I tried later arches[/strike] of course now it works fine), and we've figured out it's the fastest. [code]CUFLAGS = -m64 --ptxas-options=-v -ccbin=$(CCLOC) -D$(BIT) -Xcompiler /EHsc,/W3,/nologo,/Ox,/Oy,/GL -arch=$(CUDA_ARCH) -DMERS_PACKAGE -DBIT_SIEVE -DTESTING_SMALL_EXPONENTS -DSIEVE_SIZE_IN_BYTES=32 -DNUM_SMALL_PRIMES=32768 -DDO_NOT_USE_LONG_DOUBLE "-I$(CUDA)/include" -D__x86_64__ -O3[/code] I'm pretty sure if you did a Ctrl+F on the defines in the source, you wouldn't find anything. Here's my CUFLAGS: [code]CUFLAGS = -O2 -arch=sm_13 --compiler-options=-Wall[/code] The first two flags are from msft's makefile, and the last one is the one I added which produced warnings. Is this win makefile a relic of MacLucas? |
[QUOTE=Dubslow;300790]Heehee, I've been modifying the source with trifling differences for much of the evening, and that DL was symlinked to my files. I'll see how late it was :smile:
I've completed one expo with 2.02 myself, and another one due in a few hours. I'll come back and edit this post with a source archive that compiles "out of the box" on both Windows and Linux.[/QUOTE] I downloaded the file @ 17:23 MDT Edit: Can you compile/run Windows versions? |
[QUOTE=flashjh;300793]I downloaded the file @ 17:23 MDT
Edit: Can you compile/run Windows versions?[/QUOTE] I have Windows, but I'd rather not have to shut down and reboot; I'd also need to get the CUDA toolkit and MSVC installed. I'm half considering going to all the bother; see my edit of the post you quoted :razz: |
[QUOTE=Dubslow;300790]Heehee, I've been modifying the source with trifling differences for much of the evening, and that DL was symlinked to my files. I'll see how late it was :smile:
I've completed one expo with 2.02 myself, and another one due in a few hours. I'll come back and edit this post with a source archive that compiles "out of the box" on both Windows and Linux. Edit: Sheesh, where did you get that makefile? In all 2.x versions I've seen from msft, the makefiles he's included all had arch=sm_13 and -O2; this win makefile has a whole bunch of stuff that is (AFAICT) unnecessary. How did you even get it to compile with arch not sm_13? The change msft made in 2.01 requires sm_13 (at least nvcc threw me an error when I tried later arches), and we've figured out it's the fastest. [code]CUFLAGS = -m64 --ptxas-options=-v -ccbin=$(CCLOC) -D$(BIT) -Xcompiler /EHsc,/W3,/nologo,/Ox,/Oy,/GL -arch=$(CUDA_ARCH) -DMERS_PACKAGE -DBIT_SIEVE -DTESTING_SMALL_EXPONENTS -DSIEVE_SIZE_IN_BYTES=32 -DNUM_SMALL_PRIMES=32768 -DDO_NOT_USE_LONG_DOUBLE "-I$(CUDA)/include" -D__x86_64__ -O3[/code] The include certainly isn't necessary; the only thing that is included is in the source archives. I'm pretty sure if you did a Ctrl+F on the defines in the source, you wouldn't find anything. Here's my CUFLAGS: [code]CUFLAGS = -O2 -arch=sm_13 --compiler-options=-Wall[/code] The first two are from msft's makefile, and the last one is the one I added which produced warnings. Is this win makefile a relic of MacLucas?[/QUOTE] I had to modify a .win MAKEFILE some time ago. I think I used the include because I didn't have all the paths in my PATH; I'd have to check on that one later. As for sm_13, well, CUDA 3.2, sm_13 is faster, but it wouldn't compile with this version. It has something to do with extern, I think. Also, I never tried buidling all version with sm_13 since that wasn't what everyone was wanting (or at least I thought). [QUOTE]How did you even get it to compile with arch not sm_13? The change msft made in 2.01 requires sm_13 (at least nvcc threw me an error when I tried later arches), and we've figured out it's the fastest.[/QUOTE] It has always worked fine for me with sm_13, sm_20, sm_21, as applicable from the MAKEFILE. I saw your post about it some time ago, but it wasn't an issue - I don't know why? [code]CUFLAGS = -m64 --ptxas-options=-v -ccbin=$(CCLOC) -D$(BIT) -Xcompiler /EHsc,/W3,/nologo,/Ox,/Oy,/GL -arch=$(CUDA_ARCH) -DMERS_PACKAGE -DBIT_SIEVE -DTESTING_SMALL_EXPONENTS -DSIEVE_SIZE_IN_BYTES=32 -DNUM_SMALL_PRIMES=32768 -DDO_NOT_USE_LONG_DOUBLE "-I$(CUDA)/include" -D__x86_64__ -O3[/code] I rememeber looking up all the CUFLAGS in nVidia's CUDA whitepaper. It all made sense. I was able to modify the MAKEFILE to work, but I'm still learning some of the terminology in there. I know I used Brain's MAKEFILE as an example (among others' also). |
1 Attachment(s)
[QUOTE=Dubslow;300790]I'll come back and edit this post with a source archive that compiles "out of the box" on both Windows and Linux.[/QUOTE]
Okay, here it is. I've made some minor changes to the Windows makefile: [code]CUFLAGS = -m64 --ptxas-options=-v -ccbin=$(CCLOC) -D$(BIT) -Xcompiler /EHsc,/W3,/nologo,/Ox,/Oy,/GL -arch=$(CUDA_ARCH) -DDO_NOT_USE_LONG_DOUBLE "-I$(CUDA)/include" -D__x86_64__ -O3[/code] [code]$(CC) $(CFLAGS) /c $< /Fo$@[/code] According to [url]http://msdn.microsoft.com/en-us/library/032xwy55.aspx[/url] , /Tp makes it think it's a C++ file, which certainly isn't the case. I also added various preprocessor statements to parse.c and copied the (float) casts into CUDALucas.cu. There should be a lot less manual work required on your part flash :smile: I suddenly see why compiling was such a pain. One last thing, flash: I have no clue if this would work or not, but since "C" was not required on those function defines at the top of CUDALucas.cu, does it compile if you delete the "extern"? If so, try deleting those statements altogether; "parse.h" has been modified to include the definitions, so that any "extern" statements are only needed on Linux. msft, do you have any comments about arch, compiler flags, etc.? (PS, Could you please explain how choose_fft_length() works, and/or why the array np[] isn't just [1,2,3,4,5,6,7]?) [I](Note: I tried making it so that you could enable -t on the fly; it turns out there's a reason msft didn't have that :razz:. If you use flash's compilation before this post, don't press "t" when -k is enabled. That's reverted in this attachment.)[/I] |
1 Attachment(s)
[QUOTE=Dubslow;300790]Heehee, I've been modifying the source with trifling differences for much of the evening[/QUOTE]
Heh, it seems I never enumerated those changes. They were of a mostly janitorial nature not affecting how the program behaves; a key exception is that I added another "PrintDeviceInfo" ini file option. This means you can see the device info even for device 0, and alternately you can turn off the printing for devices other than 0; previously those two were not possible with the -d switch. There have also been some cosmetic changes, mostly to what PrintDeviceInfo actually prints :smile: And, since my previous post, I've now made it so that running "-r" (self test) prints slightly more information, as well as automatically enabling the -t extra error checking. It's attached. |
Running -cufftbench bug
Whenever I run any sort of -cufftbench, CUDALucas takes up a whole processor core (as opposed to ~nil when doing "production" work). This happens even in versions 2.00 and 2.01, so I know it's not anything I did to the code. Has anybody else seen this happen?
Edit: My screen also becomes [i]very[/i] unresponsive (though not unuseable). Again, this doesn't normally happen. |
1 Attachment(s)
[QUOTE=Dubslow;300802]Okay, here it is. I've made some minor changes to the Windows makefile:
[code]CUFLAGS = -m64 --ptxas-options=-v -ccbin=$(CCLOC) -D$(BIT) -Xcompiler /EHsc,/W3,/nologo,/Ox,/Oy,/GL -arch=$(CUDA_ARCH) -DDO_NOT_USE_LONG_DOUBLE "-I$(CUDA)/include" -D__x86_64__ -O3[/code] [code]$(CC) $(CFLAGS) /c $< /Fo$@[/code] According to [URL]http://msdn.microsoft.com/en-us/library/032xwy55.aspx[/URL] , /Tp makes it think it's a C++ file, which certainly isn't the case. I also added various preprocessor statements to parse.c and copied the (float) casts into CUDALucas.cu. There should be a lot less manual work required on your part flash :smile: I suddenly see why compiling was such a pain. One last thing, flash: I have no clue if this would work or not, but since "C" was not required on those function defines at the top of CUDALucas.cu, does it compile if you delete the "extern"? If so, try deleting those statements altogether; "parse.h" has been modified to include the definitions, so that any "extern" statements are only needed on Linux. msft, do you have any comments about arch, compiler flags, etc.? (PS, Could you please explain how choose_fft_length() works, and/or why the array np[] isn't just [1,2,3,4,5,6,7]?) [I](Note: I tried making it so that you could enable -t on the fly; it turns out there's a reason msft didn't have that :razz:. If you use flash's compilation before this post, don't press "t" when -k is enabled. That's reverted in this attachment.)[/I][/QUOTE] [QUOTE=Dubslow;300811]Heh, it seems I never enumerated those changes. They were of a mostly janitorial nature not affecting how the program behaves; a key exception is that I added another "PrintDeviceInfo" ini file option. This means you can see the device info even for device 0, and alternately you can turn off the printing for devices other than 0; previously those two were not possible with the -d switch. There have also been some cosmetic changes, mostly to what PrintDeviceInfo actually prints :smile: And, since my previous post, I've now made it so that running "-r" (self test) prints slightly more information, as well as automatically enabling the -t extra error checking. It's attached.[/QUOTE] Ok, everything compiled -- still have not tested. Here is a breakdown of changes I had to make for compile: 1) The MAKEFILE.WIN you created worked except I can't remove '/Tp'. Without that the compiler didn't understand 'timezone': [CODE] timeval.c(31) : warning C4115: 'timezone' : named type definition in parentheses timeval.c(32) : error C2055: expected formal parameter list, not a type list make: *** [timeval.x64.obj] Error 2 [/CODE] 2) I was able to remove all the requested extern statements from CUDALucas.cu 3) CUDALucas.cu line 352 needed (float) 4) Parse.c line 386 needed '[SIZE=2]}' to close the if statement (this one took me a while to find) :smile:[/SIZE] 5) I was able to remove the "-I$(CUDA)/include" line in the MAKEFILE.WIN 6) I was able to compile 3.2 | sm_13 ( I was using the wrong environment for 3.2 before... that's what happens with no :sleep: ) [SIZE=2]I didn't change any of your linux definitions and the statements seem good for compiling 'out of the box' for Win and Linux. You can take the included files and see if you can compile. If not, pass everything back to me for another run.[/SIZE] Have you tested everything on Linux? Since you made the changes, can you pass along a sample worktodo.txt file with good and bad so I can ensure Windows is capable of everything your Linux can do ;) (Source here, Compiled versions in next post) |
1 Attachment(s)
CUDALucas 2.02 x64 (updated) - Untested
Includes: CUDA 3.2 | sm_13 CUDA 4.0 | sm_20 CUDA 4.0 | sm_21 |
grrrr...
command line should have priority when there is no ini file, and from the tentative to switch the politeness it can be seen that it has, but in this case the messages are gibberish... [CODE]>cl2024020x64 -d 0 -c 100000 -s backup0 -t -polite 0 -k 26070883 Warning: Couldn't parse ini file option CheckpointIterations; using default: 10000 Warning: Couldn't parse ini file option Threads; using default: 256 Warning: Couldn't parse ini file option SaveAllCheckpoints; using default: off Warning: Couldn't parse ini file option CheckRoundoffAllIterations; using default: off Warning: Couldn't parse ini file option Polite; using default: 1 Warning: Couldn't parse ini file option Interactive; using default: off Warning: Couldn't parse ini file option DeviceNumber; using default: 0 Warning: Couldn't parse ini file option PrintDeviceInfo; using default: off Warning: Couldn't parse ini file option WorkFile; using default: "worktodo.txt" Warning: Couldn't parse ini file option FFTLength; using autoselect. ------- DEVICE 0 ------- name GeForce GTX 580 <...snip...> multiProcessorCount 16 mkdir: cannot create directory `backup0': File exists Continuing work from a partial result of M26070883 fft length = 1572864 iteration = 9082202 Iteration 9100000 M( 26070883 )C, 0x243869296cca0a3a, n = 1572864, CUDALucas v2.02 err = 0.02246 (0:51 real, 0.5022 ms/iter, ETA 2:21:28) Iteration 9200000 M( 26070883 )C, 0xd32a5f55d157802f, n = 1572864, CUDALucas v2.02 err = 0.02344 (4:32 real, 2.7260 ms/iter, ETA 12:43:17) p -polite 1 p -polite 0 Iteration 9300000 M( 26070883 )C, 0x23e3b9dd22444ef9, n = 1572864, CUDALucas v2.02 err = 0.02344 (4:34 real, 2.7415 ms/iter, ETA 12:43:03)[/CODE]The second instance (the other card) really scared me when it said "devicenumber not found using default 0", but I calmed myself down when I saw it was running on device 1, as it was supposed to do. :smile: |
1 Attachment(s)
[QUOTE=LaurV;300945]grrrr...
command line should have priority when there is no ini file, and from the tentative to switch the politeness it can be seen that it has, but in this case the messages are gibberish... [/quote]I assumed that everyone would get a copy of the inifile with the exes, even if they didn't use them. [code] [U]/*! These warnings are uncommented because the "shipped" ini file also contains these defaults, and therefore none of these should be set off anyways. */[/U] if( !IniGetInt(INIFILE, "CheckpointIterations", &checkpoint_iter, 10000) ) fprintf(stderr, "Warning: Couldn't parse ini file option CheckpointIterations; using default: 10000\n"); if( !IniGetInt(INIFILE, "Threads", &threads, 256) ) fprintf(stderr, "Warning: Couldn't parse ini file option Threads; using default: 256\n"); if( !IniGetInt(INIFILE, "SaveAllCheckpoints", &s_f, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option SaveAllCheckpoints; using default: off\n"); if( s_f && !IniGetStr(INIFILE, "SaveFolder", folder, "savefiles") ) fprintf(stderr, "Warning: Couldn't parse ini file option SaveFolder; using default: \"savefiles\"\n"); if( !IniGetInt(INIFILE, "CheckRoundoffAllIterations", &t_f, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option CheckRoundoffAllIterations; using default: off\n"); if( !IniGetInt(INIFILE, "Polite", &polite, 1) ) fprintf(stderr, "Warning: Couldn't parse ini file option Polite; using default: 1\n"); if( !IniGetInt(INIFILE, "Interactive", &k_f, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option Interactive; using default: off\n"); if( !IniGetInt(INIFILE, "DeviceNumber", &device_number, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option DeviceNumber; using default: 0\n"); if( !IniGetInt(INIFILE, "PrintDeviceInfo", &d_f, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option PrintDeviceInfo; using default: off\n"); if( !IniGetStr(INIFILE, "WorkFile", input_filename, "worktodo.txt") ) fprintf(stderr, "Warning: Couldn't parse ini file option WorkFile; using default: \"worktodo.txt\"\n"); if( !IniGetInt(INIFILE, "FFTLength", &fftlen, 0) ) fprintf(stderr, "Warning: Couldn't parse ini file option FFTLength; using autoselect.\n");[/code]Also in the "shipped" ini file I explain that any of the options are overwridden by the command line :razz: [QUOTE=LaurV;300945] [CODE]>cl2024020x64 -d 0 -c 100000 -s backup0 -t -polite 0 -k 26070883 Warning: Couldn't parse ini file option CheckpointIterations; using default: 10000 Warning: Couldn't parse ini file option Threads; using default: 256 Warning: Couldn't parse ini file option SaveAllCheckpoints; using default: off Warning: Couldn't parse ini file option CheckRoundoffAllIterations; using default: off Warning: Couldn't parse ini file option Polite; using default: 1 Warning: Couldn't parse ini file option Interactive; using default: off Warning: Couldn't parse ini file option DeviceNumber; using default: 0 Warning: Couldn't parse ini file option PrintDeviceInfo; using default: off Warning: Couldn't parse ini file option WorkFile; using default: "worktodo.txt" Warning: Couldn't parse ini file option FFTLength; using autoselect. ------- DEVICE 0 ------- name GeForce GTX 580 <...snip...> multiProcessorCount 16 mkdir: cannot create directory `backup0': File exists Continuing work from a partial result of M26070883 fft length = 1572864 iteration = 9082202 Iteration 9100000 M( 26070883 )C, 0x243869296cca0a3a, n = 1572864, CUDALucas v2.02 err = 0.02246 (0:51 real, 0.5022 ms/iter, ETA 2:21:28) Iteration 9200000 M( 26070883 )C, 0xd32a5f55d157802f, n = 1572864, CUDALucas v2.02 err = 0.02344 (4:32 real, 2.7260 ms/iter, ETA 12:43:17) p -polite 1 p -polite 0 Iteration 9300000 M( 26070883 )C, 0x23e3b9dd22444ef9, n = 1572864, CUDALucas v2.02 err = 0.02344 (4:34 real, 2.7415 ms/iter, ETA 12:43:03)[/CODE]The second instance (the other card) really scared me when it said "devicenumber not found using default 0", but I calmed myself down when I saw it was running on device 1, as it was supposed to do. :smile:[/QUOTE] Like we both remarked, the default was overwritten with the command line switch. Well, now that I look at the zip, flash didn't include the ini-file with the binaries :razz: I've added it to the attached zip. Anyone downloading the Windows executables should get this one instead :razz: (The .exes are identical, I literally used the same ones unmodified from flash's zip.) The ini-file also has some basic 'documentation' which describe the options in further detail than the (now -h) help message. ------------------------------------------------------------- In the future, how should the code handle not being able to read the ini file but getting options through the command line? I could make it so that warnings are only printed for options [i]not[/i] passed as args, but that would be somewhat difficult... |
[QUOTE=Dubslow;300973]I assumed that everyone would get a copy of the inifile with the exes, even if they didn't use them.[/QUOTE]
Oops, sorry. [QUOTE]In the future, how should the code handle not being able to read the ini but getting options through the command line? I could make it so that warningnted for options [i]not[/i] passed as args, but that would be somewhat difficult...[/QUOTE] Make it check for .ini first, if not there then just print '.ini not found' and handle like before. Edit: A lot more work, maybe, but you could also ask if the user wants to create an .ini file and use any supplied switches as default. It's a lot easier if the compiler just includes it the first time :smile: |
[QUOTE=flashjh;300978]
Make it check for .ini first, if not there then just print '.ini not found' and handle like before.[/quote]Good idea. I'm not sure how to check if a file exists in C, but a quick Google ought to solve that. [QUOTE=flashjh;300978] Edit: A lot more work, maybe, but you could also ask if the user wants to create an .ini file and use any supplied switches as default. It's a lot easier if the compiler just includes it the first time :smile:[/QUOTE] Yich... part of the inifile is that, like I said, it includes a lot of ancillary information besides configuration. I'll have to think about it. (And it'd put improving FFT selection on hold.) |
[QUOTE=Dubslow;300984]Good idea. I'm not sure how to check if a file exists in C, but a quick Google ought to solve that.
Yich... part of the inifile is that, like I said, it includes a lot of ancillary information besides configuration. I'll have to think about it. (And it'd put improving FFT selection on hold.)[/QUOTE] Yeah, I know it's too much :) In fact, the only reason to have the program check is just to let the user know it's missing. |
1 Attachment(s)
Sorry about taking so long with this, we wound up going out for ice cream (and getting my bike fixed).
[QUOTE=flashjh;300924] 1) The MAKEFILE.WIN you created worked except I can't remove '/Tp'. Without that the compiler didn't understand 'timezone': [CODE] timeval.c(31) : warning C4115: 'timezone' : named type definition in parentheses timeval.c(32) : error C2055: expected formal parameter list, not a type list make: *** [timeval.x64.obj] Error 2 [/CODE] [/quote]I think that's a a result of the "hacked from original purpose" nature of the code. Just point any sort of letters/variable name after the '*' and it should compile fine without /Tp. (That's a function [i]definition[/i]; after the list of arguments, there's a {} indicating what the function does. With function [i]declarations[/i], after the list of args, there's only a semicolon, like in parse.h. Declarations are so that the compiler can check that a function is used correctly without having to know what it does. In a [i]definition[/i] however, you need to have names for all the arguments, so that you can actually define what the function does. For whatever reason when that code was initially put into mfaktc, the second argument became useless, but it's still a compiler error to not name it.) [QUOTE=flashjh;300924] 2) I was able to remove all the requested extern statements from CUDALucas.cu[/quote]In that case, you [i]should[/i] be able to remove the "extern"s entirely from parse.h. [QUOTE=flashjh;300924] 3) CUDALucas.cu line 352 needed (float)[/quote]I didn't have helium, but I think hydrogen will do the trick ;) [QUOTE=flashjh;300924] 4) Parse.c line 386 needed '[SIZE=2]}' to close the if statement (this one took me a while to find) :smile:[/SIZE] [/quote]Whoops, sorry :razz: [QUOTE=flashjh;300924] 5) I was able to remove the "-I$(CUDA)/include" line in the MAKEFILE.WIN 6) I was able to compile 3.2 | sm_13 ( I was using the wrong environment for 3.2 before... that's what happens with no :sleep: ) [/quote]:tu: I also made one change to 'cleaner' in Makefile.win; you can do "cleaner: clean \n rules" instead of "cleaner: \n rules \n make clean" to get the same effect. [QUOTE=flashjh;300924] [SIZE=2]I didn't change any of your linux definitions and the statements seem good for compiling 'out of the box' for Win and Linux. You can take the included files and see if you can compile. If not, pass everything back to me for another run.[/SIZE] [/quote] It compiled fine for me. I'll reattach the trifling changes I've made. [QUOTE=flashjh;300924] Have you tested everything on Linux? Since you made the changes, can you pass along a sample worktodo.txt file with good and bad so I can ensure Windows is capable of everything your Linux can do ;)[/QUOTE] I haven't actually done serious testing of what is and isn't rejected by the worktodo parser. To help rectify that, I've made an example worktodo.txt, as well as some cosmetic modifications to parse.c (and CuLu.cu). Additionally, the parser now recognizes '#' as a comment character. You'll need to recompile to get the '#'; otherwise this newer version should be functionally equivalent to the binaries you made above. [code]bill@Gravemind:~/CUDALucas/test∰∂ cat worktodo.txt //Test=25723987 #Test=25723987,69,1 /* Will not parse correctly */ //Test=25723987,69 //Test=N/A,25723987,69 //Test=N/A,25723987 /* Will not parse correctly */ #Test=N/A,25723987,69,1 #Test=N/A,25723987, /* Will parse correctly because of extra comma */[/code] Uncomment one line at a time to test them. Currently, if there are less than two commas, it assumes there is no AID, that the first number is the exponent, and ignores the rest. Otherwise, the first field is treated as AID, and second is exponent. Better parsing ideas, anyone? |
[QUOTE=Dubslow;300973]
In the future, how should the code handle not being able to read the ini file but getting options through the command line? [/QUOTE] That was my argument, if you read carefully my post, I only complained the fact that the messages do not reflect the real parameters (given in the command line or wherever else). You won't request the stupid user like me to go through all your sources before using the program, or to carry a luggage full of files with him, like the guy with the watch/laptop/mobile phone (I know the joke in my time when the electronic watches appeared, but now it should be said about the smartphones) carrying two big suitcases with batteries with him. :yucky: So, the code should simple handle this situation by[B] printing the right argument[/B]. Saying or not the fact that it "uses default" or "overwritten by cmd line args", this is optional and not very important. edit: or handle like flash suggested, that is better (I did not read all the posts to the end of the thread when I replied). |
[QUOTE=LaurV;301009]That was my argument, if you read carefully my post, I only complained the fact that the messages do not reflect the real parameters (given in the command line or wherever else). You won't request the stupid user like me to go through all your sources before using the program, or to carry a luggage full of files with him, like the guy with the watch/laptop/mobile phone (I know the joke in my time when the electronic watches appeared, but now it should be said about the smartphones) carrying two big suitcases with batteries with him. :yucky:
So, the code should simple handle this situation by printing the right argument. Saying or not the fact that "uses default" or "overwritten by cmd line args" is optional, and not very important.[/QUOTE] I was intending that the .ini file would be packed with the binaries, just like mfaktc or Prime95. The problem is, I'd like to type "CUDALucas" and just have the program do work without telling me what it's doing. What I could do is move the ini-read after the command line, and only read options not passed as commands, and then print warnings only if the command wasn't passed and if the ini file didn't have it. If I did that, would you still want me to print the options used? Edit: Okay, sure. I'll do my proposition because it seems to me it's more useful in a wider variety of situations than just checking if it exists. [QUOTE=LaurV;301013] Related to typing "cudalucas" and the program runs, well, you don't imagine that I have typed all those things... I am even more lazy than you, I only typed "cu" and pressed enter. My file is called "cu.bat" :razz:. It calls another two batches, one for each card, and the maintenance (add exponents to each line, delete the old lines) is done by a third batch, which is reading the exponents from an worktodo list. I used this solution because sometime I only work with one card (the second is busy with daily work), and at that time there was no "worktodo file" option either. Later I got used with it and kept it. Bad habits die hard. The idea is that you can make a batch file if you want only to type "cudalucas" and everything runs. Don't need changing the program for it. Even with maintenance by hand, there is only a matter of few copy/paste you do only when you get new assignments. Of course, this way you have to be careful and delete the lines for the jobs already completed (I used to do that by hand in the past too).[/QUOTE]See, I had the same problem, except in my rush to be useful, I decided to modify CUDALucas (with mfaktc code) to do it without bothering with bash, etc. :razz: @flash: Wait before compiling my most recent post, I'm going to redo fopen as well as redo parameter-reading. |
1 Attachment(s)
I don't mind if you print or not the options. I only mind them be correct, if you choose to print them.
Related to typing "cudalucas" and the program runs, well, you don't imagine that I have typed all those things... I am even more lazy than you, I only typed "cu" and pressed enter. My file is called "cu.bat" :razz:. It calls another two batches, one for each card, and the maintenance (add exponents to each line, delete the old lines) is done by a third batch, which is reading the exponents from an worktodo list. I used this solution because sometime I only work with one card (the second is busy with daily work), and at that time there was no "worktodo file" option either. Later I got used with it and kept it. Bad habits die hard. The idea is that you can make a batch file if you want only to type "cudalucas" and everything runs. Don't need changing the program for it. Even with maintenance by hand, there is only a matter of few copy/paste you do only when you get new assignments. Of course, this way you have to be careful and delete the lines for the jobs already completed (I used to do that by hand in the past too). edit: for confirmation :P added the photo. the choice lines make a pause of 10 seconds between the launches of CL (I forgot about them, hehe). If you launch two CL immediately one after the other you will get an error sometime (discussed on the forum in the past too). ps: (saw the PM, man ye never go to bed? I will catch ye when ye will be sleeping... :P) |
Specification question
I asked LaurV, but he had no preference.
If a user does not enter a workfile, and the ini file does not exist or its WorkFile option is bad, should CUDALucas silently assume worktodo.txt, or print a warning like "no work file specified, assuming worktodo.txt"? If I don't see an answer, I think I'll default to no warning. |
[QUOTE=Dubslow;301018]I asked LaurV, but he had no preference.
If a user does not enter a workfile, and the ini file does not exist or its WorkFile option is bad, should CUDALucas silently assume worktodo.txt, or print a warning like "no work file specified, assuming worktodo.txt"? If I don't see an answer, I think I'll default to no warning.[/QUOTE] I think no warning, just like mfakt* for standardization |
@Dubslow: I finally got around to testing. I know you're making some changes again, but there is something wrong. I think it's with the Windows worktodo.txt parser.
CuLu works fine if I use the command line switches with exponent, but any combination with no exponent on the command line causes a force closes every time (with a good Test or DoubleCheck line). I'll look at it while you rework the program. Maybe you'll find/fix it? |
[QUOTE=flashjh;301022]@Dubslow: I finally got around to testing. I know you're making some changes again, but there is something wrong. I think it's with the Windows worktodo.txt parser.
CuLu works fine if I use the command line switches with exponent, but any combination with no exponent on the command line causes a force closes every time (with a good Test or DoubleCheck line). I'll look at it while you rework the program. Maybe you'll find/fix it?[/QUOTE] Does it throw any errors? What does it print? What if you try passing the workfile name on the command line? (Is it able to read the ini file?) |
1 Attachment(s)
[QUOTE=Dubslow;301023]Does it throw any errors? What does it print?[/QUOTE]
No, no errors. Just closes: see attached picture. (All CUDA versions do the same thing & this is the same build you posted with the ini file) [QUOTE]What if you try passing the workfile name on the command line? (Is it able to read the ini file?)[/QUOTE] [CODE] start E:\CUDA\CUDALucas2.02.cuda3.2.sm_13.x64.exe -d 1 worktodo.txt [/CODE] Still force closes. [QUOTE](Is it able to read the ini file?)[/QUOTE] When I supply the exponent, the ini file seems to parse fine because I can make changes in the ini file and they affect execution. Also, command line switches do override the ini file (though I still have not tried all possible combinations). [break] Since my 580s are TFing, I got access to a friends GT 430 for CUDALucas testing - 153 hours for one DC :sick: (at least it's better than nothing) |
1 Attachment(s)
[QUOTE=flashjh;301024]No, no errors. Just closes: see attached picture. (All CUDA versions do the same thing & this is the same build you posted with the ini file)
[CODE] start E:\CUDA\CUDALucas2.02.cuda3.2.sm_13.x64.exe -d 1 worktodo.txt [/CODE] Still force closes. When I supply the exponent, the ini file seems to parse fine because I can make changes in the ini file and they affect execution. Also, command line switches do override the ini file (though I still have not tried all possible combinations). [/QUOTE] :huh: Wow. I am shocked and confused. Does the command line stay open, so that we can at least see the last thing printed? I have literally no idea where to start. (Keep in mind that the large majority of this code used in mfaktc.) If so, I'll throw in some prints statements so we can see how far it gets before crashing. I've just added the "debug" option to Makefile.win. :smile: :razz: LaurV, can you reproduce this? Edit: Please find attached my most recent copy, which now includes various debugging statements. Run "make debug", or if that doesn't work, just add the definitions manually and run "make". (Edit2: Be sure to clean out the object files before running "make debug".) Other changes: Added -i, -v options which are PrintDeviceInfo and version respectively. -d no longer automatically prints info for any device. -v (at the moment) prints CUDALucas 2.02, though I wonder if that shouldn't be upped to 2.03. I've also modified parse.c so that every fopen() call isn't riddled with ifdefs. Instead I've defined _fopen() with the solitary #ifdef for its body. (Argument parsing is now a separate function in CUDALucas.cu to clean up main() a little bit, but there is no functional difference.) |
Hi ,Dubslow
Nice work. I think you can increase version. |
[QUOTE=msft;301029]Hi ,Dubslow
Nice work.[/QUOTE]Sadly, it doesn't work quite yet. :razz: I think we'll increase the version when we get flash's crashes fixed :smile: |
[QUOTE=Dubslow;301026]:huh:
LaurV, can you reproduce this? [/QUOTE] Yes. Original flash's files, all versions. When no ini file is in the folder (or it has different name, OR there is a # sigh in the front of "WorkFile=worktodo.txt" line) the command "CL -d 0" (where CL is how you renamed the exe file) [B]exits normally[/B], after printing my device capabilities, it says "Can't open workfile" and exits. If i delete the # sign, but change the name into "WorkFile=cucurigu.txt", then the same command exits normally, saying "Can't open workfile cucurigu.txt". But then, if the line is not commented out, and the name of the file exists on the folder (that is, I have a valid worktodo.txt file there) then it crashes without no error message after displaying my device capabilities, in less then a second. If worktodo is empty or contains garbage, then it exists normally with "No valid assignment found". Any other combination that has the exponent given in the command line it works. |
[QUOTE=LaurV;301067]...But then, if the line is not commented out, and the name of the file exists on the folder (that is, I have a valid worktodo.txt file there) then it crashes without no error message after displaying my device capabilities, in less then a second.
If worktodo is empty or contains garbage, then it exists normally with "No valid assignment found".[/QUOTE] Exactly what I'm experiencing. I'll try to figure it out also. It's probably in the changes made going to 'safe' functions. |
[QUOTE=flashjh;301069]Exactly what I'm experiencing. I'll try to figure it out also. It's probably in the changes made going to 'safe' functions.[/QUOTE]
Have you guys tried running the program under the control of a debugger? Often saves a lot of time.... |
[QUOTE=chalsall;301072]Have you guys tried running the program under the control of a debugger?
Often saves a lot of time....[/QUOTE] Not yet, that's next after I compile the next revision Dubslow posted. |
[QUOTE=LaurV;301067]Yes. Original flash's files, all versions. When no ini file is in the folder (or it has different name, OR there is a # sigh in the front of "WorkFile=worktodo.txt" line) the command "CL -d 0" (where CL is how you renamed the exe file) [B]exits normally[/B], after printing my device capabilities, it says "Can't open workfile" and exits. If i delete the # sign, but change the name into "WorkFile=cucurigu.txt", then the same command exits normally, saying "Can't open workfile cucurigu.txt".
But then, if the line is not commented out, and the name of the file exists on the folder (that is, I have a valid worktodo.txt file there) then it crashes without no error message after displaying my device capabilities, in less then a second. If worktodo is empty or contains garbage, then it exists normally with "No valid assignment found". Any other combination that has the exponent given in the command line it works.[/QUOTE] Thanks, that helps to narrow it down. What about if you put non/valid assignments into cucurigu.txt, or whatever non-default name? What about if you comment-out the WorkFile option, but then put a workfile name on the command line? Edit: If you don't specify the workfile anywhere (e.g. comment-out WorkFile and don't say anything on the command line) does it still say "Can't open workfile" even if the file exists? Edit2: Is it accurate to say that it simply cannot parse a proper worktodo line, regardless of workfile name and/or how said name was passed to the program? If that's the case, what about if you try "Test=//" or something like that? "Test=N/A,86243,//" or "Test=//86243" or "Test=N/A,,//86243"? There's not too much that could cause platform-dependent errors... strstr(), strtoul(), isspace(), fgets(), ... [QUOTE=chalsall;301072]Have you guys tried running the program under the control of a debugger? Often saves a lot of time....[/QUOTE] The problem is the only one who's currently "fluent" in the code is the only one for whom it works :razz: If my debug build doesn't help, then maybe we'll see about getting flash a proper debugger. The other problem is that it's Winbloze :razz: Does MSVC come with its own debugger? |
[QUOTE=Dubslow;301082]The problem is the only one who's currently "fluent" in the code is the only one for whom it works :razz: If my debug build doesn't help, then maybe we'll see about getting flash a proper debugger. The other problem is that it's Winbloze :razz: Does MSVC come with its own debugger?[/QUOTE]
Grasshopper... Jumps before he walks.... |
[QUOTE=chalsall;301086]Grasshopper...
Jumps before he walks....[/QUOTE] I wouldn't be as much fun any other way :smile: |
[QUOTE=Dubslow;301087]I wouldn't be as much fun any other way :smile:[/QUOTE]
Many wouldn't agree. Do you understand why the code crashes? |
[QUOTE=chalsall;301089]
Do you understand why the code crashes?[/QUOTE] Do you? :unsure: |
[QUOTE=Dubslow;301091]Do you? :unsure:[/QUOTE]
Yes. |
[QUOTE=chalsall;301092]Yes.[/QUOTE]
And it's not something that would make Linux crash...? Did you use a debugger, or just look at the code and find it? ------------------------ How about you tell flash so he can fix it, while I try and figure it out...? |
[QUOTE=Dubslow;301093]And it's not something that would make Linux crash...? Did you use a debugger, or just look at the code and find it?
------------------------ How about you tell flash so he can fix it, while I try and figure it out...?[/QUOTE] Dubslow... There is no benefit in the teacher telling the student the answer. What is the sound of one hand clapping? |
[QUOTE=LaurV;301067]
If worktodo ...contains garbage, then it exists normally with "No valid assignment found". [/QUOTE] With garbage, can you make "No Test=" or "invalid format" or "invalid data" appear? (For the last two, you could use 4 or more commas, or put a nonprime exponent or expo < 86423. E.g.:[code]bill@Gravemind:~/CUDALucas∰∂ CUDALucas Warning: exponent is not prime! Warning: ignoring line 1: >> Test=N/A,25136458,69,1 in "worktodo.txt". Reason: invalid data. Continuing work from a partial result of M25866773 fft length = 1474560 iteration = 1988865[/code]) |
[QUOTE=chalsall;301094]Dubslow... There is no benefit in the teacher telling the student the answer.
[/QUOTE] I thought I was alone occasionally "being [strike]John Malkovich[/strike]". |
| All times are UTC. The time now is 22:00. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.