@@ -1371,7 +1371,8 @@ void DataProcessingDevice::Run()
13711371 // the evaluator. In this case, the request is always satisfied and
13721372 // we run on whatever resource is available.
13731373 auto & spec = ref.get <DeviceSpec const >();
1374- bool enough = ref.get <ComputingQuotaEvaluator>().selectOffer (streamRef.index , spec.resourcePolicy .request , uv_now (state.loop ));
1374+ ComputingQuotaOffer accumulated;
1375+ bool enough = ref.get <ComputingQuotaEvaluator>().selectOffer (streamRef.index , spec.resourcePolicy .request , uv_now (state.loop ), &accumulated);
13751376
13761377 struct SchedulingStats {
13771378 std::atomic<size_t > lastScheduled = 0 ;
@@ -1399,17 +1400,42 @@ void DataProcessingDevice::Run()
13991400 run_completion (&handle, 0 );
14001401 }
14011402 } else {
1403+ auto const lastSched = schedulingStats.lastScheduled .load ();
1404+ auto const schedInfo = lastSched ? fmt::format (" , last scheduled {} ms ago" , uv_now (state.loop ) - lastSched) : std::string (" , never successfully scheduled" );
1405+ auto const buildMissingInfo = [&]() {
1406+ auto const & required = spec.resourcePolicy .minRequired ;
1407+ std::string missingInfo;
1408+ if (required.sharedMemory > 0 && accumulated.sharedMemory < required.sharedMemory ) {
1409+ missingInfo += fmt::format (" shared memory (have {} MB, need {} MB)" , accumulated.sharedMemory / 1000000 , required.sharedMemory / 1000000 );
1410+ }
1411+ if (required.timeslices > 0 && accumulated.timeslices < required.timeslices ) {
1412+ missingInfo += fmt::format (" timeslices (have {}, need {})" , accumulated.timeslices , required.timeslices );
1413+ }
1414+ if (required.cpu > 0 && accumulated.cpu < required.cpu ) {
1415+ missingInfo += fmt::format (" CPU cores (have {}, need {})" , accumulated.cpu , required.cpu );
1416+ }
1417+ if (required.memory > 0 && accumulated.memory < required.memory ) {
1418+ missingInfo += fmt::format (" memory (have {} MB, need {} MB)" , accumulated.memory / 1000000 , required.memory / 1000000 );
1419+ }
1420+ return missingInfo.empty () ? std::string (" (policy: " ) + spec.resourcePolicy .name + " )" : " -" + missingInfo;
1421+ };
14021422 if (schedulingStats.numberOfUnscheduledSinceLastScheduled >= schedulingStats.nextWarnAt ) {
1423+ auto const missingStr = buildMissingInfo ();
14031424 O2_SIGNPOST_EVENT_EMIT_WARN (scheduling, sid, " Run" ,
1404- " Not enough resources to schedule computation. %zu skipped so far. Last scheduled at %zu. Data is not lost and it will be scheduled again." ,
1425+ " Not enough resources to schedule computation on stream %d. %zu consecutive skips%s. Missing:%s. Data is not lost and it will be scheduled again." ,
1426+ streamRef.index ,
14051427 schedulingStats.numberOfUnscheduledSinceLastScheduled .load (),
1406- schedulingStats.lastScheduled .load ());
1428+ schedInfo.c_str (),
1429+ missingStr.c_str ());
14071430 schedulingStats.nextWarnAt = schedulingStats.nextWarnAt * 2 ;
14081431 } else {
1432+ auto const missingStr = buildMissingInfo ();
14091433 O2_SIGNPOST_EVENT_EMIT (scheduling, sid, " Run" ,
1410- " Not enough resources to schedule computation. %zu skipped so far. Last scheduled at %zu. Data is not lost and it will be scheduled again." ,
1434+ " Not enough resources to schedule computation on stream %d. %zu consecutive skips%s. Missing:%s. Data is not lost and it will be scheduled again." ,
1435+ streamRef.index ,
14111436 schedulingStats.numberOfUnscheduledSinceLastScheduled .load (),
1412- schedulingStats.lastScheduled .load ());
1437+ schedInfo.c_str (),
1438+ missingStr.c_str ());
14131439 }
14141440 schedulingStats.numberOfUnscheduled ++;
14151441 schedulingStats.numberOfUnscheduledSinceLastScheduled ++;
0 commit comments