mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   YAFU (https://www.mersenneforum.org/forumdisplay.php?f=96)
-   -   Yafu (https://www.mersenneforum.org/showthread.php?t=10871)

pinhodecarlos 2011-11-21 14:49

[QUOTE=bsquared;279381]Couldn't the script be modified to invoke yafu at low priority then?[/QUOTE]

At this line[code]open(YAFU, "yafu siqs($composite) -threads 2|")[/code] I added start /low but it opens two DOS boxes, yafu runs at idle at first processing but then shutdowns.
Anyway, the script is in perl but I am ignorant, I don't know how to invoke yafu at idle priority.

axn 2011-11-21 15:01

[QUOTE=pinhodecarlos;279382]I added start /low but it opens two DOS boxes, yafu runs at idle at first processing but then shutdowns.
Anyway, the script is in perl but I am ignorant, I don't know how to invoke yafu at idle priority.[/QUOTE]

Can't you invoke the script itself using start /low?

pinhodecarlos 2011-11-21 15:05

[QUOTE=axn;279384]Can't you invoke the script itself using start /low?[/QUOTE]

Yes but yafu still runs at normal priority.

[code]start /low /min factordb.pl [/code]

bsquared 2011-11-21 15:07

[QUOTE=pinhodecarlos;279382]At this line[code]open(YAFU, "yafu siqs($composite) -threads 2|")[/code] I added start /low but it opens two DOS boxes, yafu runs at idle at first processing but then shutdowns.
Anyway, the script is in perl but I am ignorant, I don't know how to invoke yafu at idle priority.[/QUOTE]

probably some conflict between perl's "open" and "start"... both are probably creating a dos window. I don't know enough perl to be sure, but maybe perl's "system" in combination with start would work.

[SIZE=1]edit: but that would probably break the rest of the script...[/SIZE]

axn 2011-11-21 15:09

[QUOTE=pinhodecarlos;279385]Yes but yafu still runs at normal priority.

[code]start /low /min factordb.pl [/code][/QUOTE]

Hmmm... Is there a perl exe somewhere in task manager? What is its priority? By default, a child process inherits the parent process' priority. So yafu should've gotten the perl process' priority.

bsquared 2011-11-21 15:11

I see this is already solved in msieve...

[CODE][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] set_idle_priority([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]) {
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]defined[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](WIN32) || [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]defined[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](_WIN64)
SetPriorityClass(GetCurrentProcess(),
IDLE_PRIORITY_CLASS);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#else
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]nice(100);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#endif
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]}
[/SIZE][/FONT][/SIZE][/FONT][/CODE]

so assuming Jason doesn't mind if I rip that off, I can copy the -p swith over to yafu too.

pinhodecarlos 2011-11-21 15:12

[QUOTE=axn;279387]Hmmm... Is there a perl exe somewhere in task manager? What is its priority? By default, a child process inherits the parent process' priority. So yafu should've gotten the perl process' priority.[/QUOTE]

I had that thought too but both perl.exe and yafu.exe are at normal priority. Priority of the program must be intrinsic, like Geoff did with srsieve a long time ago.

pinhodecarlos 2011-11-21 15:14

[QUOTE=bsquared;279389]I see this is already solved in msieve...

[CODE][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] set_idle_priority([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]) {
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]defined[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](WIN32) || [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]defined[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](_WIN64)
SetPriorityClass(GetCurrentProcess(),
IDLE_PRIORITY_CLASS);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#else
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]nice(100);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#endif
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]}
[/SIZE][/FONT][/SIZE][/FONT][/CODE]so assuming Jason doesn't mind if I rip that off, I can copy the -p swith over to yafu too.[/QUOTE]

That's it!

axn 2011-11-21 15:21

[QUOTE=pinhodecarlos;279390]I had that thought too but both perl.exe and yafu.exe are at normal priority. Priority of the program must be intrinsic, like Geoff did with srsieve a long time ago.[/QUOTE]

Aha! That mean start /low factordb.pl didn't start perl with the low priority. Can you try [CODE]start /low perl.exe factordb.pl[/CODE]

LaurV 2011-11-21 15:24

[QUOTE=pinhodecarlos;279382]At this line
[code]open(YAFU, "yafu siqs($composite) -threads 2|")[/code]I added start /low but it opens two DOS boxes, yafu runs at idle at first processing but then shutdowns.
Anyway, the script is in perl but I am ignorant, I don't know how to invoke yafu at idle priority.[/QUOTE]
You can not do that. This line invokes yafu using command prompt, which does not have a /low switch. The /low switch is part of the "start" command in windows. You can open a command prompt and type "help cmd", see there is no /low switch, then type "help start" and see the switch. Then modify your line, or tell me what windows you use and I will modify the line for you.

edit: axn have beaten me to it, his solution could work too.

pinhodecarlos 2011-11-21 15:25

axn, your line doesn't work, dos box closes.
LaurV, Vista 32 bits.


All times are UTC. The time now is 22:56.

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