File: test_is_mpi_op.cpp

package info (click to toggle)
boost1.90 1.90.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 593,120 kB
  • sloc: cpp: 4,190,908; xml: 196,648; python: 34,618; ansic: 23,145; asm: 5,468; sh: 3,774; makefile: 1,161; perl: 1,020; sql: 728; ruby: 676; yacc: 478; java: 77; lisp: 24; csh: 6
file content (33 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor@gmail.com>

// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// A test of the is_mpi_op functionality.
#include <boost/mpi/operations.hpp>
#include <boost/mpi/environment.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>

#include "mpi_test_utils.hpp"

using namespace boost::mpi;
using namespace std;
using boost::is_base_and_derived;

int main()
{
  boost::mpi::environment env;
  int failed = 0;
  // Check each predefined MPI_Op type that we support directly.
  BOOST_MPI_CHECK((is_mpi_op<minimum<float>, float>::op() == MPI_MIN), failed);
  BOOST_MPI_CHECK((is_mpi_op<plus<double>, double>::op() == MPI_SUM), failed);
  BOOST_MPI_CHECK((is_mpi_op<multiplies<long>, long>::op() == MPI_PROD), failed);
  BOOST_MPI_CHECK((is_mpi_op<logical_and<int>, int>::op() == MPI_LAND), failed);
  BOOST_MPI_CHECK((is_mpi_op<bitwise_and<int>, int>::op() == MPI_BAND), failed);
  BOOST_MPI_CHECK((is_mpi_op<logical_or<int>, int>::op() == MPI_LOR), failed);
  BOOST_MPI_CHECK((is_mpi_op<bitwise_or<int>, int>::op() == MPI_BOR), failed);
  BOOST_MPI_CHECK((is_mpi_op<logical_xor<int>, int>::op() == MPI_LXOR), failed);
  BOOST_MPI_CHECK((is_mpi_op<bitwise_xor<int>, int>::op() == MPI_BXOR), failed);
  return failed;
}