[MOAB-dev] r4261 - MOAB/trunk/tools/mbzoltan

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Nov 11 10:01:03 CST 2010


Author: tautges
Date: 2010-11-11 10:01:03 -0600 (Thu, 11 Nov 2010)
New Revision: 4261

Modified:
   MOAB/trunk/tools/mbzoltan/mbpart.cpp
Log:
Adding option to mbpart to allow generation of multiple, power-of-two partitions 
(saved to multiple files); saves the time to read the mesh before each partition. To use:

mbpart 1 inmesh.h5m outmesh_base_name -z <method> -m <power>

This will generate partitions for 2^1, 2^2, ..., 2^power, saving them to outmesh_base_2.h5m,
outmesh_base_4.h5m, ..., outmesh_base_2^power.h5m.



Modified: MOAB/trunk/tools/mbzoltan/mbpart.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/mbpart.cpp	2010-11-10 22:06:14 UTC (rev 4260)
+++ MOAB/trunk/tools/mbzoltan/mbpart.cpp	2010-11-11 16:01:03 UTC (rev 4261)
@@ -2,6 +2,7 @@
 #include "moab/Core.hpp"
 
 #include <iostream>
+#include <sstream>
 #include <stdlib.h>
 #include <list>
 
@@ -11,7 +12,7 @@
 const char ZOLTAN_PARMETIS_METHOD[] = "PARMETIS";
 const char ZOLTAN_OCTPART_METHOD[] = "OCTPART";
 
-const char usage[] = " <# parts> <infile> <outfile> [-<n>] [{-z|-p|-o} <method>] [-s|-t|-b]";
+const char usage[] = " <# parts> <infile> <outfile> [-<n>] [{-z|-p|-o} <method>] [-s|-t|-b] [-m <pow>]";
 
 void usage_err( const char* argv0 ) {
   std::cerr << argv0 << usage << std::endl;
@@ -32,7 +33,8 @@
             << "-s    Write partition as tagged sets (Default)" << std::endl
             << "-t    Write partition by tagging entities" << std::endl
             << "-b    Write partition as both tagged sets and tagged entities" << std::endl
-            << "-i    Imbalance tolerance (used in PHG, Hypergraph methods)" << std::endl
+            << "-i <tol> Imbalance tolerance (used in PHG, Hypergraph methods)" << std::endl
+            << "-m <pow> Generate multiple partitions, in powers of 2, up to 2^(pow)" << std::endl
             << std::endl;
   exit(0);
 }
@@ -54,12 +56,14 @@
   const char* zoltan_method = DEFAULT_ZOLTAN_METHOD;
   const char* other_method = 0;
   const char* imbal_tol_str = 0;
+  const char* power_str = 0;
   std::list<const char**> expected; // pointers to strings that should be set to arguments
   int i, j, part_dim = -1;
   long num_parts;
   bool write_sets = true, write_tags = false;
   bool no_more_flags = false;
   double imbal_tol = 1.10;
+  int power = -1;
   
     // Loop over each input argument
   for (i = 1; i < argc; ++i) {
@@ -119,6 +123,9 @@
           // the next non-flag argument we encounter.
           expected.push_back(&imbal_tol_str);
           break;
+        case 'm':


More information about the moab-dev mailing list