[MOAB-dev] r5649 - MOAB/trunk/src/io

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Jul 31 22:30:55 CDT 2012


Author: tautges
Date: 2012-07-31 22:30:55 -0500 (Tue, 31 Jul 2012)
New Revision: 5649

Modified:
   MOAB/trunk/src/io/WriteDamsel.cpp
   MOAB/trunk/src/io/WriteDamsel.hpp
Log:
Fixes, writing now works for at least 1hex.



Modified: MOAB/trunk/src/io/WriteDamsel.cpp
===================================================================
--- MOAB/trunk/src/io/WriteDamsel.cpp	2012-07-31 21:29:07 UTC (rev 5648)
+++ MOAB/trunk/src/io/WriteDamsel.cpp	2012-08-01 03:30:55 UTC (rev 5649)
@@ -121,7 +121,7 @@
 
 WriteDamsel::~WriteDamsel() 
 {
-  mbImpl->release_interface(mWriteIface);
+  if (mWriteIface) mbImpl->release_interface(mWriteIface);
 }
 
 ErrorCode WriteDamsel::write_file(const char *file_name, 
@@ -147,9 +147,9 @@
   
     // attach to a file, since we need it for creating containers
   MPI_Comm comm = MPI_COMM_WORLD;
+  unlink(file_name);
   err = DMSLmodel_attach(dmslModel, file_name, comm, NULL);
   CHK_DMSL_ERR(err, "DMSLmodel_attach failed.");
-  dmslFile = (damsel_model) ((damsel_model_internal *)dmslModel)->attached_file;
   
   rval = mWriteIface->gather_entities(all_ents, meshset_list, num_sets);
   CHK_MB_ERR(rval, "Gather entities failed in WriteDamsel.");
@@ -176,15 +176,16 @@
   }
 
     // write sparse tags
-//  rval = map_sparse_tags();
-//  CHK_MB_ERR(rval, "Failed to write sparse tags.");
+  rval = map_sparse_tags();
+  CHK_MB_ERR(rval, "Failed to write sparse tags.");
 
-  damsel_request_t request;
-  err = DMSLmodel_transfer_async(dmslModel, DAMSEL_TRANSFER_TYPE_WRITE, &request);
+    //damsel_request_t request;
+    //err = DMSLmodel_transfer_async(dmslModel, DAMSEL_TRANSFER_TYPE_WRITE, &request);
+  err = DMSLmodel_transfer_sync(dmslModel, DAMSEL_TRANSFER_TYPE_WRITE);
   CHK_DMSL_ERR(err, "DMSLmodel_transfer_asynch failed.");
   
-  damsel_status_t status;
-  err = DMSLmodel_wait(request, &status);
+    //damsel_status_t status;
+    //err = DMSLmodel_wait(request, &status);
   CHK_DMSL_ERR(err, "DMSLmodel_wait failed.");
 
   DMSLmodel_close(dmslModel);
@@ -207,7 +208,8 @@
     // define damsel tag handles for all dense/sparse tags
   for (std::vector<Tag>::iterator vit = tmp_mtags.begin(); vit != tmp_mtags.end(); vit++) {
     if (((*vit)->get_storage_type() != MB_TAG_DENSE && (*vit)->get_storage_type() != MB_TAG_SPARSE) ||


More information about the moab-dev mailing list