def add_task(self, task):
        ''' Allows for a task or supervisor to be added to this supervisor.
            A supervisor is added to this supervisor by adding all tasks
            that the supervisor managed.
        '''
        if(isinstance(task, Supervisor)):
            for t in task.tasks:
                t.dependencies.extend(task.dependencies)
                self.add_task(t)
        if(isinstance(task, Task)):
            if(task.cpu > self.cpu):
                err_mess = ('Task {0!s} has a higher cpu than this supervisor, {1!s}.\nYou '
                            'must increase this supervisor\'s cpu or decrease {0!s}\'s cpu.')
                err_mess = err_mess.format(task.name, self.name)
                raise Exception(err_mess)
            if(task.name in self.task_map):
                warnings.warn('A task named '+task.name+' already exists.')
            self.task_map[task.name] = task
            self.tasks.add(task)
            self.task_status[task] = {'state': Supervisor.STATE_INITIALIZED, 'exit_code': None,
                                      'message': None, 'start': None, 'stop': None}
            self.targets.extend(task.targets)