Sierra Toolkit Version of the Day
MemoryUsage.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_mesh_MemoryUsage_hpp
00010 #define stk_mesh_MemoryUsage_hpp
00011 
00012 //----------------------------------------------------------------------
00013 
00014 #include <stk_mesh/base/BulkData.hpp>
00015 
00016 #include <iosfwd>
00017 #include <vector>
00018 
00019 namespace stk {
00020 namespace mesh {
00021 
00022 //----------------------------------------------------------------------
00027 struct MemoryUsage {
00028   unsigned num_fields;
00029   unsigned field_bytes;
00030   unsigned num_parts;
00031   unsigned part_bytes;
00032   std::vector<std::string> entity_rank_names;
00033   std::vector<unsigned> entity_counts;
00034   unsigned bytes_per_entity;
00035   std::vector<unsigned> downward_relation_counts;
00036   std::vector<unsigned> upward_relation_counts;
00037   unsigned bytes_per_relation;
00038   std::vector<unsigned> bucket_counts;
00039   std::vector<unsigned> bucket_bytes;
00040   size_t total_bytes;
00041 };
00042 
00043 void compute_memory_usage(const BulkData& bulk, MemoryUsage& mem_usage);
00044 
00045 void print_memory_usage(const MemoryUsage& mem_usage, std::ostream& os);
00046 
00047 //----------------------------------------------------------------------
00048 
00049 
00050 } // namespace mesh
00051 } // namespace stk
00052 
00053 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends