• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/resil/resil.h

00001 // Copyright 2009-2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2009-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 
00013 #ifndef _RESIL_H
00014 #define _RESIL_H
00015 
00016 #include <sst/core/event.h>
00017 #include <sst/core/component.h>
00018 #include <sst/core/link.h>
00019 
00020 #define MAX_LINKS 10
00021 
00022 using namespace SST;
00023 
00024 enum comp_type {LEAF,SCHEDULER,REL_COMP,INFREQ};
00025 enum fail_dist {GAUSS,EXP};
00026 enum link_type {DISCON,INCOME,OUTGO};
00027 
00028 
00029 
00030 class resil : public Component {
00031  public:
00032   resil              ( ComponentId_t id, Params_t& params );
00033   ~resil             ()                                    ;
00034 
00035   bool clock       ( Cycle_t cycle                      );
00036   void processEvent( Event* event                       );
00037   void processfailEvent( Event* event                   );
00038   int my_id;
00039 
00040         /*      void set_values(comp_type type, fail_dist f_dist, float fail_duration);
00041         void set_gauss_params(float gauss_mean, float gauss_std_dev);
00042                 void set_exp_params(float exp_lambda);
00043                 
00044                 void do_job(job_id);
00045                 bool runningAjob();
00046     bool checkForFailure();
00047                 double computeDowntime();
00048     bool tellScheduler(failed, t);
00049                 bool jobDone();
00050                 MyEvent GetNextEvent();
00051                 void startJob();
00052                 void informParentComponents();
00053                 void killJob();*/
00054 
00055  private:
00056   resil() : Component(-1) {} // Serialization requires a default constructor.
00057   friend class boost::serialization::access;
00058 
00059         /*              comp_type c_type;   // Component type of the resil
00060                         fail_dist dist;     // resil failure rate distribution
00061                         float fail_dur;     // resil failure duration
00062 
00063                         //For use with the Gaussian Distribution
00064                         float mean;
00065                         float std_dev;*/
00066 
00067                         //For use with Exponentials Distribution
00068                         float lambda;   
00069 
00070 /*                      bool busy;  
00071                         bool fail;
00072                         int current_job;
00073 
00074     int my_id;
00075     int latency;
00076     bool done;*/
00077 
00078   Link* linkToSelf;
00079   Link* link0;
00080         Link* link1;
00081   Link* link2;
00082         Link* link3;
00083   Link* link4;
00084         Link* sched_link;
00085         Link* link_array[MAX_LINKS];
00086         Link* uplink;
00087         
00088         int counter;
00089         link_type link_state[MAX_LINKS];    //DISCON,INCOME,OUTGO
00090         int count_to;
00091         bool fail_assigned;
00092         bool failknow;  //If true I already know someone above me failed.
00093 
00094   Params_t    params   ;
00095   std::string frequency;
00096         std::string links[MAX_LINKS];
00097         std::string id_str;
00098 };
00099 
00100 float genexp(float lambda);
00101 
00102 float urand();
00103 
00104 #endif

Generated on Fri Oct 22 2010 11:02:28 for SST by  doxygen 1.7.1