[MOAB-dev] r1365 - in MOAB/trunk: . test/perf

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Nov 8 10:54:29 CST 2007


Author: kraftche
Date: 2007-11-08 10:54:29 -0600 (Thu, 08 Nov 2007)
New Revision: 1365

Modified:
   MOAB/trunk/EntitySequence.hpp
   MOAB/trunk/test/perf/seqperf.cpp
Log:
o small change to EntitySequence header so perfermance code can
  distinguish between current repository and new sequence code
o print number of sequences during performance testing
o reduce default number of test cases


Modified: MOAB/trunk/EntitySequence.hpp
===================================================================
--- MOAB/trunk/EntitySequence.hpp	2007-11-07 23:43:48 UTC (rev 1364)
+++ MOAB/trunk/EntitySequence.hpp	2007-11-08 16:54:29 UTC (rev 1365)
@@ -27,8 +27,8 @@
  *          
  */ 
 
-#ifndef ENTITY_SEQUENCE_HPP
-#define ENTITY_SEQUENCE_HPP
+#ifndef MB_ENTITY_SEQUENCE_HPP
+#define MB_ENTITY_SEQUENCE_HPP
 
 #ifndef IS_BUILDING_MB
 #error "EntitySequence.hpp isn't supposed to be included into an application"

Modified: MOAB/trunk/test/perf/seqperf.cpp
===================================================================
--- MOAB/trunk/test/perf/seqperf.cpp	2007-11-07 23:43:48 UTC (rev 1364)
+++ MOAB/trunk/test/perf/seqperf.cpp	2007-11-08 16:54:29 UTC (rev 1365)
@@ -5,13 +5,26 @@
 #include "MBCore.hpp"
 #include "MBReadUtilIface.hpp"
 
+#define PRINT_SEQUENCE_COUNT
+
+#ifdef PRINT_SEQUENCE_COUNT
+#  define IS_BUILDING_MB
+#  include "EntitySequence.hpp"
+#  ifdef MB_ENTITY_SEQUENCE_HPP
+#    include "EntitySequenceManager.hpp"
+#  else
+#    include "SequenceManager.hpp"
+#  endif
+#endif
+
   // constants
 const bool dump_mesh = false;        //!< write mesh to vtk file
 const int default_intervals = 25;    //!< defaul interval count for cubic structured hex mesh
 const int default_query_count = 100; //!< number of times to do each query set
 const int default_order[] = {0, 1, 2};
 const int default_create[] = {0,1};
-const int default_delete[] = {0,10,20,30,40,50,60,70,80,90};
+const int default_delete[] = {0,10,30,50,70,90};
+#define ARRSIZE(A) (sizeof(A)/sizeof(A[0]))
 
   // input parameters
 long numSideInt, numVert, numElem;   //!< total counts;
@@ -88,6 +101,10 @@
 void create_missing_vertices( int percent ); //!< re-create deleted vertices
 void create_missing_elements( int percent ); //!< re-create deleted elements
 
+#ifdef PRINT_SEQUENCE_COUNT
+unsigned get_number_sequences( MBEntityType type );
+#endif
+
 /* Build arrays of function pointers, indexed by the order the entities are traversed in */
 
 typedef void (*naf_t)();
@@ -133,7 +150,10 @@
   std::cerr << "Usage: seqperf [-i <intervals>] [-o <order>] [-d <percent>] [-b|-s] [-q <count>]" << std::endl;
   std::cerr << " -i specify size of cubic structured hex mesh in intervals.  Default: " << default_intervals << std::endl;
   std::cerr << " -o one of \"forward\", \"reverse\", or \"random\".  May be specified multiple times.  Default is all." << std::endl;
-  std::cerr << " -d percent of entities to delete.  May be specified multiple times.  Default is {0,10,20,...,90}." << std::endl;
+  std::cerr << " -d percent of entities to delete.  May be specified multiple times.  Default is {";
+  for (unsigned i = 0; i < ARRSIZE(default_delete)-1; ++i)
+    std::cerr << default_delete[i] << ",";
+  std::cerr << default_delete[ARRSIZE(default_delete)-1] << "}" << std::endl;
   std::cerr << " -b block creation of mesh" << std::endl;
   std::cerr << " -s single entity mesh creation" << std::endl;
   std::cerr << " -q number of times to repeat queries.  Default: " << default_query_count << std::endl;
@@ -212,6 +232,10 @@
   mb.get_number_entities_by_type( 0, MBVERTEX, num_vert );
   mb.get_number_entities_by_type( 0, MBHEX,    num_elem );
   std::cout << "  " << num_vert << " vertices and " << num_elem << " elements remaining" << std::endl;
+#ifdef PRINT_SEQUENCE_COUNT
+  std::cout << "  " << get_number_sequences(MBVERTEX) << " vertex sequences and "
+            << get_number_sequences(MBHEX) << " element sequences." << std::endl;
+#endif
 
   TIME_QRY( "  Quering vertex coordinates", query_verts[order] );
   TIME_QRY( "  Quering element connectivity", query_elems[order] );
@@ -277,7 +301,6 @@
     
   
 
-#define ARRSIZE(A) (sizeof(A)/sizeof(A[0]))
 int main( int argc, char* argv[] )
 {
     // Parse arguments
@@ -304,7 +327,7 @@
           case 'o':
             parse_order( argv[i], orderList );
             break;
-          case 'p':
+          case 'd':
             parse_percent( argv[i], deleteList );
             break;
           case 'q':
@@ -725,3 +748,13 @@
   }
 }
 
+#ifdef PRINT_SEQUENCE_COUNT
+unsigned get_number_sequences( MBEntityType type )
+{
+#ifdef MB_ENTITY_SEQUENCE_HPP
+  return moab.sequence_manager()->entity_map(type)->size();
+#else
+  return moab.sequence_manager()->entity_map(type).get_sequence_count();
+#endif
+}
+#endif




More information about the moab-dev mailing list