|
From: | Antonello Lobianco |
Subject: | [Help-glpk] Error detected in file glplib10.c at line 109 |
Date: | Thu, 19 Nov 2009 16:45:27 +0100 |
void
Manager_agents::aFunction(){
int nThreads = 1; // nThreads = 1, as for now glpk in not reendrant
for (int i=0; i < nThreads; i++){
ThreadClass* wThread = new ThreadClass;
wThreads.push_back(wThread);
}
vector<double> outputs (agents.size(), ((double)0));
for (uint y=0;y<agents.size();y++){
volatile bool assigned = false;
while(!assigned) {
for (uint z=0;z<wThreads.size();z++){
if (!wThreads[z]->isRunning()){
wThreads[z]->assignJob(agents[y]); // this is run serialised in the main working thread !
wThreads[z]->start(); // parallel threads
assigned = true;
}
}
}
}
// Be sure that all threads have ended their last job before continue..
for (int z=0; z <wThreads.size(); z++){
wThreads[z]->wait();
}
for ( int z=0; z< agents.size(); z++){
outputs[z] = agents->getOutput();
}
}
Manager_farmers_threads::Manager_farmers_threads(){
}
void
Manager_farmers_threads::run(){
agent->solve(); // -> call the PDF documentation example (content of the main function)
}
void
Manager_farmers_threads::assignJob(Agent_space* agent_h){
agent = agent_h;
agent -> cachedOutput = 0;
}
[...]
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
* 0: obj = 0.000000000e+00 infeas = 0.000e+00 (0)
* 2: obj = 7.333333333e+02 infeas = 0.000e+00 (0)
OPTIMAL SOLUTION FOUND
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
* 0: obj = 0.000000000e+00 infeas = 0.000e+00 (0)
* 2: obj = 7.333333333e+02 infeas = 0.000e+00 (0)
OPTIMAL SOLUTION FOUND
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
* 0: obj = 0.000000000e+00 infeas = 0.000e+00 (0)
* 2: obj = 7.333333333e+02 infeas = 0.000e+00 (0)
OPTIMAL SOLUTION FOUND
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
* 0: obj = 0.000000000e+00 infeas = 0.000e+00 (0)
* 2: obj = 7.333333333e+02 infeas = 0.000e+00 (0)
OPTIMAL SOLUTION FOUND
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
Assertion failed: xlcmp(env->t_last, t) <= 0
Error detected in file glplib10.c at line 109
[Prev in Thread] | Current Thread | [Next in Thread] |