[MOAB-dev] r4252 - in MOAB/trunk: doc src src/io src/parallel src/parallel/moab test/parallel tools/mbzoltan
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Fri Nov 5 10:47:19 CDT 2010
Author: tautges
Date: 2010-11-05 10:47:18 -0500 (Fri, 05 Nov 2010)
New Revision: 4252
Modified:
MOAB/trunk/doc/metadata_info.doc
MOAB/trunk/src/FileOptions.cpp
MOAB/trunk/src/FileOptions.hpp
MOAB/trunk/src/io/ReadNC.cpp
MOAB/trunk/src/parallel/ParallelComm.cpp
MOAB/trunk/src/parallel/ReadParallel.cpp
MOAB/trunk/src/parallel/moab/ParallelComm.hpp
MOAB/trunk/test/parallel/mbparallelcomm_test.cpp
MOAB/trunk/test/parallel/pcomm_unit.cpp
MOAB/trunk/tools/mbzoltan/mbpart.cpp
Log:
Primary change is in ParallelComm, to remove some n^2 behavior due to
indexing into not-very-compact ranges.
mbparallelcomm_test.cpp: fixing a time measurement bug, and using new
interface for some of the ParallelComm functions.
pcomm_unit.cpp: new ParallelComm interface
FileOptions.?pp: implemented get_reals_option, like get_ints_option
without the range.
ParallelComm.?pp: changed a few things from ranges over to either
vectors or tuple_list's, and used more efficient searching on those.
Eliminates some n^2 behavior, resulting in much better parallel read
times.
ReadParallel.cpp: eliminated a few warnings.
ReadNC.cpp: inserted (commented out for now) block for reading more of
this data (someday I'll learn to separate implementation of various
unrelated things)
tools/mbzoltan/mbpart.cpp: Adding RR as one of the supported methods
in usage message.
doc/metadata_info.doc: started adding some info on reader/writer
options for NC reader.
Passes make check in serial and parallel.
Modified: MOAB/trunk/doc/metadata_info.doc
===================================================================
(Binary files differ)
Modified: MOAB/trunk/src/FileOptions.cpp
===================================================================
--- MOAB/trunk/src/FileOptions.cpp 2010-11-04 21:28:07 UTC (rev 4251)
+++ MOAB/trunk/src/FileOptions.cpp 2010-11-05 15:47:18 UTC (rev 4252)
@@ -210,6 +210,51 @@
return MB_SUCCESS;
}
+ErrorCode FileOptions::get_reals_option( const char* name,
+ std::vector<double>& values) const
+{
+ const char* s;
+ ErrorCode rval = get_option( name, s );
+ if (MB_SUCCESS != rval)
+ return rval;
+
+ // empty string
+ if (strempty(s))
+ return MB_TYPE_OUT_OF_RANGE;
+
+ // parse values
+ while (!strempty(s)) {
+ char* endptr;
+ double sval = strtod( s, &endptr);
+
+#define EATSPACE(a) while ((!strcmp(a, " ") || \
+ !strcmp(a, ",")) && !strempty(a)) a++;
+ EATSPACE(endptr);
+ double eval = sval;
+ if (!strcmp(endptr, "-")) {
+ endptr++;
+ s = endptr;
+ eval = strtol(s, &endptr, 0);
+ EATSPACE(endptr);
+ }
+
+ // check for overflow (parsing long int, returning int)
+ int value = sval;
+ if (sval != (long int)value)
+ return MB_TYPE_OUT_OF_RANGE;
+ value = eval;
+ if (eval != (long int)value)
+ return MB_TYPE_OUT_OF_RANGE;
+
+ for (int i = sval; i <= eval; i++)
+ values.push_back(i);
+
More information about the moab-dev
mailing list