Heterogeneous Resource Allocation for Hierarchical Software