Commit 4f5d82cf authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixes for build wihtout MPI.

parent 1c71b26a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -920,6 +920,7 @@ void send( const Array< Value, Device, Index, Allocator >& array, int dest, int
template< typename Value, typename Device, typename Index, typename Allocator >
void receive( Array< Value, Device, Index, Allocator >& array, int src, int tag, MPI_Comm comm )
{
#ifdef HAVE_MPI
   TNL_ASSERT( false, "Does not work" );
   MPI_Status status;
   Index size;
@@ -927,7 +928,7 @@ void receive( Array< Value, Device, Index, Allocator >& array, int src, int tag,
   std::cerr << "Size = " << size << std::endl;
   array.setSize( size );
   MPI_Recv( ( void* ) array.getData(), size * sizeof( Value ), MPI_BYTE, src, tag, comm, &status );

#endif
}


+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <TNL/File.h>
#include <TNL/Devices/Host.h>
#include <TNL/Devices/Cuda.h>
#include <TNL/MPI.h>

namespace TNL {
namespace Containers {
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include <TNL/Containers/detail/ArrayIO.h>
#include <TNL/Containers/detail/ArrayAssignment.h>
#include <TNL/Allocators/Default.h>
#include <TNL/MPI/getDataType.h>

#include "ArrayView.h"

@@ -544,10 +543,12 @@ File& operator>>( File&& file, ArrayView< Value, Device, Index > view )
template< typename Value, typename Device, typename Index >
void send( const ArrayView< Value, Device, Index >& view, int dest, int tag, MPI_Comm comm )
{
#ifdef HAVE_MPI
   TNL_ASSERT( false, "Does not work" );
   auto size = view.getSize();
   MPI_Send( ( const void* ) size, 1, MPI::getDataType< Index >(), dest, tag, comm );
   MPI_Send( ( const void* ) view.getData(), view.getSize() * sizeof( Value ), MPI_BYTE, dest, tag, comm );
#endif
}


+1 −0
Original line number Diff line number Diff line
@@ -47,5 +47,6 @@ enum {
#define MPI_CART               1                       /* cartesian topology */
#define MPI_GRAPH              2                       /* graph topology */
#define MPI_KEYVAL_INVALID     -1                      /* invalid key value */
#define MPI_COMM_WORLD         0

#endif