[MOAB-dev] r3738 - MOAB/trunk/tools
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Thu Apr 1 17:14:45 CDT 2010
Author: kraftche
Date: 2010-04-01 17:14:45 -0500 (Thu, 01 Apr 2010)
New Revision: 3738
Modified:
MOAB/trunk/tools/convert.cpp
Log:
fix broken -P flag and add new, more powerful -p flag
Modified: MOAB/trunk/tools/convert.cpp
===================================================================
--- MOAB/trunk/tools/convert.cpp 2010-04-01 21:21:11 UTC (rev 3737)
+++ MOAB/trunk/tools/convert.cpp 2010-04-01 22:14:45 UTC (rev 3738)
@@ -25,6 +25,7 @@
#include "MBTagConventions.hpp"
#include "moab/ReaderWriterSet.hpp"
#include <iostream>
+#include <sstream>
#include <iomanip>
#include <set>
#include <cstdlib>
@@ -68,7 +69,8 @@
<< "\t-l - List available file formats and exit." << std::endl
<< "\t-I <dim> - Generate internal entities of specified dimension." << std::endl
#ifdef USE_MPI
- << "\t-P - Append processor ID to file name" << std::endl
+ << "\t-P - Append processor ID to output file name" << std::endl
+ << "\t-p - Replace '%' with processor ID in input and output file name" << std::endl
#endif
<< "\t-- - treat all subsequent options as file names" << std::endl
<< "\t (allows file names beginning with '-')" << std::endl
@@ -131,11 +133,14 @@
void remove_entities_from_sets( Interface* gMB, Range& dead_entities, Range& empty_sets );
void remove_from_vector( std::vector<EntityHandle>& vect, const Range& ents_to_remove );
bool make_opts_string( std::vector<std::string> options, std::string& result );
+std::string percent_subst( const std::string& s, int val );
int main(int argc, char* argv[])
{
+ int proc_id = 0;
#ifdef USE_MPI
MPI_Init(&argc,&argv);
+ MPI_Comm_rank( MPI_COMM_WORLD, &proc_id );
#endif
@@ -143,15 +148,15 @@
ErrorCode result;
Range range;
- int proc_id = 0;
gMB = new Core();
bool append_rank = false;
+ bool percent_rank_subst = false;
int i, dim;
bool dims[4] = {false, false, false, false};
const char* format = NULL; // output file format
- const char* in = NULL; // input file name
- const char* out = NULL; // output file name
More information about the moab-dev
mailing list