Macros | Functions
BCP_tm_nodes_to_storage.cpp File Reference
#include "BCP_os.hpp"
#include "BCP_tm.hpp"
#include "BCP_tm_node.hpp"
#include "BCP_tm_user.hpp"
#include "BCP_tm_functions.hpp"
Include dependency graph for BCP_tm_nodes_to_storage.cpp:

Go to the source code of this file.

Macros

#define NUMNODES_BASED_ON_BUFSIZE
 

Functions

static bool BCP_tm_scan_children (BCP_tm_prob &p, BCP_tm_node *node, std::vector< BCP_tm_node * > &nodes_to_send, const long bufsize)
 
static bool BCP_tm_scan_siblings (BCP_tm_prob &p, BCP_tm_node *node, std::vector< BCP_tm_node * > &nodes_to_send, const long bufsize)
 
bool BCP_tm_is_data_balanced (BCP_tm_prob &p)
 This function is invoked from exactly one place, the beginning of BCP_tm_unpack_node_description(). More...
 
bool BCP_tm_balance_data (BCP_tm_prob &p)
 This function is invoked after data from an LP is unpacked (and only if p.need_a_TS is true). More...
 

Macro Definition Documentation

#define NUMNODES_BASED_ON_BUFSIZE

Definition at line 10 of file BCP_tm_nodes_to_storage.cpp.

Function Documentation

static bool BCP_tm_scan_children ( BCP_tm_prob p,
BCP_tm_node node,
std::vector< BCP_tm_node * > &  nodes_to_send,
const long  bufsize 
)
static

Definition at line 14 of file BCP_tm_nodes_to_storage.cpp.

static bool BCP_tm_scan_siblings ( BCP_tm_prob p,
BCP_tm_node node,
std::vector< BCP_tm_node * > &  nodes_to_send,
const long  bufsize 
)
static

Definition at line 49 of file BCP_tm_nodes_to_storage.cpp.

bool BCP_tm_is_data_balanced ( BCP_tm_prob p)

This function is invoked from exactly one place, the beginning of BCP_tm_unpack_node_description().

So any time when data is received we call this function to decide if data balancing is needed or not. There may be another call from BCP_tm_do_one_phase() to keep the TM busy if it's idle.

Definition at line 98 of file BCP_tm_nodes_to_storage.cpp.

bool BCP_tm_balance_data ( BCP_tm_prob p)

This function is invoked after data from an LP is unpacked (and only if p.need_a_TS is true).

And maybe from BCP_tm_do_one_phase() to keep the TM busy if it's idle. It returns true/false depending on whether further balancing is needed.

First we try to get hold of a TS. This might come from an existing TS or we might try to convert an LP into a TS. If neither succeeds we leave the flag on and return. The flag will ensure that no LP will be allowed to dive until the flag is cleared. Therefore the LP that has sent the data that triggered the call to to this function through the call to BCP_tm_unpack_node_description() will be free when the next LP sends some data. So at that time we will be able to balance. (NOTE: if the TM is idle, we might invoke this routine to do some useful work.)

If we managed to get hold of a TS then we do the balancing

Definition at line 138 of file BCP_tm_nodes_to_storage.cpp.