STIR
6.2.0
|
This implements the Worker for the stir::distributable_computation() function. More...
#include "stir/recon_buildblock/DistributedWorker.h"
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() | |
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.
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.
|
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().