Skip to content

icarocd/parallel-meanshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parallel-meanshift

Parallel implementation of MeanShift clustering algorithm, for Java language. This Meanshift implementation adopts a distance matrix as its main input and uses flat kernel. It allows the customization of: seeds, quantile and maximum of iterations.
The parallelization is performed using Stream, from concurrent API present in Java 8. We also provide another parallel approach using thread pool.

PS: the code requires java >= 8 and maven to be built.
To install java 8 on Ubuntu: sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
To install maven on Ubuntu: apt-get install mvn

For profiling, we use and recommend VisualVM, along with its plugin plugin called 'startup profiler'.
Installation procedure on Ubuntu:
1. sudo apt-get install visualvm
2. Open the visualvm
3. Go to menu Tools -> Plugins, tab Available Plugins
4. Install the plugin Startup Profiler. To make effect, close VisualVM and open it again.

How to build:
In root folder, execute the command: mvn clean package
This will generate the resulting jar file: target/meanshift.jar

How to use it:
java -jar target/meanshift.jar input_file_name
Example: java -jar target/meanshift.jar arq2500.in

In order to test and program, we provide some distance matrix files as examples in the github project repository: see the files arq*.in. We also provide a simple generator, see method generateRandomMatrix in MeanShiftClusterer class.
How to profile the program with VisualVM:
1. open visualvm and go to menu Applications -> Profile Startup
Select:
Platform: Java 8
Profile: CPU
Start profiling from classes: MeanShiftClusterer
Profile only classes: MeanShiftClusterer, Matrix
Copy the 'agentpath' provided by VisualVM, which will be required at program startup.
Click on Profile button
2: start the program, enabling the profile for VisualVM:
The command may vary, but here it is a valid example:
java -agentpath:/usr/share/visualvm/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so=/usr/share/visualvm/profiler/lib,5140 -jar target/meanshift.jar arq2500.in

3: VisualVM will open a monitor screen, containing hot spots and several metrics.

About

parallel meanshit initiative, in Java language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published