10 #ifndef PROGS_SRC_MPI_MPI_MPI_HPP_ 11 #define PROGS_SRC_MPI_MPI_MPI_HPP_ 14 #pragma GCC diagnostic push 15 #pragma GCC diagnostic ignored "-Wold-style-cast" 16 #pragma GCC diagnostic ignored "-Weffc++" 18 #pragma GCC diagnostic pop 25 #include "../../common/sigmaodd/helper.hpp" 26 #include "../../common/sigmaodd/primes.hpp" 122 const std::set<nat_type> &previous_bad_table = std::set<nat_type>(),
123 bool print_bad =
true,
124 unsigned int range_size = 20000,
125 unsigned int master_range_size = 200);
156 const std::set<nat_type> &previous_bad_table = std::set<nat_type>(),
157 bool print_bad =
true);
323 std::pair<nat_type, nat_type>
338 #endif // PROGS_SRC_MPI_MPI_MPI_HPP_ unsigned int mpi_rank()
Return the rank of this process.
void send_size_to(unsigned int size, rank_type to_rank)
Send a size to a process.
bool mpi_slave_wait_compute_n()
Computation of one n by a slave, for the mpi_check_gentle_varsigma_odd__one_by_one() master function...
unsigned int wait_size_from(rank_type from_rank)
Wait and receive a size from a process.
uint64_t nat_type
Type for natural number used in all code, on 64 bits.
Structure for n, first_n and last_n values.
void send_bool_to_master(bool b)
Send a boolean value to the master.
first_last_bad_bad_type wait_first_last_bad_bad_from_master()
Wait and receive values first_n, last_n and bad_last_n from the master.
void print_mpi_versions()
Print the Open MPI version and the library version.
void send_finished_to_master()
Send a finished empty message to the master.
uint32_t prime_type
Type for prime number, particularly for the table of primes.
nat_type wait_n_from_master()
Wait and receive a value from the master.
sigmaodd::nat_type nat_type
std::set< nat_type > wait_bad_table_from(rank_type from_rank)
Wait and receive bad values from a process.
bool wait_bool_from(rank_type from_rank)
Wait and receive a boolean value from a process.
unsigned int mpi_nb_process()
Return the number of process.
struct mpi::first_last_bad_bad_struct first_last_bad_bad_type
Structure for first_n, last_n, bad_first_n and bad_last_n values.
void send_n_to(nat_type n, rank_type to_rank)
Send a value to a process.
unsigned int rank_type
Type of MPI rank.
bool is_finished_from(rank_type from_rank)
Return true iff the process send an empty finished message.
std::string mpi_processor_name()
Return the processor name.
std::pair< nat_type, nat_type > wait_range_from_master()
Wait and receive a range (first_n, last_n) from the master.
void send_bad_table_to(const std::set< nat_type > &bad_table, rank_type to_rank)
Send bad values to a process.
Structure for first_n, last_n, bad_first_n and bad_last_n values.
std::set< nat_type > mpi_check_gentle_varsigma_odd__one_by_one(nat_type first_n, nat_type last_n, const std::set< nat_type > &previous_bad_table, bool print_bad)
void send_first_last_bad_bad_to(nat_type first_n, nat_type last_n, nat_type bad_first_n, nat_type bad_last_n, rank_type to_rank)
Send first_n, last_n, bad_first and bad_last_n to a process.
std::set< nat_type > mpi_check_gentle_varsigma_odd__dynamic(nat_type first_n, nat_type last_n, const std::set< nat_type > &previous_bad_table, bool print_bad, unsigned int range_size, unsigned int master_range_size)
Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all...
bool mpi_slave_wait_compute_range()
Computation of one range by a slave, for the mpi_check_gentle_varsigma_odd__dynamic() master function...
struct mpi::n_bad_bad_struct n_bad_bad_type
Structure for n, first_n and last_n values.
n_bad_bad_type wait_n_bad_bad_from_master()
Wait and receive values n, first_n and last_n from the master.
void send_range_to(nat_type first_n, nat_type last_n, rank_type to_rank)
Send a range (first_n, last_n) to a process.
sigmaodd::prime_type prime_type
void wait_finished_from(rank_type from_rank)
Wait and received a finished empty message from a process.
void send_n_bad_bad_to(nat_type n, nat_type first_n, nat_type last_n, rank_type to_rank)
Send n, first_n and last_n to a process.
constexpr bool is_master(rank_type rank)
Return true iff rank correspond to the master instance.