3.3. Debugging

By default, the runtime is optimized for speed and will assume that the application code is correct. Hence, it will not perform most validity checks. To enable validity checks, run the application with the NANOS6 environment variable set to debug. This will enable many internal validity checks that may be violated when the application code is incorrect. In the future we may include a validation mode that will perform extensive application code validation.

To debug an application with a regular debugger, please compile its code with the regular debugging flags and also the -keep flag. This flag will force Mercurium to dump the transformed code in the local file system, so that it will be available for the debugger.

To debug dependencies, it is advised to reduce the problem size so that very few tasks trigger the problem, and then use let the runtime make a graphical representation of the dependency graph. See Generating a graphical representation of the dependency graph.

Processing the NANOS6 environment variable involves selecting at run time a runtime compiled for the corresponding instrumentation. This part of the bootstrap is performed by a component of the runtime called “loader. To debug problems due to the installation, run the application with the NANOS6_LOADER_VERBOSE environment variable set to any value.

3.3.1. Runtime information

Information about the runtime may be obtained by running the application with the NANOS6_REPORT_PREFIX environment variable set, or by invoking the following command:

$ nanos6-info --runtime-details
Runtime path /opt/nanos6/lib/libnanos6-optimized.so.0.0.0
Runtime Version 2017-11-07 09:26:03 +0100 5cb1900
Runtime Branch master
Runtime Compiler Version g++ (Debian 7.2.0-12) 7.2.1 20171025
Runtime Compiler Flags -DNDEBUG -Wall -Wextra -Wdisabled-optimization -Wshadow -fvisibility=hidden -O3 -flto
Initial CPU List 0-3
NUMA Node 0 CPU List 0-3
Scheduler priority
Dependency Implementation linear-regions-fragmented
Threading Model pthreads

The NANOS6_REPORT_PREFIX environment variable may be defined as an empty string or it may contain a string that will be prepended to each line. For instance, it can contain a sequence that starts a comment in the output of the program. Example:

$ NANOS6_REPORT_PREFIX="#" ./app
Some application output ...
#   string  version 2017-11-07 09:26:03 +0100 5cb1900       Runtime Version
#   string  branch  master      Runtime Branch
#   string  compiler_version    g++ (Debian 7.2.0-12) 7.2.1 20171025        Runtime Compiler Version
#   string  compiler_flags  -DNDEBUG -Wall -Wextra -Wdisabled-optimization -Wshadow -fvisibility=hidden -O3 -flto       Runtime Compiler Flags
#   string  initial_cpu_list    0-3     Initial CPU List
#   string  numa_node_0_cpu_list    0-3     NUMA Node 0 CPU List
#   string  scheduler   priority        Scheduler
#   string  dependency_implementation   linear-regions-fragmented       Dependency Implementation
#   string  threading_model pthreads        Threading Model