26 int my_id,
int parent,
double ub)
46 char *logname =
new char[len + 300];
47 memcpy(logname, log.
c_str(), len);
48 memcpy(logname + len,
"-vg-", 4);
51 len = strlen(logname);
53 sprintf(logname + len,
"%i", static_cast<int>(
GETPID));
54 logfile = freopen(logname,
"a", stdout);
56 fprintf(stderr,
"Error while redirecting stdout: %i\n", errno);
59 setvbuf(logfile, NULL, _IOLBF, 0);
62 setvbuf(stdout, NULL, _IOLBF, 0);
150 printf(
"Unknown message type arrived to VG: %i\n",
msg_buf.
msgtag());
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
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_vg_user * user
The user object holding the user's data.
BCP_buffer & pack(const T &value)
Pack a single object of type T.
Used when receiving, message with any message tag will be received.
Used to indicate that there is no message in the buffer of a process.
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
The "nice" level the process should run at.
virtual void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)=0
Blocking receive with timeout.
BCP_process_t BCP_vg_main(BCP_message_environment *msg_env, USER_initialize *user_init, int my_id, int parent, double ub)
virtual void unpack_dual_solution(BCP_buffer &buf)
Unpack the LP solution arriving from the LP process.
This is an abstract base class that describes the message passing environment.
BCP_process_t
This enumerative constant describes the various process types.
BCP_message_environment * msg_env
The message passing environment.
char entry(const chr_params key) const
const char * c_str() const
virtual BCP_user_pack * packer_init(BCP_user_class *p)
The TM sends the description of the core formulation to the slave process.
int sender() const
Return a const pointer to the process id of the sender of the message in the buffer.
The TM sends the process type to the process (LP, Cut Generator, etc.)
int phase
The phase the algorithm is in.
BCP_buffer msg_buf
The message buffer of the Variable Generator process.
void unpack(BCP_buffer &buf)
Unpack the contents of the core description from the buffer.
Pack only dual variables currently at nonzero level.
#define setpriority(x, y, z)
This class is a very simple impelementation of a constant length string.
void setVgProblemPointer(BCP_vg_prob *ptr)
Set the pointer.
int sender
The process id of the LP process that sent the solution.
The user packed everything.
bool BCP_vg_process_message(BCP_vg_prob &p, BCP_buffer &buf)
This class is an abstract base class for the initializer class the user has to provide.
int node_index
The index of search tree node where the solution was generated.
BCP_user_class * user_class
A pointer ot the usr class of the process from which the methods of this class are invoked from...
#define gethostname(x, y)
The TM sends the appropriate parameters to the slave process.
The TM sends the initial user packed information to the slave process.
TM warns an LP process that the second phase will start.
void clear()
Completely clear the buffer.
virtual BCP_vg_user * vg_init(BCP_vg_prob &p)
BCP_parameter_set< BCP_vg_par > par
The parameters controlling the Variable Generator process.
virtual void generate_vars(BCP_vec< BCP_cut * > &cuts, BCP_vec< double > &pi)
Perform the actual variable generation.
BCP_message_tag msgtag() const
Return the message tag of the message in the buffer.
BCP_problem_core * core
The description of the core of the problem.
Currently there isn't any error handling in BCP.
bool probe_messages()
Test if there is a message in the message queue waiting to be processed.
int node_level
The level of search tree node where the solution was generated.
This class describes the message buffer used for all processes of BCP.
No more (improving) variables could be found.
int node_iteration
The iteration within the search tree node where the solution was generated.
void unpack(BCP_buffer &buf)
Unpack the parameter set from the buffer.
BCP_user_pack * packer
A class that holds the methods about how to pack things.
BCP_vec< BCP_cut * > cuts
Variables are to be generated for the LP solution given by these cuts and their values (next member)...
Any process to TM or TM to any process: a new upper bound found.
virtual bool alive(const int pid)=0
Test if the process given by the argument is alive or not.
This class is the central class of the Variable Generator process.
double upper_bound
The proc id of the Tree Manager.
BCP_vec< double > pi
The dual values corresponding to the cuts above.
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the Variable Generator process by the Tree Manager...
virtual void process_message()
CouExpr & log(CouExpr &e)