static void init_dummy_sched(unsigned sched_ctx_id)
{
	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);

	struct dummy_sched_data *data = (struct dummy_sched_data*)malloc(sizeof(struct dummy_sched_data));


	/* Create a linked-list of tasks and a condition variable to protect it */
	starpu_task_list_init(&data->sched_list);

	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);

	starpu_pthread_mutex_init(&data->policy_mutex, NULL);
	FPRINTF(stderr, "Initialising Dummy scheduler\n");
}
Beispiel #2
0
static void init_dummy_sched(struct starpu_machine_topology_s *topology,
			struct starpu_sched_policy_s *policy)
{
	/* Create a linked-list of tasks and a condition variable to protect it */
	starpu_task_list_init(&sched_list);

	pthread_mutex_init(&sched_mutex, NULL);
	pthread_cond_init(&sched_cond, NULL);

	unsigned workerid;
	for (workerid = 0; workerid < topology->nworkers; workerid++)
		starpu_worker_set_sched_condition(workerid, &sched_cond, &sched_mutex);

	fprintf(stderr, "Initialising Dummy scheduler\n");
}