[chimera-dev] asynchronous running of Chimera extensions

Eric Pettersen pett at cgl.ucsf.edu
Tue Aug 17 11:32:43 PDT 2010


On Aug 16, 2010, at 3:54 PM, Marcin Pawlowski wrote:

> Great. Thanks a lot.
>
> We using both of them 1) using a web service and 2)  running the
> program on the local machine.

Hi Marcin,
	Unfortunately Conrad is sick today, so I'll try to answer the web  
service question without causing too much damage. :-)  So the answer  
depends a bit on how the back-end web service is implemented.  If it's  
implemented as an Opal service, you should look at the  
StructureDiagram.ws module, in particular the  
CDKDepictionService._runAsTask method.  It's probably more efficient  
for you to ask questions about the code than to have me explain it  
line by line.  Besides, I think it's actually pretty straightforward  
in this case.
	If the web service is implemented by REST, try looking at the  
ModBase.gui module, particularly the FetchScore._submitJob method.   
That method posts a multipart form to a REST service and reads back  
the result.  You could adapt that code and use the same task "wrapper"  
that the Opal code uses.
	That code doesn't directly use a task wrapper because it is one of  
many requests that Chimera will be making to that web service (usually  
10-20 at once), so it uses a queue to prevent overwhelming the remote  
server with requests.  If your service will be making multiple  
requests at once then maybe you would want to do the same thing.  If  
so, then look FetchScore.__init__ to see how the queue is set up (the  
httpq.get(), hq.newSlot(), and slot.request() calls) and then the end  
of the FetchScore._submitJob method to see how secondary requests to  
the server (if any) can be added to the queue with q.put().
	Please feel free to ask more questions!

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu


> Quoting Conrad Huang <conrad at cgl.ucsf.edu>:
>
>> Chimera has code for running jobs in the background while keeping
>> the GUI active.  Some of this code is still under development and I
>> would suggest using the daily build rather than 1.4.1.  Here are the
>> relevant modules and an example:
>>
>> chimera.SubprocessMonitor
>>  Module for running and monitoring background process
>> chimera.tasks
>>  Module for display background tasks in the task manager interface
>> chimera.printer
>>  SubprocessMonitor is used in saveImage() to launch background POV- 
>> Ray
>>
>> If you are using a web service rather than running the program on
>> the local machine, there are other modules that may be of interest.
>>
>> Conrad
>>
>> On 8/12/10 5:57 AM, Marcin Pawlowski wrote:
>>> Dear Chimera developers.
>>> Me and of my students are developing  a chimera extension to deal  
>>> with
>>> protein structures.
>>> Unfortunately, the execution of our plunging last at least 5  
>>> minutes,
>>> so during this time the chimera program is hinged.  We would like to
>>> execute the program in an asynchronous way.
>>>
>>> Is it possible?
>>>
>>> Please do not hesitate to contact us if you require further
>>> information about our project.
>>>
>>> Best regards,
>>> Marcin Pawlowski
>>>
>>>
>>> _______________________________________________
>>> Chimera-dev mailing list
>>> Chimera-dev at cgl.ucsf.edu
>>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
>>
>>
>>
>>
>
>
>
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20100817/e4ae77e2/attachment.html>


More information about the Chimera-dev mailing list