ufo-kit/ufo-core — pull request #44 by matze (2014-10-17 12:58:47+00:00)
Title: Refactor resource usage and allow setting used GPUs

This is the follow-up PR for the discussion started in #41. The first few commits basically clean up and refactor the internal structure. Before references to the Resources object were scattered around. Now it's simply Scheduler → Arch → Resources. As a side effect of this clean up, the Config object was finally killed. I don't know why I even came up with it as it already has shown signs of a [God object](http://en.wikipedia.org/wiki/God_object). Now, the information is stored properly alongisde the Resources and PluginManager objects. Another cleanup side effect: there is no distinction between kernel and include paths, they will be used in a unified way now.

The main novelty of this change is the addition of `Ufo.BaseScheduler.set_gpu_nodes` which takes a list of nodes which will be used solely by the scheduler for execution. In Python it looks something like that:

```python
arch = Ufo.ArchGraph()
gpus = arch.get_gpu_nodes()
sched = Ufo.Scheduler()
sched.set_gpu_nodes(arch, [gpus[1]])
sched.run(graph)
```

Since the C API does not allow optional keyword arguments it is now like it is.

@tomago, @kamer16, @rshkarin, @ashkarin: There might be more problems, so please test and check thoroughly. In particular I identified the following breaks:

* `Ufo.Config` is dead :skull: and many (constructor) signatures have thus changed.
* The `Ufo.Scheduler::remotes` property has been removed. This should be configured through the `Ufo.ArchGraph` object.
* I **do not** automatically add `/usr/[local]/lib[64]` paths to the plugin manager's search path. It's initially set only to the value configured with CMake. To extend this use `Ufo.PluginManager.add_path()` or the environment variable `UFO_PLUGIN_PATH`.