[MOAB-dev] r5462 - MOAB/trunk/itaps/imesh

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Apr 4 22:02:37 CDT 2012


Author: tautges
Date: 2012-04-04 22:02:37 -0500 (Wed, 04 Apr 2012)
New Revision: 5462

Modified:
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMesh_extensions.h
Log:
New extension function iMesh_getCommunicator, which translates a Fortran
communicator to a C communicator.  Not the best place to put this, but
necessary for now, until I make an iMeshP_extensions.h file, which I'll
probably eventually need to do.



Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2012-04-04 15:40:57 UTC (rev 5461)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2012-04-05 03:02:37 UTC (rev 5462)
@@ -3411,3 +3411,16 @@
   RETURN(iBase_SUCCESS);
 }
 
+#ifdef USE_MPI
+void iMesh_getCommunicator(
+    iMesh_Instance instance,
+    int *fcomm,
+    MPI_Comm *ccomm,
+    int *err) 
+{
+  *ccomm = MPI_Comm_f2c(*fcomm);
+  RETURN(iBase_SUCCESS);
+}
+#endif
+
+

Modified: MOAB/trunk/itaps/imesh/iMesh_extensions.h
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_extensions.h	2012-04-04 15:40:57 UTC (rev 5461)
+++ MOAB/trunk/itaps/imesh/iMesh_extensions.h	2012-04-05 03:02:37 UTC (rev 5462)
@@ -3,6 +3,9 @@
 
 #include "iMesh.h"
 #include "iMesh_extensions_protos.h"
+#ifdef USE_MPI
+#include "moab_mpi.h"
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -396,6 +399,24 @@
           /**< [out] Error flag. */
 );
 
+#ifdef USE_MPI
+/** \brief Convert a fortran to C communicator
+ * Given a Fortran communicator, convert to a C communicator that can be passed back to iMeshP.
+ *
+ *  COMMUNICATION:  None.
+ * 
+ *  \param  instance         (In)  Mesh instance to contain the partition.
+ *  \param  fcomm            (In)  Pointer to fortran communicator
+ *  \param  ccomm            (Out) Pointer to the C communicator
+ *  \param  err              (Out) Error code.
+ */


More information about the moab-dev mailing list