huawei-cloudnative / firmament

The Firmament cluster scheduling platform
http://www.firmament.io
Apache License 2.0
19 stars 9 forks source link

Loop in cpu_cost model::GetEquivClassToEquivClassesArcs need to simplified , make method and return true or false and use it in for loop condition #33

Open Suresh-Babu-K opened 5 years ago

Suresh-Babu-K commented 5 years ago

Loop in cpu_cost model::GetEquivClassToEquivClassesArcs need to simplified , make method and return true or false and use it in for loop conditional check and increment. for (cur_resource = *task_resource_request; cur_resource.cpucores < available_resources.cpucores && cur_resource.ramcap < available_resources.ramcap && cur_resource.ephemeralstorage < available_resources.ephemeralstorage && index < ecs_for_machine->size() && task_count < rd.max_pods(); cur_resource.cpucores += task_resource_request->cpucores, cur_resource.ramcap += task_resource_request->ramcap, cur_resource.ephemeralstorage += task_resource_request->ephemeralstorage, index++, task_count++) { cout<<"*** pushing at index"<<index<<endl;
pref_ecs->push_back(ec_machines.second[index]); }