56 const char* part_tag_opt =
PARTTAG;
57 bool resolve_shared =
true;
59 const char* debug_flag_str = 0;
60 bool no_more_flags =
false;
62 MPI_Init( &argc, &argv );
66 for(
int i = 1; i < argc; ++i )
68 if( !no_more_flags && argv[i][0] ==
'-' )
70 const char* opts = argv[i] + 1;
71 for(
int j = 0; opts[j]; ++j )
79 if( ++i == argc )
usage( argv[0] );
80 debug_flag_str = argv[i];
83 resolve_shared =
false;
86 if( ++i == argc )
usage( argv[0] );
87 part_tag_opt = argv[i];
118 std::cerr << argv[0] <<
": no input file specified" << std::endl;
124 std::ostringstream opts;
125 opts <<
"PARALLEL=" << read_mode_opt;
127 std::string part_opt( part_tag_opt );
128 size_t p = part_opt.find_last_of(
'=' );
129 if( p == std::string::npos )
131 opts <<
";PARTITION=" << part_opt;
136 long n = strtol( part_opt.c_str() + p + 1, &endptr, 0 );
137 if( *endptr || p == part_opt.size() - 1 )
139 std::cerr <<
"Warning: partition tag option contains an '=' followed "
140 " by a non-integer value. Assuming tag name is "
142 << part_opt <<
"\"" << std::endl;
143 opts <<
";PARTITION=" << part_opt;
147 opts <<
";PARTITION=" << part_opt.substr( 0, p );
148 opts <<
";PARTITION_VAL=" << n;
154 opts <<
";PARALLEL_RESOLVE_SHARED_ENTS";
160 long n = strtol( debug_flag_str, &endptr, 0 );
161 if( *endptr || n < 0 || !*debug_flag_str )
usage( argv[0] );
162 opts <<
";DEBUG_IO=" << n;
168 if( pcomm->
rank() == 0 )
169 std::cout <<
"Loading file: \"" <<
input_file <<
"\" with options \"" << opts.str() <<
'"' << std::endl;
170 opts <<
";PARALLEL_COMM=" << pcomm->
get_id();
172 clock_t init_time = clock();
184 ( std::numeric_limits< clock_t >::max() - init_time ) / (
double)CLOCKS_PER_SEC +
t / (double)CLOCKS_PER_SEC;
186 sec = (
t - init_time ) / (
double)CLOCKS_PER_SEC;
188 MPI_Reduce( &sec, &allsec, 1, MPI_DOUBLE, MPI_MAX, 0, pcomm->
comm() );
189 if( pcomm->
rank() == 0 )
191 std::cout <<
"Read completed in " << allsec <<
" seconds" << std::endl;