#ifndef COLL_SCHD_HPP
#define COLL_SCHD_HPP

#include <unistd.h>
#include <iostream>

template <typename Fn>

class ColectiveScheduler
{
private:
	int total;
	int levels;

	void reap_all(){
		int status;
		while(true){
			pid_t finished = waitpid(-1, &status, 0);
			if (finished > 0){
				cout<<"Reaped PID " << finished << "\n";
				continue;
			}
			if (finished==-1 && errno == ECHILD)
				// waitpid fails bcs no child left behind
				break;
		}
	}
public:
	CollectiveScheduler(int total_tasks, int num_levels)
		: total(total_tasks), levels(num_levels) {}

	void run

}
