STIR  6.2.0
Public Member Functions | Protected Member Functions | List of all members
stir::DistributedWorker< TargetT > Class Template Reference

This implements the Worker for the stir::distributable_computation() function. More...

#include "stir/recon_buildblock/DistributedWorker.h"

Inheritance diagram for stir::DistributedWorker< TargetT >:
Inheritance graph
[legend]

Public Member Functions

void start ()
 Infinite loop waiting for tasks from the master.
 
- Public Member Functions inherited from stir::TimedObject
void reset_timers ()
 reset all timers kept by this object
 
void stop_timers () const
 stop all timers kept by this object More...
 
void start_timers (bool do_reset=false) const
 start all timers kept by this object More...
 
double get_CPU_timer_value () const
 get current value of the CPU timer (since first use or last reset)
 
double get_wall_clock_timer_value () const
 get current value of the wall-clock timer (since first use or last reset)
 

Protected Member Functions

void set_defaults ()
 sets defaults for this object
 
void setup_distributable_computation ()
 Get basic information from the master. More...
 
void distributable_computation (RPC_process_related_viewgrams_type *RPC_process_related_viewgrams)
 this does the actual computation corresponding to distributable_computation()
 

Detailed Description

template<class TargetT>
class stir::DistributedWorker< TargetT >

This implements the Worker for the stir::distributable_computation() function.

The start() method is an infinite loop waiting for a task from the master. Very few tasks are implemented at the moment: set_up, compute, stop.

The distributable_computation() function does the actual work. It is the slave-part of stir::distributable_computation() which runs on the master. It is a loop receiving the related viewgrams and calling an RPC_process_related_viewgrams_type function with the received values. When an end_iteration_notification is received, it calls the reduction of the output_image.

In each inner loop the worker first receives the vs_num and the information whether this is a new viewgram or a previously received viewgram. The latter case only emerges if distributed caching is enabled. If so, the worker does not have to receive the related viewgrams, but just gets it from its saved viewgrams.

Todo:

The log_likelihood_ptr argument to the RPC function is currently always NULL.

Currently the only computation that is supported corresponds to the gradient computation. It would be trivial to add others.

Member Function Documentation

◆ setup_distributable_computation()

template<typename TargetT >
void stir::DistributedWorker< TargetT >::setup_distributable_computation ( )
protected

Get basic information from the master.

It sets up all needed objects by communicating with the master.

The following objects are set up:

Additionally some values for testing are set up.

References distributed::receive_and_set_image_parameters(), and distributed::receive_bool_value().


The documentation for this class was generated from the following files: