Closed GoogleCodeExporter closed 9 years ago
It seems that there's no built-in cross platform way to set cpu affinity within
python.
There are a couple of options currently implemented:
1) Increase the "load_throttle_sleep_interval" in global_config.json. If you do
this make sure to increase "cycle_time and min_cycle_time" to ensure a decent
population size. This will decrease the cpu load across all cores... which
isn't too helpful if you're trying to reserve a couple of cores for other tasks.
2) gal.py can be manually edited down to only two clients - 'gts.py all y' &
'gts.py all n'. However, in this configuration the BOBs and high scoring genes
will not be used to generate new populations. Instead they will only be
retested to update the scores. With this method users can manually set the cpu
affinity in task manager to limit processing to certain cpu cores.
To improve the second option I'll need to add another command line option
'score_only' to gts.py and change the behavior of 'gts.py all y' to generate
and test new populations.
Original comment by brian.mo...@gmail.com
on 25 Feb 2012 at 2:39
Thank you for the clarification. If it helps anyone, my knowledge of
accomplishing the limiting using the tools that come with various OSes is as
follows:
Under the *nix OSes, I tend to use two 'prefixes':
- the 'nice' utility which sets the process priority during the process startup
- the 'taskset' utility which restricts the process to only one [selected] core
...so I would run it as:
taskset -p 01 nice -19 pypy gal.py
...It seems the process priority when set to the parent process [gal.py] also
propagets to it's children [for example, gts.py instances]
For windows machines it seems that process priority can be set during the
startup by prefixing the command with:
start /low /b
Original comment by purge...@gmail.com
on 25 Feb 2012 at 7:07
Another option is to use VMware player with a linux image. VMware player allows
you to set a hard limit on the number of cpu cores to use.
Original comment by brian.mo...@gmail.com
on 29 Feb 2012 at 1:34
Going any further into this topic the solutions become very OS specific.
Users can modify the gal.py script to add any required command line switches to
meet their needs.
Original comment by brian.mo...@gmail.com
on 6 Mar 2013 at 2:03
Original issue reported on code.google.com by
purge...@gmail.com
on 24 Feb 2012 at 3:27