Sierra Toolkit  Version of the Day
MemoryUsage.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef stk_mesh_MemoryUsage_hpp
10 #define stk_mesh_MemoryUsage_hpp
11 
12 //----------------------------------------------------------------------
13 
14 #include <stk_mesh/base/BulkData.hpp>
15 
16 #include <iosfwd>
17 #include <vector>
18 
19 namespace stk_classic {
20 namespace mesh {
21 
22 //----------------------------------------------------------------------
27 struct MemoryUsage {
28  unsigned num_fields;
29  unsigned field_bytes;
30  unsigned num_parts;
31  unsigned part_bytes;
32  std::vector<std::string> entity_rank_names;
33  std::vector<unsigned> entity_counts;
34  unsigned bytes_per_entity;
35  std::vector<unsigned> downward_relation_counts;
36  std::vector<unsigned> upward_relation_counts;
37  unsigned bytes_per_relation;
38  std::vector<unsigned> bucket_counts;
39  std::vector<unsigned> bucket_bytes;
40  size_t total_bytes;
41 };
42 
43 void compute_memory_usage(const BulkData& bulk, MemoryUsage& mem_usage);
44 
45 void print_memory_usage(const MemoryUsage& mem_usage, std::ostream& os);
46 
47 //----------------------------------------------------------------------
48 
49 
50 } // namespace mesh
51 } // namespace stk_classic
52 
53 #endif
Sierra Toolkit.