Output formatting
This commit is contained in:
parent
7e77a1f9cd
commit
e91058c2eb
@ -26,6 +26,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#endif
|
#endif
|
||||||
#include "../DataStructures/DynamicGraph.h"
|
#include "../DataStructures/DynamicGraph.h"
|
||||||
|
#include "../DataStructures/Percent.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
@ -262,7 +263,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << "Removed " << edges.size() - edge << " edges of " << edges.size() << endl;
|
cout << "ok" << endl << "removed " << edges.size() - edge << " edges of " << edges.size() << endl;
|
||||||
edges.resize( edge );
|
edges.resize( edge );
|
||||||
_graph = new _DynamicGraph( nodes, edges );
|
_graph = new _DynamicGraph( nodes, edges );
|
||||||
|
|
||||||
@ -317,6 +318,7 @@ public:
|
|||||||
void Run() {
|
void Run() {
|
||||||
const NodeID numberOfNodes = _graph->GetNumberOfNodes();
|
const NodeID numberOfNodes = _graph->GetNumberOfNodes();
|
||||||
_LogData log;
|
_LogData log;
|
||||||
|
Percent p (numberOfNodes);
|
||||||
|
|
||||||
int maxThreads = omp_get_max_threads();
|
int maxThreads = omp_get_max_threads();
|
||||||
std::vector < _ThreadData* > threadData;
|
std::vector < _ThreadData* > threadData;
|
||||||
@ -339,7 +341,7 @@ public:
|
|||||||
for ( int x = 0; x < ( int ) numberOfNodes; ++x )
|
for ( int x = 0; x < ( int ) numberOfNodes; ++x )
|
||||||
nodeData[remainingNodes[x].first].bias = x;
|
nodeData[remainingNodes[x].first].bias = x;
|
||||||
|
|
||||||
cout << "Initialise Elimination PQ... " << endl;
|
cout << "initializing elimination PQ ..." << flush;
|
||||||
_LogItem statistics0;
|
_LogItem statistics0;
|
||||||
statistics0.updating = _Timestamp();
|
statistics0.updating = _Timestamp();
|
||||||
#pragma omp parallel
|
#pragma omp parallel
|
||||||
@ -350,13 +352,13 @@ public:
|
|||||||
nodePriority[x] = _Evaluate( data, &nodeData[x], x );
|
nodePriority[x] = _Evaluate( data, &nodeData[x], x );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << "done" << endl;
|
cout << "ok" << endl;
|
||||||
|
|
||||||
statistics0.updating = _Timestamp() - statistics0.updating;
|
statistics0.updating = _Timestamp() - statistics0.updating;
|
||||||
log.Insert( statistics0 );
|
log.Insert( statistics0 );
|
||||||
|
cout << "preprocessing ..." << flush;
|
||||||
log.PrintHeader();
|
// log.PrintHeader();
|
||||||
statistics0.PrintStatistics( 0 );
|
// statistics0.PrintStatistics( 0 );
|
||||||
|
|
||||||
while ( levelID < numberOfNodes ) {
|
while ( levelID < numberOfNodes ) {
|
||||||
_LogItem statistics;
|
_LogItem statistics;
|
||||||
@ -448,7 +450,7 @@ public:
|
|||||||
timeLast = _Timestamp();
|
timeLast = _Timestamp();
|
||||||
|
|
||||||
//output some statistics
|
//output some statistics
|
||||||
statistics.PrintStatistics( iteration + 1 );
|
// statistics.PrintStatistics( iteration + 1 );
|
||||||
//LogVerbose( wxT( "Printed" ) );
|
//LogVerbose( wxT( "Printed" ) );
|
||||||
|
|
||||||
//remove contracted nodes from the pool
|
//remove contracted nodes from the pool
|
||||||
@ -456,6 +458,7 @@ public:
|
|||||||
remainingNodes.resize( firstIndependent );
|
remainingNodes.resize( firstIndependent );
|
||||||
std::vector< std::pair< NodeID, bool > >( remainingNodes ).swap( remainingNodes );
|
std::vector< std::pair< NodeID, bool > >( remainingNodes ).swap( remainingNodes );
|
||||||
log.Insert( statistics );
|
log.Insert( statistics );
|
||||||
|
p.printStatus(levelID);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int threadNum = 0; threadNum < maxThreads; threadNum++ ) {
|
for ( int threadNum = 0; threadNum < maxThreads; threadNum++ ) {
|
||||||
@ -463,8 +466,8 @@ public:
|
|||||||
delete threadData[threadNum];
|
delete threadData[threadNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
log.PrintSummary();
|
// log.PrintSummary();
|
||||||
cout << "Total Time: " << log.GetSum().GetTotalTime()<< " s" << endl;
|
// cout << "Total Time: " << log.GetSum().GetTotalTime()<< " s" << endl;
|
||||||
cout << "checking sanity of generated data ..." << flush;
|
cout << "checking sanity of generated data ..." << flush;
|
||||||
_CheckCH<_EdgeData>();
|
_CheckCH<_EdgeData>();
|
||||||
cout << "ok" << endl;
|
cout << "ok" << endl;
|
||||||
|
@ -128,7 +128,6 @@ int main (int argc, char *argv[])
|
|||||||
cout << "initializing contractor ..." << flush;
|
cout << "initializing contractor ..." << flush;
|
||||||
Contractor* contractor = new Contractor( n, edgeList );
|
Contractor* contractor = new Contractor( n, edgeList );
|
||||||
vector<ImportEdge>(edgeList.begin(), edgeList.end()).swap(edgeList); //remove excess candidates.
|
vector<ImportEdge>(edgeList.begin(), edgeList.end()).swap(edgeList); //remove excess candidates.
|
||||||
cout << "ok" << endl;
|
|
||||||
contractor->Run();
|
contractor->Run();
|
||||||
|
|
||||||
cout << "checking data sanity ..." << flush;
|
cout << "checking data sanity ..." << flush;
|
||||||
|
Loading…
Reference in New Issue
Block a user