Ejemplo n.º 1
0
void Task::v_updateState( const af::MCTaskUp & taskup, RenderContainer * renders, MonitorContainer * monitoring, bool & errorHost)
{
   if( m_run == NULL)
   {
      std::ostringstream stream;
      stream << "Task::updatestate: Task is not running: " << m_block->m_job->getName();
      stream << "[" << taskup.getNumBlock() << "][" << taskup.getNumTask() << "]";
      AFCommon::QueueLogError( stream.str());
      if(( taskup.getStatus() == af::TaskExec::UPPercent  ) ||
         ( taskup.getStatus() == af::TaskExec::UPWarning ))
            RenderAf::closeLostTask( taskup);
      return;
   }
//printf("Task::updateState:\n");
   m_run->update( taskup, renders, monitoring, errorHost);
   if( taskup.getDataLen() != 0 ) v_writeTaskOutput( taskup);
   deleteRunningZombie();
}
Ejemplo n.º 2
0
bool ListJobs::v_filesReceived( const af::MCTaskUp & i_taskup )
{
	if(( i_taskup.getNumBlock() != -1 ) || ( i_taskup.getNumTask() != -1 ))
		return false; // This is for a task (not for an entire job)

	for( int i = 0; i < count(); i++)
	{
		ItemJob * itemjob = (ItemJob*)(m_model->item(i));
		if( itemjob->getId() == i_taskup.getNumJob() )
		{
			itemjob->v_filesReceived( i_taskup);
			
			return true;
		}
	}

	return false;
}
Ejemplo n.º 3
0
void JobContainer::updateTaskState( af::MCTaskUp &taskup, RenderContainer * renders, MonitorContainer * monitoring)
{
    switch( taskup.getStatus())
    {
    case af::TaskExec::UPNULL:
    case af::TaskExec::UPNoTaskRunning:
    case af::TaskExec::UPNoJob:
    case af::TaskExec::UPLAST:
        AFERRAR("JobContainer::updateTaskState: Bad task update status (jobID=%d).\n", taskup.getNumJob());
    return;
    }

    JobContainerIt jobsIt( this);
    JobAf* job = jobsIt.getJob( taskup.getNumJob());
    if( job != NULL )
    {
        job->v_updateTaskState( taskup, renders, monitoring);
        return;
    }

    // Job does not exist!
    AFERRAR("JobContainer::updateTaskState: Job with id=%d does not exists.", taskup.getNumJob())
            if( taskup.getStatus() == af::TaskExec::UPPercent) RenderAf::closeLostTask( taskup);
}
Ejemplo n.º 4
0
void JobAf::v_updateTaskState( const af::MCTaskUp& taskup, RenderContainer * renders, MonitorContainer * monitoring)
{
	if( false == checkBlockTaskNumbers( taskup.getNumBlock(), taskup.getNumTask(), "updateTaskState")) return;
	bool errorHost = false;
	m_blocks[taskup.getNumBlock()]->m_tasks[taskup.getNumTask()]->v_updateState( taskup, renders, monitoring, errorHost);
	if( errorHost) m_blocks[taskup.getNumBlock()]->v_errorHostsAppend( taskup.getNumTask(), taskup.getClientId(), renders);

	std::string new_report = taskup.getReport();
	if( new_report.size() && ( new_report != m_report ))
	{
		m_report = new_report;
		m_report_changed = true;
	}
}
Ejemplo n.º 5
0
void Task::v_writeTaskOutput( const af::MCTaskUp& taskup) const
{
   AFCommon::QueueFileWrite( new FileData( taskup.getData(), taskup.getDataLen(), getOutputFileName( m_progress->starts_count)));
}