[MOAB-dev] r5808 - MOAB/trunk/test/perf

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Oct 18 14:53:44 CDT 2012


Author: tautges
Date: 2012-10-18 14:53:44 -0500 (Thu, 18 Oct 2012)
New Revision: 5808

Modified:
   MOAB/trunk/test/perf/perf.cpp
   MOAB/trunk/test/perf/runtest
   MOAB/trunk/test/perf/tstt_perf_binding.cpp
Log:
More changes to test timing of direct interfaces to tags/connectivity/etc.

Passes make check parallel, optimized, debug.



Modified: MOAB/trunk/test/perf/perf.cpp
===================================================================
--- MOAB/trunk/test/perf/perf.cpp	2012-10-18 15:54:09 UTC (rev 5807)
+++ MOAB/trunk/test/perf/perf.cpp	2012-10-18 19:53:44 UTC (rev 5808)
@@ -52,11 +52,19 @@
 void testB(const int nelem, const double *coords, int *connect);
 void testC(const int nelem, const double *coords);
 void testD(const int nelem, const double *coords);
+void testE(const int nelem, const double *coords, int *connect);
 void print_time(const bool print_em, double &tot_time, double &utime, double &stime, long &imem, long &rmem);
 void query_vert_to_elem();
 void query_elem_to_vert();
 void query_struct_elem_to_vert();
+void query_elem_to_vert_direct();
+void query_vert_to_elem_direct();
+ErrorCode normalize_elems(double *coords);
+void check_answers(const char *);
 
+#define RC(msg) if (MB_SUCCESS != result) do {std::cout << "FAIL in " << msg << std::endl;return;} while (true)
+#define RR(msg) if (MB_SUCCESS != result) do {std::cout << "FAIL in " << msg << std::endl;return result;} while (true)
+
 void compute_edge(double *start, const int nelem,  const double xint,
                   const int stride) 
 {
@@ -242,8 +250,8 @@
   }
 #endif
   print_time(false, ttime1, utime1, stime1, imem, rmem);
-  std::cout << "MOAB: TFI time = " << ttime1-ttime0 << " sec" 
-            << std::endl;
+//  std::cout << "MOAB: TFI time = " << ttime1-ttime0 << " sec" 
+//            << std::endl;
 }
 
 void build_connect(const int nelem, const EntityHandle vstart, int *&connect) 
@@ -275,11 +283,25 @@
 }
 
 Interface *gMB;
+Tag pos_tag, pos2_tag;
+
+void init() 
+{
+  gMB = new Core();
+  double def_val[3] = {0.0, 0.0, 0.0};
+  ErrorCode rval = gMB->tag_get_handle("position_tag", 3, MB_TYPE_DOUBLE, pos_tag,
+                                       MB_TAG_DENSE | MB_TAG_CREAT, def_val);
+  assert(MB_SUCCESS == rval);
+  rval = gMB->tag_get_handle("position2_tag", 3, MB_TYPE_DOUBLE, pos2_tag,
+                             MB_TAG_DENSE | MB_TAG_CREAT, def_val);
+  assert(MB_SUCCESS == rval);


More information about the moab-dev mailing list