I'm looking for a method or perhaps a philosophical approach to how to do something like GNU Make inside python. We are currently using makefiles to do the processing, because makefiles are very good at parallel runs with one option changed: -j x. In addition, gnu make already has dependency stacks built into it, so adding a secondary processor or being able to handle more threads just means updating this single option. I want the same power and flexibility in python, but I don't see it.
As an example:
all: dependency_a dependency_b dependency_c dependency_a: dependency_d stuff dependency_b: dependency_d stuff dependency_c: dependency_e stuff dependency_d: dependency_f stuff dependency_e: stuff dependency_f: stuff
If we perform the standard single-stream operation (-j 1), the order of work may be:
dependency_f -> dependency_d -> dependency_a -> dependency_b -> dependency_e \ -> dependency_c
For two streams (-j 2) we can see:
1: dependency_f -> dependency_d -> dependency_a -> dependency_b 2: dependency_e -> dependency_c
Does anyone have any suggestions for an already created package or approach? I am completely open if this is a pythonic solution / approach.
Please in advance!
source share