Commit 6081b482 authored by Kirill Terekhov's avatar Kirill Terekhov

Fix for kmeans partitioner

parent 6318a6b6
...@@ -1265,8 +1265,10 @@ namespace INMOST ...@@ -1265,8 +1265,10 @@ namespace INMOST
} }
if( package == 3 ) //KMEANS if( package == 3 ) //KMEANS
{ {
int total_points = 0; int total_points = 0;
int K = (int)m->GetProcessorsNumber(); //number of clusters int K = (int)m->GetProcessorsNumber(); //number of clusters
//std::cout << "Start K-means on " << m->GetProcessorRank() << " clusters " << K << std::endl;
int max_iterations = 100; int max_iterations = 100;
#if defined(USE_OMP) #if defined(USE_OMP)
#pragma omp parallel for reduction(+:total_points) #pragma omp parallel for reduction(+:total_points)
...@@ -1553,7 +1555,7 @@ namespace INMOST ...@@ -1553,7 +1555,7 @@ namespace INMOST
#pragma omp parallel for #pragma omp parallel for
#endif #endif
for(int j = 0; j < total_points; ++j) for(int j = 0; j < total_points; ++j)
mat[m->CellByLocalID(points_node[j])] = points_cluster[j]+1; mat[m->CellByLocalID(points_node[j])] = points_cluster[j];
//m->ExchangeData(mat,CELL,0); //m->ExchangeData(mat,CELL,0);
} }
EXIT_FUNC(); EXIT_FUNC();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment