How exactly exclusive_app works?

Message boards : Questions and problems : How exactly exclusive_app works?
Message board moderation

To post messages, you must log in.

AuthorMessage
glums

Send message
Joined: 29 Apr 17
Posts: 5
Message 77689 - Posted: 29 Apr 2017, 22:29:14 UTC
Last modified: 29 Apr 2017, 22:54:34 UTC

I need to add my scripts to the list. The following didn't work.
<exclusive_app>script_name</exclusive_app>
<exclusive_app>script_name.py</exclusive_app>
<exclusive_app>python3 /home/.scripts/script_name.py</exclusive_app>
<exclusive_app>/usr/bin/python3 /home/.scripts/script_name.py</exclusive_app>

I narrowed it down to this https://github.com/BOINC/boinc/blob/b2b83a1150f31ebcf86210587516fa10b03eeb22/client/app.cpp#L310
but I'm not familiar with cpp and it didn't help.

It works with geany, chromium, etc.
<exclusive_app>geany</exclusive_app>
<exclusive_app>chromium</exclusive_app>
ID: 77689 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15477
Netherlands
Message 77692 - Posted: 30 Apr 2017, 9:57:07 UTC - in response to Message 77689.  

The exclusive applications function works by adding the name of the executable as it shows in top. You only use the name, no path. And BOINC must be set to run based on preferences, when it's set to run always it ignores these exclusive applications.
ID: 77692 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15477
Netherlands
Message 77697 - Posted: 30 Apr 2017, 13:45:15 UTC - in response to Message 77696.  
Last modified: 30 Apr 2017, 13:45:35 UTC

I do not see that. Just tested with Notepad, which shows as notepad.exe in Windows 7's Windows Task Manager.

First added notepad.exe as an exclusive GPU app, then added Notepad.exe as the exclusive GPU app.

30/04/2017 15:41:03 | | Config: don't use GPUs while notepad.exe is running
30/04/2017 15:41:40 | | Suspending GPU computation - an exclusive app is running
30/04/2017 15:41:40 | SETI@home | [cpu_sched] Preempting 23ap08ab.24443.20931.5.32.253_0 (removed from memory)
30/04/2017 15:41:40 | SETI@home | [task] task_state=QUIT_PENDING for 23ap08ab.24443.20931.5.32.253_0 from request_exit()
30/04/2017 15:41:40 | | request_exit(): PID 4172 has 0 descendants
30/04/2017 15:41:42 | SETI@home | [task] Process for 23ap08ab.24443.20931.5.32.253_0 exited, exit code 0, task state 8
30/04/2017 15:41:42 | SETI@home | [task] task_state=UNINITIALIZED for 23ap08ab.24443.20931.5.32.253_0 from handle_exited_app

30/04/2017 15:42:48 | | Config: don't use GPUs while Notepad.exe is running
30/04/2017 15:43:22 | | Suspending GPU computation - an exclusive app is running
30/04/2017 15:43:22 | SETI@home | [cpu_sched] Preempting 23ap08ab.24443.20931.5.32.253_0 (removed from memory)
30/04/2017 15:43:22 | SETI@home | [task] task_state=QUIT_PENDING for 23ap08ab.24443.20931.5.32.253_0 from request_exit()
30/04/2017 15:43:22 | | request_exit(): PID 8508 has 0 descendants
30/04/2017 15:43:23 | SETI@home | [task] Process for 23ap08ab.24443.20931.5.32.253_0 exited, exit code 0, task state 8
30/04/2017 15:43:23 | SETI@home | [task] task_state=UNINITIALIZED for 23ap08ab.24443.20931.5.32.253_0 from handle_exited_app
ID: 77697 · Report as offensive
glums

Send message
Joined: 29 Apr 17
Posts: 5
Message 77699 - Posted: 30 Apr 2017, 16:01:23 UTC

As I've said, it works with programs like chromium. So for my scripts what name should I use exactly?
In top it's:
python3 /home/.scripts/script_name.py
ID: 77699 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5077
United Kingdom
Message 77700 - Posted: 30 Apr 2017, 16:43:22 UTC - in response to Message 77699.  

Have you tried simply

python3

on its own, without the name of the script the interpreter is currently executing?
ID: 77700 · Report as offensive
glums

Send message
Joined: 29 Apr 17
Posts: 5
Message 77701 - Posted: 30 Apr 2017, 17:40:01 UTC - in response to Message 77700.  
Last modified: 30 Apr 2017, 17:46:08 UTC

Yes, I forgot to mention that I tried it, it indeed works, but it doesn't help since I've got loads of other running scripts and programs that use python3 and aren't hampered by boinc.
ID: 77701 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15477
Netherlands
Message 77702 - Posted: 30 Apr 2017, 17:54:36 UTC - in response to Message 77701.  

I think it only works on actual programs, not on processes running off of those programs.
ID: 77702 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5077
United Kingdom
Message 77703 - Posted: 30 Apr 2017, 18:00:31 UTC - in response to Message 77701.  

Then maybe you could consider something like py2app - "Create standalone Mac OS X applications with Python", as it says on the tin.

You would only need to compile the script(s) which interfere with BOINC - then the (unique) name of the resulting application would be your entry in exclusive_app. You could continue to run your other, non-intrusive, scripts in interpretive mode with python3 as now.
ID: 77703 · Report as offensive
glums

Send message
Joined: 29 Apr 17
Posts: 5
Message 77704 - Posted: 30 Apr 2017, 23:57:02 UTC - in response to Message 77703.  

I'm on linux, nonetheless compiling doesn't work for me.
ID: 77704 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5077
United Kingdom
Message 77707 - Posted: 1 May 2017, 6:36:45 UTC - in response to Message 77704.  

I'm on linux ...
Sorry, my mind must still have been in the Mac thread next door.
ID: 77707 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 77708 - Posted: 1 May 2017, 8:39:25 UTC

The check is for matching the exact name ignoring case (see: strcasecmp). So you must enter the line exactly as it appears in the proc info. This is gathered internally as parsing the information from "/proc/%s/stat" where %s is the PID of your script. When the script is running check this and get the first 256 characters from the command (see lib/procinfo_unix.cpp#L112 for where it is). The exclusive app feature only stores and compares the first 256 characters. Or it might even be shorter then show in top as I just found out.

Using ps I get:
$ ps aux |grep 21000
christi+ 21000  0.3  2.2 1670108 364732 ?      Sl   Apr30   4:05 /usr/lib/chromium/chromium --show-component-extension-options --ignore-gpu-blacklist --no-default-browser-check --disable-pings --media-router=0 --enable-remote-extensions --ppapi-flash-path=/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so --ppapi-flash-version=24.0.0.194 --ssl-version-min=tls1

Using /proc/PID/stat I get:
$ cat /proc/21000/stat
21000 (chromium) S 12070 12015 12015 0 -1 4194304 1909775 62808 2 0 20760 3806 74 50 20 0 47 0 24082074 1710190592 91183 18446744073709551615 94430747762688 94430889350680 140720762739072 0 0 0 0 4096 81923 0 0 0 17 2 0 0 0 0 0 94430889354912 94430894400176 94430912614400 140720762746772 140720762747075 140720762747075 140720762748893 0


So there might be no way to distinguish which python script is running.
ID: 77708 · Report as offensive
glums

Send message
Joined: 29 Apr 17
Posts: 5
Message 77709 - Posted: 1 May 2017, 15:23:31 UTC - in response to Message 77708.  

Solved.
Never looked it up before, but python3 is just a link to the actual interpreter python3.6. I just made an additional link and added it to the boinc's exclusive list.

The name of the link shouldn't be too long, just as ChristianB said, or it will be cut.
I spent an hour trying to understand why the link python3 worked and python3_exclusive_app didn't; it was cut to the python3_exclusi.
ID: 77709 · Report as offensive

Message boards : Questions and problems : How exactly exclusive_app works?

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.