An online scheduling algorithm for a two-layer multiprocessor architecture