Accounting for snooze feature in my workunits

Message boards : API : Accounting for snooze feature in my workunits
Message board moderation

To post messages, you must log in.

AuthorMessage
seravitae

Send message
Joined: 15 Sep 09
Posts: 2
Australia
Message 27411 - Posted: 15 Sep 2009, 10:13:03 UTC

Hey guys,
I'm new to BOINC development and am currently halfway through making a python workunit program. I was just wondering, currently my application has no 'pause' feature as it were, because I know BOINC has it's own snooze feature and methods of controlling the active workunit process/threads.

What i want to know is, how do I account for this in my code? Currently the arguments passed to the workunit is split up into 100 parts to process, such that I can return a percentage (for BOINC status update) and at this point I believe i wish to somehow check if BOINC is in snooze mode and thus wait until snooze mode has ended. I cannot find this on the documents on the website. if anyone has any ideas of how to account for this, i'd appreciate it.

Cheers :)
ID: 27411 · Report as offensive
Nicolas

Send message
Joined: 19 Jan 07
Posts: 1179
Argentina
Message 27420 - Posted: 15 Sep 2009, 18:29:31 UTC - in response to Message 27411.  

For an application to work in BOINC, it must use the BOINC API; or use the official wrapper, which already handles pausing transparently (when BOINC tells the wrapper to pause, the wrapper would pause your app).

ID: 27420 · Report as offensive
seravitae

Send message
Joined: 15 Sep 09
Posts: 2
Australia
Message 27430 - Posted: 15 Sep 2009, 23:09:32 UTC - in response to Message 27420.  

Hi there,

thanks for pointing this out. I haven't yet implemented the boinc api stuff yet, though i know a boinc python wrapper exists and will be looking into it soon.

I understand that BOINC API handles snoozing, but what i don't currently understand is the technicalities of your statement "the wrapper would pause your app" - for the wrapper to pause my application, my application must be able to detect some sort of flag (variable or signal of some form) to which my program could respond by temporarily halting computation. I cannot figure out what this flag/variable/signal is based on the docs.

cheers!
ID: 27430 · Report as offensive
Nicolas

Send message
Joined: 19 Jan 07
Posts: 1179
Argentina
Message 27434 - Posted: 16 Sep 2009, 0:13:59 UTC - in response to Message 27430.  

I understand that BOINC API handles snoozing, but what i don't currently understand is the technicalities of your statement "the wrapper would pause your app" - for the wrapper to pause my application, my application must be able to detect some sort of flag (variable or signal of some form) to which my program could respond by temporarily halting computation. I cannot figure out what this flag/variable/signal is based on the docs.

On Unix, the wrapper will send your app a SIGSTOP signal. On Windows, the wrapper will call SuspendThread on every thread of your process.

There is nothing you have to do, no flag to add. The idea of the wrapper is using it on unmodified applications, eg. if they are closed-source. I stick to my opinion that if you can modify the app, you shouldn't be using the wrapper at all; you should integrate the BOINC API into it directly.

If the app is written in an interpreted language, it's a bit of a special case. "Modifying the app to integrate the BOINC API" could mean modifying the interpreter, not the script. So I think using the wrapper in that situation is fine too.

ID: 27434 · Report as offensive

Message boards : API : Accounting for snooze feature in my workunits

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.