#include <utility>
#include "BCP_string.hpp"
#include "BCP_vector.hpp"
#include "BCP_message_tag.hpp"
#include "BCP_parameters.hpp"
#include "BCP_enum_tm.hpp"
#include "BCP_enum_process_t.hpp"
Include dependency graph for BCP_tm_functions.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
#define BCP__DUMP_PROCINFO 0 |
Definition at line 15 of file BCP_tm_functions.hpp.
void BCP_tm_parse_command_line | ( | BCP_tm_prob & | p, | |
const int | argnum, | |||
const char *const * | arglist | |||
) |
Definition at line 13 of file BCP_tm_commandline.cpp.
References BCP_check_parameters(), BCP_slave_params::cg, BCP_slave_params::lp, BCP_tm_prob::par, BCP_parameter_set< Par >::read_from_arglist(), BCP_parameter_set< Par >::read_from_file(), BCP_tm_prob::slave_pars, BCP_slave_params::ts, and BCP_slave_params::vg.
Referenced by BCP_tm_main(), and BCP_single_environment::register_process().
bool BCP_tm_do_one_phase | ( | BCP_tm_prob & | p | ) |
Definition at line 305 of file BCP_tm_main.cpp.
References BCP_AnyProcess, BCP_Msg_AnyMessage, BCP_NodeStart_Error, BCP_tm_balance_data(), BCP_tm_is_data_balanced(), BCP_tm_start_new_nodes(), BCP_tm_prob::candidate_list, BCP_buffer::clear(), BCP_tm_prob::lp_scheduler, BCP_tm_prob::msg_buf, BCP_scheduler::numNodeIds(), and BCP_tm_par::TmTimeout.
Referenced by BCP_tm_main().
BCP_problem_core* BCP_tm_create_core | ( | BCP_tm_prob & | p | ) |
Definition at line 346 of file BCP_tm_main.cpp.
References BCP_ContinuousVar, BCP_tm_prob::cuts_local, e, BCP_tm_user::initialize_core(), BCP_tm_prob::next_cut_index_set_start, BCP_tm_prob::next_var_index_set_start, BCP_vec< T >::size(), BCP_tm_prob::user, and BCP_tm_prob::vars_local.
Referenced by BCP_tm_main(), and BCP_single_environment::register_process().
BCP_tm_node* BCP_tm_create_root | ( | BCP_tm_prob & | p | ) |
Definition at line 417 of file BCP_tm_main.cpp.
References BCP_obj_set_change::_change, BCP_tm_node::_core_storage, BCP_tm_node::_cut_storage, BCP_tm_node::_data, BCP_tm_node_data::_desc, BCP_obj_set_change::_new_objs, BCP_problem_core_change::_storage, BCP_tm_node_data::_user, BCP_tm_node::_var_storage, BCP_tm_node::_ws_storage, BCP_Msg_NoMessage, BCP_Storage_Explicit, BCP_Storage_NoData, BCP_Storage_WrtCore, BCP_tm_unpack_root_cut(), BCP_string::c_str(), BCP_buffer::clear(), BCP_node_change::core_change, BCP_tm_user::create_root(), BCP_node_change::cut_change, BCP_tm_prob::cuts_local, f, BCP_string::length(), BCP_tm_prob::msg_buf, BCP_tm_prob::next_cut_index_set_start, BCP_tm_prob::next_var_index_set_start, BCP_tm_prob::param(), BCP_tm_par::ReadRootCutsFrom, BCP_vec< T >::reserve(), BCP_vec< T >::size(), BCP_vec< T >::unchecked_push_back(), BCP_tm_prob::user, BCP_node_change::var_change, and BCP_tm_prob::vars_local.
Referenced by BCP_tm_main(), and BCP_single_environment::register_process().
void BCP_tm_tasks_before_new_phase | ( | BCP_tm_prob & | p | ) |
Definition at line 500 of file BCP_tm_main.cpp.
References BCP_DoNotGenerateColumns_Fathom, BCP_tm_notify_about_new_phase(), BCP_tm_trim_tree_wrapper(), BCP_tm_wrapup(), BCP_tm_prob::candidate_list, BCP_vec< T >::clear(), BCP_tm_prob::current_phase_colgen, BCP_tm_prob::has_ub(), BCP_tm_user::init_new_phase(), BCP_tm_prob::next_phase_nodes, BCP_tm_prob::param(), BCP_tm_prob::phase, BCP_vec< T >::size(), BCP_tm_par::TmVerb_NewPhaseStart, BCP_tm_par::TrimTreeBeforeNewPhase, and BCP_tm_prob::user.
Referenced by BCP_tm_main(), and BCP_single_environment::register_process().
void BCP_tm_trim_tree_wrapper | ( | BCP_tm_prob & | p, | |
const bool | between_phases | |||
) |
Definition at line 18 of file BCP_tm_trimming.cpp.
References BCP_tm_identify_process(), BCP_tm_trim_tree(), BCP_vec< T >::begin(), BCP_tree::begin(), BCP_tm_prob::candidate_list, BCP_tm_node::cg, BCP_tm_node::child_num(), BCP_tm_node::cp, BCP_vec< T >::end(), BCP_tree::end(), BCP_tree::enumerate_leaves(), BCP_tm_prob::granularity(), BCP_tm_node::index(), BCP_tm_prob::leaves_per_cp, BCP_tm_prob::leaves_per_vp, BCP_tm_node::lp, BCP_tm_prob::next_phase_nodes, BCP_tm_prob::param(), BCP_vec< T >::pop_back(), BCP_tree::root(), BCP_tm_prob::search_tree, BCP_tm_par::TmVerb_TrimmedNum, BCP_tm_prob::ub(), BCP_tm_node::vg, and BCP_tm_node::vp.
Referenced by BCP_tm_tasks_before_new_phase().
void BCP_tm_remove_explored | ( | BCP_tm_prob & | p, | |
BCP_tm_node * | node | |||
) |
Definition at line 180 of file BCP_tm_trimming.cpp.
References BCP_tm_remove_explored(), BCP_tm_node::child_num(), BCP_tm_node::index(), BCP_tm_prob::param(), BCP_tm_node::parent(), BCP_tree::remove(), BCP_tm_node::remove_child(), BCP_tm_par::RemoveExploredBranches, and BCP_tm_prob::search_tree.
Referenced by BCP_tm_free_nodes(), and BCP_tm_remove_explored().
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.
References BCP_used_heap(), BCP_tm_par::MaxHeapSize, BCP_tm_node::num_local_nodes, BCP_tm_node::num_remote_nodes, and BCP_tm_prob::param().
Referenced by BCP_tm_do_one_phase(), BCP_tm_unpack_branching_info(), and BCP_tm_unpack_node_no_branching_info().
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.
References BCP_tm_node::_data, BCP_tm_node::_data_location, BCP_tm_node_data::_desc, BCP_tm_node::_locally_stored, BCP_tm_node_data::_user, BCP_Msg_NodeList, BCP_Msg_NodeListReply, BCP_ProcessType_TS, BCP_tm_notify_process_type(), BCP_tm_scan_siblings(), BCP_used_heap(), BCP_tm_prob::candidate_list, BCP_buffer::clear(), k, BCP_tm_prob::lp_procs, BCP_tm_prob::lp_scheduler, BCP_tm_par::MaxHeapSize, BCP_scheduler::maxNodeIds(), BCP_tm_prob::msg_buf, BCP_tm_prob::msg_env, n, BCP_tm_prob::need_a_TS, BCP_tm_node::num_local_nodes, BCP_tm_node::num_remote_nodes, BCP_buffer::pack(), BCP_tm_prob::param(), BCP_message_environment::receive(), BCP_scheduler::request_node_id(), BCP_tm_prob::search_tree, BCP_message_environment::send(), BCP_tree::size(), BCP_tm_prob::ts_procs, BCP_tm_prob::ts_space, and BCP_buffer::unpack().
Referenced by BCP_tm_do_one_phase(), BCP_tm_unpack_node_no_branching_info(), and BCP_tm_unpack_node_with_branching_info().
void BCP_tm_idle_processes | ( | BCP_tm_prob & | p | ) |
Definition at line 19 of file BCP_tm_msgproc.cpp.
References BCP_Msg_FinishedBCP, BCP_tm_prob::lp_procs, BCP_tm_prob::msg_env, and BCP_message_environment::multicast().
Referenced by BCP_tm_main().
void BCP_tm_stop_processes | ( | BCP_tm_prob & | p | ) |
Definition at line 27 of file BCP_tm_msgproc.cpp.
References BCP_Msg_FinishedBCP, BCP_tm_prob::lp_procs, BCP_tm_prob::msg_env, and BCP_message_environment::multicast().
Referenced by BCP_tm_main().
void BCP_tm_start_processes | ( | BCP_tm_prob & | p | ) |
Definition at line 35 of file BCP_tm_msgproc.cpp.
References BCP_scheduler::add_free_ids(), BCP_tm_par::CgMachines, BCP_tm_par::CgProcessNum, BCP_tm_par::CpMachines, BCP_tm_par::CpProcessNum, BCP_tm_par::DebugCgProcesses, BCP_tm_par::DebugCpProcesses, BCP_tm_par::DebugLpProcesses, BCP_tm_par::DebugVgProcesses, BCP_tm_par::DebugVpProcesses, BCP_tm_par::ExecutableName, BCP_tm_prob::lp_procs, BCP_tm_prob::lp_scheduler, BCP_tm_par::LpMachines, BCP_tm_par::LpProcessNum, BCP_tm_prob::msg_env, BCP_tm_prob::param(), BCP_vec< T >::size(), BCP_message_environment::start_processes(), BCP_tm_par::VgMachines, BCP_tm_par::VgProcessNum, BCP_tm_par::VpMachines, and BCP_tm_par::VpProcessNum.
Referenced by BCP_tm_main().
bool BCP_tm_test_machine | ( | BCP_tm_prob & | p | ) |
Definition at line 521 of file BCP_tm_msgproc.cpp.
References BCP_message_environment::alive(), BCP_tm_remove_cg(), BCP_tm_remove_lp(), BCP_tm_remove_vg(), and BCP_tm_prob::msg_env.
Referenced by BCP_tm_prob::process_message().
void BCP_tm_modify_pool_counters | ( | BCP_tm_prob & | p, | |
BCP_tm_node * | node | |||
) |
Definition at line 569 of file BCP_tm_msgproc.cpp.
References BCP_tm_identify_process(), BCP_tm_node::cp, BCP_vec< T >::end(), BCP_tm_prob::leaves_per_cp, BCP_tm_prob::leaves_per_vp, and BCP_tm_node::vp.
Referenced by BCP_tm_free_nodes().
void BCP_tm_remove_lp | ( | BCP_tm_prob & | p, | |
const int | index | |||
) |
Definition at line 602 of file BCP_tm_msgproc.cpp.
References BCP_tm_prob::active_nodes, BCP_CandidateNode, BCP_tm_identify_process(), BCP_tm_prob::candidate_list, BCP_tm_node::cg, BCP_tm_node::cp, BCP_vec< T >::end(), BCP_tm_prob::leaves_per_cp, BCP_tm_prob::leaves_per_vp, BCP_tm_node::lp, BCP_tm_node::status, BCP_tm_node::vg, and BCP_tm_node::vp.
Referenced by BCP_tm_assign_processes(), BCP_tm_remove_cg(), BCP_tm_remove_vg(), and BCP_tm_test_machine().
void BCP_tm_remove_cg | ( | BCP_tm_prob & | p, | |
const int | index | |||
) |
Definition at line 655 of file BCP_tm_msgproc.cpp.
References BCP_tm_remove_lp().
Referenced by BCP_tm_assign_processes(), and BCP_tm_test_machine().
void BCP_tm_remove_vg | ( | BCP_tm_prob & | p, | |
const int | index | |||
) |
Definition at line 662 of file BCP_tm_msgproc.cpp.
References BCP_tm_remove_lp().
Referenced by BCP_tm_assign_processes(), and BCP_tm_test_machine().
void BCP_tm_notify_about_new_phase | ( | BCP_tm_prob & | p | ) |
Definition at line 110 of file BCP_tm_msgproc.cpp.
References BCP_Msg_NextPhaseStarts, BCP_tm_prob::lp_procs, BCP_tm_prob::msg_env, and BCP_message_environment::multicast().
Referenced by BCP_tm_tasks_before_new_phase().
void BCP_tm_notify_process_type | ( | BCP_tm_prob & | p, | |
BCP_process_t | ptype, | |||
int | num, | |||
const int * | pids | |||
) |
Definition at line 163 of file BCP_tm_msgproc.cpp.
Referenced by BCP_tm_balance_data(), BCP_tm_change_config(), BCP_tm_notify_process_type(), and BCP_tm_notify_processes().
void BCP_tm_notify_processes | ( | BCP_tm_prob & | p | ) |
Definition at line 210 of file BCP_tm_msgproc.cpp.
References BCP_ProcessType_CG, BCP_ProcessType_CP, BCP_ProcessType_LP, BCP_ProcessType_VG, BCP_ProcessType_VP, BCP_tm_notify_process_type(), and BCP_tm_prob::lp_procs.
Referenced by BCP_tm_main().
void BCP_tm_unpack_priced_root | ( | BCP_tm_prob & | p, | |
BCP_buffer & | buf | |||
) |
Definition at line 672 of file BCP_tm_msgproc.cpp.
References BCP_tm_prob::active_nodes, BCP_tm_free_procs_of_node(), BCP_tm_prob::flags, BCP_tm_node::lp, BCP_tree::root(), BCP_tm_flags::root_pricing_unpacked, and BCP_tm_prob::search_tree.
void BCP_tm_free_procs_of_node | ( | BCP_tm_prob & | p, | |
BCP_tm_node * | node | |||
) |
Definition at line 690 of file BCP_tm_msgproc.cpp.
References BCP_tm_node::cg, BCP_tm_node::lp, BCP_tm_prob::lp_scheduler, BCP_scheduler::release_node_id(), and BCP_tm_node::vg.
Referenced by BCP_tm_unpack_branching_info(), BCP_tm_unpack_node_no_branching_info(), and BCP_tm_unpack_priced_root().
void BCP_tm_send_node | ( | BCP_tm_prob & | p, | |
const BCP_tm_node * | node, | |||
const BCP_message_tag | msgtag | |||
) |
void BCP_print_memusage | ( | BCP_tm_prob & | p | ) |
Definition at line 94 of file BCP_tm_msg_node_rec.cpp.
References BCP_used_heap().
Referenced by BCP_tm_start_one_node(), BCP_tm_unpack_branching_info(), and BCP_tm_unpack_node_no_branching_info().
BCP_vec<int>* BCP_tm_unpack_noncore_vars | ( | USER_packing & | user, | |
BCP_buffer & | buf, | |||
BCP_var_set_change & | var_ch, | |||
BCP_vec< BCP_var * > & | varlist | |||
) |
BCP_vec<int>* BCP_tm_unpack_noncore_cuts | ( | USER_packing & | user, | |
BCP_buffer & | buf, | |||
BCP_cut_set_change & | cut_ch, | |||
BCP_vec< BCP_cut * > & | cutlist | |||
) |
void BCP_tm_unpack_node_with_branching_info | ( | BCP_tm_prob & | p, | |
BCP_buffer & | buf | |||
) |
Definition at line 688 of file BCP_tm_msg_node_rec.cpp.
References BCP_tm_balance_data(), BCP_tm_print_info_line(), BCP_tm_unpack_branching_info(), BCP_tm_unpack_node_description(), BCP_tm_prob::need_a_TS, and BCP_tm_prob::search_tree.
Referenced by BCP_tm_prob::process_message().
BCP_tm_node* BCP_tm_unpack_node_no_branching_info | ( | BCP_tm_prob & | p, | |
BCP_buffer & | buf | |||
) |
Definition at line 702 of file BCP_tm_msg_node_rec.cpp.
References BCP_print_memusage(), BCP_tm_balance_data(), BCP_tm_free_procs_of_node(), BCP_tm_is_data_balanced(), BCP_tm_print_info_line(), BCP_tm_unpack_node_description(), BCP_tm_prob::need_a_TS, and BCP_tm_prob::search_tree.
Referenced by BCP_tm_prob::process_message().
BCP_vec< std::pair<int, int> >::iterator BCP_tm_identify_process | ( | BCP_vec< std::pair< int, int > > & | proclist, | |
int | proc | |||
) |
Definition at line 16 of file BCP_tm_functions.cpp.
References BCP_vec< T >::begin().
Referenced by BCP_tm_modify_pool_counters(), BCP_tm_remove_lp(), BCP_tm_trim_tree(), BCP_tm_trim_tree_wrapper(), and BCP_tm_unpack_branching_info().
bool BCP_tm_assign_processes | ( | BCP_tm_prob & | p, | |
BCP_tm_node * | node | |||
) |
Definition at line 31 of file BCP_tm_functions.cpp.
References BCP_message_environment::alive(), BCP_tm_assign_processes(), BCP_tm_remove_cg(), BCP_tm_remove_lp(), BCP_tm_remove_vg(), BCP_tm_node::cg, BCP_tm_node::cp, lp, BCP_tm_node::lp, BCP_tm_prob::lp_scheduler, BCP_tm_prob::msg_env, BCP_scheduler::request_node_id(), BCP_tm_node::vg, and BCP_tm_node::vp.
Referenced by BCP_tm_assign_processes(), and BCP_tm_start_one_node().
BCP_node_start_result BCP_tm_start_new_nodes | ( | BCP_tm_prob & | p | ) |
Definition at line 267 of file BCP_tm_functions.cpp.
References BCP_NodeStart_Error, BCP_NodeStart_NoNode, BCP_NodeStart_OK, BCP_tm_free_nodes(), BCP_tm_start_one_node(), BCP_scheduler::has_free_node_id(), and BCP_tm_prob::lp_scheduler.
Referenced by BCP_tm_do_one_phase(), and BCP_single_environment::register_process().
void BCP_tm_list_candidates | ( | BCP_tm_prob & | p | ) |
void BCP_check_parameters | ( | BCP_tm_prob & | p | ) |
Definition at line 305 of file BCP_tm_functions.cpp.
References BCP_free_mem(), BCP_slave_params::cg, BCP_cg_par::CgVerb_First, BCP_cg_par::CgVerb_Last, BCP_parameter_set< Par >::entry(), BCP_slave_params::lp, BCP_lp_par::LpVerb_First, BCP_lp_par::LpVerb_Last, BCP_tm_par::MaxHeapSize, BCP_ts_par::MaxHeapSize, BCP_tm_prob::par, BCP_tm_prob::param(), BCP_tm_par::ReportWhenDefaultIsExecuted, BCP_lp_par::ReportWhenDefaultIsExecuted, BCP_cg_par::ReportWhenDefaultIsExecuted, BCP_vg_par::ReportWhenDefaultIsExecuted, BCP_parameter_set< Par >::set_entry(), BCP_tm_prob::slave_pars, BCP_tm_par::TmVerb_BestFeasibleSolution, BCP_tm_par::TmVerb_FinalStatistics, BCP_tm_par::TmVerb_First, BCP_tm_par::TmVerb_Last, BCP_slave_params::ts, BCP_tm_prob::ub(), BCP_tm_par::UpperBound, BCP_tm_par::VerbosityShutUp, and BCP_slave_params::vg.
Referenced by BCP_tm_parse_command_line().
void BCP_sanity_checks | ( | BCP_tm_prob & | p | ) |
Definition at line 377 of file BCP_tm_functions.cpp.
Referenced by BCP_tm_main(), and BCP_single_environment::register_process().
void BCP_tm_save_root_cuts | ( | BCP_tm_prob * | tm | ) |
Definition at line 37 of file BCP_tm_statistics.cpp.
References BCP_tm_node::_data, BCP_tm_node_data::_desc, BCP_obj_set_change::_new_objs, BCP_Storage_Explicit, BCP_tm_pack_root_cut(), BCP_string::c_str(), BCP_buffer::clear(), BCP_tm_prob::cuts_local, BCP_tm_prob::cuts_remote, f, BCP_string::length(), BCP_tm_prob::msg_buf, BCP_tm_prob::param(), BCP_tm_prob::phase, BCP_tree::root(), BCP_tm_par::SaveRootCutsTo, BCP_tm_prob::search_tree, BCP_vec< T >::size(), and BCP_obj_set_change::storage().
Referenced by BCP_tm_wrapup().
void BCP_tm_wrapup | ( | BCP_tm_prob * | tm, | |
BCP_lp_prob * | lp, | |||
BCP_cg_prob * | cg, | |||
BCP_vg_prob * | vg, | |||
bool | final_stat | |||
) |
Definition at line 71 of file BCP_tm_statistics.cpp.
References BCP_lp_statistics::add(), BCP_message_environment::alive(), BCP_Msg_LpStatistics, BCP_Msg_NoMessage, BCP_tm_save_root_cuts(), BCP_tm_user::display_final_information(), lp, BCP_tm_prob::lp_procs, BCP_tm_prob::lp_scheduler, BCP_tm_prob::lp_stat, BCP_tm_prob::msg_buf, BCP_tm_prob::msg_env, BCP_buffer::msgtag(), BCP_scheduler::node_idle(), BCP_tm_stat::print(), BCP_message_environment::receive(), BCP_scheduler::sb_idle(), BCP_tm_prob::stat, BCP_lp_statistics::unpack(), and BCP_tm_prob::user.
Referenced by BCP_tm_main(), BCP_tm_tasks_before_new_phase(), and BCP_single_environment::register_process().