[MOAB-dev] r4730 - MOAB/trunk/src/io
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Mon Apr 11 14:36:08 CDT 2011
Author: tautges
Date: 2011-04-11 14:36:06 -0500 (Mon, 11 Apr 2011)
New Revision: 4730
Modified:
MOAB/trunk/src/io/ReadNC.cpp
MOAB/trunk/src/io/ReadNC.hpp
Log:
- get rid of valgrind-indicated memory error, was using scd interface after I'd released it
- implement "flexible data mode" interface (nonblocking read) to try improving throughput;
disabled by default, to enable, un-comment #define NCASYNCH in ReadNC.hpp
Passes make check in parallel.
Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp 2011-04-10 00:27:03 UTC (rev 4729)
+++ MOAB/trunk/src/io/ReadNC.cpp 2011-04-11 19:36:06 UTC (rev 4730)
@@ -314,9 +314,6 @@
rval = scdi->create_scd_sequence(HomCoord(ilMin, jlMin, (-1 != klMin ? klMin : 0), 1),
HomCoord(ilMax, jlMax, (-1 != klMax ? klMax : 0), 1),
(-1 != klMin ? MBHEX : MBQUAD), 0, elem_box);
- mbImpl->release_interface(scdi);
- ERRORR(rval, "Trouble creating scd element sequence.");
-
// add vertex seq to element seq, forward orientation, unity transform
rval = elem_box->add_vbox(scd_box,
// p1: imin,jmin
@@ -352,6 +349,9 @@
ERRORR(rval, "Trouble listing element connectivity.");
}
+ mbImpl->release_interface(scdi);
+ ERRORR(rval, "Trouble creating scd element sequence.");
+
return MB_SUCCESS;
}
@@ -389,18 +389,35 @@
if (tstep_nums.empty() && -1 != tMin) {
// no timesteps input, get them all
for (int i = tMin; i <= tMax; i++) tstep_nums.push_back(i);
- for (unsigned int i = 0; i < vdatas.size(); i++)
+ for (unsigned int i = 0; i < vdatas.size(); i++) {
vdatas[i].varTags.resize(tstep_nums.size(), 0);
+ vdatas[i].varDatas.resize(tstep_nums.size());
+ }
}
+ std::vector<int> requests(vdatas.size()*tstep_nums.size()), statuss(vdatas.size()*tstep_nums.size());
+ int j = 0;
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Reading variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- ErrorCode tmp_rval = read_variable(file_set, vdatas[i], tstep_nums[t]);
+ ErrorCode tmp_rval = read_variable(file_set, vdatas[i], tstep_nums[t], &requests[j]);
+ j++;
if (MB_SUCCESS != tmp_rval) rval = tmp_rval;
}
}
+#ifdef NCWAIT
+ int success = ncmpi_wait_all(fileId, requests.size(), &requests[0], &statuss[0]);
+ ERRORS(success, "Failed on wait_all.");
+#endif
More information about the moab-dev
mailing list