10 #define NUMNODES_BASED_ON_BUFSIZE
15 std::vector<BCP_tm_node*>& nodes_to_send,
18 #ifndef NUMNODES_BASED_ON_BUFSIZE
19 const size_t send_size = 100;
22 for (
int i = children.
size() - 1; i >= 0; --i) {
34 bool has_user_data = node->
_data.
_user.IsValid();
40 #ifndef NUMNODES_BASED_ON_BUFSIZE
41 return (nodes_to_send.size() >= send_size);
50 std::vector<BCP_tm_node*>& nodes_to_send,
53 #ifndef NUMNODES_BASED_ON_BUFSIZE
54 const size_t send_size = 100;
57 nodes_to_send.push_back(node);
61 bool has_user_data = node->
_data.
_user.IsValid();
66 #ifndef NUMNODES_BASED_ON_BUFSIZE
67 if (nodes_to_send.size() >= send_size)
79 for (
int i = siblings.
size() - 1; i >= 0; --i) {
81 if (s == node || s == NULL)
114 const double freeheap = maxheap - usedheap;
115 printf(
"free: %f used: %f free/max: %f\n",
116 freeheap, usedheap, freeheap/maxheap);
117 return (freeheap > 1<<24 && freeheap / maxheap > 0.15);
147 for (std::map<int,int>::const_iterator tsi = p.
ts_space.begin();
149 if (tsi->second > max_space) {
150 max_space = tsi->second;
154 if (max_space < 1 << 22 ) {
167 std::vector<int>::iterator ipid =
171 Trying to convert an LP into TS, but its pid is not in lp_procs!\n");
175 printf(
"Turning LP (#%i) into a TS\n", pid);
189 std::vector<BCP_tm_node*> nodes_to_send;
190 const std::vector<CoinTreeSiblings*>& candList =
193 dynamic_cast<BCP_tm_node*
>(candList.back()->currentNode());
199 assert(usedheap > 0);
202 int freeheap = maxheap - usedheap;
203 printf(
"Before sending off: freeheap: %i usedheap: %i\n",
207 int num = nodes_to_send.size();
213 buf.
pack(fake_index);
216 int saved = 0, fm = 0;
221 for (
int i = 0; i < saved; ++i) {
222 node = nodes_to_send[i];
228 nodes_to_send.clear();
231 freeheap = maxheap - usedheap;
232 printf(
"After sending off: freeheap: %i usedheap: %i\n",
BCP_buffer msg_buf
members to measure how long it took to process the root node.
virtual void send(const int target, const BCP_message_tag tag)=0
Send an empty message (message tag only) to the process given by the frist argument.
BCP_buffer & pack(const T &value)
Pack a single object of type T.
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 int num_local_nodes
void BCP_tm_notify_process_type(BCP_tm_prob &p, BCP_process_t ptype, int num, const int *pids)
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
virtual void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)=0
Blocking receive with timeout.
Print out a message when the default version of an overridable method is executed.
int maxNodeIds() const
Return the maximum possible number of busy LP processes.
BCP_vec< BCP_tm_node * > _children
static int num_remote_nodes
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().
CoinSearchTreeManager candidate_list
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)...
void push_back(const_reference x)
Append x to the end of the vector.
Coin::SmartPtr< BCP_node_change > _desc
std::vector< int > ts_procs
members to measure how long it took to process the root node.
static long BCP_used_heap()
int request_node_id()
Request an id for processing nodes.
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real * s
void clear()
Completely clear the buffer.
Coin::SmartPtr< BCP_user_data > _user
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)
Currently there isn't any error handling in BCP.
BCP_message_environment * msg_env
A class that holds the methods about how to pack things.
BCP_user_pack * packer
A class that holds the methods about how to pack things.
The maximum size of the memory heap the TM can use.
size_t size() const
Return the current number of entries.
std::vector< int > lp_procs
members to measure how long it took to process the root node.
This class describes the message buffer used for all processes of BCP.
BCP_scheduler lp_scheduler
members to measure how long it took to process the root node.
std::map< int, int > ts_space
virtual void pack_user_data(const BCP_user_data *ud, BCP_buffer &buf)
Pack an user data.
char param(BCP_tm_par::chr_params key) const
int size() const
Return the size of the current message in the buffer.