mersenneforum.org

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

thyw 2017-08-07 21:38

Temporary solution - filtering out output with scripts
 
Guessing around so...
I'm cluless in Powershell, but in bash filters with the [I]cut[/I] and[I] fields[/I] (because these separate based on separators, not character number) you could probably ignore those line with ...| class [B]1.5%[/B] | ... where based on class or the percentage you could filter out those with for example ??.3 or ??.4 or ??.5 percentage or classes containing certain numbers. Implying you are redirecting the console output to file, and not the program writing the output to a file.
Or a drastic solution would be removing all the lines containing "|". <- I don't have access to Cuda harware, so cannot confirm if it influences the results.

Or inserting a for loop somewhere into the sourcecode. E.g. looks like in output.c line #360 or #389 or even #323 is responsible (maybe) for the logging/console output? (Don't trust me, i don't know a thing about these.)

A probably not preferable method for you would be to not redirect the console output as the program itself would/will write results to the results.txt. Maybe make a separate "buffer" output with the console output which deletes/trims itself after x time/size.

kriesel 2017-08-09 17:54

[QUOTE=thyw;465055]Guessing around so...
I'm cluless in Powershell, but in bash filters with the [I]cut[/I] and[I] fields[/I] (because these separate based on separators, not character number) you could probably ignore those line with ...| class [B]1.5%[/B] | ... where based on class or the percentage you could filter out those with for example ??.3 or ??.4 or ??.5 percentage or classes containing certain numbers. Implying you are redirecting the console output to file, and not the program writing the output to a file.
Or a drastic solution would be removing all the lines containing "|". <- I don't have access to Cuda harware, so cannot confirm if it influences the results.

Or inserting a for loop somewhere into the sourcecode. E.g. looks like in output.c line #360 or #389 or even #323 is responsible (maybe) for the logging/console output? (Don't trust me, i don't know a thing about these.)

A probably not preferable method for you would be to not redirect the console output as the program itself would/will write results to the results.txt. Maybe make a separate "buffer" output with the console output which deletes/trims itself after x time/size.[/QUOTE]

In Windows: Command Prompt, Properties, Layout, Screen Buffer large height and width values accomplish a lot of what you suggest last. But it doesn't survive a system halt, of course, or preserve the more important content for reference weeks or months later when considering questions not thought of before the screen data rolled off the deep history buffer, even at 4000 lines deep buffer size.

kriesel 2017-08-16 16:10

has anyone checked for systems missing factors lately?
 
Saw [url]http://mersenneforum.org/showthread.php?t=21705[/url] and wondered if such a check has been made this year.

storm5510 2017-08-17 16:18

[QUOTE=thyw;465055]...I'm cluless in Powershell...[/QUOTE]

All you have to do in [I]PowerShell[/I] is enter [B]cmd[/B] at the first prompt,and then it behaves like a regular command prompt.

kriesel 2017-08-17 18:33

powershell tee caution
 
[QUOTE=storm5510;465770]All you have to do in [I]PowerShell[/I] is enter [B]cmd[/B] at the first prompt,and then it behaves like a regular command prompt.[/QUOTE]

Re powershell and tee use, I saw a warning somewhere that tee creates a destination file, even if a file by that name exists. Which would blow away the previously accumulated log every time the app halted from the nvidia driver timeout or other reason and the batch wrapper restarted the application with tee to redirect a copy of screen output to the file.. Unless the alert user incorporated the batch loop count into the tee destination file name in the batch file. That first time could be a killer, of months of logging. The -append modifier for tee is not accepted at the command line in my test moments ago on Win7.

chalsall 2017-08-17 19:26

[QUOTE=kriesel;465779]That first time could be a killer, of months of logging. The -append modifier for tee is not accepted at the command line in my test moments ago on Win7.[/QUOTE]

I don't use Winblows, but under Linux the append option for the tee command is either "-a" or "--append".

[CODE][chalsall@burrow ~]$ ping 127.0.0.1 | tee -a ping.txt[/CODE]

...sent the output of the ping to the console, and also to the file ping.txt. The file was not overwritten upon a cntl-C and then a relaunch. Rather, it was appended, as instructed.

kriesel 2017-08-18 01:31

[QUOTE=chalsall;465784]I don't use Winblows, but under Linux the append option for the tee command is either "-a" or "--append".

[CODE][chalsall@burrow ~]$ ping 127.0.0.1 | tee -a ping.txt[/CODE]...sent the output of the ping to the console, and also to the file ping.txt. The file was not overwritten upon a cntl-C and then a relaunch. Rather, it was appended, as instructed.[/QUOTE]

Win7 Pro PS (same comments except no -a or -append work)
PS C:\Users\Ken\documents> dir | tee-object -filepath tee-test.txt -append
Tee-Object : A parameter cannot be found that matches parameter name 'append'.
At line:1 char:48
+ dir | tee-object -filepath tee-test.txt -append <<<<
+ CategoryInfo : InvalidArgument: (:) [Tee-Object], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TeeObjectCommand

PS C:\Users\Ken\documents> dir | tee-object -filepath tee-test.txt -a
Tee-Object : A parameter cannot be found that matches parameter name 'a'.
At line:1 char:43
+ dir | tee-object -filepath tee-test.txt -a <<<<
+ CategoryInfo : InvalidArgument: (:) [Tee-Object], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TeeObjectCommand

PS C:\Users\Ken\documents>

The plot thickens; the -append option is not present in command line tee help on Win7, but is in Win10.

I think I'm well off the thread topic now so won't go into it any further.

storm5510 2017-08-18 02:28

[QUOTE=kriesel]...Which would blow away the previously accumulated log every time the app halted from the nvidia driver timeout or other reason...

[/QUOTE]This may, or may not, be of any use. Below is a batch file which [B]kladner[/B] posted in response to a driver reset issue I have with CUDALucas. It will also work CUDAPm1 and mfaktc.

I added the line in bold because, if the program does not find an assignment in its [I]worktodo.txt [/I]file, it continues to loop. Not so long ago, I got up one morning to find a loop value over 700,000.

Change the program name in the third line and put it the proper folder.

[CODE]@echo off
set count=0
set program=cudalucas
:loop
TITLE %program% current reset count = %count%
set /a count+=1
echo %count% >> log.txt
echo %count%
%program%.exe [COLOR="Red"]>> logname.txt
[/COLOR][B]if %count%==50 goto end
[/B]goto loop
:end[/CODE]

If one adds the part in [COLOR="Red"]red[/COLOR], an output file will be [U]appended[/U], not replaced. Naturally, the name can be whatever you need.

kriesel 2017-08-18 09:55

[QUOTE=storm5510;465819]This may, or may not, be of any use. Below is a batch file which [B]kladner[/B] posted in response to a driver reset issue I have with CUDALucas. It will also work CUDAPm1 and mfaktc.

I added the line in bold because, if the program does not find an assignment in its [I]worktodo.txt [/I]file, it continues to loop. Not so long ago, I got up one morning to find a loop value over 700,000.

Change the program name in the third line and put it the proper folder.

[CODE]@echo off
set count=0
set program=cudalucas
:loop
TITLE %program% current reset count = %count%
set /a count+=1
echo %count% >> log.txt
echo %count%
%program%.exe [COLOR=Red]>> logname.txt
[/COLOR][B]if %count%==50 goto end
[/B]goto loop
:end[/CODE]If one adds the part in [COLOR=Red]red[/COLOR], an output file will be [U]appended[/U], not replaced. Naturally, the name can be whatever you need.[/QUOTE]

Thanks, yes, I use something similar to that. Tee had been suggested to me as a means of having both screen output and logging.

storm5510 2017-08-18 16:55

[QUOTE=kriesel;465855]Thanks, yes, I use something similar to that. Tee had been suggested to me as a means of having both screen output and logging.[/QUOTE]

I did some web searching and found something I thought might perform screen output and logging. It was a Windows 7 command. I could not get it to perform properly on Windows 10, except for miscellaneous prompt commands like 'dir.' It did not work in my batch file or on the command line. Below is an example.

[CODE]mfaktc >> mfa.txt & type mfa.txt[/CODE]

James Heinrich 2017-08-18 17:32

That will send the output to mfa.txt and then to the screen once mfaktc is finished. Not simultaneously.


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

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