summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-05-04 15:06:02 +0000
committerwolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-05-04 15:06:02 +0000
commitcca6c3125c58255721a339a6696fb27dc3344d09 (patch)
treeb7909fcfaaef0be7c7af1433bcdf63d947739753
parent1775663bc0771d418dea059a12e20741c21cec5b (diff)
downloadATCD-cca6c3125c58255721a339a6696fb27dc3344d09.tar.gz
added binary search for bestfit
-rwxr-xr-xTAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/generate.sh4
-rwxr-xr-xTAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/processor_util.sh4
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/DeCoRAM.mpc36
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.cpp10
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h9
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.cpp63
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.h23
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.cpp10
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.h8
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.cpp15
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.h20
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_bestfit_ftrmff.cpp (renamed from TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_ftrmff.cpp)2
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_worstfit_ftrmff.cpp91
13 files changed, 226 insertions, 69 deletions
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/generate.sh b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/generate.sh
index 9a98572a32b..fd3cbf8da0d 100755
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/generate.sh
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/generate.sh
@@ -22,8 +22,8 @@ for TASK_NO in 10 20 40 80 160; do \
-l $PERIOD_LOWER \
-s $SS_UPPER \
-z $SS_LOWER > ./$DATA_DIR/$TASK_NO-tasks.input && \
- for BACKUP_NO in 1 2 3 4 5; do \
- for ALGORITHM in pftrmff aftrmff frftrmff; do \
+ for BACKUP_NO in 1 2 3 4; do \
+ for ALGORITHM in pftrmff aftrmff frftrmff bsftrmbf; do \
echo "run $ALGORITHM for $BACKUP_NO backups..." && \
$DECORAM_BIN/$ALGORITHM \
./$DATA_DIR/$TASK_NO-tasks.input \
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/processor_util.sh b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/processor_util.sh
index 9beb1193f8d..3e4f53ef456 100755
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/processor_util.sh
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/experiments/packing/processor_util.sh
@@ -7,10 +7,10 @@ RESULT_DIR=$DATA_DIR/$EXPERIMENT_NAME
if [ ! -d ./$DATA_DIR ]; then echo Directory $DATA_DIR does not exist && exit; fi
if [ ! -d ./$RESULT_DIR ]; then mkdir -p ./$RESULT_DIR; fi
-for ALGORITHM in pftrmff aftrmff frftrmff; do \
+for ALGORITHM in pftrmff aftrmff frftrmff bsftrmbf; do \
for TASK_NO in 10 20 40 80 160; do \
echo "$TASK_NO tasks:" >> ./$RESULT_DIR/$EXPERIMENT_NAME-$ALGORITHM.dat && \
- for BACKUP_NO in 1 2 3 4 5; do \
+ for BACKUP_NO in 1 2 3 4; do \
echo "count processors used by $ALGORITHM for $BACKUP_NO backups and $TASK_NO tasks ..." && \
echo "$BACKUP_NO backups: `$DECORAM_BIN/scheck -c -f ./$DATA_DIR/$ALGORITHM-$BACKUP_NO-backups-$TASK_NO-tasks.txt`" >> ./$RESULT_DIR/$EXPERIMENT_NAME-$ALGORITHM.dat; \
done; \
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/DeCoRAM.mpc b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/DeCoRAM.mpc
index b641a48b21d..fe4bd5b829c 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/DeCoRAM.mpc
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/DeCoRAM.mpc
@@ -111,7 +111,7 @@ project (worstfit_ranked_ftrmff) {
}
}
-project (binary_ranked_ftrmff) {
+project (binary_worstfit_ftrmff) : acelib {
exename = bsftrmwf
exeout = ../bin
@@ -121,17 +121,49 @@ project (binary_ranked_ftrmff) {
Source_Files {
Algorithms.cpp
Schedule.cpp
+ Scheduler.cpp
CTT_Basic.cpp
CTT_Enhanced.cpp
Task_Scheduler.cpp
+ Forward_Ranking_Scheduler.cpp
Utilization_Ranking.cpp
OptimizedWCRT.cpp
RankedWCRT.cpp
+ FailureAwareWCRT.cpp
Simple_Ranking.cpp
FTRMFF_Worstfit.cpp
+ FTRMFF_Bestfit.cpp
+ FTRMFF_Binary_Search.cpp
+ FTRMFF_Basic.cpp
+ binary_worstfit_ftrmff.cpp
+ }
+}
+
+project (binary_bestfit_ftrmff) : acelib {
+
+ exename = bsftrmbf
+ exeout = ../bin
+
+ macros += DO_DEBUG
+
+ Source_Files {
+ Algorithms.cpp
+ Schedule.cpp
+ Scheduler.cpp
+ CTT_Basic.cpp
+ CTT_Enhanced.cpp
+ Task_Scheduler.cpp
+ Forward_Ranking_Scheduler.cpp
+ Utilization_Ranking.cpp
+ OptimizedWCRT.cpp
+ RankedWCRT.cpp
+ FailureAwareWCRT.cpp
+ Simple_Ranking.cpp
+ FTRMFF_Worstfit.cpp
+ FTRMFF_Bestfit.cpp
FTRMFF_Binary_Search.cpp
FTRMFF_Basic.cpp
- binary_ftrmff.cpp
+ binary_bestfit_ftrmff.cpp
}
}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.cpp
index 590f2eaf132..1b6ea8915fd 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.cpp
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.cpp
@@ -38,7 +38,7 @@ FTRMFF_Bestfit::operator () (const FTRMFF_Input & input)
FTRMFF_Bestfit_Algorithm::FTRMFF_Bestfit_Algorithm (
const PROCESSOR_LIST & processors,
unsigned int consistency_level)
- : consistency_level_ (consistency_level),
+ : FTRMFF_Algorithm_Impl (consistency_level),
scheduler_ (processors,
consistency_level_)
{
@@ -84,8 +84,6 @@ FTRMFF_Bestfit_Algorithm::operator () (const TASK_LIST & tasks)
task_it != task_group.end ();
++task_it)
{
- std::cout << *task_it << std::endl;
-
PROCESSOR_LIST processors = this->best_processors ();
ScheduleResult schedule_result;
@@ -123,12 +121,6 @@ FTRMFF_Bestfit_Algorithm::operator () (const TASK_LIST & tasks)
return transform_schedule (scheduler_.schedule ());
}
-SCHEDULE_PROGRESS_LIST
-FTRMFF_Bestfit_Algorithm::get_unschedulable ()
-{
- return unschedulable_;
-}
-
const SCHEDULE &
FTRMFF_Bestfit_Algorithm::schedule () const
{
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h
index 15ac9a93051..de339f81278 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h
@@ -26,8 +26,7 @@ public:
typedef std::map <Processor, ScheduleResult> RESULT_MAP;
class FTRMFF_Bestfit_Algorithm :
- public std::unary_function <TASK_LIST,
- SCHEDULING_MAP>
+ public FTRMFF_Algorithm_Impl
{
public:
FTRMFF_Bestfit_Algorithm (const PROCESSOR_LIST & processors,
@@ -37,17 +36,13 @@ public:
virtual SCHEDULING_MAP operator () (const TASK_LIST & tasks);
- SCHEDULE_PROGRESS_LIST get_unschedulable ();
-
- const SCHEDULE & schedule () const;
+ virtual const SCHEDULE & schedule () const;
private:
PROCESSOR_LIST best_processors (void);
private:
- SCHEDULE_PROGRESS_LIST unschedulable_;
RESULT_MAP last_results_;
- unsigned int consistency_level_;
Forward_Ranking_Scheduler scheduler_;
};
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.cpp
index 4c3cc5942de..a31d4cb7a05 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.cpp
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.cpp
@@ -13,10 +13,17 @@
#include "FTRMFF_Binary_Search.h"
#include "FTRMFF_Basic.h"
#include "FTRMFF_Worstfit.h"
+#include "FTRMFF_Bestfit.h"
#include "CTT_Enhanced.h"
#include "CTT_Basic.h"
-FTRMFF_Binary_Search::~FTRMFF_Binary_Search ()
+FTRMFF_Binary_Search::FTRMFF_Binary_Search (
+ const std::string & scheduling_algorithm)
+ : scheduling_algorithm_ (scheduling_algorithm)
+{
+}
+
+FTRMFF_Binary_Search::~FTRMFF_Binary_Search (void)
{
}
@@ -24,7 +31,8 @@ FTRMFF_Output
FTRMFF_Binary_Search::operator () (const FTRMFF_Input & input)
{
FTRMFF_Binary_Search_Algorithm algorithm (input.processors,
- input.backup_count);
+ input.backup_count,
+ scheduling_algorithm_);
FTRMFF_Output output;
output.schedule = algorithm (input.tasks);
@@ -37,10 +45,12 @@ FTRMFF_Binary_Search::operator () (const FTRMFF_Input & input)
FTRMFF_Binary_Search_Algorithm::FTRMFF_Binary_Search_Algorithm (
const PROCESSOR_LIST & processors,
- unsigned int consistency_level)
- : processors_ (processors),
+ unsigned int consistency_level,
+ const std::string & scheduling_algorithm)
+ : FTRMFF_Algorithm_Impl (consistency_level),
+ processors_ (processors),
schedule_ (create_schedule (processors)),
- consistency_level_ (consistency_level)
+ scheduling_algorithm_ (scheduling_algorithm)
{
}
@@ -92,21 +102,21 @@ FTRMFF_Binary_Search_Algorithm::operator () (const TASK_LIST & tasks)
TRACE ("Binary Search: max = " << max << " min = " << min);
// schedule with the average value between minimum and maximum
- FTRMFF_Worstfit_Algorithm worstfit_ftrmff (
- create_processors (min + ((max - min)/2)),
- consistency_level_);
+ std::auto_ptr <FTRMFF_Algorithm_Impl> ftrmff (
+ this->create_scheduling_algorithm (
+ create_processors (min + ((max - min)/2))));
- worstfit_ftrmff (tasks);
+ (*ftrmff) (tasks);
// determine number of used processors
- processors = processor_usage (worstfit_ftrmff.schedule ());
+ processors = processor_usage (ftrmff->schedule ());
// if successful schedule
- if (worstfit_ftrmff.get_unschedulable ().empty ())
+ if (ftrmff->get_unschedulable ().empty ())
{
// store number of processors as new max
max = processors;
- schedule_ = worstfit_ftrmff.schedule ();
+ schedule_ = ftrmff->schedule ();
}
else // not schedulable
{
@@ -124,15 +134,14 @@ FTRMFF_Binary_Search_Algorithm::operator () (const TASK_LIST & tasks)
{
// in failure case try maximum number of processors and then
// give up.
- FTRMFF_Worstfit_Algorithm worstfit_ftrmff (
- create_processors (max),
- consistency_level_);
+ std::auto_ptr <FTRMFF_Algorithm_Impl> ftrmff (
+ this->create_scheduling_algorithm (create_processors (max)));
- SCHEDULING_MAP result = worstfit_ftrmff (tasks);
+ SCHEDULING_MAP result = (*ftrmff) (tasks);
- unschedulable_ = worstfit_ftrmff.get_unschedulable ();
+ unschedulable_ = ftrmff->get_unschedulable ();
- schedule_ = worstfit_ftrmff.schedule ();
+ schedule_ = ftrmff->schedule ();
return result;
}
@@ -140,14 +149,20 @@ FTRMFF_Binary_Search_Algorithm::operator () (const TASK_LIST & tasks)
return transform_schedule (schedule_);
}
-SCHEDULE_PROGRESS_LIST
-FTRMFF_Binary_Search_Algorithm::get_unschedulable ()
+const SCHEDULE &
+FTRMFF_Binary_Search_Algorithm::schedule (void) const
{
- return unschedulable_;
+ return schedule_;
}
-const SCHEDULE &
-FTRMFF_Binary_Search_Algorithm::schedule () const
+FTRMFF_Algorithm_Impl *
+FTRMFF_Binary_Search_Algorithm::create_scheduling_algorithm (
+ const PROCESSOR_LIST & processors)
{
- return schedule_;
+ if (scheduling_algorithm_ == "bestfit")
+ return new FTRMFF_Bestfit_Algorithm (processors,
+ consistency_level_);
+ else
+ return new FTRMFF_Worstfit_Algorithm (processors,
+ consistency_level_);
}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.h
index 7f53d537949..4b35f7e23a6 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.h
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Binary_Search.h
@@ -18,32 +18,39 @@
class FTRMFF_Binary_Search : public FTRMFF_Algorithm
{
public:
+ FTRMFF_Binary_Search (const std::string & scheduling_algorithm);
+
virtual ~FTRMFF_Binary_Search ();
virtual FTRMFF_Output operator () (const FTRMFF_Input & input);
+private:
+ std::string scheduling_algorithm_;
};
class FTRMFF_Binary_Search_Algorithm :
- public std::unary_function <TASK_LIST,
- SCHEDULING_MAP>
+ public FTRMFF_Algorithm_Impl
{
public:
FTRMFF_Binary_Search_Algorithm (const PROCESSOR_LIST & processors,
- unsigned int consistency_level);
+ unsigned int consistency_level,
+ const std::string & scheduling_algorithm);
- virtual ~FTRMFF_Binary_Search_Algorithm ();
+ virtual ~FTRMFF_Binary_Search_Algorithm (void);
virtual SCHEDULING_MAP operator () (const TASK_LIST & tasks);
- SCHEDULE_PROGRESS_LIST get_unschedulable ();
-
- const SCHEDULE & schedule () const;
+ virtual const SCHEDULE & schedule (void) const;
private:
+ // factory method that creates the appropriate algorithm to work
+ // with during the search
+ FTRMFF_Algorithm_Impl * create_scheduling_algorithm (
+ const PROCESSOR_LIST & processors);
+
const PROCESSOR_LIST & processors_;
SCHEDULE schedule_;
SCHEDULE_PROGRESS_LIST unschedulable_;
- unsigned int consistency_level_;
+ std::string scheduling_algorithm_;
};
#endif /* FTRMFF_BINARY_SEARCH_ALGORITHM_H_ */
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.cpp
index af6ec7e8e64..9ae919f7f83 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.cpp
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.cpp
@@ -37,8 +37,8 @@ FTRMFF_Worstfit::operator () (const FTRMFF_Input & input)
FTRMFF_Worstfit_Algorithm::FTRMFF_Worstfit_Algorithm (
const PROCESSOR_LIST & processors,
unsigned int consistency_level)
- : schedule_ (create_schedule (processors)),
- consistency_level_ (consistency_level)
+ : FTRMFF_Algorithm_Impl (consistency_level),
+ schedule_ (create_schedule (processors))
{
}
@@ -133,12 +133,6 @@ FTRMFF_Worstfit_Algorithm::operator () (const TASK_LIST & tasks)
return transform_schedule (schedule_);
}
-SCHEDULE_PROGRESS_LIST
-FTRMFF_Worstfit_Algorithm::get_unschedulable ()
-{
- return unschedulable_;
-}
-
const SCHEDULE &
FTRMFF_Worstfit_Algorithm::schedule () const
{
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.h
index 66d305f3201..79fb183d02c 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.h
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Worstfit.h
@@ -24,8 +24,7 @@ public:
};
class FTRMFF_Worstfit_Algorithm :
- public std::unary_function <TASK_LIST,
- SCHEDULING_MAP>
+ public FTRMFF_Algorithm_Impl
{
public:
FTRMFF_Worstfit_Algorithm (const PROCESSOR_LIST & processors,
@@ -35,14 +34,11 @@ public:
virtual SCHEDULING_MAP operator () (const TASK_LIST & tasks);
- SCHEDULE_PROGRESS_LIST get_unschedulable ();
-
- const SCHEDULE & schedule () const;
+ virtual const SCHEDULE & schedule () const;
private:
SCHEDULE schedule_;
SCHEDULE_PROGRESS_LIST unschedulable_;
- unsigned int consistency_level_;
};
#endif /* FTRMFF_WORSTFIT_ALGORITHM_H_ */
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.cpp
index f82ef0ad784..28042e15186 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.cpp
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.cpp
@@ -232,3 +232,18 @@ operator<< (std::ostream & ostr, const ScheduleResult & r)
return ostr;
}
+
+FTRMFF_Algorithm_Impl::~FTRMFF_Algorithm_Impl (void)
+{
+}
+
+FTRMFF_Algorithm_Impl::FTRMFF_Algorithm_Impl (unsigned int consistency_level)
+ : consistency_level_ (consistency_level)
+{
+}
+
+const SCHEDULE_PROGRESS_LIST &
+FTRMFF_Algorithm_Impl::get_unschedulable () const
+{
+ return unschedulable_;
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.h
index 9745372654d..ec0431dd36e 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.h
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/Schedule.h
@@ -47,6 +47,26 @@ struct ScheduleResult
typedef std::vector <ScheduleResult> SCHEDULE_RESULT_LIST;
+class FTRMFF_Algorithm_Impl : public std::unary_function <
+ TASK_LIST,
+ SCHEDULING_MAP>
+{
+public:
+ FTRMFF_Algorithm_Impl (unsigned int consistency_level);
+
+ virtual ~FTRMFF_Algorithm_Impl (void);
+
+ virtual SCHEDULING_MAP operator () (const TASK_LIST & tasks) = 0;
+
+ virtual const SCHEDULE & schedule (void) const = 0;
+
+ virtual const SCHEDULE_PROGRESS_LIST & get_unschedulable (void) const;
+
+protected:
+ SCHEDULE_PROGRESS_LIST unschedulable_;
+ unsigned int consistency_level_;
+};
+
/// This abtract base class represents a class of algorithms that will
/// determine the rank of scheduled replicas
/// @return the number of backups that could actually be ranked
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_ftrmff.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_bestfit_ftrmff.cpp
index eedcb55a449..b11db363f72 100644
--- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_ftrmff.cpp
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_bestfit_ftrmff.cpp
@@ -57,7 +57,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ifile.close ();
- FTRMFF_Binary_Search ftrmff;
+ FTRMFF_Binary_Search ftrmff ("bestfit");
FTRMFF_Input input;
input.tasks = tasks;
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_worstfit_ftrmff.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_worstfit_ftrmff.cpp
new file mode 100644
index 00000000000..dafee091080
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/binary_worstfit_ftrmff.cpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file binary_ftrmff.cpp
+ *
+ * $Id$
+ *
+ * @author Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
+ */
+//=============================================================================
+
+#include <fstream>
+#include <sstream>
+#include <iostream>
+#include <ace/Get_Opt.h>
+#include "FTRMFF_Binary_Search.h"
+
+std::string filename = "test.sd"; // filename of task list input
+unsigned int m = 4; // number of processors
+unsigned int c = 2; // consitency level
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ if (argc > 1)
+ filename = argv[1];
+
+ if (argc > 2)
+ m = atoi (argv[2]);
+
+ if (argc > 3)
+ c = atoi (argv[3]);
+
+ TASK_LIST tasks;
+ PROCESSOR_LIST procs;
+ for (unsigned int i = 1; i <= m; ++i)
+ {
+ std::stringstream ss;
+ ss << "P";
+ if (i < 10)
+ ss << "00";
+ else if (i < 100)
+ ss << "0";
+ ss << i;
+ procs.push_back (ss.str ());
+ }
+
+ std::ifstream ifile;
+ ifile.open (filename.c_str ());
+
+ std::transform (
+ std::istream_iterator <std::string> (ifile),
+ std::istream_iterator <std::string> (),
+ std::inserter <TASK_LIST> (tasks,
+ tasks.begin ()),
+ string_to_task ());
+
+ ifile.close ();
+
+ FTRMFF_Binary_Search ftrmff ("worstfit");
+
+ FTRMFF_Input input;
+ input.tasks = tasks;
+ input.processors = procs;
+ input.backup_count = c;
+ FTRMFF_Output result = ftrmff (input);
+
+#if 0
+ for (SCHEDULING_MAP::iterator it = result.schedule.begin ();
+ it != result.schedule.end ();
+ ++it)
+ {
+ std::cout << it->first << " -> "
+ << it->second.processor
+ << " (" << it->second.priority << ")"
+ << std::endl;
+ }
+#endif
+
+ if (result.unscheduled_tasks.size () > 0)
+ {
+ std::cout << "Could not schedule :"
+ << std::endl
+ << result.unscheduled_tasks
+ << std::endl;
+
+ return 1;
+ }
+
+ return 0;
+}