Skip to content
Snippets Groups Projects
Commit c3391cbb authored by Guillaume Damiand's avatar Guillaume Damiand
Browse files

Update script; cleanup parallel-arrangement-bench.

parent 63749b87
No related branches found
No related tags found
No related merge requests found
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
# REPEAT is the number of runs to do for each file; computation time will be # REPEAT is the number of runs to do for each file; computation time will be
# the average of these runs. 1 by default. # the average of these runs. 1 by default.
REPEAT=1 # Number of runs; computation time will be the average REPEAT=1 # Number of runs; computation time will be the average
PROG="./src/builds/release/parallel-arrangement-bench" # Executable name PROG="./builds/release/parallel-arrangement-bench" # Executable name
if (( $# > 1 )) if (( $# > 0 ))
then
REPEAT=${1} REPEAT=${1}
fi fi
# Test function: 1st parameter: directory that contains segment files; 2nd parameter: options # Test function: 1st parameter: directory that contains segment files; 2nd parameter: options
function test { function test {
echo "######################################## ${2} ###############################" >> times.dat echo "######################################## ${REPEAT} ${2} ###############################" >> times.dat
echo "######################################## ${2} ################################" >> detailed-times.dat echo "######################################## ${REPEAT} ${2} ################################" >> detailed-times.dat
echo "######################################## ${2} ###############################" >> nbcells.dat echo "######################################## ${REPEAT} ${2} ###############################" >> nbcells.dat
for file in "${1}/"*.txt for file in "${1}/"*.txt
do do
${PROG} -t1 "${file}" -cgal -repeat ${REPEAT} ${PROG} -t1 "${file}" -cgal -repeat ${REPEAT}
# echo -n "${file} - " >> times.dat
for i in 1 2 4 8 16 32 for i in 1 2 4 8 16 32
do do
${PROG} -t1 "${file}" -nbs $((i)) -nbt ${i} -repeat ${REPEAT} ${2} ${PROG} -t1 "${file}" -nbs $((i)) -nbt $((i)) -repeat ${REPEAT} ${2}
done done
echo "" >> times.dat echo "" >> times.dat
echo "" >> detailed-times.dat echo "" >> detailed-times.dat
...@@ -36,8 +36,7 @@ echo "########################################################################## ...@@ -36,8 +36,7 @@ echo "##########################################################################
echo "################################################################################" >> nbcells.dat echo "################################################################################" >> nbcells.dat
echo "#GlobalTimes CGAL 1 2 4 8 16 32" >> times.dat echo "#GlobalTimes CGAL 1 2 4 8 16 32" >> times.dat
echo "#DetailedTimes LoadAndDispatch ComputeLocals ComputeLCC" >> detailed-times.dat echo "#DetailedTimes LoadAndDispatch ComputeLocals ComputeFaces" >> detailed-times.dat
echo "#NbCells HalfEdges Vertices Edges FiniteFaces Faces CriticalSegments" >> nbcells.dat echo "#NbCells HalfEdges Vertices Edges FiniteFaces Faces ExternalHalfedges" >> nbcells.dat
gunzip ./data/countries/*.gzip
test ./data/countries "-crop" test ./data/countries "-crop"
...@@ -36,7 +36,7 @@ endif() ...@@ -36,7 +36,7 @@ endif()
# add_definitions("-pg") # add_definitions("-pg")
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") # SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
# add_definitions("-D_GLIBCXX_DEBUG") # add_definitions("-D_GLIBCXX_DEBUG")
add_definitions("-g") # for vtune (perf evaluator) # add_definitions("-g") # for vtune (perf evaluator)
# ########################################################## # ##########################################################
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/")
......
...@@ -97,6 +97,8 @@ public: ...@@ -97,6 +97,8 @@ public:
{ return hds().number_of_halfedges()-number_of_externals(); } { return hds().number_of_halfedges()-number_of_externals(); }
std::size_t number_of_input_segments() const std::size_t number_of_input_segments() const
{ return m_nb_input_segments; } { return m_nb_input_segments; }
std::size_t number_of_vertices() const
{ return hds().number_of_vertices(); }
void clear() void clear()
{ {
......
...@@ -53,7 +53,6 @@ public: ...@@ -53,7 +53,6 @@ public:
m_xmin(0), m_ymin(0), m_xmax(0), m_ymax(0), m_xmin(0), m_ymin(0), m_xmax(0), m_ymax(0),
m_nb_strips(0), m_nb_strips(0),
m_number_segments(0), m_number_segments(0),
m_number_of_halfedges(0),
m_nb_finite_faces(0) m_nb_finite_faces(0)
{ init_all_marks(); } { init_all_marks(); }
...@@ -80,7 +79,6 @@ public: ...@@ -80,7 +79,6 @@ public:
m_xmin(0), m_ymin(0), m_xmax(0), m_ymax(0), m_xmin(0), m_ymin(0), m_xmax(0), m_ymax(0),
m_nb_strips(nb_strips), m_nb_strips(nb_strips),
m_number_segments(0), m_number_segments(0),
m_number_of_halfedges(0),
m_nb_finite_faces(0) m_nb_finite_faces(0)
{ {
init_all_marks(); init_all_marks();
...@@ -258,7 +256,7 @@ public: ...@@ -258,7 +256,7 @@ public:
void clear() void clear()
{ {
m_xmin=m_ymin=m_xmax=m_ymax=0; m_xmin=m_ymin=m_xmax=m_ymax=0;
m_nb_strips=m_number_segments=m_number_of_halfedges=0; m_nb_strips=m_number_segments=0;
for (auto it=m_tab_partial_hds.begin(), for (auto it=m_tab_partial_hds.begin(),
itend=m_tab_partial_hds.end(); it!=itend; ++it) itend=m_tab_partial_hds.end(); it!=itend; ++it)
{ delete *it; *it=nullptr; } { delete *it; *it=nullptr; }
...@@ -553,7 +551,7 @@ public: ...@@ -553,7 +551,7 @@ public:
{ {
std::size_t res=0; std::size_t res=0;
for (std::size_t i=0; i<number_of_strips(); ++i) for (std::size_t i=0; i<number_of_strips(); ++i)
{ res+=Partial_hds(i).number_of_non_externals(); } { res+=partial_hds(i).number_of_non_externals(); }
return res; return res;
} }
...@@ -565,6 +563,17 @@ public: ...@@ -565,6 +563,17 @@ public:
return res; return res;
} }
std::size_t number_of_vertices() const
{
std::size_t res=0;
for (std::size_t i=0; i<number_of_strips(); ++i)
{ res+=m_tab_partial_hds[i]->number_of_vertices(); }
return res;
}
std::size_t number_of_edges() const
{ return number_of_non_external_halfedges()/2; }
/** Count the number of used marks. /** Count the number of used marks.
* @return the number of used marks. * @return the number of used marks.
*/ */
...@@ -810,7 +819,7 @@ public: ...@@ -810,7 +819,7 @@ public:
mnb_times_reserved_marks[amark]=0; mnb_times_reserved_marks[amark]=0;
} }
// Build the faces of the given lcc (and the father/son relations between holes) // Build the faces of the given shds (and the father/son relations between holes)
// Return the number of finite faces. // Return the number of finite faces.
std::size_t build_faces_array() std::size_t build_faces_array()
{ {
...@@ -832,7 +841,7 @@ public: ...@@ -832,7 +841,7 @@ public:
for (auto it=hds(i).vertices().begin(), for (auto it=hds(i).vertices().begin(),
itend=hds(i).vertices().end(); it!=itend; ++it) itend=hds(i).vertices().end(); it!=itend; ++it)
{ {
if (!Partial_hds(i).is_external(it->first_halfedge()) && if (!partial_hds(i).is_external(it->first_halfedge()) &&
!is_marked(it->first_halfedge(), treated)) !is_marked(it->first_halfedge(), treated))
{ // first_halfedge belongs necessarily to one infinite face. { // first_halfedge belongs necessarily to one infinite face.
firsthalfedge=it->first_halfedge(); firsthalfedge=it->first_halfedge();
...@@ -1019,7 +1028,6 @@ public: ...@@ -1019,7 +1028,6 @@ public:
{ {
m_xmin=m_ymin=m_xmax=m_ymax=0.; m_xmin=m_ymin=m_xmax=m_ymax=0.;
m_number_segments=0; m_number_segments=0;
m_number_of_halfedges=0;
m_tab_partial_hds.clear(); m_tab_partial_hds.clear();
std::size_t i=0; std::size_t i=0;
...@@ -1163,7 +1171,6 @@ protected: ...@@ -1163,7 +1171,6 @@ protected:
double m_xmin, m_ymin, m_xmax, m_ymax; double m_xmin, m_ymin, m_xmax, m_ymax;
std::size_t m_nb_strips; std::size_t m_nb_strips;
std::size_t m_number_segments; std::size_t m_number_segments;
std::size_t m_number_of_halfedges;
std::size_t m_nb_finite_faces; std::size_t m_nb_finite_faces;
std::vector<Partial_hds*> m_tab_partial_hds; std::vector<Partial_hds*> m_tab_partial_hds;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "Segment_readers.h" #include "Segment_readers.h"
#include "My_visitor.h" #include "My_visitor.h"
#include "SHds.h" #include "SHds.h"
#include "SHds_to_lcc.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -260,14 +259,12 @@ int main(int argc, char** argv) ...@@ -260,14 +259,12 @@ int main(int argc, char** argv)
SHds shds(filename, nbstrips, nbthreads, optimized_strips, times, crop); SHds shds(filename, nbstrips, nbthreads, optimized_strips, times, crop);
if (i==0) if (i==0)
{ {
LCC_2 lcc;
std::size_t finite_faces=shds_to_lcc(shds, lcc); // TODO NO MORE NEED !!
std::vector<unsigned int> nbcells=lcc.count_all_cells();
fcells<<shds.number_of_halfedges()<<'\t' fcells<<shds.number_of_halfedges()<<'\t'
<<nbcells[0]<<'\t'<<nbcells[1]<<'\t' <<shds.number_of_vertices()<<'\t'
<<finite_faces<<'\t'<<nbcells[2] <<shds.number_of_edges()<<'\t'
<<'\t'<<shds.number_of_external_halfedges()<<std::endl; <<shds.number_of_finite_faces()<<'\t'
<<shds.number_of_faces()<<'\t'
<<shds.number_of_external_halfedges()<<std::endl;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment