Update of /cvsroot/boost/boost/boost/mpi
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21972

Modified Files:
        communicator.hpp config.hpp operations.hpp 
Log Message:
Introduce workarounds a fixes for Microsoft's tool chain, based on MS-MPI and 
Visual C++ 8.0

Index: communicator.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/mpi/communicator.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- communicator.hpp    17 Jan 2007 02:48:46 -0000      1.1
+++ communicator.hpp    16 Feb 2007 21:01:24 -0000      1.2
@@ -35,6 +35,11 @@
 #include <boost/mpi/status.hpp>
 #include <boost/mpi/request.hpp>
 
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable : 4800) // forcing to bool 'true' or 'false'
+#endif
+
 namespace boost { namespace mpi {
 
 /**
@@ -955,7 +960,7 @@
 
   int return_value;
   BOOST_MPI_CHECK_RESULT(MPI_Get_count,
-                         (&m_status, get_mpi_datatype<T>(), &return_value));
+                         (&m_status, get_mpi_datatype<T>(T()), &return_value));
   if (return_value == MPI_UNDEFINED)
     return optional<int>();
   else
@@ -979,7 +984,7 @@
 communicator::send_impl(int dest, int tag, const T& value, mpl::true_) const
 {
   BOOST_MPI_CHECK_RESULT(MPI_Send,
-                         (const_cast<T*>(&value), 1, get_mpi_datatype<T>(),
+                         (const_cast<T*>(&value), 1, 
get_mpi_datatype<T>(value),
                           dest, tag, MPI_Comm(*this)));
 }
 
@@ -1011,7 +1016,8 @@
                               mpl::true_) const
 {
   BOOST_MPI_CHECK_RESULT(MPI_Send,
-                         (const_cast<T*>(values), n, get_mpi_datatype<T>(),
+                         (const_cast<T*>(values), n, 
+                                                 get_mpi_datatype<T>(*values),
                           dest, tag, MPI_Comm(*this)));
 }
 
@@ -1043,7 +1049,8 @@
   status stat;
 
   BOOST_MPI_CHECK_RESULT(MPI_Recv,
-                         (const_cast<T*>(&value), 1, get_mpi_datatype<T>(),
+                         (const_cast<T*>(&value), 1, 
+                                                 get_mpi_datatype<T>(value),
                           source, tag, MPI_Comm(*this), &stat.m_status));
   return stat;
 }
@@ -1077,7 +1084,8 @@
 {
   status stat;
   BOOST_MPI_CHECK_RESULT(MPI_Recv,
-                         (const_cast<T*>(values), n, get_mpi_datatype<T>(),
+                         (const_cast<T*>(values), n, 
+                                                 get_mpi_datatype<T>(*values),
                           source, tag, MPI_Comm(*this), &stat.m_status));
   return stat;
 }
@@ -1123,7 +1131,8 @@
 {
   request req;
   BOOST_MPI_CHECK_RESULT(MPI_Isend,
-                         (const_cast<T*>(&value), 1, get_mpi_datatype<T>(),
+                         (const_cast<T*>(&value), 1, 
+                                                 get_mpi_datatype<T>(value),
                           dest, tag, MPI_Comm(*this), &req.m_requests[0]));
   return req;
 }
@@ -1157,7 +1166,8 @@
 {
   request req;
   BOOST_MPI_CHECK_RESULT(MPI_Isend,
-                         (const_cast<T*>(values), n, get_mpi_datatype<T>(),
+                         (const_cast<T*>(values), n, 
+                                                 get_mpi_datatype<T>(*values),
                           dest, tag, MPI_Comm(*this), &req.m_requests[0]));
   return req;
 }
@@ -1396,7 +1406,8 @@
 {
   request req;
   BOOST_MPI_CHECK_RESULT(MPI_Irecv,
-                         (const_cast<T*>(&value), 1, get_mpi_datatype<T>(),
+                         (const_cast<T*>(&value), 1, 
+                                                 get_mpi_datatype<T>(value),
                           source, tag, MPI_Comm(*this), &req.m_requests[0]));
   return req;
 }
@@ -1412,7 +1423,8 @@
   req.m_handler = request::handle_serialized_irecv<T>;
 
   BOOST_MPI_CHECK_RESULT(MPI_Irecv,
-                         (&data->count, 1, get_mpi_datatype<std::size_t>(),
+                         (&data->count, 1, 
+                                                 
get_mpi_datatype<std::size_t>(data->count),
                           source, tag, MPI_Comm(*this), &req.m_requests[0]));
   
   return req;
@@ -1432,7 +1444,8 @@
 {
   request req;
   BOOST_MPI_CHECK_RESULT(MPI_Irecv,
-                         (const_cast<T*>(values), n, get_mpi_datatype<T>(),
+                         (const_cast<T*>(values), n, 
+                                                 get_mpi_datatype<T>(*values),
                           source, tag, MPI_Comm(*this), &req.m_requests[0]));
   return req;
 }
@@ -1449,7 +1462,8 @@
   req.m_handler = request::handle_serialized_array_irecv<T>;
 
   BOOST_MPI_CHECK_RESULT(MPI_Irecv,
-                         (&data->count, 1, get_mpi_datatype<std::size_t>(),
+                         (&data->count, 1, 
+                                                 
get_mpi_datatype<std::size_t>(data->count),
                           source, tag, MPI_Comm(*this), &req.m_requests[0]));
 
   return req;
@@ -1580,4 +1594,8 @@
 #  include <boost/mpi/detail/communicator_sc.hpp>
 #endif
 
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+
 #endif // BOOST_MPI_COMMUNICATOR_HPP

Index: config.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/mpi/config.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- config.hpp  17 Jan 2007 02:48:46 -0000      1.1
+++ config.hpp  16 Feb 2007 21:01:24 -0000      1.2
@@ -39,6 +39,22 @@
 #  define BOOST_MPI_HAS_NOARG_INITIALIZATION
 #endif
 
+#if defined(MPIAPI)
+#  define BOOST_MPI_CALLING_CONVENTION MPIAPI
+#else
+/** @brief Specifies the calling convention that will be used for callbacks
+ *  from the underlying C MPI. 
+ *
+ *  This is a Windows-specific macro, which will be used internally to state
+ *  the calling convention of any function that is to be used as a callback
+ *  from MPI. For example, the internally-defined functions that are used in
+ *  a call to @c MPI_Op_create. This macro is likely only to be useful to
+ *  users that wish to bypass Boost.MPI, registering their own callbacks in
+ *  certain cases, e.g., through @c MPI_Op_create.
+ */
+#  define BOOST_MPI_CALLING_CONVENTION
+#endif
+
 #if defined(LAM_MPI)
 // Configuration for LAM/MPI
 #  define BOOST_MPI_HAS_MEMORY_ALLOCATION

Index: operations.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/mpi/operations.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- operations.hpp      17 Jan 2007 02:48:46 -0000      1.1
+++ operations.hpp      16 Feb 2007 21:01:25 -0000      1.2
@@ -18,7 +18,7 @@
 #ifndef BOOST_MPI_IS_MPI_OP_HPP
 #define BOOST_MPI_IS_MPI_OP_HPP
 
-#include <mpi.h>
+#include <boost/mpi/config.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/and.hpp>
@@ -305,7 +305,7 @@
     MPI_Op mpi_op;
     static Op* op_ptr;
 
-    static void perform(void* vinvec, void* voutvec, int* plen, MPI_Datatype*)
+    static void BOOST_MPI_CALLING_CONVENTION perform(void* vinvec, void* 
voutvec, int* plen, MPI_Datatype*)
     {
       T* invec = static_cast<T*>(vinvec);
       T* outvec = static_cast<T*>(voutvec);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to