Loading [MathJax]/extensions/tex2jax.js
Parallel numerical verification of the σ_odd problem  October 6, 2018
All Classes Namespaces Files Functions Variables Typedefs Macros
Classes | Typedefs | Functions
mpi Namespace Reference

Classes

struct  first_last_bad_bad_struct
 Structure for first_n, last_n, bad_first_n and bad_last_n values. More...
 
struct  n_bad_bad_struct
 Structure for n, first_n and last_n values. More...
 

Typedefs

using nat_type = sigmaodd::nat_type
 
using prime_type = sigmaodd::prime_type
 
typedef unsigned int rank_type
 Type of MPI rank. More...
 
typedef 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. More...
 
typedef struct mpi::n_bad_bad_struct n_bad_bad_type
 Structure for n, first_n and last_n values. More...
 

Functions

std::set< nat_typempi_check_gentle_varsigma_odd__dynamic (nat_type first_n, nat_type last_n, const std::set< nat_type > &previous_bad_table=std::set< nat_type >(), bool print_bad=true, unsigned int range_size=20000, unsigned int master_range_size=200)
 Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all bad numbers between first_n and last_n (included). The consequence of the result is that: if (all numbers < first_n respect the conjecture) and (all perfect squares < last_n respect the conjecture) and (all bad numbers < last_n respect the conjecture) then all numbers < last_n respect the conjecture. More...
 
std::set< nat_typempi_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)
 
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. More...
 
bool mpi_slave_wait_compute_range ()
 Computation of one range by a slave, for the mpi_check_gentle_varsigma_odd__dynamic() master function. More...
 
void print_mpi_versions ()
 Print the Open MPI version and the library version. More...
 
void send_bad_table_to (const std::set< nat_type > &bad_table, rank_type to_rank)
 Send bad values to a process. More...
 
std::set< nat_typewait_bad_table_from (rank_type from_rank)
 Wait and receive bad values from a process. More...
 
bool is_finished_from (rank_type from_rank)
 Return true iff the process send an empty finished message. More...
 
constexpr bool is_master (rank_type rank)
 Return true iff rank correspond to the master instance. More...
 
unsigned int mpi_nb_process ()
 Return the number of process. More...
 
std::string mpi_processor_name ()
 Return the processor name. More...
 
unsigned int mpi_rank ()
 Return the rank of this process. More...
 
void send_bool_to_master (bool b)
 Send a boolean value to the master. More...
 
void send_finished_to_master ()
 Send a finished empty message to the master. More...
 
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. More...
 
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. More...
 
void send_n_to (nat_type n, rank_type to_rank)
 Send a value to a process. More...
 
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. More...
 
void send_size_to (unsigned int size, rank_type to_rank)
 Send a size to a process. More...
 
bool wait_bool_from (rank_type from_rank)
 Wait and receive a boolean value from a process. More...
 
void wait_finished_from (rank_type from_rank)
 Wait and received a finished empty message from a process. More...
 
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. More...
 
n_bad_bad_type wait_n_bad_bad_from_master ()
 Wait and receive values n, first_n and last_n from the master. More...
 
nat_type wait_n_from_master ()
 Wait and receive a value from the master. More...
 
std::pair< nat_type, nat_typewait_range_from_master ()
 Wait and receive a range (first_n, last_n) from the master. More...
 
unsigned int wait_size_from (rank_type from_rank)
 Wait and receive a size from a process. More...
 

Typedef Documentation

◆ first_last_bad_bad_type

Structure for first_n, last_n, bad_first_n and bad_last_n values.

◆ n_bad_bad_type

Structure for n, first_n and last_n values.

◆ nat_type

Definition at line 31 of file mpi.hpp.

◆ prime_type

Definition at line 32 of file mpi.hpp.

◆ rank_type

typedef unsigned int mpi::rank_type

Type of MPI rank.

Definition at line 43 of file mpi.hpp.

Function Documentation

◆ is_finished_from()

bool mpi::is_finished_from ( rank_type  from_rank)
inline

Return true iff the process send an empty finished message.

Definition at line 38 of file mpi__inline.hpp.

◆ is_master()

constexpr bool mpi::is_master ( rank_type  rank)

Return true iff rank correspond to the master instance.

Definition at line 27 of file mpi__inline.hpp.

◆ mpi_check_gentle_varsigma_odd__dynamic()

std::set< nat_type > mpi::mpi_check_gentle_varsigma_odd__dynamic ( nat_type  first_n,
nat_type  last_n,
const std::set< nat_type > &  previous_bad_table = std::set< nat_type >(),
bool  print_bad = true,
unsigned int  range_size = 20000,
unsigned int  master_range_size = 200 
)

Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all bad numbers between first_n and last_n (included). The consequence of the result is that: if (all numbers < first_n respect the conjecture) and (all perfect squares < last_n respect the conjecture) and (all bad numbers < last_n respect the conjecture) then all numbers < last_n respect the conjecture.

One master process dispatch one range of numbers for each of the (nb_process - 1) slaves process and compute itself one range. There is no barrier, the master process dispatch new range for free slave process and compute itself one new range. And so forth with next numbers.

Printing is do in increasing order.

sigmaodd::primes.cpp must be compiled without the macro PRIME16.

Parameters
first_n3 <= odd <= last_n
last_n<= MAX_POSSIBLE_N
previous_bad_tableif not empty then must be contains all bad numbers < first_n
print_bad
range_sizeeven
master_range_sizeeven
Returns
the set of all bad numbers between first_n and last_n (included)

Definition at line 28 of file mpi.cpp.

◆ mpi_check_gentle_varsigma_odd__one_by_one()

std::set< nat_type > mpi::mpi_check_gentle_varsigma_odd__one_by_one ( nat_type  first_n,
nat_type  last_n,
const std::set< nat_type > &  previous_bad_table = std::set< nat_type >(),
bool  print_bad = true 
)

Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all bad numbers between first_n and last_n (included). The consequence of the result is that: if (all numbers < first_n respect the conjecture) and (all perfect squares < last_n respect the conjecture) and (all bad numbers < last_n respect the conjecture) then all numbers < last_n respect the conjecture.

One master process dispatch one number for each of the (nb_process - 1) slaves process and compute itself one number. Then wait that they all finish, and so forth with next numbers.

Printing is do in not deterministic order.

sigmaodd::primes.cpp must be compiled without the macro PRIME16.

Parameters
first_n3 <= odd <= last_n
last_n<= MAX_POSSIBLE_N
previous_bad_tableif not empty then must be contains all bad numbers < first_n
print_bad
Returns
the set of all bad numbers between first_n and last_n (included)

Definition at line 147 of file mpi.cpp.

◆ mpi_nb_process()

unsigned int mpi::mpi_nb_process ( )
inline

Return the number of process.

Definition at line 52 of file mpi__inline.hpp.

◆ mpi_processor_name()

std::string mpi::mpi_processor_name ( )
inline

Return the processor name.

Definition at line 66 of file mpi__inline.hpp.

◆ mpi_rank()

unsigned int mpi::mpi_rank ( )
inline

Return the rank of this process.

Definition at line 78 of file mpi__inline.hpp.

◆ mpi_slave_wait_compute_n()

bool mpi::mpi_slave_wait_compute_n ( )

Computation of one n by a slave, for the mpi_check_gentle_varsigma_odd__one_by_one() master function.

Definition at line 237 of file mpi.cpp.

◆ mpi_slave_wait_compute_range()

bool mpi::mpi_slave_wait_compute_range ( )

Computation of one range by a slave, for the mpi_check_gentle_varsigma_odd__dynamic() master function.

Definition at line 265 of file mpi.cpp.

◆ print_mpi_versions()

void mpi::print_mpi_versions ( )

Print the Open MPI version and the library version.

Definition at line 300 of file mpi.cpp.

◆ send_bad_table_to()

void mpi::send_bad_table_to ( const std::set< nat_type > &  bad_table,
rank_type  to_rank 
)

Send bad values to a process.

Definition at line 315 of file mpi.cpp.

◆ send_bool_to_master()

void mpi::send_bool_to_master ( bool  b)
inline

Send a boolean value to the master.

Definition at line 92 of file mpi__inline.hpp.

◆ send_finished_to_master()

void mpi::send_finished_to_master ( )
inline

Send a finished empty message to the master.

Definition at line 104 of file mpi__inline.hpp.

◆ send_first_last_bad_bad_to()

void mpi::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 
)
inline

Send first_n, last_n, bad_first and bad_last_n to a process.

Definition at line 114 of file mpi__inline.hpp.

◆ send_n_bad_bad_to()

void mpi::send_n_bad_bad_to ( nat_type  n,
nat_type  first_n,
nat_type  last_n,
rank_type  to_rank 
)
inline

Send n, first_n and last_n to a process.

Definition at line 130 of file mpi__inline.hpp.

◆ send_n_to()

void mpi::send_n_to ( nat_type  n,
rank_type  to_rank 
)
inline

Send a value to a process.

Definition at line 145 of file mpi__inline.hpp.

◆ send_range_to()

void mpi::send_range_to ( nat_type  first_n,
nat_type  last_n,
rank_type  to_rank 
)
inline

Send a range (first_n, last_n) to a process.

Definition at line 157 of file mpi__inline.hpp.

◆ send_size_to()

void mpi::send_size_to ( unsigned int  size,
rank_type  to_rank 
)
inline

Send a size to a process.

Definition at line 171 of file mpi__inline.hpp.

◆ wait_bad_table_from()

std::set< nat_type > mpi::wait_bad_table_from ( rank_type  from_rank)

Wait and receive bad values from a process.

Definition at line 332 of file mpi.cpp.

◆ wait_bool_from()

bool mpi::wait_bool_from ( rank_type  from_rank)
inline

Wait and receive a boolean value from a process.

Definition at line 183 of file mpi__inline.hpp.

◆ wait_finished_from()

void mpi::wait_finished_from ( rank_type  from_rank)
inline

Wait and received a finished empty message from a process.

Definition at line 197 of file mpi__inline.hpp.

◆ wait_first_last_bad_bad_from_master()

first_last_bad_bad_type mpi::wait_first_last_bad_bad_from_master ( )
inline

Wait and receive values first_n, last_n and bad_last_n from the master.

Definition at line 207 of file mpi__inline.hpp.

◆ wait_n_bad_bad_from_master()

n_bad_bad_type mpi::wait_n_bad_bad_from_master ( )
inline

Wait and receive values n, first_n and last_n from the master.

Definition at line 223 of file mpi__inline.hpp.

◆ wait_n_from_master()

nat_type mpi::wait_n_from_master ( )
inline

Wait and receive a value from the master.

Definition at line 239 of file mpi__inline.hpp.

◆ wait_range_from_master()

std::pair< nat_type, nat_type > mpi::wait_range_from_master ( )
inline

Wait and receive a range (first_n, last_n) from the master.

Definition at line 255 of file mpi__inline.hpp.

◆ wait_size_from()

unsigned int mpi::wait_size_from ( rank_type  from_rank)
inline

Wait and receive a size from a process.

Definition at line 271 of file mpi__inline.hpp.