Skip to content

Commit

Permalink
MPI for SWW data
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaweiZhuang committed Apr 30, 2017
1 parent bf22487 commit 1541f7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Parallel_Algorithm/MPI/Kmean_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include "../shared/math_util.h"

/* This is the name of the data file we will read. */
#define FILE_NAME "../test_data/Blobs_smp20000_fea30_cls8.nc"
//#define FILE_NAME "../test_data/Blobs_smp20000_fea30_cls8.nc"
#define FILE_NAME "../../Data_Analysis/data/SSWdata.nc"
#define TOL 0.0001
#define MAX_ITER 100

Expand Down Expand Up @@ -209,9 +210,11 @@ int main() {
reduction(+:dist_sum_new)
for (i = 0; i < N_samples; i++) {
k_best = 0;//assume cluster no.0 is the nearest
dist_min = distance(N_features, X[i], old_cluster_centers[k_best]);
//dist_min = distance(N_features, X[i], old_cluster_centers[k_best]);
dist_min = correlation(N_features, X[i], old_cluster_centers[k_best]);
for (k = 1; k < N_clusters; k++){
dist = distance(N_features, X[i], old_cluster_centers[k]);
//dist = distance(N_features, X[i], old_cluster_centers[k]);
dist = correlation(N_features, X[i], old_cluster_centers[k]);
if (dist < dist_min){
dist_min = dist;
k_best = k;
Expand Down

0 comments on commit 1541f7e

Please sign in to comment.