Met het 'log-updates' commando is het mogelijk om de v7 FAHClient de logging wat je nu in de log.txt (vroeger FAHlog.txt) vind, via de remote interface naar je applicatie gepusht te krijgen. Dit is een vorm van
Asynchronous I/O welke qua implementatie veel lijkt op de Unix select loops. Kijken of er een bericht gepusht is, zo ja verwerk die, zo nee slaap even om daarna weer te kijken. Dit is in essentie wat FAHControl ook doet met zijn read_some()/parse() combinatie, die wat data uit de socket leest en deze verwerkt indien het een PyON bericht ontvangen heeft.
Helaas is de source code van FAHControl de enige referentie die we hebben wat het gebruik van het 'log-updates' commando betreft. Zoals er ook nog geen documentatie van het 'protein' commando is, is Joe er ook nog niet aan toe gekomen dit te documenteren. Het 'protein' commando word niet expliciet genoemd in
de documentatie, maar er word wel naar gehint:
Introduction
The v7 Folding@home client supports a new remote interface which allows applications to do the following:
* Access information about the client.
* Read and modify the client's configuration.
* Access information about the work units in the client's queue.
* Start and stop folding slots.
* Add, configure or remove folding slots.
* Access protein models.
Het 'log-updates' command heeft zowaar
zijn eigen sectie, maar deze is nog erg kaal:
Log Updates
Log updates are handled slightly differently than the updates described in the previous section.
Zojuist het ik de
eerste code voltooid die hier gebruik van kan maken:
fah-log-tail.pl, een simpel script wat eindeloos wacht op nieuwe 'log-update' PyON berichten van de FAHClient en deze netjes opgemaakt en op de console toont. Het is een soort network enabled `tail -f log.txt`
$ ./bin/fah-log-tail.pl -H vmware-debian -v
Connecting to the FAHClient remote interface on vmware-debian:36330
Starting log updates.
06:39:51:Unit 00:goefile size: 0
06:39:51:Unit 00:logfile size: 31125
06:39:51:Unit 00:Leaving Run
06:39:52:Unit 00:- Writing 588253 bytes of core data to disk...
06:39:52:FahCore, running Unit 00, returned: FINISHED_UNIT (100)
06:39:52:Sending unit results: id:00 state:SEND project:6885 run:157 clone:9 gen:88 core:0x78 unit:0x0000005e6652edb14cebfe6600b2680f
06:39:52:Unit 00: Uploading 547.21KiB
06:39:52:Connecting to 171.67.108.33:8080
06:39:58:Unit 00: Upload complete
06:39:58:Server responded WORK_ACK (400)
06:39:58:Final credit estimate, 69.00 points
06:39:58:Cleaning up Unit 00
08:02:59:Server connection id=11 on 0.0.0.0:36330 from 10.0.0.150
08:02:59:Started thread 19 on PID 5141
08:13:00:Server connection id=11 ended
16:51:20:Server connection id=12 on 0.0.0.0:36330 from 10.0.0.150
16:51:20:Started thread 20 on PID 5141
16:52:45:Server connection id=12 ended
21:30:06:Server connection id=13 on 0.0.0.0:36330 from 10.0.0.150
21:30:06:Started thread 21 on PID 5141
Waiting for message...
21:30:25:Server connection id=14 on 0.0.0.0:36330 from 10.0.0.150
21:30:25:Started thread 22 on PID 5141
21:30:25:Server connection id=14 ended
Sleeping...
Waiting for message...
^C
Stopping log updates.
Closing connection to the FAHClient remote interface
En dan waar iedereen echt voor komt, de stats van (eer)gister
DPC Folding@Home hitparade van 5 mei 2011
Mijlpalen
Nieuwe Leden
Folding@Home Links
Folding@Home webpage
Folding@Home forum
DPCH Suggestiepagina
DPC FAQ
Bron