diff options
author | wolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-05-02 03:22:22 +0000 |
---|---|---|
committer | wolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-05-02 03:22:22 +0000 |
commit | 246a2d331cb73612afbbf9a57766a4e8c9b88c04 (patch) | |
tree | 9c875dfb91d398b6e958c2f0c234f5977fd287b1 | |
parent | e794d96e4b9df108dbd6426275ac7f3e81e3bcad (diff) | |
download | ATCD-246a2d331cb73612afbbf9a57766a4e8c9b88c04.tar.gz |
fixed some issues in schedulability check
3 files changed, 52 insertions, 43 deletions
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FailureAwareWCRT.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FailureAwareWCRT.cpp index 20730846d4b..606c138cfbb 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FailureAwareWCRT.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FailureAwareWCRT.cpp @@ -24,6 +24,9 @@ double FailureAwareWCRT::operator () (double previous, const PROCESSOR_SET & failures) { + if (previous == .0) + return .0; + // find all tasks that need to become active std::set<Taskname> active_tasks; @@ -39,6 +42,9 @@ FailureAwareWCRT::operator () (double previous, TRACE (necessary_failures); + if (necessary_failures.empty ()) + continue; + PROCESSOR_SET difference; std::set_intersection (failures.begin (), failures.end (), @@ -57,7 +63,7 @@ FailureAwareWCRT::operator () (double previous, // activate relevant tasks t_it->role = PRIMARY; } - } + } // end for double result = ctt_ (tasks_); @@ -72,7 +78,7 @@ FailureAwareWCRT::operator () (double previous, } } - if ((result > .0) && (previous != .0)) + if (result > .0) return std::max(result, previous); diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Forward_Ranking_Scheduler.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Forward_Ranking_Scheduler.cpp index a2d75406dc7..ab7857ccfd4 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Forward_Ranking_Scheduler.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Forward_Ranking_Scheduler.cpp @@ -210,7 +210,7 @@ Forward_Ranking_Scheduler::permute_processors ( { unsigned int tupel_size = max_failures_ - fixed.size (); - if (exchangeable.size () < tupel_size) + if (exchangeable.size () <= tupel_size) { failure_sets.push_back (exchangeable); } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/schedulability_check.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/schedulability_check.cpp index ba81c31dd68..a33dc390dba 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/schedulability_check.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/schedulability_check.cpp @@ -70,60 +70,63 @@ public: processor, FailureAwareWCRT (sched_it->second, replica_finder_))); - } - - - + } } int check_schedulability (void) { PROCESSOR_LIST all_processors = get_processors (schedule_, true); - unsigned int tupel_size = std::min (max_rank_, - (unsigned int) all_processors.size ()); - - PROCESSOR_LIST combination; - PROCESSOR_LIST::iterator it = all_processors.begin (); - for (unsigned int c_index = 0; - c_index < tupel_size; - ++c_index, ++it) + if (all_processors.size () > max_rank_) { - combination.push_back (*it); - } + PROCESSOR_LIST combination; + PROCESSOR_LIST::iterator it = all_processors.begin (); + for (unsigned int c_index = 0; + c_index < max_rank_; + ++c_index, ++it) + { + combination.push_back (*it); + } - do - { - PROCESSOR_SET set; - std::copy (combination.begin (), - combination.end (), - std::inserter (set, - set.begin ())); - - // check combination against each task; - for (WCRT_MAP::iterator wcrt_it = wcrt_map_.begin (); - wcrt_it != wcrt_map_.end (); - ++wcrt_it) + do { - // ignore failure sets that contain the own processor - if (set.find (wcrt_it->first) != set.end ()) - continue; + PROCESSOR_SET set; + std::copy (combination.begin (), + combination.end (), + std::inserter (set, + set.begin ())); + + // check combination against each task; + for (WCRT_MAP::iterator wcrt_it = wcrt_map_.begin (); + wcrt_it != wcrt_map_.end (); + ++wcrt_it) + { + // ignore failure sets that contain the own processor + if (set.find (wcrt_it->first) != set.end ()) + continue; - DBG_OUT ("checking " << wcrt_it->first << " with " << set); + TRACE ("checking " << wcrt_it->first << " with " << set); - double wcrt = (wcrt_it->second) (-1.0, set); - if (!(wcrt > .0)) - { - DBG_OUT (wcrt_it->first << " not schedulable with " << set << ": " << wcrt); - return 1; + double wcrt = (wcrt_it->second) (-1.0, set); + + if (!(wcrt > .0)) + { + DBG_OUT (wcrt_it->first << " not schedulable with " << set << ": " << wcrt); + return 1; + } } } + while (next_combination (all_processors.begin (), + all_processors.end (), + combination.begin (), + combination.end ())); } - while (next_combination (all_processors.begin (), - all_processors.end (), - combination.begin (), - combination.end ())); - + else + { + DBG_OUT ("There are not enough processors for " << max_rank_ << " failures."); + return 1; + } + return 0; } |