// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { getMPKI(); if (winner == null) { winner = candidate; } else if (mpki[winner.mreq.request.requesterID] < mpki[candidate.mreq.request.requesterID]) { winner = candidate; } else if (mpki[winner.mreq.request.requesterID] == mpki[candidate.mreq.request.requesterID]) { if (!winner.Urgent && candidate.Urgent) { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } } return(winner); }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else if (!winner.Urgent && candidate.Urgent) { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (ch.triggerCPUPrio && winner.mreq.from_GPU && !candidate.mreq.from_GPU) //Priritize CPU if GPU is not bursty { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } return(winner); }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else if (!winner.Urgent && candidate.Urgent) { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (!winner.marked && candidate.marked) { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (winner.rank > candidate.rank) { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } return(winner); }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else if (!winner.Urgent && candidate.Urgent) // urgent wins over non-urgent { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (winner.FromGPU && !candidate.FromGPU) // cores win over GPU { winner = candidate; } else if (winner.IsWrite && !candidate.IsWrite) // reads win over writes { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } return(winner); }
override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else { int winner_id = winner.mreq.request.requesterID; int candidate_id = candidate.mreq.request.requesterID; int winner_priority = getPriority(winner_id); int candidate_priority = getPriority(candidate_id); if( winner_priority < candidate_priority ) { winner = candidate; } else if( winner_priority == candidate_priority ) { if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() && Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) { int winner_rank = Simulator.QoSCtrl.getHwaRank(winner.mreq.request.requesterID); int candidate_rank = Simulator.QoSCtrl.getHwaRank(candidate.mreq.request.requesterID); if( winner_rank > candidate_rank ) return winner; else if( winner_rank < candidate_rank ) return candidate; } if(( winner.index == top_index_in_buf[winner_id] ) && ( candidate.index != top_index_in_buf[candidate_id] )) return winner; else if(( winner.index != top_index_in_buf[winner_id] ) && ( candidate.index == top_index_in_buf[candidate_id] )) return candidate; if( winner_id != candidate_id ) { if( bw_required[winner_id] <= bw_required[candidate_id] ) return winner; return candidate; } if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(winner.Urgent && !candidate.Urgent) winner = winner; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(winner.IsRowBufferHit && !candidate.IsRowBufferHit ) winner = winner; else if(candidate.IsOlderThan(winner)) winner = candidate; } } return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else { if (Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() && Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()) { if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID) { if (candidate.IsOlderThan(winner)) { winner = candidate; } } else if (getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID)) { winner = candidate; } // else if( remainingTime(winner) > remainingTime(candidate) ) // winner = candidate; } else if (Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) { } else if (Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()) { winner = candidate; } else { if (!winner.Urgent && candidate.Urgent) { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } } } return(winner); }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else { int winner_priority = getPriority(winner.mreq.request.requesterID); int candidate_priority = getPriority(candidate.mreq.request.requesterID); if (winner_priority < candidate_priority) { winner = candidate; } else if (winner_priority == candidate_priority) { if (Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) && Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID)) { // if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() && // Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){ if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID) { if (candidate.IsOlderThan(winner)) { winner = candidate; } } } if (!winner.Urgent && candidate.Urgent) { winner = candidate; } else if (winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } } } return(winner); }
override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; bool marked1 = req1.is_marked; bool marked2 = req2.is_marked; if (marked1 ^ marked2) { if (marked1) return winner; else return candidate; } int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) return winner; else return candidate; } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) return winner; else return candidate; } if (candidate.IsOlderThan(winner)) return candidate; else return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(ch.triggerCPUPrio && winner.mreq.from_GPU && !candidate.mreq.from_GPU) //Priritize CPU if GPU is not bursty winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else if(!candidate.IsOlderThan(winner)) winner = candidate; return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else if(!winner.Urgent && candidate.Urgent) // urgent wins over non-urgent winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(winner.FromGPU && !candidate.FromGPU) // cores win over GPU winner = candidate; else if(winner.IsWrite && !candidate.IsWrite) // reads win over writes winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(winner.FromGPU && !candidate.FromGPU) // cores win over GPU winner = candidate; else if(!winner.marked && candidate.marked) winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(winner.rank > candidate.rank) winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { getMPKI(); if(winner == null) winner = candidate; else if(mpki[winner.mreq.request.requesterID] > mpki[candidate.mreq.request.requesterID]) winner = candidate; else if(mpki[winner.mreq.request.requesterID] == mpki[candidate.mreq.request.requesterID]) { if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; } return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } return(winner); }
// Override this for other algorithms virtual protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } else if (!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit { winner = candidate; } else if (candidate.IsOlderThan(winner)) { winner = candidate; } return(winner); }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; } MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) { return(winner); } else { return(candidate); } } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) { return(winner); } else { return(candidate); } } if (candidate.IsOlderThan(winner)) { return(candidate); } else { return(winner); } }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; double rank1 = blp[req1.request.requesterID]; double rank2 = blp[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) return winner; else return candidate; } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) return winner; else return candidate; } if (candidate.IsOlderThan(winner)) return candidate; else return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) { winner = candidate; return winner; } if( (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) && (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) )) // if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) && // (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())) { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) return winner; else return candidate; } } else if( !Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) // else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) { return candidate; } else if( !Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ) // else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) { return winner; } else { if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID ) { if(candidate.IsOlderThan(winner)) { return candidate; } else { return winner; } } else if( getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID)) return candidate; else return winner; } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) return winner; else return candidate; } if (candidate.IsOlderThan(winner)) return candidate; else return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) { winner = candidate; return winner; } double winner_priority = getPriority( winner ); double candidate_priority = getPriority( candidate ); if( winner_priority < candidate_priority ) { winner = candidate; return winner; } else if( winner_priority > candidate_priority ) { return winner; } if( (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) && (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) )) // if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) && // (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())) { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) return winner; else return candidate; } } else if( !Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) ) // else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) // winner is CPU, candidate is HWA { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; if( !Simulator.QoSCtrl.schedule_cluster_check(1, req2.request.requesterID, chan.mem_id, chan.id ) ) return winner; // else if( icluster_size == 0 ) else if( quantum_cnt == 0 ) return winner; if( rank1 >= icluster_size + Config.HWANum ) // CPU is low memory intensity { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 ); return winner; } else if( rnd_value < 100 * Config.sched.ratio_allocated_sdl_cluster ) // CPU is high memory intensity, HWA is selected { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-3,Id:{0} win against {1}, rnd_value:{2}, ratio:{3}", req2.request.requesterID, req1.request.requesterID, rnd_value, Config.sched.ratio_allocated_sdl_cluster ); return candidate; } else { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 ); return winner; } } else if( !Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ) // else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) // winner is HWA, candidate is CPU { MemoryRequest req1 = candidate.mreq; MemoryRequest req2 = winner.mreq; int rank1 = rank[req1.request.requesterID]; if( !Simulator.QoSCtrl.schedule_cluster_check(1, req2.request.requesterID, chan.mem_id, chan.id ) ) return candidate; else if( quantum_cnt == 0 ) return candidate; else if( rank1 >= icluster_size + Config.HWANum ) // CPU is low memory intensity { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 ); return candidate; } else if( rnd_value < 100 * Config.sched.ratio_allocated_sdl_cluster ) // CPU is high memory intensity, HWA is selected { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-3,Id:{0} win against {1}, rnd_value:{2}, ratio:{3}", req2.request.requesterID, req1.request.requesterID, rnd_value, Config.sched.ratio_allocated_sdl_cluster ); return winner; } else { // if(( Simulator.CurrentRound > 5041500 ) && ( Simulator.CurrentRound < 5294000 )) // Console.WriteLine("1-2,Id:{0} win against {1}, icluster_size:{2}, rank:{3}", req1.request.requesterID, req2.request.requesterID, icluster_size, rank1 ); return candidate; } } else // both are HWA { if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID ) { if(candidate.IsOlderThan(winner)) return candidate; else return winner; } if( remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID) ) { return candidate; } else { return winner; } } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) return winner; else return candidate; } if (candidate.IsOlderThan(winner)) return candidate; else return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; return(winner); } if ((!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID)) && (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID))) // if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) && // (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())) { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) { return(winner); } else { return(candidate); } } } else if (!Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID)) // else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) { return(candidate); } else if (!Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID)) // else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) { return(winner); } else { if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID) { if (candidate.IsOlderThan(winner)) { return(candidate); } else { return(winner); } } else if (getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID)) { return(candidate); } else { return(winner); } } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) { return(winner); } else { return(candidate); } } if (candidate.IsOlderThan(winner)) { return(candidate); } else { return(winner); } }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) { winner = candidate; return winner; } double winner_priority = getPriority( winner ); double candidate_priority = getPriority( candidate ); if( winner_priority < candidate_priority ) { winner = candidate; return winner; } else if( winner_priority > candidate_priority ) { return winner; } if( (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) && (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())) { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) return winner; else return candidate; } } else if( !Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) // winner is CPU, candidate is HWA { MemoryRequest req1 = winner.mreq; int rank1 = rank[req1.request.requesterID]; if( rank1 >= icluster_size + Config.HWANum ) { return winner; } else { return candidate; } } else if( !Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) // winner is HWA, candidate is CPU { MemoryRequest req1 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; if( rank1 >= icluster_size + Config.HWANum ) { return candidate; } else { return winner; } } else // both are HWA { if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID ) { if(candidate.IsOlderThan(winner)) return candidate; else return winner; } if( remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID) ) { return candidate; } else { return winner; } } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) return winner; else return candidate; } if (candidate.IsOlderThan(winner)) return candidate; else return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else { if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() && Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){ if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID ) { if(candidate.IsOlderThan(winner)) { winner = candidate; } } else if( getPriority(winner.mreq.request.requesterID) < getPriority(candidate.mreq.request.requesterID)) winner = candidate; // else if( remainingTime(winner) > remainingTime(candidate) ) // winner = candidate; } else if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() ) { } else if( Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ) { winner = candidate; } else { if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; } } return winner; }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if (winner == null) { winner = candidate; return(winner); } double winner_priority = getPriority(winner); double candidate_priority = getPriority(candidate); if (winner_priority < candidate_priority) { winner = candidate; return(winner); } else if (winner_priority > candidate_priority) { return(winner); } if ((!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) && (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA())) { MemoryRequest req1 = winner.mreq; MemoryRequest req2 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; int rank2 = rank[req2.request.requesterID]; if (rank1 != rank2) { if (rank1 > rank2) { return(winner); } else { return(candidate); } } } else if (!Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA()) // winner is CPU, candidate is HWA { MemoryRequest req1 = winner.mreq; int rank1 = rank[req1.request.requesterID]; if (rank1 >= icluster_size + Config.HWANum) { return(winner); } else { return(candidate); } } else if (!Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA()) // winner is HWA, candidate is CPU { MemoryRequest req1 = candidate.mreq; int rank1 = rank[req1.request.requesterID]; if (rank1 >= icluster_size + Config.HWANum) { return(candidate); } else { return(winner); } } else // both are HWA { if (winner.mreq.request.requesterID == candidate.mreq.request.requesterID) { if (candidate.IsOlderThan(winner)) { return(candidate); } else { return(winner); } } if (remainingTime(winner.mreq.request.requesterID) > remainingTime(candidate.mreq.request.requesterID)) { return(candidate); } else { return(winner); } } bool hit1 = winner.IsRowBufferHit; bool hit2 = candidate.IsRowBufferHit; if (hit1 ^ hit2) { if (hit1) { return(winner); } else { return(candidate); } } if (candidate.IsOlderThan(winner)) { return(candidate); } else { return(winner); } }
// Override this for other algorithms override protected SchedBuf Pick(SchedBuf winner, SchedBuf candidate) { if(winner == null) winner = candidate; else { int winner_priority = getPriority( winner.mreq.request.requesterID ); int candidate_priority = getPriority( candidate.mreq.request.requesterID ); if( winner_priority < candidate_priority ) { winner = candidate; } else if( winner_priority == candidate_priority ) { if( Simulator.QoSCtrl.is_HWA(winner.mreq.request.requesterID) && Simulator.QoSCtrl.is_HWA(candidate.mreq.request.requesterID) ){ // if( Simulator.network.nodes[winner.mreq.request.requesterID].cpu.is_HWA() && // Simulator.network.nodes[candidate.mreq.request.requesterID].cpu.is_HWA() ){ if( winner.mreq.request.requesterID == candidate.mreq.request.requesterID ) { if(candidate.IsOlderThan(winner)) { winner = candidate; } } } if(!winner.Urgent && candidate.Urgent) winner = candidate; else if(winner.Urgent && candidate.Urgent && candidate.IsOlderThan(winner)) winner = candidate; else if(!winner.IsRowBufferHit && candidate.IsRowBufferHit) // prev not RB hit winner = candidate; else if(candidate.IsOlderThan(winner)) winner = candidate; } } return winner; }