[MOAB-dev] r2129 - MOAB/trunk/tools/iMesh

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Oct 3 15:06:16 CDT 2008


Author: kraftche
Date: 2008-10-03 15:06:15 -0500 (Fri, 03 Oct 2008)
New Revision: 2129

Modified:
   MOAB/trunk/tools/iMesh/iMeshP.h
   MOAB/trunk/tools/iMesh/iMeshP_MOAB.cpp
Log:
update to latest iMeshP.h

Modified: MOAB/trunk/tools/iMesh/iMeshP.h
===================================================================
--- MOAB/trunk/tools/iMesh/iMeshP.h	2008-10-03 13:56:15 UTC (rev 2128)
+++ MOAB/trunk/tools/iMesh/iMeshP.h	2008-10-03 20:06:15 UTC (rev 2129)
@@ -1,13 +1,31 @@
 #ifndef iMeshP_H
 #define iMeshP_H
 
-#include "iBase.h"
+#include "iMesh.h"
 #include "iMeshP_protos.h"
+#include <mpi.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#define ITAPS_DECLARE_HANDLE( NAME ) typedef struct NAME##DummyStruct *NAME
+
+ITAPS_DECLARE_HANDLE( iMeshP_PartitionHandle );
+ITAPS_DECLARE_HANDLE( iMeshP_PartHandle );
+ITAPS_DECLARE_HANDLE( iMeshP_RequestHandle );
+ITAPS_DECLARE_HANDLE( iMeshP_Status );
+
+typedef unsigned iMeshP_Part;
+
+enum iMeshP_EntStatus 
+{
+  iMeshP_INTERNAL,
+  iMeshP_BOUNDARY,
+  iMeshP_GHOST
+};
+
+
 /*
 ------------------------------------------------
 Background and Terminology:
@@ -110,7 +128,7 @@
  *  be NULL.
  *  COMMUNICATION:  Collective.*/
 void iMeshP_createPartitionAll(iMesh_Instance instance,
-                    /*in*/  MPI_Comm *communicator,
+                    /*in*/  MPI_Comm communicator,
                     /*out*/ iMeshP_PartitionHandle *partition_handle,
                             int *err);
  
@@ -177,7 +195,8 @@
                           const iMeshP_PartitionHandle partition_handle,
                           int *num_local_part, 
                           iMeshP_PartHandle *part_handles,
-                          int part_handles_allocated,
+                          int *part_handles_allocated,
+                          int *part_handles_size,
                           int *err); 
 
 /**  Map from parts to processes:  
@@ -196,6 +215,7 @@
              /*in*/    const int part_ids_size,
              /*inout*/ int **rank, 
              /*inout*/ int *rank_allocated, 
+                       int *rank_size,
                        int *err); 
 
 /**  Provide global mesh information about a partition.  
@@ -244,36 +264,38 @@
  * return an error.
  *  COMMUNICATION:  None.*/
 
-void iMeshP_getPartFromPartHandle(iMesh_Instance instance,
+void iMeshP_getPartIdFromPartHandle(iMesh_Instance instance,
                        const iMeshP_PartitionHandle partition_handle,
              /*in*/    const iMeshP_PartHandle part_handle,
              /*out*/   iMeshP_Part *part_id,
                        int *err);
 
-void iMeshP_getPartFromPartHandlesArr(iMesh_Instance instance,
+void iMeshP_getPartIdsFromPartHandlesArr(iMesh_Instance instance,
                        const iMeshP_PartitionHandle partition_handle,
              /*in*/    const iMeshP_PartHandle *part_handles,
              /*in*/    const int part_handles_size,
              /*inout*/ iMeshP_Part **part_ids,
              /*inout*/ int *part_ids_allocated,
+             /*out*/   int *part_ids_size,
                        int *err);
 
 /** Given a partition handle and a part ID, return the part handle 
  * if the part is local; otherwise, return error code.
  *  COMMUNICATION:  None.*/
 
-void iMeshP_getPartHandleFromPart(iMesh_Instance instance,
+void iMeshP_getPartHandleFromPartId(iMesh_Instance instance,
                        const iMeshP_PartitionHandle partition_handle,
              /*in*/    iMeshP_Part part_id,
              /*out*/   iMeshP_PartHandle *part_handle,
                        int *err);
 
-void iMeshP_getPartHandlesFromPartsArr(iMesh_Instance instance,
+void iMeshP_getPartHandlesFromPartsIdsArr(iMesh_Instance instance,
                        const iMeshP_PartitionHandle partition_handle,
              /*in*/    const iMeshP_Part *part_ids,
              /*in*/    const int part_ids_size,
              /*inout*/ iMeshP_PartHandle **part_handles,
              /*inout*/ int *part_handles_allocated,
+             /*out*/   int *part_handles_size,
                        int *err);
 
 /**  Add/remove on-process entities to/from on-process part:  Given
@@ -313,6 +335,7 @@
              /*in*/    int entity_type,
              /*inout*/ int **num_part_nbors,
              /*inout*/ int *num_part_nbors_allocated,
+             /*out*/   int *num_part_nbors_size,
                        int *err); 
 
 /**  Given a partition handle, a part handle, and an entity type, 
@@ -339,6 +362,7 @@
              /*in*/    int entity_type,
              /*inout*/ int **num_part_nbors,
              /*inout*/ int *num_part_nbors_allocated,
+             /*out*/   int *num_part_nbors_size,
              /*inout*/ iMeshP_Part **nbor_part_ids,
              /*inout*/ int *nbor_part_ids_allocated,
              /*out*/   int *nbor_part_ids_size,
@@ -545,6 +569,7 @@
                       /*in*/  const int entity_handles_size,
                    /*inout*/  iMeshP_Part **part_ids,
                    /*inout*/  int *part_ids_allocated,
+                     /*out*/  int *part_ids_size,
                               int* err); 
   
 /**  Provide entity categorization within part.
@@ -565,6 +590,7 @@
                     /*in*/ const int entity_handles_size, 
 		 /*inout*/ int** is_owner, 
                  /*inout*/ int* is_owner_allocated, 
+                 /*inout*/ int* is_owner_size, 
                            int *err); 
 
 /**  Given a partition handle, a part handle, and an entity handle, return a
@@ -576,15 +602,16 @@
                     /*in*/ const iMeshP_PartitionHandle partition_handle, 
                     /*in*/ const iMeshP_PartHandle part_handle, 
                     /*in*/ const iBase_EntityHandle entity_handle, 
-                   /*out*/ int* par_status, // Values=INTERNAL,BOUNDARY,GHOST
+                   /*out*/ int* par_status, /* enum iMeshP_EntStatus */
                            int *err); 
 void iMeshP_getEntStatusArr(iMesh_Instance instance,
                     /*in*/ const iMeshP_PartitionHandle partition_handle, 
                     /*in*/ const iMeshP_PartHandle part_handle, 
                     /*in*/ const iBase_EntityHandle *entity_handles, 
                     /*in*/ const int entity_handles_size, 
-		 /*inout*/ int** par_status, // Values=INTERNAL,BOUNDARY,GHOST
+		 /*inout*/ int** par_status, /* enum iMeshP_EntStatus */
                  /*inout*/ int* par_status_allocated, 
+                 /*inout*/ int* par_status_size, 
                            int *err); 
 
 /**  Provide information about copies of entities.  
@@ -622,6 +649,7 @@
                    /*out*/ int *part_ids_size, 
                  /*inout*/ iBase_EntityHandle **copies_entity_handles, 
                  /*inout*/ int *copies_entity_handles_allocated, 
+                           int *copies_entity_handles_size,
                            int *err); 
 
 /**  Given a partition handle, an entity handle and a part ID, return the
@@ -666,8 +694,8 @@
 void iMeshP_Wait(iMesh_Instance instance,
       const iMeshP_PartitionHandle partition_handle,
              /*in*/ iMeshP_RequestHandle req,
-            /*out*/ iMeshP_Status stat,
-            /*out*/ int *err)
+            /*out*/ iMeshP_Status *stat,
+            /*out*/ int *err);
 
 /**\brief  Wait for any of the specified requests to complete
  *
@@ -685,7 +713,7 @@
                /*in*/ int req_size,
                /*out*/ int *index,
                /*out*/ iMeshP_Status *stat,
-               /*out*/ int *err)
+               /*out*/ int *err);
 
 /**\brief  Wait for all of the specified requests to complete
  *
@@ -701,7 +729,7 @@
                /*in*/ iMeshP_RequestHandle *req,
                /*in*/ int req_size,
                /*out*/ iMeshP_Status *stat,
-               /*out*/ int *err)
+               /*out*/ int *err);
 
 
 /**\brief  Wait for specified request to complete
@@ -721,7 +749,7 @@
                /*inout*/ iBase_EntityHandle **out_entities,
                /*inout*/ int *out_entities_alloc,
                /*inout*/ int *out_entities_size,
-               /*out*/ int *err)
+               /*out*/ int *err);
 
 /**\brief Test for whether specified request has completed
  *
@@ -737,7 +765,7 @@
              /*in*/ iMeshP_RequestHandle req,
             /*out*/ int *flag,
             /*out*/ iMeshP_Status *stat,
-            /*out*/ int *err)
+            /*out*/ int *err);
 
 /** Poll for requests.  The internals of this function are going to have
  * to cover a lot of ground.  The array in the return is there as a
@@ -783,8 +811,8 @@
                        /*in*/  const iBase_EntityHandle *entity_handles,
                        /*in*/  const int entity_handles_size,
                        /*in*/  const iMeshP_Part *target_part_ids,
-                       /*in*/  int command_code,  // e.g., MIGRATE,COPY
-                       /*in*/  int update_ghost,  // e.g., YES,NO
+                       /*in*/  int command_code,  /* e.g., MIGRATE,COPY */
+                       /*in*/  int update_ghost,  /* e.g., YES,NO */
                       /*out*/  iMeshP_RequestHandle *request,
                                int *err);
 
@@ -901,7 +929,7 @@
                 /*in*/ iBase_TagHandle tag, 
                 /*in*/ int entity_type, 
                 /*in*/ int entity_topo, 
-                /*out*/ int *err)
+                /*out*/ int *err);
 
 /**\brief  Synchronously send tag data for entities and part
  *
@@ -914,16 +942,16 @@
  * data type, size, etc.  This call blocks until communication is
  * completed
  * \param tag Tag handle to exchange
- * \param entities Entities for which to exchange data
+ * \param entities Owned entities for which to send data
  * \param entities_size Number of entities
  * \param err Error returned from function
  */
 void iMeshP_pushTagsEnt(iMesh_Instance instance,
                  const iMeshP_PartitionHandle partition_handle,
                    /*in*/ iBase_TagHandle tag, 
-                   /*in*/ iBase_EntityHandle *entities,
+                   /*in*/ const iBase_EntityHandle *entities,
                    /*in*/ int entities_size,
-                   /*out*/ int *err)
+                   /*out*/ int *err);
 
 
 /**\brief  Asynchronously send tag data for entity type/topo
@@ -953,7 +981,7 @@
                  /*in*/ int entity_type, 
                  /*in*/ int entity_topo, 
                 /*out*/ iMeshP_RequestHandle *req,
-                /*out*/ int *err)
+                /*out*/ int *err);
 
 /**\brief  Asynchronously send tag data for entities and part
  *
@@ -966,7 +994,7 @@
  * data type, size, etc.  Applications can call iMeshP_Wait or
  * iMeshP_WaitEnt to block until associated call completes
  * \param tag Tag handle to exchange
- * \param entities Entities for which to exchange data
+ * \param entities Owned entities for which to send data
  * \param entities_size Number of entities
  * \param iMeshP_RequestHandle Request object used in call to
  *    iMeshP_Wait or iMeshP_WaitEnt
@@ -975,10 +1003,10 @@
 void iMeshP_iPushTagsEnt(iMesh_Instance instance,
                      const iMeshP_PartitionHandle partition_handle,
                     /*in*/ iBase_TagHandle tag, 
-                    /*in*/ iBase_EntityHandle *entities,
+                    /*in*/ const iBase_EntityHandle *entities,
                     /*in*/ int entities_size,
                    /*out*/ iMeshP_RequestHandle *req,
-                   /*out*/ int *err)
+                   /*out*/ int *err);
 
 /*  GHOST ENTITY SUPPORT */
 /*
@@ -1038,6 +1066,7 @@
 /* \brief Return information about all ghosting on a partition.
   * \param instance iMesh instance
   * \param partition_handle Partition on which ghost entities are deleted
+  * \param num_ghost_rules  Number of ghosting rules currently registered 
   * \param ghost_dim Dimension of ghost entities
   * \param bridge_dim Dimension of bridge entities
   * \param num_layers Number of layers of ghost entities
@@ -1046,7 +1075,7 @@
   */
 void iMeshP_ghostEntInfo(/*in*/ iMesh_Instance instance,
                     /*in*/ iMeshP_PartitionHandle partition_handle,
-                    /*out*/ int num_ghost_rules,
+                    /*out*/ int *num_ghost_rules,
                     /*inout*/ int *ghost_rules_allocated, 
                     /*inout*/ int *ghost_rules_size, 
                     /*out*/ int **ghost_dim,
@@ -1369,16 +1398,15 @@
 
 
 
-/*
-------------------------------------------------
-CVS File Information
-   $RCSfile: DraftInterface.h,v $
-   $Author: kddevin $
-   $Date: 2008/09/15 17:50:05 $
-   $Revision: 1.31 $
-------------------------------------------------
-*/
+////////////////////////////////////////////////////////////
+//SVN File Information
+//
+//  $Author:$
+//  $Date:$
+//  $Revision:$
+////////////////////////////////////////////////////////////
 
+
 #ifdef __cplusplus
 } // extern "C" 
 #endif

Modified: MOAB/trunk/tools/iMesh/iMeshP_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMeshP_MOAB.cpp	2008-10-03 13:56:15 UTC (rev 2128)
+++ MOAB/trunk/tools/iMesh/iMeshP_MOAB.cpp	2008-10-03 20:06:15 UTC (rev 2129)
@@ -16,18 +16,6 @@
 #define RETURN(a) {iMesh_LAST_ERROR.error_type = a; *err = a;return;}
 #define iMesh_processError(a, b) {sprintf(iMesh_LAST_ERROR.description, "%s", b); iMesh_LAST_ERROR.error_type = a; *err = a;}
 
-#define CHECK_SIZE(array, allocated, size, type, retval)  \
-  if (0 != allocated && NULL != array && allocated < (size)) {\
-    iMesh_processError(iBase_MEMORY_ALLOCATION_FAILED, \
-          "Allocated array not large enough to hold returned contents.");\
-    RETURN(iBase_MEMORY_ALLOCATION_FAILED);\
-  }\
-  if (allocated == 0 || NULL == array) {\
-    array = (type*)malloc((size)*sizeof(type));\
-    allocated=(size);\
-    if (NULL == array) {iMesh_processError(iBase_MEMORY_ALLOCATION_FAILED, \
-          "Couldn't allocate array.");RETURN(iBase_MEMORY_ALLOCATION_FAILED); }\
-  }
 // TAG_CHECK_SIZE is like CHECK_SIZE except it checks for and makes the allocated memory
 // size a multiple of sizeof(void*), and the pointer is assumed to be type char*
 #define TAG_CHECK_SIZE(array, allocated, size)  \
@@ -50,7 +38,6 @@
 #define ENTITY_HANDLE(handle) reinterpret_cast<MBEntityHandle>(handle)
 #define CONST_ENTITY_HANDLE(handle) reinterpret_cast<const MBEntityHandle>(handle)
 #define RANGE_ITERATOR(it) reinterpret_cast<RangeIterator*>(it)
-#define CAST_TO_VOID(ptr) reinterpret_cast<void*>(ptr)
 
 const iBase_ErrorType iBase_ERROR_MAP[] = 
 {
@@ -70,17 +57,53 @@
 
 extern iBase_Error iMesh_LAST_ERROR;
 
+template <typename ArrType> inline bool
+allocate_itaps_array( ArrType*& array, int& allocated, int& size, int requested )
+{
+  size = requested;
+  if (allocated) {
+    return (allocated >= requested);
+  }
+  else {
+    array = (ArrType*)malloc( requested * sizeof(ArrType) );
+    allocated = requested;
+    return (array != 0);
+  }
+}
+
+inline int allocate_itaps_array_failed()
+{
+  strcpy( iMesh_LAST_ERROR.description, 
+          "Insufficient allocated array size or insufficient "
+          "memory to allocate array." );
+  iMesh_LAST_ERROR.error_type = iBase_MEMORY_ALLOCATION_FAILED;
+  return iBase_MEMORY_ALLOCATION_FAILED;
+}
+
+#define ALLOCATE_ARRAY( NAME, SIZE ) \
+  if (!allocate_itaps_array( *NAME, *NAME##_allocated, *NAME##_size, (SIZE) )) \
+    RETURN(allocate_itaps_array_failed())
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+void iMeshP_createPartitionAll( iMesh_Instance /*instance*/,
+                        /*in*/  MPI_Comm /*communicator*/,
+                        /*out*/ iMeshP_PartitionHandle */*partition_handle*/,
+                                int *err )
+{
+  RETURN(iBase_NOT_SUPPORTED);
+}
+
 //  Given a partition handle, a part handle, and an entity handle, return a
 //  flag indicating whether the entity is strictly internal, on a 
 //  boundary, or a ghost.
 //  If part_handle is remote, an error is returned.
 //  COMMUNICATION:  None.
   void iMeshP_getEntStatus(iMesh_Instance instance,
-                           /*in*/ const iMeshP_PartHandle part_handle, 
+                           /*in*/ const iMeshP_PartitionHandle,
+                           /*in*/ const iMeshP_PartHandle, 
                            /*in*/ const iBase_EntityHandle entity_handle, 
                            /*out*/ int* par_status, // Values=INTERNAL,BOUNDARY,GHOST
                            int *err) 
@@ -99,6 +122,7 @@
   }
   
   void iMeshP_getEntStatusArr(iMesh_Instance instance,
+                              /*in*/ const iMeshP_PartitionHandle,
                               /*in*/ const iMeshP_PartHandle part_handle, 
                               /*in*/ const iBase_EntityHandle *entity_handles, 
                               /*in*/ const int entity_handles_size, 
@@ -114,9 +138,8 @@
                                            entity_handles_size,
                                            &pstatus[0]);
     if (MB_SUCCESS != result) RETURN(result);
-    *par_status_size = entity_handles_size;
 
-    CHECK_SIZE(*par_status, *par_status_allocated, *par_status_size, int, );
+    ALLOCATE_ARRAY( par_status, entity_handles_size );
   
     for (int i = 0; i < entity_handles_size; i++) {
       if (!pstatus[i]) (*par_status)[i] = iMeshP_INTERNAL;
@@ -144,13 +167,12 @@
 
     MBRange part_sets;
   
-    *part_handles_size = pc->partition_sets().size();
-    CHECK_SIZE(*part_handles, *part_handles_allocated, *part_handles_size, iMeshP_PartHandle,);
+    ALLOCATE_ARRAY( part_handles, pc->partition_sets().size() );
     MBRange::iterator rit;
     int i;
     for (i = 0, rit = pc->partition_sets().begin(); 
          rit != pc->partition_sets().end(); rit++, i++)
-      (*part_handles)[i] = CAST_TO_VOID(*rit);
+      (*part_handles)[i] = reinterpret_cast<iMeshP_PartHandle>(*rit);
   
     RETURN(iBase_SUCCESS);
   }
@@ -182,6 +204,7 @@
 //  If part_handle is remote, an error is returned.
 //  COMMUNICATION:  None.
   void iMeshP_isEntOwner(iMesh_Instance instance,
+                         /*in*/ const iMeshP_PartitionHandle,
                          /*in*/ const iMeshP_PartHandle part_handle, 
                          /*in*/ const iBase_EntityHandle entity_handle, 
                          /*out*/ int* is_owner, 
@@ -201,6 +224,7 @@
   }
 
   void iMeshP_isEntOwnerArr(iMesh_Instance instance,
+                            /*in*/ const iMeshP_PartitionHandle,
                             /*in*/ const iMeshP_PartHandle part_handle, 
                             /*in*/ const iBase_EntityHandle *entity_handles, 
                             /*in*/ const int entity_handles_size, 
@@ -216,9 +240,8 @@
                                            entity_handles_size,
                                            &pstatus[0]);
     if (MB_SUCCESS != result) RETURN(result);
-    *is_owner_size = entity_handles_size;
 
-    CHECK_SIZE(*is_owner, *is_owner_allocated, *is_owner_size, int, );
+    ALLOCATE_ARRAY( is_owner, entity_handles_size );
   
     for (int i = 0; i < entity_handles_size; i++) {
       if (pstatus[i] & PSTATUS_NOT_OWNED) (*is_owner)[i] = 0;
@@ -282,9 +305,9 @@
   void iMeshP_getCopies(iMesh_Instance instance,
                         /*in*/ const iMeshP_PartitionHandle partition_handle, 
                         /*in*/ const iBase_EntityHandle entity_handle, 
-                        /*inout*/ iMeshP_PartHandle **part_handles, 
-                        /*inout*/ int *part_handles_allocated, 
-                        /*out*/ int *part_handles_size, 
+                        /*inout*/ iMeshP_Part **part_ids, 
+                        /*inout*/ int *part_ids_allocated, 
+                        /*out*/ int *part_ids_size, 
                         /*inout*/ iBase_EntityHandle **copies_entity_handles, 
                         /*inout*/ int *copies_entity_handles_allocated, 
                         /*inout*/ int *copies_entity_handles_size, 
@@ -299,48 +322,48 @@
       RETURN(iBase_ERROR_MAP[result]);
     }
   
+    std::vector<iMeshP_PartHandle> part_handles;
     if (0 != shared_handle) {
-      *part_handles_size = 1;
-      *copies_entity_handles_size = 1;
-      CHECK_SIZE(*part_handles, *part_handles_allocated, *part_handles_size, 
-                 iMeshP_PartHandle, );
-      CHECK_SIZE(*copies_entity_handles, *copies_entity_handles_allocated, 
-                 *copies_entity_handles_size, iBase_EntityHandle, );
-      (*part_handles)[0] = 0;
-      (*copies_entity_handles)[0] = CAST_TO_VOID(shared_handle);
-      RETURN(iBase_SUCCESS);
+      part_handles.resize( 1 );
+      ALLOCATE_ARRAY(copies_entity_handles, 1);
+      part_handles[0] = 0;
+      (*copies_entity_handles)[0] = reinterpret_cast<iBase_EntityHandle>(shared_handle);
     }
+    else {
   
-    static int tag_size = 0;
-    if (!tag_size) {
-      result = MBI->tag_get_size(pc.sharedhs_tag(), tag_size);
+      static int tag_size = 0;
+      if (!tag_size) {
+        result = MBI->tag_get_size(pc.sharedhs_tag(), tag_size);
+        if (MB_SUCCESS != result) {
+          RETURN(iBase_ERROR_MAP[result]);
+        }
+      }
+      static std::vector<MBEntityHandle> shared_handles(tag_size);
+
+      result = MBI->tag_get_data(pc.sharedhs_tag(), 
+                                 CONST_HANDLE_ARRAY_PTR(&entity_handle), 1,
+                                 &shared_handles[0]);
       if (MB_SUCCESS != result) {
         RETURN(iBase_ERROR_MAP[result]);
       }
-    }
-    static std::vector<MBEntityHandle> shared_handles(tag_size);
 
-    result = MBI->tag_get_data(pc.sharedhs_tag(), 
-                               CONST_HANDLE_ARRAY_PTR(&entity_handle), 1,
-                               &shared_handles[0]);
-    if (MB_SUCCESS != result) {
-      RETURN(iBase_ERROR_MAP[result]);
+      int index = std::find(shared_handles.begin(), shared_handles.end(), -1) - shared_handles.begin();
+
+      part_handles.resize(index+1, 0);
+      ALLOCATE_ARRAY( copies_entity_handles, index+1 );
+      std::copy(&shared_handles[0], &shared_handles[index], 
+                HANDLE_ARRAY_PTR(*copies_entity_handles));
     }
-  
-    int index = std::find(shared_handles.begin(), shared_handles.end(), -1) - shared_handles.begin();
     
-    *part_handles_size = index+1;
-    *copies_entity_handles_size = index+1;
-    CHECK_SIZE(*part_handles, *part_handles_allocated, *part_handles_size, 
-               iMeshP_PartHandle, );
-    CHECK_SIZE(*copies_entity_handles, *copies_entity_handles_allocated, 
-               *copies_entity_handles_size, iMeshP_PartHandle, );
-    std::copy(&shared_handles[0], &shared_handles[index], 
-              HANDLE_ARRAY_PTR(*copies_entity_handles));
-    std::fill(*part_handles, *part_handles+index, CAST_TO_VOID(0));
-
-    RETURN(iBase_SUCCESS);
+    ALLOCATE_ARRAY(part_ids, part_handles.size());
+    iMeshP_getPartIdsFromPartHandlesArr( instance, partition_handle, 
+                                         &part_handles[0], part_handles.size(),
+                                         part_ids, part_ids_allocated,
+                                         part_ids_size, err );
+    *part_ids_size = part_handles.size();
+    RETURN(*err);
   }
+  
 
 #ifdef __cplusplus
 } // extern "C"




More information about the moab-dev mailing list