Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mpi_util.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file utility/mpi_util.hh
11 /// @brief
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 #ifndef INCLUDED_utility_mpi_util_hh
15 #define INCLUDED_utility_mpi_util_hh
16 
17 
18 // MPI Headers have to be #included first
19 #ifdef USEMPI
20 #include <mpi.h>
21 #endif
22 
23 // Utility headers
24 #include <utility/vector1.hh>
25 
26 /// STL Headers
27 // Have to go full string because of Windows PyRosetta
28 #include <string>
29 
30 namespace utility {
31 
32 int
33 mpi_rank();
34 
35 int
36 mpi_nprocs();
37 
38 /// @brief Use MPI to wait until some node sends an integer -- usually its own mpi_rank
39 /// so that it can send further messages.
40 int
42 
43 /// @brief Use MPI to receive a string from a particular node.
44 std::string
45 receive_string_from_node( int source );
46 
47 void
48 send_string_to_node( int source, std::string const & message );
49 
50 /// @brief Use MPI to receive a single char from a particular node.
51 char
52 receive_char_from_node( int source );
53 
54 void
55 send_char_to_node( int destination, char message );
56 
57 /// @brief Use MPI to receive a single integer from a particular node.
58 int
59 receive_integer_from_node( int source );
60 
61 void
62 send_integer_to_node( int destination, int message );
63 
64 /// @brief Use MPI to receive a vector of integers from a particular node.
66 receive_integers_from_node( int source );
67 
68 void
69 send_integers_to_node( int destination, utility::vector1< int > const & message );
70 
71 /// @brief Use MPI to receive a single double from a particular node.
72 double
73 receive_double_from_node( int source );
74 
75 void
76 send_double_to_node( int destination, double message );
77 
78 /// @brief Use MPI to receive a vector of doubles from a particular node.
80 receive_doubles_from_node( int source );
81 
82 void
83 send_doubles_to_node( int destination, utility::vector1< double > const & message );
84 
85 }
86 
87 #endif
void send_double_to_node(int destination, double message)
Definition: mpi_util.cc:397
int receive_integer_from_node(int source)
Use MPI to receive a single integer from a particular node.
Definition: mpi_util.cc:336
void send_doubles_to_node(int destination, utility::vector1< double > const &message)
Definition: mpi_util.cc:421
void send_string_to_node(int destination, std::string const &message)
Definition: mpi_util.cc:300
void send_integer_to_node(int destination, int message)
Definition: mpi_util.cc:348
utility::vector1< int > receive_integers_from_node(int source)
Use MPI to receive a vector of integers from a particular node.
Definition: mpi_util.cc:360
char receive_char_from_node(int source)
Use MPI to receive a single char from a particular node.
Definition: mpi_util.cc:312
int receive_integer_from_anyone()
Use MPI to wait until some node sends an integer – usually its own mpi_rank so that it can send furt...
Definition: mpi_util.cc:276
void send_integers_to_node(int destination, utility::vector1< int > const &message)
Definition: mpi_util.cc:372
vector1: std::vector with 1-based indexing
int mpi_rank()
Definition: mpi_util.cc:254
utility::vector1< double > receive_doubles_from_node(int source)
Use MPI to receive a vector of doubles from a particular node.
Definition: mpi_util.cc:409
std::string receive_string_from_node(int source)
Use MPI to receive a string from a particular node.
Definition: mpi_util.cc:288
void send_char_to_node(int destination, char message)
Definition: mpi_util.cc:324
int mpi_nprocs()
Definition: mpi_util.cc:265
double receive_double_from_node(int source)
Use MPI to receive a single double from a particular node.
Definition: mpi_util.cc:385