#ifndef COLLECTIVE_SCHEDULER
#define COLLECTIVE_SCHEDULER
#include <vector>
#include <unistd.h>
#include <sys/types.h>


class collective_scheduler {
private:
	int num_workers;
	pid_t* worker_pids;
	int** to_worker;
	int** from_worker;

	void create_workers();
	void wait_for_children();

public:
	collective_scheduler(int workers);

	~collective_scheduler();

	std::vector<int> sort_matrix_rows(const std::vector<int>& matrix, int rows, int cols);

};

#endif
