Example #1
0
bool UserAf::v_canRunOn( RenderAf * i_render)
{
    if( false == v_canRun())
    {
        // Unable to run at all
        return false;
    }

// Check nimby:
    if( i_render->isNimby() && (m_name != i_render->getUserName())) return false;

// check hosts mask:
    if( false == checkHostsMask( i_render->getName())) return false;
// check exclude hosts mask:
    if( false == checkHostsMaskExclude( i_render->getName())) return false;

// Returning that user is able to run on specified render
    return true;
}
Example #2
0
void AfNodeSolve::calcNeedResouces( int i_resourcesquantity)
{
	m_solve_need = 0.0;

	// Need calculation no need as there is no need at all for some reason.
	if( i_resourcesquantity < 0)
	{
		return;
	}

	if( false == v_canRun())
	{
		// Cannot run at all - no solving needed
		return;
	}

	// Main solving function:
	// ( each priority point gives 10% more resources )
	m_solve_need = pow( 1.1, m_node->getPriority()) / (i_resourcesquantity + 1.0);
}
Example #3
0
bool JobAf::v_canRunOn( RenderAf * i_render)
{
	if( false == v_canRun())
	{
		// Unable to run at all
		return false;
	}
	
	// Check Render Nimby:
	if( false == isIgnoreNimbyFlag())
	{
		if( i_render->isNIMBY())
			return false;

		if( i_render->isNimby())
			if( i_render->getUserName() != m_user_name )
				return false;
	}

	// Check Render Paused:
	if( false == isIgnorePausedFlag())
	{
		if( i_render->isPaused())
			return false;
	}

	// check maximum running tasks per host:
	if(( m_max_running_tasks_per_host  > 0 ) && ( getRenderCounts(i_render) >= m_max_running_tasks_per_host ))
	{
		return false;
	}
	
	// check at least one block can run on render
	bool blockCanRunOn = false;
	for( int b = 0; b < m_blocks_num; b++)
	{
		if( m_blocks[b]->canRunOn( i_render))
		{
			blockCanRunOn = true;
			break;
		}
	}
	if( false == blockCanRunOn )
		return false;
	
	// check hosts mask:
	if( false == checkHostsMask( i_render->getName()))
	{
		return false;
	}
	
	// check exclude hosts mask:
	if( false == checkHostsMaskExclude( i_render->getName()))
	{
		return false;
	}
	
	// check needed os:
	if( false == checkNeedOS( i_render->getHost().m_os))
	{
		return false;
	}
	
	// check needed properties:
	if( false == checkNeedProperties( i_render->getHost().m_properties))
	{
		return false;
	}
	
	return true;
}