SST/macro
dumpi_meta.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_SOFTWARE_SKELETONS_UNDUMPI_DUMPIMETA_H_INCLUDED
13 #define SSTMAC_SOFTWARE_SKELETONS_UNDUMPI_DUMPIMETA_H_INCLUDED
14 
15 #include <fstream>
16 #include <deque>
17 #include <map>
18 
19 namespace sstmac {
20 namespace sw {
21 
22 
23 class dumpi_meta {
24 
25  public:
26  dumpi_meta(const std::string &filename);
27 
28  void parse_numprocs(const std::deque<std::string> &token);
29  void parse_fileprefix(const std::deque<std::string> &token);
30 
31  void parsemeta();
32  bool openfile();
33  int getnumprocs();
34 
35  virtual std::string
36  to_string() const {
37  return "dumpimeta";
38  }
39 
40  int num_procs() const {
41  return numprocs_;
42  }
43 
44  std::string fileprefix_;
45  std::string dirplusfileprefix_;
46 
47  virtual ~dumpi_meta() throw();
48 
49  protected:
50  std::string metafile_; //trace meta filename
51  std::ifstream infile_;
52  void init_callbacks();
53 
54  typedef void (dumpi_meta::*parsefun_t)(const
55  std::deque<std::string>&);
56  typedef std::map<std::string, parsefun_t> CallMap_t;
57  CallMap_t callback_;
58  int numprocs_;
61 
62 
63 };
64 
65 }
66 } //end sstmac namespace
67 
68 #endif // ! SSTMAC_SOFTWARE_SKELETONS_UNDUMPI_DUMPIMETA_H_INCLUDED
69 
std::string fileprefix_
Definition: dumpi_meta.h:44
std::string metafile_
Definition: dumpi_meta.h:50
virtual std::string to_string() const
Definition: dumpi_meta.h:36
void(dumpi_meta::* parsefun_t)(const std::deque< std::string > &)
Definition: dumpi_meta.h:54
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
void parse_fileprefix(const std::deque< std::string > &token)
std::string dirplusfileprefix_
Definition: dumpi_meta.h:45
std::ifstream infile_
Definition: dumpi_meta.h:51
dumpi_meta(const std::string &filename)
int num_procs() const
Definition: dumpi_meta.h:40
std::map< std::string, parsefun_t > CallMap_t
Definition: dumpi_meta.h:56
void parse_numprocs(const std::deque< std::string > &token)