[MOAB-dev] r5766 - MOAB/trunk/src/io
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Fri Oct 5 00:37:48 CDT 2012
Author: iulian
Date: 2012-10-05 00:37:48 -0500 (Fri, 05 Oct 2012)
New Revision: 5766
Modified:
MOAB/trunk/src/io/ReadNC.cpp
MOAB/trunk/src/io/ReadNC.hpp
Log:
correct parallel read of ucd mesh; consider the fragmentation;
this is still the trivial partition;
async calls are made in pnetcdf case only, and right now only for
float variables that are to nonset. (the heavy data)
a special transpose is done too, and after each time step, and each variable,
a collective wait is done, so actually the read is pretty much in sync,
per variable and per time step.
The fragmentation in the vertex global id space is due to the contiguous
global element space. (a.k.a TRIVIAL_PARTITION)
NODAL_PARTITION is coming soon...
Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp 2012-10-04 16:01:47 UTC (rev 5765)
+++ MOAB/trunk/src/io/ReadNC.cpp 2012-10-05 05:37:48 UTC (rev 5766)
@@ -1075,149 +1075,22 @@
}
if (!vdatas.empty()) {
- rval = read_variable_to_nonset(file_set, vdatas, tstep_nums);
+#if PNETCDF_FILE
+ if (ucdMesh) // in serial, we will use the old read, everything is contiguous
+ // in parallel, we will use async read in pnetcdf
+ // the other mechanism is not working, forget about it
+ rval = read_variable_to_nonset_async(file_set, vdatas, tstep_nums);
+ else
+#endif
+ rval = read_variable_to_nonset(file_set, vdatas, tstep_nums);
+
ERRORR(rval, "Trouble read variables to entities verts/edges/quads.");
}
return MB_SUCCESS;
}
-/*
- ErrorCode ReadNC::read_variable_to_ucdmesh(EntityHandle file_set,
- std::vector<std::string> &varnames,
- std::vector<int> &tstep_nums,
- std::vector<VarData> &vdatas)
- {
- // get vertices in set
- Range verts;
- ErrorCode rval = mbImpl->get_entities_by_dimension(file_set, 0, verts);
- ERRORR(rval, "Trouble getting vertices in set.");
- assert("Should only have a single vertex subrange, since they were read in one shot" &&
- verts.psize() == 1);
- rval = read_variable_ucd_allocate(vdatas, tstep_nums, verts);
- ERRORR(rval, "Trouble allocating read variables.");
-
- // finally, read into that space
- int success;
- std::vector<int> requests(vdatas.size()*tstep_nums.size()), statuss(vdatas.size()*tstep_nums.size());
- for (unsigned int i = 0; i < vdatas.size(); i++) {
- for (unsigned int t = 0; t < tstep_nums.size(); t++) {
- void *data = vdatas[i].varDatas[t];
-
- switch (vdatas[i].varDataType) {
- case NC_BYTE:
- case NC_CHAR:
- success = NCFUNCAG(_vara_text)(fileId, vdatas[i].varId,
More information about the moab-dev
mailing list