STIR 6.5.0
distributed_functions.h File Reference

Declaration of functions in the distributed namespace. More...

Go to the source code of this file.

Namespaces

namespace  distributed
 Namespace for distributed computation with MPI.
namespace  stir
 Namespace for the STIR library (and some/most of its applications).

Macros

#define STIR_MPI
 Precompiler-define that needs to be set to enable the parallel version of stir::distributable_computation.
#define STIR_MPI_TIMINGS
 Precompiler-define that needs to be set to enable timings in the parallel version of stir::distributable_computation.

Variables

Tag-names currently used by functions in the distributed namespace
const int distributed::INT_TAG = 7
const int distributed::ARBITRARY_TAG = 8
 special tag, equivalent to MPI_ANY_TAG in some functions
const int distributed::STIR_MPI_CONF_TAG = 9
const int distributed::IMAGE_ESTIMATE_TAG = 23
const int distributed::IMAGE_PARAMETER_TAG = 24
const int distributed::VIEWGRAM_DIMENSIONS_TAG = 27
const int distributed::VIEWGRAM_TAG = 28
const int distributed::VIEWGRAM_COUNT_TAG = 29
const int distributed::PROJECTION_DATA_INFO_TAG = 30
const int distributed::PARAMETER_INFO_TAG = 21
const int distributed::REGISTERED_NAME_TAG = 25

Global variables used for STIR_MPI

int distributed::num_processors
 the number of processes used for distributed computation
bool distributed::first_iteration
 some stuff in distributable_computation needs to be done only in the first iteration
bool distributed::test = false
 enable/disable tests
bool distributed::rpc_time = false
bool distributed::test_send_receive_times = false
 enable timings for PRC_process_related_viewgrams_gradient() computation
double distributed::total_rpc_time = 0
 enable timings for every single send/receive operation
double distributed::total_rpc_time_2 = 0.0
 adding up the time used for PRC_process_related_viewgrams_gradient() computation at all slaves
double distributed::total_rpc_time_slaves = 0.0
 adding up the time used for PRC_process_related_viewgrams_gradient() computation at a single slave
double distributed::min_threshold = 0.1
 value to reduce the total_rpc_time values
void distributed::send_int_value (int value, int destination)
 threshold for displaying send/receive times, initially set to 0.1 seconds
void distributed::send_string (const std::string &str, int tag, int destination)
 sends or broadcasts a string
void distributed::send_bool_value (bool value, int tag, int destination)
 send or broadcast a bool value
void distributed::send_int_values (int *values, int count, int tag, int destination)
 sends or broadcasts some integer values
void distributed::send_double_values (double *values, int count, int tag, int destination)
 send or broadcast double values
void distributed::send_view_segment_numbers (const stir::ViewSegmentNumbers &vs_num, int tag, int destination)
 send or broadcast ViewSegmentNumbers object
void distributed::send_projectors (const stir::shared_ptr< stir::ProjectorByBinPair > &proj_pair_sptr, int destination)
 send or broadcast a projector-pair object
void distributed::send_image_parameters (const stir::DiscretisedDensity< 3, float > *input_image_ptr, int tag, int destination)
 sends or broadcasts the parameters of a DiscretisedDensity object
void distributed::send_image_estimate (const stir::DiscretisedDensity< 3, float > *input_image_ptr, int destination)
 sends or broadcasts the values of a DiscretisedDensity object
void distributed::send_exam_and_proj_data_info (const stir::ExamInfo &exam_info, const stir::ProjDataInfo &proj_data_info, int destination)
 sends or broadcasts the information from ExamInfo and ProjDataInfo
void distributed::send_related_viewgrams (stir::RelatedViewgrams< float > *viewgrams, int destination)
 sends a RelatedViegrams object
void distributed::send_viewgram (const stir::Viewgram< float > &viewgram, int destination)
 sends a Viewgram object
int distributed::receive_int_value (int source)
 receives a single integer value
std::string distributed::receive_string (int tag, int source)
 receives a string
void distributed::receive_and_initialize_projectors (stir::shared_ptr< stir::ProjectorByBinPair > &projector_pair_ptr, int source)
 receives all needed information to subsequently construct a ProjectorByBinPair object
bool distributed::receive_bool_value (int tag, int source)
 receives a bool value
MPI_Status distributed::receive_int_values (int *values, int count, int tag)
 receives some integer values
MPI_Status distributed::receive_double_values (double *values, int count, int tag)
 receives some double values
MPI_Status distributed::receive_view_segment_numbers (stir::ViewSegmentNumbers &vs_num, int tag)
 receive a ViewSegmentNumbers object
void distributed::receive_and_set_image_parameters (stir::shared_ptr< stir::DiscretisedDensity< 3, float > > &image_ptr, int &buffer, int tag, int source)
 receives the parameters of a DiscretisedDensity object
MPI_Status distributed::receive_image_values_and_fill_image_ptr (stir::shared_ptr< stir::DiscretisedDensity< 3, float > > &image_ptr, int buffer_size, int source)
 receives the values of a DiscretisedDensity object
void distributed::receive_and_construct_exam_and_proj_data_info_ptr (stir::shared_ptr< stir::ExamInfo > &exam_info_sptr, stir::shared_ptr< stir::ProjDataInfo > &proj_data_info_sptr, int source)
 receives information of ExamInfo and ProjDataInfo objects and constructs new ones from it
void distributed::receive_and_construct_related_viewgrams (stir::RelatedViewgrams< float > *&viewgrams, const stir::shared_ptr< stir::ProjDataInfo > &proj_data_info_ptr, const stir::shared_ptr< stir::DataSymmetriesForViewSegmentNumbers > symmetries_sptr, int source)
 receives and constructs a RelatedViewgrams object
void distributed::receive_and_construct_viewgram (stir::Viewgram< float > *&viewgram, const stir::shared_ptr< stir::ProjDataInfo > &proj_data_info_ptr, int source)
 receives a Viewgram object
void distributed::reduce_received_output_image (stir::DiscretisedDensity< 3, float > *output_image_ptr, int destination)
 the function called by the master to reduce the output image
void distributed::reduce_output_image (stir::shared_ptr< stir::DiscretisedDensity< 3, float > > &output_image_ptr, int image_buffer_size, int my_rank, int destination)
 the function called by the slaves to reduce the output image

Detailed Description

Declaration of functions in the distributed namespace.

Author
Tobias Beisel
Kris Thielemans

Macro Definition Documentation

◆ STIR_MPI_TIMINGS

#define STIR_MPI_TIMINGS

Precompiler-define that needs to be set to enable timings in the parallel version of stir::distributable_computation.

The functions in the distributable namespace can include run-time measurements included which print times from start to end of a single Send or Receive command. This will uncover some maybe unnecessary long waiting times. It was actually used while developing the parallel version to check whether some code rearrangements would lead to faster computation. To enable these timings, compile the MPI-Version with the preprocessor variable STIR_MPI_TIMINGS defined.

If compiled with STIR_MPI_TIMINGS defined, you still have the possibility to enable/disable the timings by using the parsing parameter (for stir::stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData).

enable message timings := 1

To give the printed times a threshold use

message timings threshold := 0.1