set proc->p_comm to the correct value