11#ifndef __stir_recon_buildblock_DistributedFunctions_h__
12#define __stir_recon_buildblock_DistributedFunctions_h__
43# define STIR_MPI_TIMINGS
123void send_string(
const std::string& str,
int tag,
int destination);
164void send_projectors(
const stir::shared_ptr<stir::ProjectorByBinPair>& proj_pair_sptr,
int destination);
178void send_image_parameters(
const stir::DiscretisedDensity<3, float>* input_image_ptr,
int tag,
int destination);
187void send_image_estimate(
const stir::DiscretisedDensity<3, float>* input_image_ptr,
int destination);
226void send_viewgram(
const stir::Viewgram<float>& viewgram,
int destination);
339 stir::shared_ptr<stir::ProjDataInfo>& proj_data_info_sptr,
364 const stir::shared_ptr<stir::ProjDataInfo>& proj_data_info_ptr,
365 const stir::shared_ptr<stir::DataSymmetriesForViewSegmentNumbers> symmetries_sptr,
382 const stir::shared_ptr<stir::ProjDataInfo>& proj_data_info_ptr,
402void reduce_output_image(stir::shared_ptr<stir::DiscretisedDensity<3, float>>& output_image_ptr,
403 int image_buffer_size,
410const int INT_TAG = 7;
412const int STIR_MPI_CONF_TAG = 9;
413const int IMAGE_ESTIMATE_TAG = 23;
414const int IMAGE_PARAMETER_TAG = 24;
415const int VIEWGRAM_DIMENSIONS_TAG = 27;
416const int VIEWGRAM_TAG = 28;
417const int VIEWGRAM_COUNT_TAG = 29;
418const int PROJECTION_DATA_INFO_TAG = 30;
419const int PARAMETER_INFO_TAG = 21;
420const int REGISTERED_NAME_TAG = 25;
defines the stir::DiscretisedDensity class
Declaration of class stir::ProjDataInfo.
Declares class stir::ProjectorByBinPair.
Declaration of class stir::Viewgram.
defines the stir::VoxelsOnCartesianGrid class
Namespace for distributed computation with MPI.
void 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
Definition distributed_functions.cxx:833
void send_view_segment_numbers(const stir::ViewSegmentNumbers &vs_num, int tag, int destination)
send or broadcast ViewSegmentNumbers object
Definition distributed_functions.cxx:218
void send_int_values(int *values, int count, int tag, int destination)
sends or broadcasts some integer values
Definition distributed_functions.cxx:161
MPI_Status receive_double_values(double *values, int count, int tag)
receives some double values
Definition distributed_functions.cxx:642
bool first_iteration
some stuff in distributable_computation needs to be done only in the first iteration
Definition distributed_functions.cxx:54
void send_projectors(const stir::shared_ptr< stir::ProjectorByBinPair > &proj_pair_sptr, int destination)
send or broadcast a projector-pair object
Definition distributed_functions.cxx:457
bool test
enable/disable tests
Definition distributed_functions.cxx:47
MPI_Status 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
Definition distributed_functions.cxx:745
std::string receive_string(int tag, int source)
receives a string
Definition distributed_functions.cxx:496
double total_rpc_time_2
adding up the time used for PRC_process_related_viewgrams_gradient() computation at all slaves
Definition distributed_functions.cxx:46
double total_rpc_time_slaves
adding up the time used for PRC_process_related_viewgrams_gradient() computation at a single slave
Definition distributed_functions.cxx:45
bool test_send_receive_times
enable timings for PRC_process_related_viewgrams_gradient() computation
Definition distributed_functions.cxx:41
void send_image_parameters(const stir::DiscretisedDensity< 3, float > *input_image_ptr, int tag, int destination)
sends or broadcasts the parameters of a DiscretisedDensity object
Definition distributed_functions.cxx:227
void 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
Definition distributed_functions.cxx:779
void send_related_viewgrams(stir::RelatedViewgrams< float > *viewgrams, int destination)
sends a RelatedViegrams object
Definition distributed_functions.cxx:397
void send_double_values(double *values, int count, int tag, int destination)
send or broadcast double values
Definition distributed_functions.cxx:190
void receive_and_initialize_projectors(stir::shared_ptr< stir::ProjectorByBinPair > &projector_pair_ptr, int source)
receives all needed information to subsequently construct a ProjectorByBinPair object
Definition distributed_functions.cxx:524
const int ARBITRARY_TAG
special tag, equivalent to MPI_ANY_TAG in some functions
Definition distributed_functions.h:411
void 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
Definition distributed_functions.cxx:956
MPI_Status receive_int_values(int *values, int count, int tag)
receives some integer values
Definition distributed_functions.cxx:612
void receive_and_construct_viewgram(stir::Viewgram< float > *&viewgram, const stir::shared_ptr< stir::ProjDataInfo > &proj_data_info_ptr, int source)
receives a Viewgram object
Definition distributed_functions.cxx:863
bool receive_bool_value(int tag, int source)
receives a bool value
Definition distributed_functions.cxx:584
double min_threshold
value to reduce the total_rpc_time values
Definition distributed_functions.cxx:44
MPI_Status receive_view_segment_numbers(stir::ViewSegmentNumbers &vs_num, int tag)
receive a ViewSegmentNumbers object
Definition distributed_functions.cxx:669
int receive_int_value(int source)
receives a single integer value
Definition distributed_functions.cxx:469
void send_int_value(int value, int destination)
threshold for displaying send/receive times, initially set to 0.1 seconds
Definition distributed_functions.cxx:66
void send_bool_value(bool value, int tag, int destination)
send or broadcast a bool value
Definition distributed_functions.cxx:131
void 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
Definition distributed_functions.cxx:679
double total_rpc_time
enable timings for every single send/receive operation
Definition distributed_functions.cxx:43
void send_image_estimate(const stir::DiscretisedDensity< 3, float > *input_image_ptr, int destination)
sends or broadcasts the values of a DiscretisedDensity object
Definition distributed_functions.cxx:302
void reduce_received_output_image(stir::DiscretisedDensity< 3, float > *output_image_ptr, int destination)
the function called by the master to reduce the output image
Definition distributed_functions.cxx:908
void send_viewgram(const stir::Viewgram< float > &viewgram, int destination)
sends a Viewgram object
Definition distributed_functions.cxx:416
void 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
Definition distributed_functions.cxx:338
void send_string(const std::string &str, int tag, int destination)
sends or broadcasts a string
Definition distributed_functions.cxx:92
int num_processors
the number of processes used for distributed computation
Definition distributed_functions.cxx:50
Namespace for the STIR library (and some/most of its applications)
Definition General_Reconstruction.h:19
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...