mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GPU Computing (https://www.mersenneforum.org/forumdisplay.php?f=92)
-   -   CUDALucas (a.k.a. MaclucasFFTW/CUDA 2.3/CUFFTW) (https://www.mersenneforum.org/showthread.php?t=12576)

chalsall 2012-06-05 15:14

[QUOTE=Dubslow;301314]The signal() code is identical to previous versions of CUDALucas except for the string printed.[/QUOTE]

You may want to do some research on the sigaction() function (although there is no direct Windows equivalent). signal() is a portability nightmare.

Dubslow 2012-06-05 15:15

[QUOTE=chalsall;301318]You may want to do some research on the sigaction() function (although there is no direct Windows equivalent). signal() is a portability nightmare.[/QUOTE]

:shrug: It's what msft has been using, and no one's complained so far. (I'm guessing it's been in there a long time, since at least 1.2 in all likelihood.)

chalsall 2012-06-05 15:38

[QUOTE=Dubslow;301319]:shrug: It's what msft has been using, and no one's complained so far. (I'm guessing it's been in there a long time, since at least 1.2 in all likelihood.)[/QUOTE]

:shrug: Just because it's being used doesn't necessarily mean it's correct in every environment. Once a month bug anyone? :wink:

Quoting the man page for signal(2): [QUOTE]The only portable use of signal() is to set a signal’s disposition to SIG_DFL or SIG_IGN. The semantics when using signal() to establish a signal handler vary across systems (and POSIX.1 explicitly permits this variation); [B]do not use it for this purpose[/B].[/QUOTE]

Redarm 2012-06-05 16:11

[QUOTE=Dubslow;301292]I didn't change a thing math-wise. Perhaps you chose a better FFT length? Edit: Could be new drivers, the 680 is still rather new. Or, if previously you were using arch>=2.0 but are now using arch=1.3, you might see some performance gains.

PS: Are you in Windows, and if so, does it crash for you like above?[/QUOTE]


i used the compiled versions for windows by flashjh, without the worktodo-file

edit: with worktodo.txt it will crash

Dubslow 2012-06-05 16:42

[QUOTE=Redarm;301334]i used the compiled versions for windows by flashjh, without the worktodo-file

edit: with worktodo.txt it will crash[/QUOTE]

Okay, well if you read the intermediate posts, that bug has been fixed and now we're just waiting for flash to recompile. :smile:

LaurV 2012-06-05 17:04

Found my issue. In v2.02 you have:

[CODE]enum ASSIGNMENT_ERRORS clear_assignment(char *filename, int exponent)
{
<snip>

[COLOR=Blue]#ifdef linux [/COLOR]
f_in = fopen(filename, "r");
if (NULL == f_in)
return CANT_OPEN_WORKFILE;

f_out = fopen("__worktodo__.tmp", "w");
if (NULL == f_out)
{
fclose(f_in);
return CANT_OPEN_TEMPFILE;
}
[COLOR=Blue]#else[/COLOR]
errno_t err;
err = fopen_s(&f_in, filename, "r");
if (err)
return CANT_OPEN_WORKFILE;

err=0; err = fopen_s(&f_out, "[COLOR=Red][B]__worktodo.tmp[/B][/COLOR]", "w");
if (err)
{
fclose(f_in);
return CANT_OPEN_TEMPFILE;
}
[COLOR=Blue]#endif[/COLOR]
[/CODE]This seems to be fixed in v2.03, I saw you made a new "_fopen()" and moved the OS-specific inside. Waiting for binaries of v2.03 (don't want to complicate the things even more by attempting a compilation by myself, I let flash do it, he has more experience :P). Meantime 2.02 produced first correct residues, two DCs (all switches in command line, no ini used).

Dubslow 2012-06-05 17:20

1 Attachment(s)
[QUOTE=LaurV;301340]Found my issue. In v2.02 you have:

[CODE]enum ASSIGNMENT_ERRORS clear_assignment(char *filename, int exponent)
{
<snip>

[COLOR=Blue]#ifdef linux [/COLOR]
f_in = fopen(filename, "r");
if (NULL == f_in)
return CANT_OPEN_WORKFILE;

f_out = fopen("__worktodo__.tmp", "w");
if (NULL == f_out)
{
fclose(f_in);
return CANT_OPEN_TEMPFILE;
}
[COLOR=Blue]#else[/COLOR]
errno_t err;
err = fopen_s(&f_in, filename, "r");
if (err)
return CANT_OPEN_WORKFILE;

err=0; err = fopen_s(&f_out, "[COLOR=Red][B]__worktodo.tmp[/B][/COLOR]", "w");
if (err)
{
fclose(f_in);
return CANT_OPEN_TEMPFILE;
}
[COLOR=Blue]#endif[/COLOR]
[/CODE]This seems to be fixed in v2.03, I saw you made a new "_fopen()" and moved the OS-specific inside. Waiting for binaries of v2.03 (don't want to complicate the things even more by attempting a compilation by myself, I let flash do it, he has more experience :P). Meantime 2.02 produced first correct residues, two DCs (all switches in command line, no ini used).[/QUOTE]

Ah. In that case, it was [i]probably[/i] just a transcription error on flash's part when he inserted the fopen_s. When I redefined all that crap under _fopen, I deleted all the Windows #ifdefs and used the Linux ones, and apparently I deleted the error as well. :smile:

By the way throughout this mess I think I've had 3 for 3 with my hacks.

By the other way, was I correct about you wanting print_time_from_seconds to always pad the ETA with zeros to a constant length?

PS Try hitting the ^C yourself. :smile:
___________________________________________________________________

PPS
[QUOTE=LaurV;301348]No idea what that means till I will see it in action :blush:
The "err=" and "ms/iter" is what I was thinking of. The ETA looks good as it is in v2.02. If you pad it with zeroes or better spaces up to 3:2:2 digits (in case is shorter) it would be perfect. But this is just nitpicking...[/QUOTE]

[QUOTE=LaurV;301303]
edit2: next cosmetic thing would be to use a fixed format (6, 5, even 4 decimals would be enough) for error display, and 4 decimals for [U]ETA[/U]. [/QUOTE]

The ms/iter was already at a steady field width; like I said in my original response, err is also now at a fixed field width. ETA would look like
15 hrs: "15:42:24"
5 hrs: "05:42:24"
0 hrs 42 mns: "00:42:24"
7 mins "00:07:24"
24 seconds "00:00:24"
4 seconds "00:00:04"

I personally think 3:2:2 is a bit excessive, since the vast majority of users do DCs.
___________________________________________________________________

PPPS
[QUOTE=LaurV;301349]Remember I am still running v2.02 :P
Most probably it will say "caught. Bla Bla" without "^C". I don't want to interrupt the work right now only for that.

edit: could not resist... I was right. Maybe you have done some changes in v2.03, but they didn't reach me yet...[/QUOTE]

Hmm... it should be "^C caught. ..." because when you hit ^C yourself, it appears on the terminal, then " caught..." makes it look like one print. (And no, I haven't changed that part since I initially made 2.00a.)
___________________________________________________________________

PPPPS
[QUOTE=LaurV;301348]ETA is already 2:2:2, so if you think 3:2:2 is too much, then there is nothing to do here. For me it looks ok either way.[/QUOTE]

Well if it gets below an hour, the hour field isn't printed at all and we get a 2:2, not a 2:2:2. That's what I was wondering about.
[code]//From apsen
void
print_time_from_seconds (int sec)
{
if [U](sec > 3600)[/U]
{
printf ([U]"%d", sec / 3600[/U]);
sec %= 3600;
printf (":%02d", sec / 60);
}
[U]else
printf ("%d", sec / 60);[/U]
sec %= 60;
printf (":%02d", sec);
}[/code]

Reattaching 2.03 from previous page.

LaurV 2012-06-05 17:40

[QUOTE=Dubslow;301344]
By the other way, was I correct about you wanting print_time_from_seconds to always pad the ETA with zeros to a constant length?[/QUOTE]
No idea what that means till I will see it in action :blush:
The "err=" and "ms/iter" is what I was thinking of. The ETA looks good as it is in v2.02. If you pad it with zeroes or better spaces up to 3:2:2 digits (in case is shorter) it would be perfect. But this is just nitpicking...

Thanks for the PM, my post count is inflated too, but who cares :D, I saw your reply, I wrongly wrote ETA there. I was thinking to ms/iter with 4 decimals, fixed. ETA is already 2:2:2, so if you think 3:2:2 is too much, then there is nothing to do here. For me it looks ok either way.

LaurV 2012-06-05 17:45

[QUOTE=Dubslow;301344]PS Try hitting the ^C yourself. :smile:[/QUOTE]
Remember I am still running v2.02 :P
Most probably it will say "caught. Bla Bla" without "^C". I don't want to interrupt the work right now only for that.

edit: could not resist... I was right. Maybe you have done some changes in v2.03, but they didn't reach me yet...

flashjh 2012-06-05 18:52

CUDALucas 2.03 x64 Binaries
 
1 Attachment(s)
Attached CUDALucas 2.03 x64 binaries - Tested


- I was able to run with or without .ini file
- Worktodo.txt works fine.
- Command line still takes precedence
- Test=XXXXXXXX in worktodo.txt works fine
- Test=N/A,XXXXXXXX,XX,X works fine
- Test=AID,XXXXXXXX,XX,X works fine
- I tested DoubleCheck with all these also, they work fine

@Dubslow - everything compiled straight out, but the makefile.win needed a small change OUT = NAME -> OUT = $(NAME) on line 6 and I still need /Tp for now

This is CUDA 4.0 | sm20 & sm_21 (see next posts for CUDA 3.2 & source)

Edit: With .ini and worktodo.txt in directory, I can run just CUDALucas.exe and it works fine.

BTW - Thanks for all the hard work everyone!

Edit2:

I just edited my worktodo.txt with M86243 and restarted with CUDALucas.exe:

[CODE]
M( 86243 )P, n = 4608, CUDALucas v2.03
Continuing work from a partial result of M26105XXX fft length = 1572864 iteration = 13559297
[/CODE]

It successfully found the Prime, cleared the exponent from worktodo.txt and continued with my current exponent - awesome!

flashjh 2012-06-05 18:54

CUDALucas 2.03 x64 Binaries
 
1 Attachment(s)
CUDALucas 2.03 x64 CUDA 3.2 | sm_13


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

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