runtime/realm/threads.cc
// versions of the above that understand shared cores
versions of the above that understand shared cores
versions of the above that understand shared cores
static bool can_add_usage(const std::map<const CoreMap::Proc *,
			                   CoreReservationParameters::CoreUsage>& current,
			    CoreReservationParameters::CoreUsage reqd,
			    const CoreMap::Proc *p,
			    const std::set<CoreMap::Proc *>& shared)
  {
    std::map<const CoreMap::Proc *, CoreReservationParameters::CoreUsage>::const_iterator it;
    it = current.find(p);
    if((it != current.end()) && !can_add_usage(it->second, reqd)) return false;
    for(std::set<CoreMap::Proc *>::const_iterator it2 = shared.begin();
	it2 != shared.end();
	it2++) {
      it = current.find(*it2);
      if((it != current.end()) && !can_add_usage(it->second, reqd)) return false;
    }
    return true;
  }
static bool can_add_usage ( const std :: map < const CoreMap :: Proc * , CoreReservationParameters :: CoreUsage > & current , CoreReservationParameters :: CoreUsage reqd , const CoreMap :: Proc * p , const std :: set < CoreMap :: Proc * > & shared ) { std :: map < const CoreMap :: Proc * , CoreReservationParameters :: CoreUsage > :: const_iterator it ; it = current . find ( p ) ; if ( ( it != current . end ( ) ) && ! can_add_usage ( it -> second , reqd ) ) return false ; for ( std :: set < CoreMap :: Proc * > :: const_iterator it2 = shared . begin ( ) ; it2 != shared . end ( ) ; it2 ++ ) { it = current . find ( * it2 ) ; if ( ( it != current . end ( ) ) && ! can_add_usage ( it -> second , reqd ) ) return false ; } return true ; }
versions of the above that understand shared cores
versions of the above that understand shared cores