SST/macro
compute_scheduler.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SSTMAC_HARDWARE_PROCESSOR_COMPUTEscheduleR_H_INCLUDED
13 #define SSTMAC_HARDWARE_PROCESSOR_COMPUTEscheduleR_H_INCLUDED
14 
21 #include <sprockit/debug.h>
22 
24 
25 namespace sstmac {
26 namespace sw {
27 
28 class compute_scheduler :
30 {
31  public:
32  compute_scheduler(sw::operating_system* os) :
33  os_(os)
34  {
35  }
36 
37  virtual std::string
38  to_string() const {
39  return "compute_scheduler";
40  }
41 
42  virtual ~compute_scheduler() {}
43 
44  void
45  init_factory_params(sprockit::sim_parameters* params);
46 
47  int
48  ncores() const {
49  return ncores_;
50  }
51 
52  int
53  nsocket() const {
54  return nsocket_;
55  }
56 
57  virtual void
58  finalize_init();
59 
60  virtual void
61  reserve_core(thread* thr) = 0;
62 
63  virtual void
64  release_core(thread* thr) = 0;
65 
66  virtual void
67  configure(int ncore, int nsocket);
68 
69  protected:
71 
72  protected:
73  int ncores_;
74  int nsocket_;
75  int cores_per_socket_;
76  sw::operating_system* os_;
77 
78 };
79 
80 DeclareFactory1InitParam(compute_scheduler, sw::operating_system*);
81 
82 }
83 } //end of namespace sstmac
84 #endif
DeclareDebugSlot(compute_scheduler) namespace sstmac
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
#define DeclareFactory1InitParam(type_name, param1_name)
Definition: factory.h:315