This work is based upon the approach from A clustering aggregation algorithm on neutral-atoms and annealing quantum processors.
Make sure to have a working MPI installation available. Its include path should either be added to $INCLUDE or $MPI_INC.
The code can be compiled using make. The newly built executable will be under the build/bin directory.
Beware that for the quantum emulation system to work you will also need to pull the SimulatedAnnealing submodule, enter its directory and run the make command.
HyperQueue is also required. If you are testing the application on qluster, open two terminals inside asvsys02, load the HyperQueue module and run these commands respectively:
hq server starthq alloc add slurm --time-limit 01:00:00 --workers-per-alloc 1 --max-worker-count 1 --idle-timeout 30s -- --partition=quantum
The code can be run as follows:
mpirun -n 3 build/bin/clustering data/input/cluster_points_article.csv work_dirThe two required arguments are:
- The input CSV file
- The directory where intermediate and final outputs will be written. It is not necessary to manually create this directory beforehand.
Some intermediate files will be created inside the working directory (last argument). Two additional output files will be created, containing:
- The Silhoutte score of the final clustering (best_silhouette.txt)
- The final association between points and assigned clusters, in tab-separated values format (best_cluster.txt)
- Add brief description with images
It recommended to use VS Code.
IntelliSense from the Microsoft-provided C++ and Makefile extensions reports errors even if the code compiles. It is recommended to use the clangd extension instead.
Install the clangd extension and allow it to disable IntelliSense. Install the clangd language server if prompted.
Then install bear and, from the project root directory, run the following:
make clean; bear -- makeThis will create a compile_commands.json file that is used by clangd to correctly inspect code.
Run "clangd: Restart language server" from the Command Palette (Ctrl+Shift+P) to read the newly created file.
You need to execute again the commands from above and restart the language server after each Makefile change
The clangd extension from the previous section can also format C/C++ code. Invoke it from Command Palette -> Format Document.