adding incomplete kmeans.

I'm having a problem with the broadcast, and still need to implement the logic
This commit is contained in:
nachocano
2014-12-03 01:16:13 -08:00
parent ed1de6df80
commit 56aad86231
3 changed files with 199 additions and 0 deletions

42
toolkit/Makefile Normal file
View File

@@ -0,0 +1,42 @@
export CC = gcc
export CXX = g++
export MPICXX = mpicxx
export LDFLAGS= -pthread -lm
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -I../src
# specify tensor path
BIN = kmeans
# objectives that makes up rabit library
RABIT_OBJ = allreduce_base.o allreduce_robust.o engine.o
MPIOBJ = engine_mpi.o
OBJ = $(RABIT_OBJ) kmeans.o
MPIBIN = kmeans.mpi
.PHONY: clean all
all: $(BIN) $(MPIBIN)
allreduce_base.o: ../src/allreduce_base.cc ../src/*.h
engine.o: ../src/engine.cc ../src/*.h
allreduce_robust.o: ../src/allreduce_robust.cc ../src/*.h
engine_mpi.o: ../src/engine_mpi.cc
kmeans.o: kmeans.cpp ../src/*.h
# we can link against MPI version to get use MPI
kmeans: kmeans.o $(RABIT_OBJ)
kmeans.mpi: kmeans.o $(MPIOBJ)
$(BIN) :
$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc, $^)
$(OBJ) :
$(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) )
$(MPIBIN) :
$(MPICXX) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc, $^)
$(MPIOBJ) :
$(MPICXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) )
clean:
$(RM) $(OBJ) $(BIN) $(MPIBIN) *~ ../src/*~