Compiling with Machine Architecture Visualization Support
_________________________________________________________

These tools are intended to allow CP2K to provide an overview of the machine where it is running. Using this support it is possible observe the machine hardware organization and how process/threads are placed over the machine cores. Additionally, it is possible to extract the memoruy policy used by processes to place their data over the machine. This latter is avaible only on NUMA machines.

In order to use these tools, it is necessary to have hwloc library (http://www.open-mpi.org/projects/hwloc/) and libnuma (ftp://oss.sgi.com/www/projects/libnuma/download/) installed in the system. Both 
libraries are used in the Machine Architecture Visualization tools. However, when the Machine Architecture Visualization Support is build with hwloc, much more information is provided about the machine and process/threads/memory placement. The libnuma does not provide a graphic view of the machine.

To compile CP2K with Machine Architecture Visualization support, two modifications must be made to the arch file. An example is provided in arch/Linux-x86-64-ma.sopt.  The necessary modifications are:

1) Add -D__HWLOC or -D__LIBNUMA to the DFLAGS environmental variable

2) Add libhwloc.so or libnuma.so to the LIBS variable. It is also possible to add the static version of such libraries to LIBS.

Then, compile as normal.


Features
--------
To visualize the output generated by the Machine Architecture Visualization Support, it is necessary to include the print keys in the input file of CP2K.

By default threads and processes placement are shown only once at the initialization of the application (when they are created). If you want to verify threads and processes placement in other steps of the applications, you could use the interface functions to change the application source code and get the placement.

Note
-------
It is not possible to compile CP2K with both libraries at same time. The  Machine Architecture Visualization Support is build using the same interface for both libraries.
