Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ExactTaskAdvocate.hh

Go to the documentation of this file.
00001 /*
00002  * ExactTaskAdvocate.hh
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file ExactTaskAdvocate.hh
00014  *
00015  * Header file for a task advocate class that suggests the task get exactly the
00016  * amount of compute time as needed by the last period.
00017  */
00018 
00019 #ifndef _exact_task_advocate_hh
00020 #define _exact_task_advocate_hh
00021 
00022 #include <iostream>
00023 
00024 #include "RKTask.hh"
00025 
00026 /**
00027  * A Broker::RealTimeAdvocate that suggests the task gets the exact amount of
00028  * compute time as needed by the last period.
00029  */
00030 class ExactTaskAdvocate : public virtual RKTask,
00031                           public virtual POA_Broker::RealTimeAdvocate
00032 {
00033 
00034 public:
00035 
00036     /** @copydoc Broker::TaskFactory::CreateTask */
00037     ExactTaskAdvocate(const Broker::TaskParameters &tp)
00038         throw (CORBA::SystemException,
00039                Broker::DuplicateTaskParameter,
00040                Broker::InvalidTaskParameter,
00041                Broker::MissingTaskParameter);
00042 
00043     virtual ~ExactTaskAdvocate();
00044 
00045     /**
00046      * Compute a new processing time advice from the given status value.  The
00047      * default implementation will compute the exact amount of processing time
00048      * required to make the deadline.
00049      *
00050      * @param status The value passed into ReportCPU.
00051      * @return The exact processing time required for the process to make its
00052      *         deadline.
00053      * @exception InvalidStatus if the status value is invalid.
00054      * @exception CORBA::BAD_INV_ORDER if the method is called without
00055      *            BeginCPUScheduling() being called first.
00056      */
00057     virtual CORBA::ULong ComputeAdvice(CORBA::ULong status)
00058         throw (CORBA::SystemException, Broker::InvalidStatus);
00059 
00060     /** @copydoc Broker::RealTimeAdvocate::ReportCPU */
00061     virtual void ReportCPU(CORBA::ULong status)
00062         throw (CORBA::SystemException, Broker::InvalidStatus);
00063 
00064 protected:
00065 
00066     struct timeval eta_LastCPULog;
00067 
00068     ofstream *eta_CPULog;
00069 
00070     struct timeval eta_LastAdviceLog;
00071 
00072     ofstream *eta_AdviceLog;
00073 
00074     ofstream *eta_CompleteLog;
00075 
00076 };
00077 
00078 #endif

Generated on Mon Dec 1 16:21:56 2003 for CPUBroker by doxygen 1.3.4