Esempio n. 1
0
static void send_scheduler_task (enum phase_e phase, size_t wid)
{
    size_t tid = user.scheduler_f (phase, wid);

    if (tid == NONE)
    {
	return;
    }

    enum task_type_e task_type = get_task_type (phase, tid, wid);
    size_t	     sid = NONE;

    if (task_type == LOCAL || task_type == LOCAL_SPEC)
    {
	sid = wid;
    }
    else if (task_type == REMOTE || task_type == REMOTE_SPEC)
    {
	sid = find_random_chunk_owner (tid);
    }

    XBT_INFO ("%s %zu assigned to %s %s", (phase==MAP?"map":"reduce"), tid,
	    MSG_host_get_name (config.workers[wid]),
	    task_type_string (task_type));

    send_task (phase, tid, sid, wid);

    update_stats (task_type);
}
Esempio n. 2
0
static void visit(struct task *p)
{
	struct task *next;
	static int tab = 0;

	unsigned int i;
#define print_tab() for (i = 0; i < tab; i++) puts("|\t");

	print_tab();
	printf("+-- 0x%x 0x%02x 0x%02x %d\n", p->addr,
			get_task_type(p), get_task_state(p), get_task_pri(p));
	print_tab();
	printf("|   /vruntime %d /exec_runtime %d (%d sec)\n",
			(unsigned)p->se.vruntime,
			(unsigned)p->se.sum_exec_runtime,
			(unsigned)p->se.sum_exec_runtime / HZ);
	print_tab();
	printf("|   /sp 0x%08x /base 0x%08x /heap 0x%08x /size %d\n",
			p->mm.sp, p->mm.base, p->mm.heap, STACK_SIZE);
	print_tab();
	printf("|   /kernel stack 0x%08x base 0x%08x\n", p->mm.kernel.sp, p->mm.kernel.base);
	print_tab();
	printf("|\n");

	if (list_empty(&p->children))
		return;

	tab++;

	next = get_container_of(p->children.next, struct task, sibling);
	visit(next);
	p = next;

	while (p->sibling.next != &p->parent->children) {
		next = get_container_of(
				p->sibling.next, struct task, sibling);
		visit(next);
		p = next;
	}

	tab--;

	printf("control %08x, sp %08x, msp %08x, psp %08x\n",
			GET_CNTL(), GET_SP(), GET_KSP(), GET_USP());
}