Compare commits

...

166 Commits

Author SHA1 Message Date
Raúl Peñacoba Veigas
9826879bcd Add OpenMP support for labels and taskID views
Some checks failed
CI / build:rt (push) Failing after 15s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Failing after 13s
CI / build:nompi (push) Successful in 13s
CI / build:compilers (push) Successful in 13s
CI / build:local (push) Successful in 23s
Co-authored-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-12-09 16:41:16 +01:00
a7103f8510 Release version 1.11.0 2024-11-08 10:26:10 +01:00
Aleix Boné
d931a68b3e
Set cfg colors for nosv_cond apis 2024-11-08 10:13:01 +01:00
Aleix Boné
a297adab7a
Add tests for nosv_cond 2024-11-08 10:13:00 +01:00
Aleix Boné
b5fd438ce0
Add nosv_cond API events (nosv 3.1.0) 2024-11-08 10:13:00 +01:00
Aleix Boné
a4a5bf0d37
Update nosv 2024-11-08 10:13:00 +01:00
180ac51aea Use fixed clock for sort-into-previous-region test
With large values of clocks, awk starts to lose precision due handling
the time as floating point values, which causes the test to fail. By
always setting the clock of the events to a known value we can just
compare the outcome as-is, without performing any arithmetic operation.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/205
2024-11-06 11:51:57 +01:00
73b19ca1c4 Allow setting manual clock for emu events 2024-11-06 11:51:55 +01:00
31e8802803 Allow partial CPUs in thread metadata 2024-11-05 10:56:51 +01:00
fe860b2e38 Add partial-cpus test 2024-11-05 10:56:29 +01:00
60b575c8f8 Add python3 dependency for openmp 2024-10-29 09:42:03 +01:00
3a20cb717c Update runtimes, clang and ovni commits for CI 2024-10-29 09:41:58 +01:00
3bbfe0f0ec Update changelog 2024-10-25 14:39:41 +02:00
04d984d4fc Make cpu index check more strict 2024-10-25 14:22:37 +02:00
05c4ed4963 Remove info() call leftover in libovni 2024-10-25 14:22:37 +02:00
7cf69d055a Remove ovni as explictly required model
It is already added as a requirement in ovni_thead_init().
2024-10-25 14:22:37 +02:00
4c80cb3ed1 Fix typos in docs and extend CPU index usage 2024-10-25 14:22:32 +02:00
4c5e3ae151 Make all atomic operations explicit 2024-10-25 13:41:15 +02:00
86d0d11869 Add trace diagram and organize concepts 2024-10-25 13:41:15 +02:00
bf8c609dbd Remove trailing slashes from tracedir 2024-10-25 13:41:15 +02:00
706aa4a787 Rename trace-model.md to just trace.md 2024-10-25 13:41:15 +02:00
dd5b85d2c8 Add examples in some trace concepts 2024-10-25 13:41:15 +02:00
53aa3b3679 Add example program for mark API 2024-10-25 13:41:15 +02:00
6c33a2f4c0 Document environment variables 2024-10-25 13:41:15 +02:00
ea77f3d72e Fix unit-stream test 2024-10-25 13:41:15 +02:00
c190d27467 Remove tracing.md 2024-10-25 13:41:15 +02:00
ecf4c5da8c Update trace specification to version 3 2024-10-25 13:41:15 +02:00
6285a47f72 Explain some concepts in the documentation 2024-10-25 13:41:15 +02:00
5d4fa15eb9 Change hyperlinks to point to .md files
Allows mkdocs to discover broken links when the pointed document has
moved.
2024-10-25 13:41:15 +02:00
bb4e4d7e56 Emit rank information after ovni_thread_init 2024-10-25 13:41:15 +02:00
c9bbd542c5 Store rank information in the libovni thread
Prevents threads from finishing while another thread is being
initializing the rank information, causing a race to read the rank and
nranks.
2024-10-25 13:41:15 +02:00
6e99d91dae Use atomics to protect libovni process state
Multiple threads may attempt to initialize or finalize the process, so
we keep the state stored in an atomic integer to protect against bad
usage.
2024-10-25 13:41:15 +02:00
4c2071e906 Make calling ovni_thread_require() optional
When only emitting ovni events, there is no need to explicitly require
the ovni model, as libovni will already pre-populate it for the user.
2024-10-25 13:41:15 +02:00
b49671d530 Always require the current ovni model 2024-10-25 13:41:15 +02:00
5c11c469f2 Make ovni.require a mandatory attribute
We no longer accept streams that don't have the ovni.require attribute.
2024-10-25 13:41:15 +02:00
361290e24f Parse metadata from proc and loom directly
All the metadata keys are known to proc and loom only, making it
self-contained. The metadata.c module is no longer needed.
2024-10-25 13:41:15 +02:00
65d1a5ecec Add merge-cpus-loom test
Ensure we can merge the information of CPUs from multiple threads.
2024-10-25 13:41:15 +02:00
6af367ba76 Fix spawn-task-external test
It is mandatory to call ovni_thread_free().
2024-10-25 13:41:15 +02:00
65907a96f4 Update tmpdir-metadata test 2024-10-25 13:41:15 +02:00
05c1724234 Move thread streams in ovni_thread_free()
The process metadata in metadata.json is no longer needed.
2024-10-25 13:41:15 +02:00
4180300e87 Reject incomplete thread streams 2024-10-25 13:41:15 +02:00
c61f5a8772 Ensure the thread is ready before adding cpus 2024-10-25 13:41:15 +02:00
fdcff58318 Fix unit tests 2024-10-25 13:41:15 +02:00
72e60e97ea Store .obs and .json paths in stream struct 2024-10-25 13:41:15 +02:00
132b2fd536 Store loom CPUs in thread metadata 2024-10-25 13:41:15 +02:00
12835ad23a Store process information in thread metadata 2024-10-25 13:41:15 +02:00
06a2262db9 Load thread tid from metadata 2024-10-25 13:41:15 +02:00
cc5578e306 Store loom name in metadata instead of path 2024-10-25 13:41:15 +02:00
8765588667 Store ovni.part in stream metadata
Allows multiple types of streams for different system parts: thread,
process, cpu, node...
2024-10-25 13:41:15 +02:00
9a8dc382a2 Store stream metadata in stream.json
Place all stream files in its own stream directory.
2024-10-25 13:41:15 +02:00
85859a488d Add more path utility functions 2024-10-25 13:41:15 +02:00
e54e3e684e Store TID and PID in thread metadata 2024-10-25 13:41:15 +02:00
17c74d2e32 Increase version metadata to 3 2024-10-25 13:41:15 +02:00
c60f22f7f7 Update mkdocs to 1.6.0 2024-09-13 09:38:40 +02:00
36cf3121d1 Fix implicit signed conversions
Some checks failed
CI / build:rt (push) Failing after 12s
CI / build:asan (push) Failing after 12s
CI / build:nompi (push) Successful in 59s
CI / build:debug (push) Successful in 1m50s
CI / build:local (push) Successful in 2m2s
CI / build:compilers (push) Successful in 2m27s
2024-09-09 13:44:05 +02:00
c8b95313ff Fix unaligned access to 64 bits payload 2024-09-09 13:44:05 +02:00
e5448af6d8 Rebuild ring buffer pointers after injecting events
The ring buffer pointers are no longer valid as we may have displaced
events around. The pointers of the affected region are reconstructed by
reading the events again, following their size.
2024-09-09 13:43:59 +02:00
49149e452c Check ring buffer order after injecting events
Ensure that we are not reading garbage.
2024-09-09 09:10:04 +02:00
b2d91391b3 Add sort-into-previous-region emu test 2024-09-09 09:10:04 +02:00
13f70be87b Set nOS-V version required for tests to 2.3.1
Includes the required fixes for the kernel ring buffer tests.
2024-09-09 08:51:04 +02:00
71aa33d22f Use string to set ovni.kernel_ringsize 2024-09-09 08:51:04 +02:00
4c3da12ea1 Fix typos in nOS-V kernel test 2024-09-09 08:51:04 +02:00
a47082730a Ensure that nOS-V aborts on ring overflow 2024-09-09 08:51:04 +02:00
99dc3904af Add overflow and normal kernel nOS-V tests 2024-09-09 08:51:04 +02:00
acf18c1bb4 Make nOS-V kernel overflow test configurable 2024-09-09 08:51:04 +02:00
e9788e22ad Add test kernel ring overflow test for nOS-V
There is a problem in the way we are reading the buffer in nOS-V, which
fails when the ring buffer gets full. This regression test ensures it is
fixed.

Reported-by: David Álvarez <david.alvarez@bsc.es>
2024-09-09 08:51:04 +02:00
6cb983a7c4 Update nOS-V commit 2024-09-09 08:51:04 +02:00
7496a6a866 Fix easy cases of unneeded casts 2024-09-09 08:28:08 +02:00
c8750b9dfd Enable -Wconversion and -Wsign-conversion
Prevents implicit conversions to go undetected, as they will have to be
explicit now.
2024-09-09 08:28:02 +02:00
d98ca97624 Fix unaligned load of 4 bytes for typeid
Use memcpy() to move the typeid to an aligned address.
2024-07-29 13:17:37 +02:00
61d57901b1 Enable undefined behavior sanitizer in CI 2024-07-29 13:09:41 +02:00
9c82038561 Add release link to tag 1.10.0 2024-07-26 16:20:34 +02:00
15dfa48d2d Release version 1.10.0 2024-07-26 13:25:43 +02:00
2457e50712 Use always base 10 integer formats with scanf()
The %i printf variant tries to autodetect the base, so 010 becomes 8.
2024-07-24 16:36:54 +02:00
92c36502bc Reduce heat and fibonnacci test sizes 2024-07-24 16:09:47 +02:00
439b716a71 Use int64_t printf formats for mark channels 2024-07-24 16:09:47 +02:00
97282ff051 Increase test timeout to 60 seconds 2024-07-24 16:09:47 +02:00
093c91521a Fix error format strings in mark API 2024-07-24 16:09:44 +02:00
74aa7b4ea6 Update changelog 2024-07-24 15:12:09 +02:00
3d8c84e17c Fix heap when size_t is not unsigned long long
When the width of size_t doesn't match the width of the unsigned long
long type, the number of leading zeros doesn't match, making the
heap_get_move() function return incorrect values. This is the case on
ARMv7 with 32 bits, where size_t is 32 bits but unsigned long long is 64
bits.

We check the size of size_t to select which builtin we need. The sizeof
operator cannot be used at preprocessing, so we rely on the
optimizations to only leave the proper assembly instruction.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/193
2024-07-24 15:12:09 +02:00
91e8367d35 Set timeout to 30 seconds for tests 2024-07-24 15:12:09 +02:00
129020e1c5 Fix format errors in printf-like functions 2024-07-24 15:12:09 +02:00
d03fe10be8 Protect printf-like calls against format errors 2024-07-24 15:12:09 +02:00
3fdbb95080 Fix remaining problems for 32 bits architectures 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
3103018404 Use format macro constants for fprintf and fscanf family functions 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
478ed1f5d0 Use proper format specifiers
Allows compiling for architectures with different data type sizes
2024-07-24 15:12:09 +02:00
42feb53c86 Cross compile for ARMv7, Aarch64 and RISC-V 64
Adds CI cross-compilation tests for those architectures. Requires the
host to be able to run thos binaries via binfmt.

See: https://docs.kernel.org/admin-guide/binfmt-misc.html
2024-07-24 15:12:09 +02:00
391d695144 Add mark API to the changelog 2024-07-23 10:35:08 +02:00
038b9d8564 Document usage rules for the mark API 2024-07-23 10:35:08 +02:00
5448b5c0ec Check duplicated mark channel types are the same
Ensure that two threads cannot define the same mark type with different
channel types.
2024-07-23 10:35:08 +02:00
be45235d15 Improve documentation of the mark API 2024-07-23 10:35:08 +02:00
87e4b829c5 Switch the mark tracking for threads to active
In the thread view, the values will still be visible when the thread
goes to Warming or Cooling states, instead of being removed like when
the thread enters the Paused state. The CPU view will continue to track
the running thread (only in the Running state).
2024-07-23 10:35:02 +02:00
1ab605b70d Fix calloc() argument order
Catched by a new gcc 14.1.1 warning.
2024-07-22 16:45:29 +02:00
fbb78ae22d Avoid initialization of mark channels without types
There is no need to create any channel or connect any channel to the PRV
output.
2024-07-22 16:42:23 +02:00
a21dc76d81 Use 100 as example mark type
As the types for mark timelines start at 100, it is likely that it
matches in the first try.
2024-06-21 09:45:54 +02:00
49cecb798a Don't allow zero in PRV for mark channels
As the zero value is not allowed to reach the mark channels, there is no
need to allow it in the PRV end.
2024-06-21 09:39:32 +02:00
e31f0f1ded Add fibonacci and heat RT tests for mark API 2024-06-20 17:39:42 +02:00
43792fb349 Clarify push and pop value in mark API 2024-06-20 11:48:31 +02:00
d6a83a0520 Allow duplicate values in mark channels 2024-06-20 11:41:38 +02:00
c803a7566f Prevent zero values in the mark API
These values cannot be differentiated from a null value, due to a
Paraver limitation.
2024-06-20 11:41:09 +02:00
670edb6ddc Add documentation for the mark API
Includes the runtime usage as well as how to adjust the Paraver
configuration.
2024-06-20 11:08:29 +02:00
f5d1e0a3cb Add example mark configurations 2024-06-20 11:07:49 +02:00
a58b3d194c Add CPU output for mark channels
By default they are configured to track the running thread.
2024-06-19 13:48:18 +02:00
d9180d950b Make mark thread channels show only when running
Implements support for tracking the running thread using the track API.
2024-06-19 13:15:16 +02:00
9da7234684 Pause one thread in mark API emu test.
The Paraver timeline should hide the value of the thread while it is
paused. This will require adding a tracking module with a mux.
2024-06-19 13:13:18 +02:00
610b1223d9 Update version docs for ovni model 1.1.0 2024-06-19 12:26:58 +02:00
6954f05dee Update mark test to for single and stack types 2024-06-19 12:26:35 +02:00
db57136f1b Allow the value zero in marks
When using the mark API to track a counter, it is posible that the value
zero is being emitted as it will be properly displayed using the
gradient view in Paraver.
2024-06-19 12:26:35 +02:00
2c111fd98c Add ovni_mark_set() to the API
Allows emitting a single event to change the value of the mark channel.
The mark type must be defined as single without the MARK_FLAG_STACK
flag.
2024-06-19 12:26:35 +02:00
90f8ae4188 Allow marks without labels defined
The labels are optional, so they shouldn't be required when processing
the mark types.
2024-06-19 12:26:35 +02:00
b4d445b378 Write mark PCF types for thread PVT 2024-06-19 12:26:35 +02:00
ea79c90c89 Connect mark channels to PRV
There must be one channel per thread and type.
2024-06-19 12:26:35 +02:00
1b2f72cc3a Store mark labels into a hash table
Multiple threads can define the same values as long as the labels match.
They will be combined into a single hash table by value.
2024-06-19 12:26:35 +02:00
505245d54c Implement emulator logic to parse mark metadata
The marks are parsed from the metadata definition, then merged from all
threads and a new channel for each mark type is created. The channel
type is specified using a flag when calling ovni_mark_type(), so the
channels is set to single or stack. For now, only ovni_mark_push() and
ovni_mark_pop() are implemented.
2024-06-19 12:26:35 +02:00
93ab5a5833 Add ovni_mark_* API to store custom states
In order to allow easy debugging of some programs and runtimes, it is
often neccessary to add extra information in the timeline views. The
modification of the emulator to accomodate those temporal events is time
consuming and requires knowlegde of the emulator internals.

To improve the situation, a new set of functions are added to libovni
which allow users to define their own views. Up to 100 types of events
can be declared, where each type can have an unlimited number ov values
with an optional label attached.
2024-06-19 12:26:35 +02:00
247ea7e7c3 Add nosv.can_breakdown attribute check
The nosv.can_breakdown attribute states if enough events for the
breakdown model of nOS-V are enabled at runtime. It is used to ensure
that breakdown traces have the progress events enabled along with others
required for proper visualization of traces.

The emulator will panic when the level is not enough, instead of relying
on users to always remember to enable the correct level.
2024-06-18 12:06:42 +02:00
d1e8a62396 Add API to manage metadata in streams
The ovni_attr_* set of functions allows users to write and read metadata
stores in the thread stream. The metadata information is available to
the emulator at the beginning of the emulation.
2024-06-13 11:09:40 +02:00
2ac67cff18 Update CHANGELOG for nOS-V breakdown 2024-06-12 16:52:30 +02:00
eed2273ddf Add nOS-V docs for idle and breakdown views 2024-06-12 16:52:30 +02:00
31d6eb076c Add unknown subsystem state for nOS-V breakdown
It will appear when the emulator knows that a thread is running in the
CPU, but no subsystem has been entered yet. This is common a
instrumentation level lower than 3 in nOS-V.
2024-06-12 16:52:30 +02:00
bb5e406af3 Set a default value for empty task type labels 2024-06-12 16:52:30 +02:00
aab33ccfab Add Nodes RT tests with breakdown enabled 2024-06-12 16:52:30 +02:00
98164afc90 Update nOS-V state colors in paraver CFG 2024-06-12 16:52:30 +02:00
819e83d138 Add RT breakdown tests for nOS-V
The nOS-V version required is now 2.3.0.
2024-06-12 16:52:30 +02:00
16b9b2ba85 Update nOS-V commit for RT tests 2024-06-12 16:51:57 +02:00
9d94189165 Increase nOS-V model version to 2.2.0
The new progressing state events VP{pra} cause a minor version bump in
the nOS-V model.
2024-06-12 10:25:24 +02:00
David Alvarez
9fb53df45d nOS-V Breakdown 2024-06-12 10:15:59 +02:00
92cc779caf Make chan_pop() error more clear
Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/188
2024-06-11 09:19:35 +02:00
e3d72fb14e Release version 1.9.1
All checks were successful
CI / build:debug (pull_request) Successful in 1m21s
CI / build:local (pull_request) Successful in 1m47s
CI / build:compilers (pull_request) Successful in 1m37s
CI / build:nompi (pull_request) Successful in 1m39s
CI / build:rt (pull_request) Successful in 1m53s
CI / build:asan (pull_request) Successful in 2m21s
CI / build:rt (push) Successful in 13s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Successful in 13s
CI / build:nompi (push) Successful in 13s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
2024-05-10 15:31:38 +02:00
014152fc89 Fix warning with gcc 11.3.1
All checks were successful
CI / build:debug (pull_request) Successful in 1m20s
CI / build:compilers (pull_request) Successful in 1m35s
CI / build:nompi (pull_request) Successful in 1m40s
CI / build:local (pull_request) Successful in 1m48s
CI / build:rt (pull_request) Successful in 1m54s
CI / build:asan (pull_request) Successful in 2m20s
CI / build:rt (push) Successful in 13s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Successful in 13s
CI / build:nompi (push) Successful in 13s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
Reported-by: Kevin Sala <kevin.sala@bsc.es>
2024-05-10 15:25:23 +02:00
3a300c816e Fix breakdown model forbidden value 0 error
All checks were successful
CI / build:local (pull_request) Successful in 2m4s
CI / build:debug (pull_request) Successful in 1m7s
CI / build:rt (pull_request) Successful in 2m32s
CI / build:compilers (pull_request) Successful in 1m12s
CI / build:nompi (pull_request) Successful in 1m17s
CI / build:asan (pull_request) Successful in 2m7s
CI / build:debug (push) Successful in 3s
CI / build:asan (push) Successful in 3s
CI / build:rt (push) Successful in 13s
CI / build:nompi (push) Successful in 12s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
When a event causes a new value in the sort module, the first time it
will write all output values, which most of them will be zero. Writting
a zero value is forbidden by default, so we relax the constraint with
the PRV_ZERO flag.
2024-05-09 15:36:58 +02:00
8c8bde4a0f Add emulation test for breakdown zero values 2024-05-09 15:36:58 +02:00
0c64f62d01 Add Nanos6 breakdown test for runtime 2024-05-09 15:36:58 +02:00
d5d5f2fcd4 Add Gitea CI workflow
All checks were successful
CI / build:debug (pull_request) Successful in 1m17s
CI / build:compilers (pull_request) Successful in 1m53s
CI / build:nompi (pull_request) Successful in 2m1s
CI / build:local (pull_request) Successful in 2m14s
CI / build:rt (pull_request) Successful in 2m23s
CI / build:asan (pull_request) Successful in 3m29s
CI / build:rt (push) Successful in 13s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Successful in 13s
CI / build:nompi (push) Successful in 12s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
2024-05-09 15:36:39 +02:00
51269a478b Release version 1.9.0 2024-05-02 12:08:22 +02:00
bf3165af8b Open Paraver windows at (100,100) instead of (0,0)
In Mac OS, the top menu bar is placed above any window, causing the
timelines being opened at (0,0) appear under it in such a way that the
timeline title bar is not reachable by the mouse, making it hard to
move.

This simple solution opens the windows a bit away from the top left
corner, at (100,100).

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/180
2024-03-28 10:55:02 +01:00
bd629136ef Fix the color for the delegate subsystem state 2024-03-27 12:05:59 +01:00
e3bd221d01 Run nOS-V mutex and barrier tests on level 3
The mutex and barrier API events are only emitted on level 3 or above.
2024-03-27 12:05:59 +01:00
8f1f7a2040 Update nOS-V commit 2024-03-27 12:05:56 +01:00
eb1fc0f7da Add nosv barrier API event 2024-03-22 16:58:14 +01:00
aaa7769448 Add nosv mutex API events 2024-03-22 16:56:25 +01:00
70f34e9e33 Fail fibonacci test on nOS-V kernel warnings
Some threads may fail to enable the kernel instrumentation by reaching
the memory lock limit, causing the kernel instrumentation to be disabled
without any error in the emulation.

To prevent this situation, we run the test manually and check that there
are no warnings during the execution.
2024-03-22 15:40:42 +01:00
c7dbf643d3 Implement outlined fibonacci test too 2024-03-22 15:40:38 +01:00
4fba6cd10e Update CHANGELOG 2024-03-21 17:15:46 +01:00
37a567299e Add a fibonacci test to cause context switches
The test creates tasks that pause until the children task have finished.
The value of the perf_event_paranoid file is checked to determine if we
can run the test.
2024-03-21 17:07:19 +01:00
d1e4f46128 Implement level parameter in nodes tests
The level is used to override the nOS-V configuration for the ovni.level
value.
2024-03-21 16:15:45 +01:00
7cd4fa2bf0 Fix indentation in test/rt/nosv/CMakeLists.txt 2024-03-21 16:15:07 +01:00
6aff4388eb Panic on events when the thread is preempted
When the thread is not running on the CPU it shouldn't be able to emit
events. A new emulation test ensures the emulation fails if it happens.
2024-03-20 15:55:43 +01:00
31fa1508f7 Mark threads out of CPU by kernel events 2024-03-20 15:50:46 +01:00
d1312ff6e9 Fix definitions for kernel context switch events 2024-03-20 12:27:47 +01:00
f4296c66e4 Release version 1.8.0
It is the 888 commit :-)
2024-03-18 11:18:46 +01:00
Raúl Peñacoba Veigas
7cb67ecaee Update flake.nix llvm pinned commit to b813108e 2024-03-15 15:53:10 +01:00
31c3c965c7 Increase Nanos6 model minor version
As Nanos6 now emits pause events for the parent task before nesting
another one, we increase the minor so the old emulator rejects new
traces that come with the new pause events.
2024-03-14 14:43:05 +01:00
2c58a6058b Document version changes in emulator models
A consistency check ensures that all versions reported by the emulator
appear in the documentation as the latest version. This prevents
forgetting updating the version in the documentation.
2024-03-14 13:56:37 +01:00
929cc12c04 Make attach-old nOS-V RT test fail now
The new nOS-V emulation version 2.0.0 is no longer compatible with the
old traces.
2024-03-13 17:44:13 +01:00
0404304803 Add task labels to rt-nodes-taskiter test 2024-03-13 17:44:13 +01:00
f8fdcc0a79 Add Nanos6 emu test to check strict nesting model 2024-03-13 17:44:13 +01:00
3e5b949c4e Add nOS-V RT parallel task tests
The runtime tests check that we can submit and inline task (which must
emit a pause event before the nested task begins) and that we can run
parallel tasks.
2024-03-13 17:44:13 +01:00
f81c5695f1 Update nOS-V commit to test parallel tasks 2024-03-13 17:44:02 +01:00
096775f08f Add copyright headers to cmake modules 2024-03-13 17:07:32 +01:00
24324ae734 Add parallel task and update old emu tests
All task-related events now require the body id as argument.
Additionally, in nOS-V, nested tasks require the parents to be paused.
2024-03-13 17:07:32 +01:00
50837d6173 Port Nanos6 model to tasks with bodies
For now we still allow Nanos6 to use the relaxed nest model, so a nested
task can begin the execution without the parent being paused.
2024-03-13 17:07:32 +01:00
815633221d Port nOS-V model to task bodies
The nOS-V events are modified in two ways: 1) to create a parallel task
the new VTC event must be used and 2) all task events for both normal
(VTc) and parallel (VTC) tasks require an extra argument in the payload
to indicate the body id. As a consequence, the nOS-V model version is
now increased to 2.0.0.

Additionally, all the channel PRV flags are set to PRV_SKIPDUPNULL, so
duplicates are only emitted if they are not null. It solves the problem
when a task switches to another task with the same body id.

A new Paraver configuration is added for the body id.
2024-03-13 17:07:26 +01:00
27a23f25ca Update task model to use bodies
The task model is now integrated with the body model. A normal task can
only have one body, while a parallel task can have more.

It inherits the restriction that a task body cannot be nested over
another one unless it is paused (or the relaxed nest model is enabled).
2024-03-12 12:37:58 +01:00
a0e7fad83e Add body model for tasks
The new task body model (or just body model) allows a task to have
multiple bodies. Generally a body is mapped to the execution of the same
user code of the task with specific input arguments.

The body model can constraint if a given body can be paused or re-run
again (resurrect).

Additionally, the body model can run multiple nested bodies but with the
restriction that the parent body should be paused first. This condition
can be relaxed with the BODY_FLAG_RELAX_NESTING flag.
2024-03-12 12:37:09 +01:00
bdd5696641 Add PRV_SKIPDUPNULL flag
This flag allows to only skip duplicates if the value is null, otherwise
the value is emitted. Invalid combinations of PRV_* flags are also
checked on prv_register().
2024-03-12 12:37:09 +01:00
264 changed files with 9306 additions and 2002 deletions

45
.gitea/workflows/ci.yaml Normal file
View File

@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:local:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.local
build:rt:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.rt
build:debug:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.debug
build:asan:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.asan
build:nompi:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.nompi
build:compilers:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link .#ovniPackages.compilers

View File

@ -42,6 +42,13 @@ build:asan:
script:
- nix build -L --no-link .#ovniPackages.asan
build:ubsan:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.ubsan
build:nompi:
stage: build
tags:
@ -55,3 +62,24 @@ build:compilers:
- nix
script:
- nix build -L --no-link .#ovniPackages.compilers
build:armv7:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.armv7
build:aarch64:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.aarch64
build:riscv64:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.riscv64

View File

@ -7,6 +7,95 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- OpenMP model version increased to 1.2.0.
### Added
- Add support OpenMP label and task ID views.
## [1.11.0] - 2024-11-08
### Added
- Introduce part model.
- Support for `nosv_cond_wait`, `nosv_cond_signal` and `nosv_cond_broadcast` events VA{oOgGkK}.
### Changed
- Enable -Wconversion and -Wsign-conversion.
- Update trace format to version 3.
- The ovni.require metadata key is now mandatory.
- Store process metadata in thread metadata.
- nOS-V model version increased to 2.4.0.
### Fixed
- Fix bug in ovnisort when injecting events in a previously modified section.
## [1.10.0] - 2024-07-26
### Changed
- nOS-V model version increased to 2.3.0.
- Prevent accidental use of nOS-V traces without required events for the
breakdown model using the `nosv.can_breakdown` attribute.
- Increase ovni model version to 1.1.0 for the mark events `OM*`.
### Added
- Add support for nOS-V progressing events VP{pra}.
- Add breakdown model for nOS-V.
- New API to manage stream metadata `ovni_attr_*()`.
- New mark API `ovni_mark_*()` to emit user-defined events.
### Fixed
- Cross-compilation for ARM 32 bits.
## [1.9.1] - 2024-05-10
### Fixed
- Fix breakdown model error that was preventing a zero value to be written in
the PRV trace.
- Fix gcc 11.3.1 -Wstringop-overflow warning.
## [1.9.0] - 2024-04-25
### Added
- Consistency check for events emitted when the kernel has removed the thread
from the CPU.
- The nOS-V model version is bumped to 2.1.0.
- Add support for `nosv_mutex_lock`, `nosv_mutex_trylock` and
`nosv_mutex_unlock` events VA{lLtTuU}.
- Add support for the `nosv_barrier_event` event VA{bB}.
### Fixed
- Open Paraver windows at (100,100) instead of (0,0) to avoid them appearing
under the menu bar in Mac OS.
## [1.8.0] - 2024-03-18
### Added
- Add new body model to support parallel tasks in nOS-V (used in taskfor).
- Add the ability to restrict transitions in the task model states.
- Add nOS-V support for parallel tasks reading the body id from the
event payload.
- Keep a changelog of emulation model versions.
### Changed
- The task model now requires the previous task body to be paused before nesting
another one. A compatibility flag is still available to still allow the old
behavior.
- Nanos6 model version increased to 1.1.0.
- nOS-V model version increased to 2.0.0.
## [1.7.0] - 2024-03-12
### Added
@ -203,16 +292,21 @@ are used along with some other changes.
- First ovni release.
[unreleased]: https://pm.bsc.es/gitlab/rarias/ovni/-/commits/master
[1.7.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.7.0
[1.6.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.6.0
[1.5.1]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.5.1
[1.5.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.5.0
[1.4.1]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.4.1
[1.4.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.4.0
[1.3.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.3.0
[1.2.2]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.2.2
[1.2.1]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.2.1
[1.2.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.2.0
[1.1.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.1.0
[1.0.0]: https://pm.bsc.es/gitlab/rarias/ovni/-/tags/1.0.0
[unreleased]: https://jungle.bsc.es/git/rarias/ovni
[1.11.0]: https://github.com/rodarima/ovni/releases/tag/1.11.0
[1.10.0]: https://github.com/rodarima/ovni/releases/tag/1.10.0
[1.9.1]: https://github.com/rodarima/ovni/releases/tag/1.9.1
[1.9.0]: https://github.com/rodarima/ovni/releases/tag/1.9.0
[1.8.0]: https://github.com/rodarima/ovni/releases/tag/1.8.0
[1.7.0]: https://github.com/rodarima/ovni/releases/tag/1.7.0
[1.6.0]: https://github.com/rodarima/ovni/releases/tag/1.6.0
[1.5.1]: https://github.com/rodarima/ovni/releases/tag/1.5.1
[1.5.0]: https://github.com/rodarima/ovni/releases/tag/1.5.0
[1.4.1]: https://github.com/rodarima/ovni/releases/tag/1.4.1
[1.4.0]: https://github.com/rodarima/ovni/releases/tag/1.4.0
[1.3.0]: https://github.com/rodarima/ovni/releases/tag/1.3.0
[1.2.2]: https://github.com/rodarima/ovni/releases/tag/1.2.2
[1.2.1]: https://github.com/rodarima/ovni/releases/tag/1.2.1
[1.2.0]: https://github.com/rodarima/ovni/releases/tag/1.2.0
[1.1.0]: https://github.com/rodarima/ovni/releases/tag/1.1.0
[1.0.0]: https://github.com/rodarima/ovni/releases/tag/1.0.0

View File

@ -3,13 +3,13 @@
cmake_minimum_required(VERSION 3.20)
project(OVNI LANGUAGES C VERSION 1.7.0)
project(OVNI LANGUAGES C VERSION 1.11.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
add_compile_options(-Wall -Wextra -Wformat
-Wmissing-prototypes -Wstrict-prototypes
#-Wconversion -Wsign-conversion
-Wconversion -Wsign-conversion
-Wold-style-definition -pedantic
-Werror
)
@ -67,7 +67,9 @@ set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_DEBUG} \
-fno-omit-frame-pointer"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds." FORCE)
set(CMAKE_C_FLAGS_UBSAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=undefined"
set(CMAKE_C_FLAGS_UBSAN "${CMAKE_C_FLAGS_DEBUG} \
-fsanitize=undefined \
-fno-sanitize-recover=all"
CACHE STRING "Flags used by the C compiler during UndefinedBehaviorSanitizer builds." FORCE)
find_program(IWYU NAMES include-what-you-use iwyu)

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Context switches of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: MPI function of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 Runtime/Idle/Task breakdown
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 idle state of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 task MPI rank of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 subsystem of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 task ID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 task type of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Nanos6 thread type of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: NODES subsystem of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

42
cfg/cpu/nosv/body-id.cfg Normal file
View File

@ -0,0 +1,42 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: nOS-V task body ID of the RUNNING thread >
################################################################################
window_name CPU: nOS-V task body ID of the RUNNING thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_color_mode window_in_null_gradient_mode
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 15
window_filter_module evt_type_label 1 "CPU: nOS-V task body ID of the RUNNING thread"

View File

@ -0,0 +1,44 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: nOS-V Runtime/Idle/Task breakdown >
################################################################################
window_name CPU: nOS-V Runtime/Idle/Task breakdown
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_width 600
window_height 150
window_comm_lines_enabled false
window_flags_enabled false
window_noncolor_mode true
window_custom_color_enabled true
window_custom_color_palette {6.000000000000:94,0,0},{7.000000000000:153,114,0},{9.000000000000:124,213,228},{10.000000000000:242,239,141},{11.000000000000:0,70,0},{19.000000000000:195,96,151},{20.000000000000:255,162,255},{21.000000000000:203,255,3},{22.000000000000:7,255,12},{23.000000000000:21,224,189},{24.000000000000:255,103,0},{25.000000000000:0,99,162},{26.000000000000:110,77,252},{100.000000000000:0,100,0},{101.000000000000:60,60,60},{102.000000000000:150,150,0}
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 17
window_filter_module evt_type_label 1 "CPU: nOS-V Runtime/Idle/Task breakdown"

44
cfg/cpu/nosv/idle.cfg Normal file
View File

@ -0,0 +1,44 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: nOS-V idle state of the RUNNING thread >
################################################################################
window_name CPU: nOS-V idle state of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_width 600
window_height 150
window_comm_lines_enabled false
window_flags_enabled false
window_noncolor_mode true
window_custom_color_enabled true
window_custom_color_palette {100.000000000000:0,100,0},{101.000000000000:60,60,60},{102.000000000000:150,150,0}
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 16
window_filter_module evt_type_label 1 "CPU: nOS-V idle state of the RUNNING thread"

View File

@ -9,15 +9,15 @@ ConfigFile.NumWindows: 1
window_name CPU: nOS-V subsystem of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_custom_color_enabled true
window_custom_color_palette {6.000000000000:94,0,0},{7.000000000000:153,114,0},{9.000000000000:124,213,228},{10.000000000000:242,239,141},{11.000000000000:0,70,0},{19.000000000000:195,96,151},{20.000000000000:255,162,255},{21.000000000000:0,99,162}
window_custom_color_palette {6.000000000000:94,0,0},{7.000000000000:153,114,0},{9.000000000000:124,213,228},{10.000000000000:242,239,141},{11.000000000000:0,70,0},{19.000000000000:195,96,151},{20.000000000000:255,162,255},{21.000000000000:203,255,3},{22.000000000000:7,255,12},{23.000000000000:21,165,118},{24.000000000000:255,103,0},{25.000000000000:200,30,5},{26.000000000000:255,10,200},{27.000000000000:98,133,80},{28.000000000000:0,99,162},{29.000000000000:110,77,252}
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: nOS-V task AppID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: nOS-V TaskID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: nOS-V task rank+1 of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: nOS-V task type of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

41
cfg/cpu/openmp/label.cfg Normal file
View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: OpenMP label of the RUNNING thread >
################################################################################
window_name CPU: OpenMP label of the RUNNING thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 51
window_filter_module evt_type_label 1 "CPU: OpenMP label of the RUNNING thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: OpenMP subsystem of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: OpenMP task id of the RUNNING thread >
################################################################################
window_name CPU: OpenMP task id of the RUNNING thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 52
window_filter_module evt_type_label 1 "CPU: OpenMP task id of the RUNNING thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Flushing state of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

41
cfg/cpu/ovni/mark.cfg Normal file
View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW CPU: Mark value of the RUNNING thread >
################################################################################
window_name CPU: Mark value of the RUNNING thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 100
window_filter_module evt_type_label 1 "CPU: Mark value of the RUNNING thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: Number of RUNNING threads
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: PID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: TID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: TAMPI subsystem of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Context switches of the CURRENT thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: MPI function of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 idle state
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 task MPI rank of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 subsystem of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 task ID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 task type of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Nanos6 thread type
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled false

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: NODES subsystem of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -0,0 +1,42 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW Thread: nOS-V task body ID of the RUNNING thread >
################################################################################
window_name Thread: nOS-V task body ID of the RUNNING thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_color_mode window_in_null_gradient_mode
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 15
window_filter_module evt_type_label 1 "Thread: nOS-V task body ID of the RUNNING thread"

View File

@ -9,15 +9,15 @@ ConfigFile.NumWindows: 1
window_name Thread: nOS-V subsystem of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_custom_color_enabled true
window_custom_color_palette {6.000000000000:94,0,0},{7.000000000000:153,114,0},{9.000000000000:124,213,228},{10.000000000000:242,239,141},{11.000000000000:0,70,0},{19.000000000000:195,96,151},{20.000000000000:255,162,255},{21.000000000000:0,99,162}
window_custom_color_palette {6.000000000000:94,0,0},{7.000000000000:153,114,0},{9.000000000000:124,213,228},{10.000000000000:242,239,141},{11.000000000000:0,70,0},{19.000000000000:195,96,151},{20.000000000000:255,162,255},{21.000000000000:203,255,3},{22.000000000000:7,255,12},{23.000000000000:21,165,118},{24.000000000000:255,103,0},{25.000000000000:200,30,5},{26.000000000000:255,10,200},{27.000000000000:98,133,80},{28.000000000000:0,99,162},{29.000000000000:110,77,252}
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: nOS-V task AppID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: nOS-V TaskID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: nOS-V task rank+1 of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: nOS-V task type of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW Thread: OpenMP label of the ACTIVE thread >
################################################################################
window_name Thread: OpenMP label of the ACTIVE thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 51
window_filter_module evt_type_label 1 "Thread: OpenMP label of the ACTIVE thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: OpenMP subsystem of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW Thread: OpenMP task id of the ACTIVE thread >
################################################################################
window_name Thread: OpenMP task id of the ACTIVE thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 52
window_filter_module evt_type_label 1 "Thread: OpenMP task id of the ACTIVE thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: CPU affinity of the CURRENT thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: Flushing state of the CURRENT thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

41
cfg/thread/ovni/mark.cfg Normal file
View File

@ -0,0 +1,41 @@
#ParaverCFG
ConfigFile.Version: 3.4
ConfigFile.NumWindows: 1
################################################################################
< NEW DISPLAYING WINDOW Thread: Mark value of the ACTIVE thread >
################################################################################
window_name Thread: Mark value of the ACTIVE thread
window_type single
window_id 1
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true
window_flags_enabled false
window_noncolor_mode true
window_logical_filtered true
window_physical_filtered false
window_comm_fromto true
window_comm_tagsize true
window_comm_typeval true
window_units Microseconds
window_maximum_y 1000.0
window_minimum_y 1.0
window_compute_y_max true
window_level thread
window_scale_relative 1.000000000000
window_end_time_relative 1.000000000000
window_object appl { 1, { All } }
window_begin_time_relative 0.000000000000
window_open true
window_drawmode draw_randnotzero
window_drawmode_rows draw_randnotzero
window_pixel_size 1
window_labels_to_draw 1
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
window_filter_module evt_type 1 100
window_filter_module evt_type_label 1 "Thread: Mark value of the ACTIVE thread"

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name CPU: PID of the RUNNING thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: State of the CURRENT thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: TID of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -9,8 +9,8 @@ ConfigFile.NumWindows: 1
window_name Thread: TAMPI subsystem of the ACTIVE thread
window_type single
window_id 1
window_position_x 0
window_position_y 0
window_position_x 100
window_position_y 100
window_width 600
window_height 150
window_comm_lines_enabled true

View File

@ -1,3 +1,6 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later
include(CheckCCompilerFlag)
set(CMAKE_REQUIRED_LINK_OPTIONS "-fompss-2")

View File

@ -0,0 +1,20 @@
# Copyright (c) 2024 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later
if(EXISTS "/proc/sys/kernel/perf_event_paranoid")
file(READ "/proc/sys/kernel/perf_event_paranoid" paranoid_raw)
string(REPLACE "\n" "" paranoid_value "${paranoid_raw}")
message(STATUS "Value of /proc/sys/kernel/perf_event_paranoid is ${paranoid_value}")
if(paranoid_value LESS_EQUAL 1)
message(STATUS "Value of perf_event_paranoid suitable for Kernel tests")
set(PERF_PARANOID_KERNEL ON)
else()
message(STATUS "Value of perf_event_paranoid NOT suitable for Kernel tests")
set(PERF_PARANOID_KERNEL OFF)
endif()
else()
message(STATUS "Missing /proc/sys/kernel/perf_event_paranoid")
set(PERF_PARANOID_KERNEL OFF)
endif()

View File

@ -1,3 +1,6 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later
include(GNUInstallDirs)
find_library(NANOS6_LIBRARY NAMES nanos6)

View File

@ -1,3 +1,6 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later
include(GNUInstallDirs)
if(DEFINED ENV{NODES_HOME})

View File

@ -65,5 +65,5 @@ to write the duplicated value with no error.
A unique function can be set to each channel which will be called once a channel
becomes dirty with `chan_set_dirty_cb()`. This callback will be called before
`chan_set()`, `chan_push()` or `chan_pop()` returns. The [patch
bay](../patchbay) uses this callback to detect when a channel is modified an run
bay](patchbay.md) uses this callback to detect when a channel is modified an run
other callbacks.

View File

@ -22,7 +22,7 @@ If the model is not enabled, no other function will be called.
The create function is called for each enabled model to allow them to allocate
all the required structures to perform the emulation using the
[extend](../extend) mechanism. All the required channels must be created and
[extend](extend.md) mechanism. All the required channels must be created and
registered in the patch bay in this function, so other models can found them in
the next stage.

View File

@ -1,6 +1,6 @@
# Mux
The emulator provides a mechanism to interconnect [channels](../channels) in a
The emulator provides a mechanism to interconnect [channels](channels.md) in a
similar way as an [analog
multiplexer](https://en.wikipedia.org/wiki/Multiplexer) by using the `mux`
module.
@ -19,7 +19,7 @@ selected. This allows a multiplexer to act as a filter too.
The typical use of multiplexers is to implement the tracking modes of channels.
As an example, the following diagram shows two multiplexers used to implement
the subsystem view of [Nanos6](../nanos6):
the subsystem view of [Nanos6](../user/emulation/nanos6.md):
![Mux example](fig/mux.svg)
@ -51,5 +51,5 @@ Multiplexers allow models to interact with each other in a controlled way. In
the example, the blue channel (*nanos6.thread0.subsystem*) is directly modified by
the Nanos6 model when a new event is received. While the red channels are
controlled by the ovni model. The rest of the channels are automatically updated
in the propagation phase of the [bay](../patchbay) allowing the ovni model to
in the propagation phase of the [bay](patchbay.md) allowing the ovni model to
modify the Nanos6 Paraver view of the subsystems.

View File

@ -16,7 +16,7 @@ A channel can be connected to each row in a trace with `prv_register()`, so the
new values of the channel get written in the trace. Only null and int64 data
values are supported for now.
The emission phase is controlled by the [patch bay](../patchbay) and runs all
The emission phase is controlled by the [patch bay](patchbay.md) and runs all
the emit callbacks at once for all dirty channels.
## Duplicate values

View File

@ -1,6 +1,6 @@
# Patch bay
The patch bay (or simply bay) allows [channels](../channels/) to be registered
The patch bay (or simply bay) allows [channels](channels.md) to be registered
with their name so they are visible to all parts of the emulator and provides a
way to run callbacks when the channels update their values.

View File

@ -13,8 +13,9 @@ The ovni project implements a fast instrumentation library that records
small events (starting at 12 bytes) during the execution of programs to
later investigate how the execution happened.
The instrumentation process is split in two stages: [runtime](runtime)
tracing and [emulation](emulation/).
The instrumentation process is split in two stages:
[runtime](user/runtime/index.md)
tracing and [emulation](user/emulation/index.md).
During runtime, very short binary events are stored on disk which
describe what is happening. Once the execution finishes, the events are

View File

@ -1,4 +1,4 @@
mkdocs==1.4.1
mkdocs==1.6.0
markdown==3.3.7
python-markdown-math==0.8
jinja2==3.1.2

View File

@ -1,31 +0,0 @@
# Overview
The objective of the ovni project is to provide insight into what
happened at execution of a program.
![Instrumentation process](fig/instrumentation.svg)
The key pieces of software involved are instrumented so they emit events
during the execution which allow the reconstruction of the execution
later on.
During the execution phase, the information gathered in the events is
kept very short and simple, so the overhead is kept at minimum to avoid
disturbing the execution process. Here is an example of a single event
emitted during the execution phase, informing the current thread to
finish the execution:
00 4f 48 65 52 c0 27 b4 d3 ec 01 00
During the emulation phase, the events are read and processed in the
emulator, reconstructing the execution. State transitions are recorded
in a Paraver trace. Here is an example of the same thread ceasing the
execution:
2:0:1:1:1:50105669:1:0
Finally, loading the trace in the Paraver program, we can generate a
timeline visualization of the state change. Here is the example for the
same state transition of the thread stopping the execution:
![Visualization](fig/visualization.png)

View File

@ -0,0 +1,62 @@
# Part model
Ovni has a model to represent the hardware components as well as the software
concepts like threads or processes. Each concept is considered to be a *part*.
Here is an example diagram depicting the part hierarchy:
![Part model](part-model.svg)
Notice how a loom can restrict the CPUs of the node to its child processes.
## Software parts
These are not physical parts, but they abstract common concepts.
### Thread
A thread in ovni is directly mapped to a [POSIX
thread](https://en.wikipedia.org/wiki/Pthreads) and they are identified by a
`TID` which must be unique in a [node](#node). Threads in ovni have [a model with
an internal state](../emulation/ovni.md/#thread_model) that tries to tracks the
state of the real thread.
### Process
A process is directly mapped to a UNIX
[process](https://en.wikipedia.org/wiki/Process_(computing)) and they are
identified by a `PID` number which must be unique in a [node](#node).
### Loom
A loom has no direct mapping to a usual concept. It consists of a set of
[CPUs](#cpu) from the same node and a set of processes that can *only run in
those CPUs*. Each CPUs must belong to one and only one loom. It is often used
to group CPUs that belong to the same process when running workloads with
multiple processes (like with MPI).
Each loom has a virtual CPU which collects running threads that are not
exclusively assigned to a physical CPU, so we cannot determine on which CPU they
are running.
## Hardware parts
These parts have a physical object assigned.
### CPU
A CPU is a hardware thread that can execute at most one thread at a time. Each
CPU must have a physical ID that is unique in a node. In ovni there is also a
virtual CPU, which simply is used to collect threads that are not tied to an
specific physical CPU, so it cannot be easily determined where they are running.
### Node
A *node* refers to a compute node, often a physical machine with memory and
network which may contain one or more
[sockets](https://en.wikipedia.org/wiki/CPU_socket), where each socket has one
or more CPUs.
### System
A system represents the complete set of hardware parts and software parts that
are known to ovni in a given trace.

View File

@ -0,0 +1,516 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="306.91663mm"
height="127.00001mm"
viewBox="0 0 306.91663 127.00001"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="part-model.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.73049944"
inkscape:cx="629.70616"
inkscape:cy="280.62992"
inkscape:window-width="1920"
inkscape:window-height="1031"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
id="grid1"
units="px"
originx="-74.083327"
originy="-89.958345"
spacingx="0.26458333"
spacingy="0.26458334"
empcolor="#7a7aff"
empopacity="0.25098039"
color="#6a6aff"
opacity="0.1254902"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
visible="false" />
</sodipodi:namedview>
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-74.083328,-89.958344)">
<rect
style="fill:none;stroke:none;stroke-width:0.264999;stroke-linecap:square;stroke-dasharray:none;stroke-dashoffset:0"
id="rect33"
width="306.91663"
height="127.00001"
x="74.083328"
y="89.958344" />
<rect
style="fill:#ffeeaa;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none;stroke-dashoffset:0"
id="rect32"
width="121.70832"
height="84.666679"
x="253.99998"
y="127.00001" />
<text
xml:space="preserve"
style="font-size:6.35px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="290.19363"
y="202.25124"
id="text32"><tspan
sodipodi:role="line"
id="tspan32"
style="font-size:6.35px;stroke-width:0.264583"
x="290.19363"
y="202.25124">Hardware parts</tspan></text>
<rect
style="fill:#eeffaa;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none;stroke-dashoffset:0"
id="rect31"
width="169.33333"
height="84.666679"
x="79.374992"
y="127.00001" />
<rect
style="fill:#fff6d5;stroke:#000000;stroke-width:0.3;stroke-linecap:square;stroke-dasharray:none;stroke-dashoffset:0"
id="rect27"
width="47.625004"
height="21.166676"
x="269.87497"
y="148.16667"
ry="2.645834" />
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect1"
width="21.166662"
height="10.583329"
x="84.566666"
y="174.52502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="87.947342"
y="181.39488"
id="text1"><tspan
sodipodi:role="line"
id="tspan1"
style="stroke-width:0.264583"
x="87.947342"
y="181.39488">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect3"
width="21.166664"
height="10.583337"
x="111.12499"
y="153.45834"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="113.57446"
y="160.26309"
id="text3"><tspan
sodipodi:role="line"
id="tspan3"
style="stroke-width:0.264583"
x="113.57446"
y="160.26309">Process</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect4"
width="21.166664"
height="10.583333"
x="111.12499"
y="174.62502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="114.50567"
y="181.49487"
id="text4"><tspan
sodipodi:role="line"
id="tspan4"
style="stroke-width:0.264583"
x="114.50567"
y="181.49487">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect5"
width="21.166658"
height="10.583333"
x="137.58333"
y="174.62502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="140.964"
y="181.49487"
id="text5"><tspan
sodipodi:role="line"
id="tspan5"
style="stroke-width:0.264583"
x="140.964"
y="181.49487">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect6"
width="21.166672"
height="10.583333"
x="169.33331"
y="174.62502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="172.71399"
y="181.49487"
id="text6"><tspan
sodipodi:role="line"
id="tspan6"
style="stroke-width:0.264583"
x="172.71399"
y="181.49487">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect7"
width="20.966642"
height="10.38336"
x="195.99167"
y="153.55833"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="198.24112"
y="160.16312"
id="text7"><tspan
sodipodi:role="line"
id="tspan7"
style="stroke-width:0.264583"
x="198.24112"
y="160.16312">Process</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect8"
width="21.16667"
height="10.583333"
x="195.79164"
y="174.62502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="199.17232"
y="181.49487"
id="text8"><tspan
sodipodi:role="line"
id="tspan8"
style="stroke-width:0.264583"
x="199.17232"
y="181.49487">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect9"
width="21.166666"
height="10.583333"
x="222.24997"
y="174.62502"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="225.63065"
y="181.49487"
id="text9"><tspan
sodipodi:role="line"
id="tspan9"
style="stroke-width:0.264583"
x="225.63065"
y="181.49487">Thread</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect10"
width="21.166658"
height="10.583337"
x="153.45833"
y="132.29167"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="158.21979"
y="139.09644"
id="text10"><tspan
sodipodi:role="line"
id="tspan10"
style="stroke-width:0.264583"
x="158.21979"
y="139.09644">Loom</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect11"
width="21.166651"
height="10.58334"
x="306.91666"
y="132.29167"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="311.88068"
y="139.16154"
id="text11"><tspan
sodipodi:role="line"
id="tspan11"
style="stroke-width:0.264583"
x="311.88068"
y="139.16154">Node</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect12"
width="15.875001"
height="10.583341"
x="275.16666"
y="153.45834"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="278.86566"
y="160.291"
id="text12"><tspan
sodipodi:role="line"
id="tspan12"
style="stroke-width:0.264583"
x="278.86566"
y="160.291">CPU</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect13"
width="15.874983"
height="10.583341"
x="296.33334"
y="153.45834"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="300.03235"
y="160.291"
id="text13"><tspan
sodipodi:role="line"
id="tspan13"
style="stroke-width:0.264583"
x="300.03235"
y="160.291">CPU</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 121.70832,164.04168 0,10.58334"
id="path15"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect3"
inkscape:connection-end="#rect4" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 206.45046,163.94169 -0.0505,10.68333"
id="path16"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect7"
inkscape:connection-end="#rect8" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 212.94006,163.94169 13.30366,10.68333"
id="path17"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-end="#rect9"
inkscape:connection-start="#rect7" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 199.96086,163.94169 -13.40463,10.68333"
id="path18"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect7"
inkscape:connection-end="#rect6" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 128.32291,164.04168 13.22917,10.58334"
id="path19"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect3"
inkscape:connection-end="#rect5" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 115.03723,164.04168 -13.21614,10.48334"
id="path20"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect3"
inkscape:connection-end="#rect1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 153.45833,142.87501 -21.16667,10.58333"
id="path21"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect10"
inkscape:connection-end="#rect3" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 174.62499,142.86254 21.44212,10.69579"
id="path22"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect10"
inkscape:connection-end="#rect7" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 314.19269,142.87501 -6.61457,10.58333"
id="path24"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect11"
inkscape:connection-end="#rect13" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 308.90102,142.87501 291.04166,153.8654"
id="path25"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect11"
inkscape:connection-end="#rect12" />
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect25"
width="15.875013"
height="10.583337"
x="322.79163"
y="153.45834"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="326.49063"
y="160.291"
id="text25"><tspan
sodipodi:role="line"
id="tspan25"
style="stroke-width:0.264583"
x="326.49063"
y="160.291">CPU</tspan></text>
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect26"
width="15.874991"
height="10.583337"
x="343.95831"
y="153.45834"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="347.65732"
y="160.291"
id="text26"><tspan
sodipodi:role="line"
id="tspan26"
style="stroke-width:0.264583"
x="347.65732"
y="160.291">CPU</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 320.80727,142.87501 6.61457,10.58333"
id="path26"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect11"
inkscape:connection-end="#rect25" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 326.09894,142.87501 17.85937,10.99039"
id="path27"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect11"
inkscape:connection-end="#rect26" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 174.62499,139.70001 95.24998,19.05"
id="path28"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect10" />
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-linecap:square;stroke-dasharray:none"
id="rect29"
width="21.166666"
height="10.583335"
x="216.95831"
y="95.250008"
ry="0" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="219.6889"
y="101.67236"
id="text29"><tspan
sodipodi:role="line"
id="tspan29"
style="stroke-width:0.264583"
x="219.6889"
y="101.67236">System</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 238.12498,104.89952 68.79168,28.32598"
id="path29"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect29"
inkscape:connection-end="#rect11" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 218.47022,105.83334 -45.35713,26.45833"
id="path30"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect29"
inkscape:connection-end="#rect10" />
<text
xml:space="preserve"
style="font-size:6.35px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="140.81671"
y="202.25124"
id="text31"><tspan
sodipodi:role="line"
id="tspan31"
style="font-size:6.35px;stroke-width:0.264583"
x="140.81671"
y="202.25124">Software parts</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 18 KiB

123
doc/user/concepts/trace.md Normal file
View File

@ -0,0 +1,123 @@
# Trace concepts
When using libovni to generate traces or the emulator to process them, there are
several concepts to keep in mind.
## Trace elements
The information generated by a program or later processed by other ovni tools is
known as a trace. A runtime trace stores the information as-is in disk from a
program execution. While a emulation trace is generated from the runtime trace
for visualization with Paraver.
Both runtime and emulation traces are always stored inside the same directory,
by default `ovni/`, which is known as the *trace directory*.
Here are the components of a runtime trace, as generated by libovni:
<p align="center">
<img alt="Trace concepts" src="../trace.svg">
</p>
### Stream
A stream is a directory which contains a binary stream and the associated stream
metadata file. Each stream is associated with a given part of a system. As of
now, libovni can only generate streams associated to [threads](part-model.md#thread).
### Stream metadata
The stream metadata is a JSON file named `stream.json` which holds information
about the stream itself.
### Binary stream
A binary stream is a file named `stream.obs` (.obs stands for Ovni Binary
Stream) composed of a header and a concatenated array of events without padding.
Notice that each event may have different length.
### Event
An event is a point in time that has some information associated. Events written
at runtime by libovni have at MCV, a clock and a optional payload. The list of
all events recognized by the emulator can be found [here](../emulation/events.md).
Events can be displayed by ovnidump, which shows an explanation of what the
event means:
```txt
$ ovnidump ovni/loom.hop.nosv-u1000/proc.1121064 | grep -A 10 VTx | head
517267929632815 VTx thread.1121064 executes the task 1 with bodyid 0
517267930261672 VYc thread.1121064 creates task type 2 with label "task"
517267930875858 VTC thread.1121064 creates parallel task 2 with type 2
517267930877789 VU[ thread.1121064 starts submitting a task
517267930877990 VU] thread.1121064 stops submitting a task
517267930878098 VTC thread.1121064 creates parallel task 3 with type 2
517267930878196 VU[ thread.1121064 starts submitting a task
517267930878349 VU] thread.1121064 stops submitting a task
517267930878432 VTC thread.1121064 creates parallel task 4 with type 2
517267930878494 VU[ thread.1121064 starts submitting a task
```
There are two types or events: normal and jumbo events, the latter can hold
large attached payloads.
### MCV
The MCV acronym is the abbreviation of Model-Class-Value, which are a three
characters that identify any event. The MCV is shown in the ovnitop and ovnidump
tools and allows easy filtering with grep, for a single or related events:
```
$ ovnitop ovni | grep VT
VTe 20002
VTx 20002
VTC 200
VTc 2
VTp 1
VTr 1
```
### Clock
A clock is a 64 bit counter, which counts the number of nanoseconds from an
arbitrary point in time in the past. Each event has the value of the clock
stored inside, to indicate when that event happened. In a given trace there can
be multiple clocks which don't refer to the same point in the past and must be
corrected so they all produce an ordered sequence of events. The ovnisync
program performs this correction by measuring the difference across clocks of
different nodes.
### Payload
Events may have associated additional information which is stored in the stream.
Normal events can hold up to 16 bytes, otherwise the jumbo events must be used
to hold additional payload.
## Other related concepts
Apart from the trace itself, there are other concepts to keep in mind when the
trace is being processed by the emulator.
### Event model
Each event belongs to an event model, as identified by the model character in
the MCV. An event model is composed of several components:
- A set of [events](#event) all with the same model identifier in the
[MCV](#mcv)
- The emulator code that processes those events.
- A human readable name, like `ovni` or `nanos6`.
- A semantic version.
### State
A state is a discrete value that can change over time based on the events the
emulator receives. Usually a single event causes a single state change, which is
then written to the Paraver traces. An example is the thread state, which can
change over time based on the events `OH*` that indicate a state transition
of the current thread.
In contrast with an event, states have a duration associated which can usually
be observed in Paraver. Notice that the trace only contains events, the states
are computed at emulation.

474
doc/user/concepts/trace.svg Normal file
View File

@ -0,0 +1,474 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="116.41666mm"
height="105.83334mm"
viewBox="0 0 116.41666 105.83334"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="trace.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="true"
inkscape:zoom="1.4609989"
inkscape:cx="248.80238"
inkscape:cy="199.17879"
inkscape:window-width="1920"
inkscape:window-height="1031"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
id="grid1"
units="px"
originx="-39.687498"
originy="-15.875"
spacingx="0.26458333"
spacingy="0.26458334"
empcolor="#7a7aff"
empopacity="0.25098039"
color="#6a6aff"
opacity="0.1254902"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
visible="true" />
</sodipodi:namedview>
<defs
id="defs1">
<rect
x="45"
y="370"
width="209.99998"
height="35"
id="rect15" />
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-39.687498,-15.875)">
<g
id="g59"
transform="translate(5.5781353,-0.74017783)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="100.23113"
y="24.896034"
id="text22"><tspan
sodipodi:role="line"
id="tspan22"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="100.23113"
y="24.896034">Trace</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect32"
width="15.875"
height="7.9375005"
x="92.281235"
y="19.4142" />
</g>
<g
id="g57"
transform="translate(-0.84260657,-0.98969722)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="106.39689"
y="46.186943"
id="text24"><tspan
sodipodi:role="line"
id="tspan24"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="106.39689"
y="46.186943">Stream</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect33"
width="21.166666"
height="7.9375019"
x="96.092606"
y="40.6772" />
</g>
<g
id="g56"
transform="translate(0.32292488,-0.89336269)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="78.773026"
y="46.090603"
id="text23"><tspan
sodipodi:role="line"
id="tspan23"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="78.773026"
y="46.090603">Stream</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect34"
width="21.166666"
height="7.9375"
x="68.468742"
y="40.580864" />
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 100.80665,26.611522 84.365216,39.687501"
id="path35"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect32"
inkscape:connection-end="#rect34" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 105.80376,26.611522 0.0227,13.075981"
id="path36"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect32"
inkscape:connection-end="#rect33" />
<g
id="g54"
style="stroke-width:0.15875;stroke-dasharray:none"
transform="translate(-0.99999828,-3.5391978)">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="58.792854"
y="72.586143"
id="text25"><tspan
sodipodi:role="line"
id="tspan25"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="58.792854"
y="72.586143">Metadata</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect36"
width="26.458336"
height="7.9375"
x="45.979164"
y="67.0392" />
</g>
<g
id="g55"
style="stroke-width:0.15875;stroke-dasharray:none"
transform="translate(-0.99999828,-3.5391978)">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="97.157433"
y="72.175835"
id="text26"><tspan
sodipodi:role="line"
id="tspan26"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="97.157433"
y="72.175835">Binary stream</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect37"
width="34.395832"
height="7.9375"
x="80.374992"
y="67.0392" />
</g>
<rect
style="stroke-width:0.15875;stroke-dasharray:none;fill:none;stroke:none;stroke-linecap:square"
id="rect60"
width="116.41666"
height="105.83334"
x="40.687496"
y="19.414198"
inkscape:label="background"
transform="translate(-0.99999735,-3.5391979)" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 75.847223,47.625001 61.736111,63.500002"
id="path37"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect34"
inkscape:connection-end="#rect36" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 82.241318,47.625001 93.706592,63.500002"
id="path38"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect34"
inkscape:connection-end="#rect37" />
<g
id="g53"
style="stroke-width:0.15875;stroke-dasharray:none"
transform="translate(-8.2507438,-3.0742007)">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="62.074863"
y="95.933655"
id="text27"><tspan
sodipodi:role="line"
id="tspan27"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="62.074863"
y="95.933655">Header</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect38"
width="23.812506"
height="7.9375014"
x="50.584076"
y="90.386703" />
</g>
<g
id="g52"
transform="translate(-8.2507438,-3.3066989)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="91.411552"
y="96.101036"
id="text28"><tspan
sodipodi:role="line"
id="tspan28"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="91.411552"
y="96.101036">Event</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect39"
width="23.812506"
height="7.9375014"
x="79.920769"
y="90.619202" />
</g>
<g
id="g51"
style="stroke-width:0.15875;stroke-dasharray:none"
transform="translate(-8.2507438,-3.0742007)">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="120.28321"
y="95.868538"
id="text29"><tspan
sodipodi:role="line"
id="tspan29"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="120.28321"
y="95.868538">Event</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect40"
width="23.812506"
height="7.9375014"
x="108.79243"
y="90.386703" />
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 89.517356,71.437502 61.29514,87.312503"
id="path40"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect37"
inkscape:connection-end="#rect38" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 94.406805,71.437502 85.742383,87.312503"
id="path41"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect37"
inkscape:connection-end="#rect39" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 99.218748,71.437502 109.8021,87.312503"
id="path42"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect37"
inkscape:connection-end="#rect40" />
<g
id="g46"
transform="translate(-68.659367,2.7781237)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="123.93869"
y="113.98891"
id="text30"><tspan
sodipodi:role="line"
id="tspan30"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="123.93869"
y="113.98891">MCV</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect42"
width="15.875001"
height="7.9375038"
x="116.41666"
y="108.47917" />
</g>
<g
id="g45"
transform="translate(-68.659367,5.4239515)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="147.92894"
y="111.38029"
id="text31"><tspan
sodipodi:role="line"
id="tspan31"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="147.92894"
y="111.38029">Clock</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect43"
width="15.875001"
height="7.9375038"
x="140.22916"
y="105.83334" />
</g>
<g
id="g44"
transform="translate(-66.112857,13.610614)"
style="stroke-width:0.15875;stroke-dasharray:none">
<g
id="g60"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="172.85362"
y="102.65102"
id="text32"><tspan
sodipodi:role="line"
id="tspan32"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="172.85362"
y="102.65102">Payload</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect44"
width="23.812506"
height="7.9375014"
x="161.36285"
y="97.514389" />
</g>
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 83.366344,95.250004 80.27399,111.2573"
id="path47"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-end="#g45" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 80.082847,95.250004 60.540101,111.2573"
id="path48"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-end="#g46" />
<g
id="g58"
transform="translate(-1.9073076,-1.4153422)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="132.47266"
y="46.496338"
id="text49"><tspan
sodipodi:role="line"
id="tspan49"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="132.47266"
y="46.496338">...</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect49"
width="18.619415"
height="7.9374995"
x="123.61564"
y="41.102844" />
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 110.56031,26.611522 15.69429,13.07598"
id="path49"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-end="#rect49"
inkscape:connection-start="#rect32" />
<g
id="g50"
transform="translate(-8.2507438,-2.9293636)"
style="stroke-width:0.15875;stroke-dasharray:none">
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="149.35014"
y="95.635361"
id="text50"><tspan
sodipodi:role="line"
id="tspan50"
style="text-align:center;text-anchor:middle;stroke-width:0.15875;stroke-dasharray:none"
x="149.35014"
y="95.635361">...</tspan></text>
<rect
style="fill:none;stroke:#000000;stroke-width:0.15875;stroke-linecap:square;stroke-dasharray:none"
id="rect40-5"
width="23.812506"
height="7.9375014"
x="137.89658"
y="90.241867" />
</g>
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="m 104.06944,71.437502 29.98612,15.875001"
id="path50"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#rect37"
inkscape:connection-end="#g50" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.15875;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 87.506274,95.250004 103.22625,111.125"
id="path60"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0"
inkscape:connection-start="#g52"
inkscape:connection-end="#g44" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,11 +1,11 @@
# Emulator events
This is a exhaustive list of the events recognized by the emulator.
Built on Feb 15 2024.
Built on Nov 13 2024.
## Model nanos6
List of events for the model *nanos6* with identifier **`6`** at version `1.0.0`:
List of events for the model *nanos6* with identifier **`6`** at version `1.1.0`:
<dl>
<dt><a id="6Yc" href="#6Yc"><pre>6Yc+(u32 typeid, str label)</pre></a></dt>
<dd>creates task type %{typeid} with label &quot;%{label}&quot;</dd>
@ -185,9 +185,9 @@ List of events for the model *nodes* with identifier **`D`** at version `1.0.0`:
List of events for the model *kernel* with identifier **`K`** at version `1.0.0`:
<dl>
<dt><a id="KO[" href="#KO["><pre>KO[</pre></a></dt>
<dt><a id="KCO" href="#KCO"><pre>KCO</pre></a></dt>
<dd>out of CPU</dd>
<dt><a id="KO]" href="#KO]"><pre>KO]</pre></a></dt>
<dt><a id="KCI" href="#KCI"><pre>KCI</pre></a></dt>
<dd>back to CPU</dd>
</dl>
@ -395,7 +395,7 @@ List of events for the model *mpi* with identifier **`M`** at version `1.0.0`:
## Model ovni
List of events for the model *ovni* with identifier **`O`** at version `1.0.0`:
List of events for the model *ovni* with identifier **`O`** at version `1.1.0`:
<dl>
<dt><a id="OAr" href="#OAr"><pre>OAr(i32 cpu, i32 tid)</pre></a></dt>
<dd>changes the affinity of thread %{tid} to CPU %{cpu}</dd>
@ -427,11 +427,17 @@ List of events for the model *ovni* with identifier **`O`** at version `1.0.0`:
<dd>enters unordered event region</dd>
<dt><a id="OU]" href="#OU]"><pre>OU]</pre></a></dt>
<dd>leaves unordered event region</dd>
<dt><a id="OM[" href="#OM["><pre>OM[(i64 value, i32 type)</pre></a></dt>
<dd>push mark with value %{value} from type %{type}</dd>
<dt><a id="OM]" href="#OM]"><pre>OM](i64 value, i32 type)</pre></a></dt>
<dd>pop mark with value %{value} from type %{type}</dd>
<dt><a id="OM=" href="#OM="><pre>OM=(i64 value, i32 type)</pre></a></dt>
<dd>set mark with value %{value} from type %{type}</dd>
</dl>
## Model openmp
List of events for the model *openmp* with identifier **`P`** at version `1.1.0`:
List of events for the model *openmp* with identifier **`P`** at version `1.2.0`:
<dl>
<dt><a id="PBb" href="#PBb"><pre>PBb</pre></a></dt>
<dd>begins plain barrier</dd>
@ -557,6 +563,18 @@ List of events for the model *openmp* with identifier **`P`** at version `1.1.0`
<dd>begins initialization</dd>
<dt><a id="PCI" href="#PCI"><pre>PCI</pre></a></dt>
<dd>ceases initialization</dd>
<dt><a id="POc" href="#POc"><pre>POc+(u32 typeid, str label)</pre></a></dt>
<dd>creates a type %{typeid} with label &quot;%{label}&quot;</dd>
<dt><a id="PPc" href="#PPc"><pre>PPc(u32 taskid, u32 typeid)</pre></a></dt>
<dd>creates the task %{taskid} with type %{typeid}</dd>
<dt><a id="PPx" href="#PPx"><pre>PPx(u32 taskid)</pre></a></dt>
<dd>executes the task %{taskid}</dd>
<dt><a id="PPe" href="#PPe"><pre>PPe(u32 taskid)</pre></a></dt>
<dd>ends the task %{taskid}</dd>
<dt><a id="PQx" href="#PQx"><pre>PQx(u32 typeid)</pre></a></dt>
<dd>begins worksharing with type %{typeid}</dd>
<dt><a id="PQe" href="#PQe"><pre>PQe(u32 typeid)</pre></a></dt>
<dd>ends worksharing with type %{typeid}</dd>
</dl>
## Model tampi
@ -615,18 +633,20 @@ List of events for the model *tampi* with identifier **`T`** at version `1.0.0`:
## Model nosv
List of events for the model *nosv* with identifier **`V`** at version `1.1.0`:
List of events for the model *nosv* with identifier **`V`** at version `2.4.0`:
<dl>
<dt><a id="VTc" href="#VTc"><pre>VTc(u32 taskid, u32 typeid)</pre></a></dt>
<dd>creates task %{taskid} with type %{typeid}</dd>
<dt><a id="VTx" href="#VTx"><pre>VTx(u32 taskid)</pre></a></dt>
<dd>executes the task %{taskid}</dd>
<dt><a id="VTe" href="#VTe"><pre>VTe(u32 taskid)</pre></a></dt>
<dd>ends the task %{taskid}</dd>
<dt><a id="VTp" href="#VTp"><pre>VTp(u32 taskid)</pre></a></dt>
<dd>pauses the task %{taskid}</dd>
<dt><a id="VTr" href="#VTr"><pre>VTr(u32 taskid)</pre></a></dt>
<dd>resumes the task %{taskid}</dd>
<dt><a id="VTC" href="#VTC"><pre>VTC(u32 taskid, u32 typeid)</pre></a></dt>
<dd>creates parallel task %{taskid} with type %{typeid}</dd>
<dt><a id="VTx" href="#VTx"><pre>VTx(u32 taskid, u32 bodyid)</pre></a></dt>
<dd>executes the task %{taskid} with bodyid %{bodyid}</dd>
<dt><a id="VTe" href="#VTe"><pre>VTe(u32 taskid, u32 bodyid)</pre></a></dt>
<dd>ends the task %{taskid} with bodyid %{bodyid}</dd>
<dt><a id="VTp" href="#VTp"><pre>VTp(u32 taskid, u32 bodyid)</pre></a></dt>
<dd>pauses the task %{taskid} with bodyid %{bodyid}</dd>
<dt><a id="VTr" href="#VTr"><pre>VTr(u32 taskid, u32 bodyid)</pre></a></dt>
<dd>resumes the task %{taskid} with bodyid %{bodyid}</dd>
<dt><a id="VYc" href="#VYc"><pre>VYc+(u32 typeid, str label)</pre></a></dt>
<dd>creates task type %{typeid} with label &quot;%{label}&quot;</dd>
<dt><a id="VSr" href="#VSr"><pre>VSr</pre></a></dt>
@ -691,6 +711,34 @@ List of events for the model *nosv* with identifier **`V`** at version `1.1.0`:
<dd>enters nosv_detach()</dd>
<dt><a id="VAE" href="#VAE"><pre>VAE</pre></a></dt>
<dd>leaves nosv_detach()</dd>
<dt><a id="VAl" href="#VAl"><pre>VAl</pre></a></dt>
<dd>enters nosv_mutex_lock()</dd>
<dt><a id="VAL" href="#VAL"><pre>VAL</pre></a></dt>
<dd>leaves nosv_mutex_lock()</dd>
<dt><a id="VAt" href="#VAt"><pre>VAt</pre></a></dt>
<dd>enters nosv_mutex_trylock()</dd>
<dt><a id="VAT" href="#VAT"><pre>VAT</pre></a></dt>
<dd>leaves nosv_mutex_trylock()</dd>
<dt><a id="VAu" href="#VAu"><pre>VAu</pre></a></dt>
<dd>enters nosv_mutex_unlock()</dd>
<dt><a id="VAU" href="#VAU"><pre>VAU</pre></a></dt>
<dd>leaves nosv_mutex_unlock()</dd>
<dt><a id="VAb" href="#VAb"><pre>VAb</pre></a></dt>
<dd>enters nosv_barrier_wait()</dd>
<dt><a id="VAB" href="#VAB"><pre>VAB</pre></a></dt>
<dd>leaves nosv_barrier_wait()</dd>
<dt><a id="VAo" href="#VAo"><pre>VAo</pre></a></dt>
<dd>enters nosv_cond_wait()</dd>
<dt><a id="VAO" href="#VAO"><pre>VAO</pre></a></dt>
<dd>leaves nosv_cond_wait()</dd>
<dt><a id="VAg" href="#VAg"><pre>VAg</pre></a></dt>
<dd>enters nosv_cond_signal()</dd>
<dt><a id="VAG" href="#VAG"><pre>VAG</pre></a></dt>
<dd>leaves nosv_cond_signal()</dd>
<dt><a id="VAk" href="#VAk"><pre>VAk</pre></a></dt>
<dd>enters nosv_cond_broadcast()</dd>
<dt><a id="VAK" href="#VAK"><pre>VAK</pre></a></dt>
<dd>leaves nosv_cond_broadcast()</dd>
<dt><a id="VHa" href="#VHa"><pre>VHa</pre></a></dt>
<dd>enters nosv_attach()</dd>
<dt><a id="VHA" href="#VHA"><pre>VHA</pre></a></dt>
@ -703,4 +751,10 @@ List of events for the model *nosv* with identifier **`V`** at version `1.1.0`:
<dd>begins execution as delegate</dd>
<dt><a id="VHD" href="#VHD"><pre>VHD</pre></a></dt>
<dd>ceases execution as delegate</dd>
<dt><a id="VPp" href="#VPp"><pre>VPp</pre></a></dt>
<dd>sets progress state to Progressing</dd>
<dt><a id="VPr" href="#VPr"><pre>VPr</pre></a></dt>
<dd>sets progress state to Resting</dd>
<dt><a id="VPa" href="#VPa"><pre>VPa</pre></a></dt>
<dd>sets progress state to Absorbing</dd>
</dl>

View File

@ -0,0 +1,9 @@
digraph {
graph [size="6!", ranksep="0.7", nodesep="1"];
Created -> Running;
Running -> Paused [label=BODY_FLAG_PAUSE];
Paused -> Running;
Running -> Dead;
Dead -> Running [label="BODY_FLAG_RESURRECT\niteration++"];
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 8.1.0 (0)
-->
<!-- Pages: 1 -->
<svg width="432pt" height="202pt"
viewBox="0.00 0.00 432.00 202.47" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(0.805048 0.805048) rotate(0) translate(4 247.5)">
<polygon fill="white" stroke="none" points="-4,4 -4,-247.5 532.61,-247.5 532.61,4 -4,4"/>
<!-- Created -->
<g id="node1" class="node">
<title>Created</title>
<ellipse fill="none" stroke="black" cx="246.61" cy="-225.5" rx="51.21" ry="18"/>
<text text-anchor="middle" x="246.61" y="-220.82" font-family="Times,serif" font-size="14.00">Created</text>
</g>
<!-- Running -->
<g id="node2" class="node">
<title>Running</title>
<ellipse fill="none" stroke="black" cx="246.61" cy="-138.5" rx="53.31" ry="18"/>
<text text-anchor="middle" x="246.61" y="-133.82" font-family="Times,serif" font-size="14.00">Running</text>
</g>
<!-- Created&#45;&gt;Running -->
<g id="edge1" class="edge">
<title>Created&#45;&gt;Running</title>
<path fill="none" stroke="black" d="M246.61,-207.3C246.61,-195.97 246.61,-180.86 246.61,-167.79"/>
<polygon fill="black" stroke="black" points="250.11,-167.97 246.61,-157.97 243.11,-167.97 250.11,-167.97"/>
</g>
<!-- Paused -->
<g id="node3" class="node">
<title>Paused</title>
<ellipse fill="none" stroke="black" cx="132.61" cy="-18" rx="47" ry="18"/>
<text text-anchor="middle" x="132.61" y="-13.32" font-family="Times,serif" font-size="14.00">Paused</text>
</g>
<!-- Running&#45;&gt;Paused -->
<g id="edge2" class="edge">
<title>Running&#45;&gt;Paused</title>
<path fill="none" stroke="black" d="M193.44,-135.87C130.26,-132.68 30.43,-123.26 7.11,-95.5 -2.75,-83.76 -1.84,-73.44 7.11,-61 22.79,-39.22 50.29,-28.57 75.56,-23.43"/>
<polygon fill="black" stroke="black" points="75.98,-26.73 85.22,-21.55 74.76,-19.84 75.98,-26.73"/>
<text text-anchor="middle" x="80.36" y="-73.58" font-family="Times,serif" font-size="14.00">BODY_FLAG_PAUSE</text>
</g>
<!-- Dead -->
<g id="node4" class="node">
<title>Dead</title>
<ellipse fill="none" stroke="black" cx="343.61" cy="-18" rx="37" ry="18"/>
<text text-anchor="middle" x="343.61" y="-13.32" font-family="Times,serif" font-size="14.00">Dead</text>
</g>
<!-- Running&#45;&gt;Dead -->
<g id="edge4" class="edge">
<title>Running&#45;&gt;Dead</title>
<path fill="none" stroke="black" d="M260.31,-120.77C276.79,-100.63 304.62,-66.64 323.53,-43.53"/>
<polygon fill="black" stroke="black" points="326.68,-46.22 330.3,-36.26 321.26,-41.78 326.68,-46.22"/>
</g>
<!-- Paused&#45;&gt;Running -->
<g id="edge3" class="edge">
<title>Paused&#45;&gt;Running</title>
<path fill="none" stroke="black" d="M148.33,-35.34C167.75,-55.52 200.96,-90.04 223.34,-113.31"/>
<polygon fill="black" stroke="black" points="220.31,-115.24 229.76,-120.02 225.35,-110.39 220.31,-115.24"/>
</g>
<!-- Dead&#45;&gt;Running -->
<g id="edge5" class="edge">
<title>Dead&#45;&gt;Running</title>
<path fill="none" stroke="black" d="M343.24,-36.22C342.05,-52.96 337.96,-78.31 324.61,-95.5 316.51,-105.94 305.06,-114.1 293.42,-120.34"/>
<polygon fill="black" stroke="black" points="292.09,-117.59 284.66,-125.14 295.18,-123.87 292.09,-117.59"/>
<text text-anchor="middle" x="434.11" y="-82.2" font-family="Times,serif" font-size="14.00">BODY_FLAG_RESURRECT</text>
<text text-anchor="middle" x="434.11" y="-64.95" font-family="Times,serif" font-size="14.00">iteration++</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="117.73958mm"
height="26.458332mm"
viewBox="0 0 117.73958 26.458332"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="parallel-tasks.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="true"
inkscape:zoom="1.4289282"
inkscape:cx="335.21629"
inkscape:cy="58.085495"
inkscape:window-width="1914"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
id="grid1"
units="px"
originx="-9.9999997"
originy="-9.9999997"
spacingx="0.26458333"
spacingy="0.26458334"
empcolor="#3f3fff"
empopacity="0.25098039"
color="#3f3fff"
opacity="0.1254902"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
visible="true" />
</sodipodi:namedview>
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-2.6458333,-2.6458333)">
<rect
style="fill:none;stroke:none;stroke-width:0.3;stroke-linecap:round"
id="rect9"
width="117.73958"
height="26.458332"
x="2.6458333"
y="2.6458333" />
<rect
style="fill:#f2f2f2;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect1"
width="44.979168"
height="23.8125"
x="3.96875"
y="3.9687502" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="6.6805291"
y="9.5720644"
id="text1"><tspan
sodipodi:role="line"
id="tspan1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans';stroke-width:0.264583"
x="6.6805291"
y="9.5720644">Normal task</tspan></text>
<rect
style="fill:#d5ffd5;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect3"
width="39.6875"
height="10.583333"
x="6.614583"
y="14.552083" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="18.784389"
y="21.011637"
id="text3"><tspan
sodipodi:role="line"
id="tspan3"
style="stroke-width:0.264583"
x="18.784389"
y="21.011637">Body 1</tspan></text>
<rect
style="fill:#f2f2f2;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect4"
width="67.46875"
height="23.8125"
x="51.59375"
y="3.9687502" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="54.704952"
y="9.4792204"
id="text4"><tspan
sodipodi:role="line"
id="tspan4"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans';stroke-width:0.264583"
x="54.704952"
y="9.4792204">Parallel task</tspan></text>
<rect
style="fill:#d5ffd5;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect6"
width="21.166662"
height="10.583335"
x="54.239586"
y="14.552083" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="57.148972"
y="21.011637"
id="text6"><tspan
sodipodi:role="line"
id="tspan6"
style="stroke-width:0.264583"
x="57.148972"
y="21.011637">Body 1</tspan></text>
<rect
style="fill:#d5ffd5;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect7"
width="21.166662"
height="10.583335"
x="78.052078"
y="14.552084" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="80.997643"
y="21.011639"
id="text7"><tspan
sodipodi:role="line"
id="tspan7"
style="stroke-width:0.264583"
x="80.997643"
y="21.011639">Body 2</tspan></text>
<rect
style="fill:#d5ffd5;stroke:#000000;stroke-width:0.3;stroke-linecap:round"
id="rect8"
width="14.552085"
height="10.583334"
x="101.86458"
y="14.552084" />
<text
xml:space="preserve"
style="font-size:4.23333px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
x="105.3207"
y="20.895952"
id="text8"><tspan
sodipodi:role="line"
id="tspan8"
style="stroke-width:0.264583"
x="105.3207"
y="20.895952">...</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -47,7 +47,7 @@ the following elements:
- A single byte model identification (for example `O`).
- A set of runtime events with that model identification (see the [list
of events](events)).
of events](events.md)).
- Rules that determine which sequences of events are valid.
- The emulation hooks that process each event and modify the state of
the emulator.

View File

@ -1,9 +1,42 @@
# nOS-V model
The [nOS-V library][nosv] implements a user space runtime that can schedule
tasks to run in multiple CPUs. The nOS-V library is instrumented to
track the internal state of the runtime as well as emit information
about the tasks that are running.
[nosv]: https://github.com/bsc-pm/nos-v
## Task model
The nOS-V runtime is composed of tasks that can be scheduled to run in
threads. Tasks can be paused and resumed, leaving the CPUs free to
execute other tasks. The nOS-V model tracks the state of each task as
well as the state of the runtime internal state.
execute other tasks.
In nOS-V, parallel tasks can also be scheduled multiple times and the
same task may run concurrently in several CPUs. To model this scenario,
we introduce the concept of *body*, which maps to each execution of the
same task, with a unique body id.
![Parallel tasks](fig/parallel-tasks.svg)
A normal task only has one body, while a parallel task (created with
`TASK_FLAG_PARALLEL`) can have more than one body. Each body holds the
execution state, and can transition to different execution states
following this state diagram:
![Body model](fig/body-model.svg)
Bodies begin in the Created state and transition to Running when they
begin the execution. Bodies that can be paused (created with the flag
`BODY_FLAG_PAUSE` can transition to the Paused state.
Additionally, bodies can run multiple times if they are created with the
`BODY_FLAG_RESURRECT`, and transition from Dead to Running. This
transition is required to model the tasks that implement the taskiter in
NODES, which will be submitted multiple times for execution reusing the
same task id and body id. Every time a body runs again, the iteration
number is increased.
## Task type colors
@ -27,4 +60,47 @@ For more details, see [this MR][1].
The subsystem view provides a simplified view on what is the nOS-V
runtime doing over time. The view follows the same rules described in
the [subsystem view of Nanos6](../nanos6/#subsystem_view).
the [subsystem view of Nanos6](nanos6.md/#subsystem_view).
## Idle view
The idle view shows the progress state of the running threads:
*Progressing* and *Resting*. The *Progressing* state is shown when they
are making useful progress and the *Resting* state when they are waiting
for work. When workers start running, by definition, they begin in the
Progressing state and there are some situations that make them
transition to Resting:
- When workers are waiting in the delegation lock after some spins or
when instructed to go to sleep.
- When the server is trying to serve tasks, but there are no more tasks
available.
They will go back to Progressing as soon as they receive work. The
specific points at which they do so can be read in [nOS-V source
code](https://gitlab.bsc.es/nos-v/nos-v) by looking at the
`instr_worker_resting()` and `instr_worker_progressing()` trace points.
This view is intended to detect parts of the execution time on which the
workers don't have work, typically because the application doesn't have
enough parallelism or the scheduler is unable to serve work fast enough.
## Breakdown view
The breakdown view displays a summary of what is happening in all CPUs
by mixing in a single timeline the subsystem, idle and task type views.
Specifically, it shows how many CPUs are resting as defined by the idle
view, how many are inside a given task by showing the task type label,
and how many are in a particular subsystem of the runtime.
!!! Important
You must specify *ovni.level = 3* or higher in *nosv.toml* and pass
the *-b* option to ovniemu to generate the breakdown view.
Notice that the vertical axis shows the **number**
of CPUs in that state, not the physical CPUs like other views.
Here is an example of the Heat mini-app:
![Breakdown example](fig/breakdown-nosv.png)

View File

@ -8,21 +8,20 @@ refer to the
The [LLVM OpenMP Runtime](https://openmp.llvm.org/design/Runtimes.html) provides
an implementation of the OpenMP specification as a component of the LLVM
compiler infrastructure. We have modified the LLVM OpenMP runtime to run on top
compiler infrastructure. We have modified the LLVM OpenMP runtime (libomp) to run on top
of the [nOS-V](https://gitlab.bsc.es/nos-v/nos-v) runtime as part of the
[OmpSs-2 LLVM compiler](https://pm.bsc.es/llvm-ompss), named **OpenMP-V**.
[OmpSs-2 LLVM compiler](https://pm.bsc.es/llvm-ompss), named **libompv**.
We have added instrumentation events to OpenMP-V designed to be enabled along
We have added instrumentation events to libompv designed to be enabled along
the [nOS-V instrumentation](nosv.md). This document describes all the
instrumentation features included in our modified OpenMP-V runtime to identify
instrumentation features included in our modified libompv runtime to identify
what is happening. This data is useful for both users and developers of the
OpenMP runtime to analyze issues and undesired behaviors.
!!! Note
Instrumenting the original OpenMP runtime from the LLVM project is planned
but is not yet posible. For now you must use the modified OpenMP-V runtime
with nOS-V.
Instrumenting libomp is planned but is not yet posible.
For now you must use libompv.
## Enable the instrumentation
@ -33,25 +32,25 @@ To generate runtime traces, you will have to:
documentation](https://github.com/bsc-pm/nos-v/blob/master/docs/user/tracing.md).
Typically you should use the `--with-ovni` option at configure time to specify
where ovni is installed.
2. **Build OpenMP-V with ovni and nOS-V support:** Use the `PKG_CONFIG_PATH`
2. **Build libompv with ovni and nOS-V support:** Use the `PKG_CONFIG_PATH`
environment variable to specify the nOS-V and ovni installation
when configuring CMake.
3. **Enable the instrumentation in nOS-V at runtime:** Refer to the
[nOS-V documentation](https://github.com/bsc-pm/nos-v/blob/master/docs/user/tracing.md)
to find out how to enable the tracing at runtime. Typically you can just set
`NOSV_CONFIG_OVERRIDE="instrumentation.version=ovni"`.
4. **Enable the instrumentation of OpenMP-V at runtime:** Set the environment
4. **Enable the instrumentation of libompv at runtime:** Set the environment
variable `OMP_OVNI=1`.
Currently there is only support for the subsystem view, which is documented
below. The view is complemented with the information of [nOS-V views](nosv.md),
as OpenMP-V uses nOS-V tasks to run the workers.
Next sections describe each of the views included for analysis.
## Subsystem view
![Subsystem view example](fig/openmp-subsystem.png)
This view illustrates the activities of each thread with different states:
The view is complemented with the information of [nOS-V views](nosv.md),
as libompv uses nOS-V tasks to run the workers.
Subsystem illustrates the activities of each thread with different states:
- **Work-distribution subsystem**: Related to work-distribution constructs,
[in Chapter 11][workdis].
@ -135,9 +134,9 @@ This view illustrates the activities of each thread with different states:
- **Fork call**: Preparing a parallel section using the fork-join model.
Only called from the master thread.
- **Init**: Initializing the OpenMP-V runtime.
- **Init**: Initializing the libompv runtime.
- **Internal microtask**: Running a internal OpenMP-V function as a microtask.
- **Internal microtask**: Running a internal libompv function as a microtask.
- **User microtask**: Running user code as a microtask in a worker thread.
@ -156,9 +155,31 @@ This view illustrates the activities of each thread with different states:
[critical]: https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf#section.15.2
[barrier]: https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf#section.15.3
## Label view
The label view displays the text in the `label()` clause of OpenMP
tasks and work distribution constructs (static and dynamic for, single
and section). When the label is not provided, the source file and source
line location is used instead.
When nesting multiple tasks or work distribution constructs, only the
innermost label is shown.
Note that in this view, the numeric event value is a hash function of
the type label, so two distinct tasks (declared in different parts of
the code) with the same label will share the event value and have the
same color.
## Task ID view
The task ID view represents the numeric ID of the OpenMP task that is
currently running on each thread. The ID is a monotonically increasing
identifier assigned on task creation. Lower IDs correspond to tasks
created at an earlier point than higher IDs.
## Limitations
As the compiler generates the code that perform the calls to the OpenMP-V
As the compiler generates the code that perform the calls to the libompv
runtime, there are some parts of the execution that are complicated to
instrument by just placing a pair of events to delimite a function.

View File

@ -60,4 +60,4 @@ will set all the channels to an error state.
The emulator automatically switches the channels from one thread to
another when a thread is switched from the CPU. So the different models
don't need to worry about thread transitions. See the
[channels](../channels) section for more information.
[channels](../../dev/channels.md) section for more information.

View File

@ -0,0 +1,61 @@
# Model versions
Track changes in emulator model versions.
!!! Note
These versions cover the [events defined](events.md) in the emulator models.
They are **not related to the versions of the libraries**.
## Nanos6
- nanos6 1.1.0:
- Deprecate running nested tasks (`6Tx`) without pausing the parent task
first (`6Tp`). For compatibility, the old behavior is still supported.
- nanos6 1.0.0: Initial version
## Nodes
- nodes 1.0.0: Initial version
## Kernel
- kernel 1.0.0: Initial version
## MPI
- mpi 1.0.0: Initial version
## Ovni
- ovni 1.1.0
- Add support for mark events `OM[`, `OM]` and `OM=`
- ovni 1.0.0: Initial version
## OpenMP
- openmp 1.2.0:
- Add support for labels and task ID views
- openmp 1.1.0: Initial version
## TAMPI
- tampi 1.0.0: Initial version
## nOS-V
- nosv 2.4.0
- Add support for `nosv_cond_wait`, `nosv_cond_signal` and `nosv_cond_broadcast` events VA{oOgGkK}.
- nosv 2.3.0
- Add `nosv.can_breakdown` attribute to metadata for breakdown checks.
- nosv 2.2.0
- Add support for progress events `VP{pra}`.
- nosv 2.1.0
- Add support for `nosv_mutex_lock`, `nosv_mutex_trylock` and `nosv_mutex_unlock` events `VA{lLtTuU}`.
- Add support for `nosv_barrier_wait` event `VA{bB}`.
- nosv 2.0.0
- Add support for parallel tasks, adding a new `bodyid` argument in `VT*` events.
- Remove support for old attach events `VH{aA}`.
- nosv 1.1.0
- Ignore old attach events `VH{aA}`.
- Add new API attach `VA{aA}` and detach `VA{eE}` events.
- nosv 1.0.0: Initial version.

56
doc/user/runtime/env.md Normal file
View File

@ -0,0 +1,56 @@
# Environment variables
Some environment variables can be used to adjust settings during the execution
of libovni, they all begin with the `OVNI_` prefix. Be sure that all threads of
the same node use the same environment variables.
## OVNI_TMPDIR
During the execution of your program, a per-thread buffer is kept where the new
events are being recorded. When this buffer is full, it is written to disk and
emptied, an operation known as flush. This may take a while depending on the
underlying filesystem.
Keep in mind that the thread will be blocked until the flush ends, so if your
filesystem is slow it would interrupt the execution of your program for a long
time. It is advisable to use the fastest filesystem available (see the tmpfs(5)
and df(1) manual pages).
You can select a temporary trace directory where the buffers will be flushed
during the execution by setting the environment variable `OVNI_TMPDIR`. The last
directory will be created if doesn't exist. In that case, as soon as a process
calls `ovni_proc_fini()`, the traces of all its threads will be moved to the
final directory at `$PWD/ovni`. Example:
OVNI_TMPDIR=$(mktemp -u /dev/shm/ovni.XXXXXX) srun ./your-app
To test the different filesystem speeds, you can use hyperfine and dd. Take a
closer look at the max time:
```
$ hyperfine 'dd if=/dev/zero of=/gpfs/projects/bsc15/bsc15557/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/gpfs/projects/bsc15/bsc15557/kk bs=2M count=10
Time (mean ± σ): 71.7 ms ± 130.4 ms [User: 0.8 ms, System: 10.2 ms]
Range (min … max): 14.7 ms … 1113.2 ms 162 runs
Warning: Statistical outliers were detected. Consider re-running this
benchmark on a quiet PC without any interferences from other programs. It
might help to use the '--warmup' or '--prepare' options.
$ hyperfine 'dd if=/dev/zero of=/tmp/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/tmp/kk bs=2M count=10
Time (mean ± σ): 56.2 ms ± 5.7 ms [User: 0.6 ms, System: 14.8 ms]
Range (min … max): 45.8 ms … 77.8 ms 63 runs
$ hyperfine 'dd if=/dev/zero of=/dev/shm/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/dev/shm/kk bs=2M count=10
Time (mean ± σ): 11.4 ms ± 0.4 ms [User: 0.5 ms, System: 11.1 ms]
Range (min … max): 9.7 ms … 12.5 ms 269 runs
```
## OVNI_TRACEDIR
By default, the runtime trace will be placed in the `ovni` directory, inside the
working directory. You can specify a different location to place the trace by
setting the `OVNI_TRACEDIR` environment variable. It accepts a relative or
absolute path, which will be created if it doesn't exist.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

123
doc/user/runtime/index.md Normal file
View File

@ -0,0 +1,123 @@
# Introduction
To use *libovni* to instrument a program follow the next instructions
carefully or you may end up with an incomplete trace that is rejected at
emulation.
You can also generate a valid trace from your own software or hardware
directly following the [trace specification](trace_spec.md).
## Initialization
To initialize libovni follow these steps in all threads:
1. **Check the version**. Call `ovni_version_check()` once before calling any
ovni function. It can be called multiple times from any thread, but only one
is required.
2. **Init the process**. Call `ovni_proc_init()` to initialize the process. It
can only be called **once per process** and it must be called before the
thread is initialized.
3. **Init the thread**. Call `ovni_thread_init()` to initialize the thread.
Multiple attempts to initialize the same thread are ignored with a warning.
Must be called by all threads.
The `ovni_proc_init()` arguments are as follows:
```c
void ovni_proc_init(int app, const char *loom, int pid);
```
The `app` defines the "appid" of the program, which must be a number >0. This is
useful to run multiple processes some of which run the same "app", so you can
tell which one is which. The `loom` argument defines the
[loom](../concepts/part-model.md#loom) name and maps the process to that
loom. It must be composed of the host name, a dot and a suffix. The PID is the
one obtained by `getpid(2)`.
The `ovni_thread_init()` function only accepts one argument, the TID as returned
by `gettid(2)`.
## Setup metadata
Once the process and thread are initialized, you can begin adding metadata to
the thread stream.
1. **Require models**. Call `ovni_thread_require()` with the required model
version before emitting events for a given model. Only required once from a
thread in a given trace. The `ovni` model is implicitly required when calling
`ovni_thread_init()`, so there is no need to add it again.
2. **Emit loom CPUs**. Call `ovni_add_cpu()` to register each CPU in the loom. It can
be done from a single thread or multiple threads, in the latter the list of
CPUs is merged.
3. **Set the rank**. If you use MPI, call `ovni_proc_set_rank()` to register the
rank and number of ranks of the current execution. Only once per process.
When emitting the CPUs with:
```c
void ovni_add_cpu(int index, int phyid);
```
The `index` will be used to identify the CPU in the loom and goes from 0 to N -
1, where N is the number of CPUs in the loom. It must match the index that is
used in affinity events when a thread switches to another CPU. The `phyid` is
only displayed in Paraver and is usually the same as the index, but it can be
different if there are multiple looms per node.
## Start the execution
The current thread must switch to the "Running" state before any event can be
processed by the emulator. Do so by emitting a [`OHx`
event](../emulation/events.md#OHx) in the stream with the appropriate payload:
```c
static void thread_execute(int32_t cpu, int32_t ctid, uint64_t tag)
{
struct ovni_ev ev = {0};
ovni_ev_set_clock(&ev, ovni_clock_now());
ovni_ev_set_mcv(&ev, "OHx");
ovni_payload_add(&ev, (uint8_t *) &cpu, sizeof(cpu));
ovni_payload_add(&ev, (uint8_t *) &ctid, sizeof(ctid));
ovni_payload_add(&ev, (uint8_t *) &tag, sizeof(tag));
ovni_ev_emit(&ev);
}
```
The `cpu` is the logical index (not the physical ID) of the loom CPU at which
this thread will begin the execution. Use -1 if it is not known. The `ctid` and
`tag` allow you to track the exact point at which a given thread was created and
by which thread but they are not relevant for the first thread, so they can be
set to -1.
## Emit events
After this point you can emit any other event from this thread. Use the
`ovni_ev_*` set of functions to create and emit events. Notice that all events
refer to the current thread that emits them.
If you need to store metadata information, use the `ovni_attr_*` set of
functions. The metadata is stored in disk by `ovni_attr_flush()` and when the
thread is freed by `ovni_thread_free()`.
Attempting to emit events or writing metadata without having a thread
initialized will cause your program to abort.
## Finishing the execution
To finalize the execution **every thread** must perform the following steps,
otherwise the trace **will be rejected**.
1. **End the current thread**. Emit a [`OHe` event](../emulation/events.md#OHe) to inform the current thread ends.
2. **Flush the buffer**. Call `ovni_flush()` to be sure all events are written
to disk.
3. **Free the thread**. Call `ovni_thread_free()` to complete the stream and
free the memory used by the buffer.
4. **Finish the process**. If this is the last thread, call `ovni_proc_fini()`
to set the process state to finished.
If a thread fails to perform these steps, the complete trace will be rejected by
the emulator as it cannot guarantee it to be consistent.

218
doc/user/runtime/mark.md Normal file
View File

@ -0,0 +1,218 @@
# Mark events
The mark API allows you to add arbitrary events in a trace to mark regions of
interest while debugging or developing a new program or library. The events are
processed by the emulator to generate a timeline.
## Usage in runtime
Follow these steps to correctly use the API. Most problems will be detected in
emulation and cause a panic if you are not careful.
### Create a mark type
You can create up to 100 types of marks, each will be shown in its own Paraver
timeline. To create a new type, use the following call:
```c
void ovni_mark_type(int32_t type, long flags, const char *title);
```
The numeric value `type` must be a number between 0 and 99 (both included). The
`title` will be used to give a name to the Paraver timeline.
The default with flags set to zero, is to create a channel that can hold a
single value only (see [channels](../../dev/channels.md)). To use a stack of
values add the `OVNI_MARK_STACK` value to the flags.
Only one thread among all nodes needs to define a type to be available globally,
but the same type can be defined from multiple threads, as long as the same
flags and title argument are used. The idea is to avoid having to check if the
type was already defined or not.
### Define labels (optional)
The values that are written to the channel can have labels to display in the
Paraver timeline. The labels are optional, if not given the numeric value will
be shown in Paraver.
Use the following call to register a label for a value in a given type.
```c
void ovni_mark_label(int32_t type, int64_t value, const char *label);
```
A value can only have at most a single label associated. Multiple threads can
call the `ovni_mark_label()` with the same type and value as long as they use
the same label. New labels for the same type can be associated from different
threads, as long as the values are different.
All value and label pairs are combined from all threads and will be available in
the Paraver view for each type.
### Emit events
All mark channels begin with the default value *null*, which is not shown in
Paraver and will be displayed as the usual empty space. The value of the channel
can be changed over time with the following functions.
!!! warning
The value 0 is forbidden, as it is used by Paraver to represent the
"empty" state.
If you have used a single channel (without `OVNI_MARK_STACK`), then you must use
the following call to emit events at runtime:
```c
void ovni_mark_set(int32_t type, int64_t value);
```
It will update the value of the channel to the given `value`.
If you have used a stack channel (with `OVNI_MARK_STACK`), then you must use the
push/pop set of calls:
```c
void ovni_mark_push(int32_t type, int64_t value);
void ovni_mark_pop(int32_t type, int64_t value);
```
The value in the pop call must match the previous pushed value.
<details>
<summary>Example OmpSs-2 program</summary>
<br>
<div style="padding-left: 1em; border-left: 3px solid #ddd">
<p>
Here is a dummy program showing how to use the mark API with an OmpSs-2 program.
Notice that there is no initialization of the current thread or process, as it
already occurs inside the OmpSs-2 runtime before reaching the main.
```c
/* Build with:
* $ clang -fompss-2 -lovni dummy.c -o dummy
* Enable instrumentation in nanos6:
* $ echo 'version.instrument = "ovni"' > nanos6.toml
* Run:
* $ ./dummy
* Emulate:
* $ ovniemu ovni
* View timeline:
* $ wxparaver ovni/cpu.prv ovni/cfg/cpu/ovni/mark.cfg
*/
#include <ovni.h>
#include <unistd.h>
enum { INDEX = 0, RUN = 1 };
static void process(int run, int i)
{
ovni_mark_push(RUN, run + 1);
ovni_mark_push(INDEX, i + 1);
usleep(10000); // Dummy operation for 10 ms
ovni_mark_pop(INDEX, i + 1);
ovni_mark_pop(RUN, run + 1);
}
int main(void)
{
ovni_mark_type(INDEX, OVNI_MARK_STACK, "Index");
ovni_mark_type(RUN, OVNI_MARK_STACK, "Run");
for (int run = 0; run < 10; run++) {
for (int i = 0; i < 50; i++) {
#pragma oss task
process(run, i);
}
}
#pragma oss taskwait
return 0;
}
```
<!-- Images don't seem to work via markdown -->
<p>Here is the resulting timeline loaded in Paraver with the gradient color
configuration, showing the first mark type (the index):
<img style="margin-top: 1em" alt="" src="../fig/mark.png"></p>
</div>
</details>
<p></p>
## Usage in Paraver
Each thread holds a channel for each mark type that you have defined. The
information of the mark channels is propagated to the Paraver timeline in
Thread and CPU views.
When a thread is not *running*, the value of the mark channels is not shown in
Paraver. In the case of the CPU timeline, only the values of the running thread are
shown. If there are no running threads, nothing is shown.
Follow the next steps to create a configuration to suit your needs. You only
need to do it once, then you can save the configuration file and reuse it for
future traces.
### Filtering the type
To see a mark type, you will have to create a Paraver configuration that matches
the type that you have created. The mark `type` value gets converted into a PRV
type by adding 100 (as values from 0 to 99 are reserved).
You can use the `cpu/ovni/mark.cfg` and `thread/ovni/mark.cfg` configurations as
a starting point to create your own.
Go to "Window Properties" (the second button under "Files & Window Properties")
and then go to Filter > Events > Event type. Set Function to `=` and click the
Types value to display the `[...]` button, which will allow you to choose which
type to display.
In the "Events Selection" window, ensure that only one type is selected, and the
"Values" panel shows Function "All", to see all values for the selected type.
### Setting the title
In the "Window Properties" adjust the Name so it reflects what you are seeing.
This will be shown in the saved images, so it is good to use a proper
description.
### Configure the display method
By default, the timeline will display the values as "Code color". To switch to a
gradient or other methods, left-click in the timeline and go to "Paint As" and
select "Gradient" (or others).
You may also want to adjust the "Drawmode" which determines what happens when
there are multiple values under a given pixel. This is specially important when
you are viewing the trace with a large time range, before zooming into a given
region.
By default, the "Random not zero" mode is selected, which will select a
random value from the ones under each pixel, disregarding the occurrences of each
value. This mode will give importance to rare values, so it is usually a safe
starting point. The "Last" mode will show the last value in that pixel, which is
more or less fair, but will often hide rare values.
To change in both horizontal (Time) and in vertical (Objects) directions, go to:
left click on timeline > Drawmode > Both > Last.
### Ensure the range is good
Paraver will only display values in the timeline that are in the Semantic
range. If you see a red triangle in the lower left corner then there are values
outside the range that are not being displayed. You can click on this button to
expand the range to cover all values in the current view.
The opposite may also happen, where the range is too big for the current values.
You can also click on the same spot (even if the triangle is not shown) to
shrink the range to cover the values in the view, or go to the Window Properties
and modify the "Semantic Minimum" and "Semantic Maximum" values manually.
### Save the configuration
Once you finish configuring the timeline, save the configuration by
left-clicking the view and then "Save > Configuration...". You can use this
configuration in future traces to avoid doing these steps again.

View File

@ -1,127 +1,149 @@
# Trace specification
# Trace specification v3
!!! Important
This document refers to the trace specification for
the version 2
the version 3
The ovni instrumentation library stores the information collected in a
trace following the specification of this document.
The ovni instrumentation library libovni stores the information
collected in a runtime trace following the specification of this document.
## Structure
An ovni runtime trace (or simply, a trace) is composed of one or more
[streams](../concepts/trace.md#stream), which are directories containing
two mandatory files:
- `stream.json` the stream metadata in JSON format.
- `stream.obs` the binary stream with events.
Each stream is assigned to a single *part* in the [part
model](../concepts/part-model.md), usually assigned to a given thread.
There are no imposed rules on how to organize the several streams into
directories, but libovni uses the following approach for thread streams:
The complete trace is stored in a top-level directory named `ovni`.
Inside this directory you will find the loom directories with the prefix
`loom.`. The name of the loom is built from the `loom` parameter of
`ovni_proc_init()`, prefixing it with `loom.`.
Inside this directory you will find the loom directories. The name of
the loom directory is built from the `loom` parameter of `ovni_proc_init()`,
prefixing it with `loom.`.
Each loom directory contains one directory per process of that loom. The
name is composed of the `proc.` prefix and the PID of the process
specified in the `pid` argument to `ovni_proc_init()`.
Each process directory contains:
Inside each process there is one directory for each thread, composed by
the `thread.` prefix and the TID, which are the streams. The files
`stream.json` and `stream.obs` reside inside. Example:
- The process metadata file `metadata.json`.
- The thread streams, composed of:
- The binary stream like `thread.123.obs`
- The thread metadata like `thread.123.json`
```
ovni/loom.mio.nosv-u1000/proc.89719/thread.89719/stream.json
ovni/loom.mio.nosv-u1000/proc.89719/thread.89719/stream.obs
```
## Process metadata
This structure prevents collisions among threads with the same TID among nodes,
while allowing dumping events from a single thread, process or loom with
ovnidump.
!!! Important
## Stream metadata
Process metadata has version 2
The `stream.json` metadata file contains information about the part that
the stream is assigned to. This is generally used to determine the
hierarchy of the part model.
The process metadata file contains important information about the trace
that is invariant during the complete execution, and generally is
required to be available prior to processing the events in the trace.
The metadata is stored in the JSON file `metadata.json` inside each
process directory and contains the following keys:
The JSON must be an object (dictionary) with the following mandatory
keys:
- `version`: a number specifying the version of the metadata format.
Must have the value 2 for this version.
- `app_id`: the application ID, used to distinguish between applications
running on the same loom.
- `rank`: the rank of the MPI process (optional).
- `nranks`: number of total MPI processes (optional).
- `cpus`: the array of $`N_c`$ CPUs available in the loom. Only one
process in the loom must contain this mandatory key. Each element is a
dictionary with the keys:
- `index`: containing the logical CPU index from 0 to $`N_c - 1`$.
- `phyid`: the number of the CPU as given by the operating system
(which can exceed $`N_c`$).
Must have the value 3 for this version.
Here is an example of the `metadata.json` file:
The rest of information is stored for each model.
```
{
"version": 2,
"app_id": 1,
"rank": 0,
"nranks": 4,
"cpus": [
{
"index": 0,
"phyid": 0
},
{
"index": 1,
"phyid": 1
},
{
"index": 2,
"phyid": 2
},
{
"index": 3,
"phyid": 3
}
]
}
```
In particular, the `ovni` model enforces the use of:
## Thread metadata
- `ovni.part`: the type of part this stream is assigned to, usually
`thread`.
- `ovni.require`: a dictionary of model name and version which will
determine which models are enabled at emulation and the required
version.
- `ovni.finished`: must be 1 to ensure the stream is complete (mandatory
in all streams).
!!! Important
### Thread stream metadata
Thread metadata has version 2
For `thread` streams, the following attributes are used.
The thread metadata stores constant information per thread, like the
process metadata. The information is stored in a dictionary, where the
name of the emulation models are used as keys. In particular, the
libovni library writes information in the "ovni" key, such as the
model requirements, and other information like the version of libovni
used. Example:
- `ovni.tid`: the TID of the thread (mandatory, per-thread).
- `ovni.pid`: the PID of the process that the thread belongs to (mandatory, per-thread).
- `ovni.app_id`: the application ID of the process (optional, per-process).
- `ovni.rank`: the rank of the MPI process (optional, per-process).
- `ovni.nranks`: number of total MPI processes (optional, per-process).
- `ovni.loom`: the name of the loom that the process belongs to (mandatory, per-process).
- `ovni.loom_cpus`: the array of N CPUs available in the loom
(mandatory, per-loom). Each element is a dictionary with the keys:
- `index`: containing the logical CPU index from 0 to N - 1.
- `phyid`: the number of the CPU as given by the operating system
(which can exceed N).
Notice that some attributes don't need to be present in all thread
streams. For example, per-process requires that at least one thread
contains the attribute for each process. Similarly, per-loom requires
that at least one thread of the loom emits the attribute.
The final attribute value will be computed by merging all the values from the
children metadata. Simple values like numbers or strings must match exactly if
they appear duplicated, arrays are appended.
Other attributes can be used for other models.
Here is an example of the `stream.json` file for a thread of a nOS-V
program:
```json
{
"version": 2,
"version": 3,
"ovni": {
"lib": {
"version": "1.4.0",
"commit": "unknown"
"version": "1.10.0",
"commit": "dirty"
},
"part": "thread",
"tid": 89719,
"pid": 89719,
"loom": "mio.nosv-u1000",
"app_id": 1,
"require": {
"ovni": "1.0.0"
}
"ovni": "1.1.0",
"nosv": "2.3.0"
},
"loom_cpus": [
{ "index": 0, "phyid": 0 },
{ "index": 1, "phyid": 1 },
{ "index": 2, "phyid": 2 },
{ "index": 3, "phyid": 3 }
],
"finished": 1
},
"nosv": {
"can_breakdown": false,
"lib_version": "2.3.1"
}
}
```
The metadata is written to disk when the thread is first initialized
and when the thread finishes.
## Thread binary streams
## Binary stream
!!! Important
Thread binary stream has version 1
Binary streams have version 1
Streams are a binary files that contains a succession of events with
monotonically increasing clock values. Streams have a small header and
the variable size events just after the header.
A binary stream is a binary file named `stream.obs` that contains a
succession of events with monotonically increasing clock values. They
have a small header and the variable size events just after the header.
The header contains the magic 4 bytes of "ovni" and a version number of
4 bytes too. Here is a figure of the data stored in disk:
4 bytes too. Here is a figure of the data stored in disk on a little
endian machine:
![Stream](fig/stream.svg)
@ -145,7 +167,7 @@ payload:
- Normal events: with a payload up to 16 bytes
- Jumbo events: with a payload up to $`2^{32}`$ bytes
## Normal events
### Normal events
The normal events are composed of:
@ -178,7 +200,7 @@ In the following figure you can see each field annotated:
![Normal event with payload content](fig/event-normal-payload.svg)
## Jumbo events
### Jumbo events
The jumbo events are just like normal events but they can hold large
data. The size of the jumbo data is stored as a 32 bits integer as a
@ -203,10 +225,10 @@ In the following figure you can see each field annotated:
![Jumbo event](fig/event-jumbo.svg)
## Design considerations
### Design considerations
The stream format has been designed to be very simple, so writing a
parser library would take no more than 2 days for a single developer.
The binary stream format has been designed to be very simple, so writing
a parser library would take no more than 2 days for a single developer.
The size of the events has been designed to be small, with 12 bytes per
event when no payload is used.
@ -239,11 +261,7 @@ raw stream in binary, as the MCV codes can be read as ASCII characters:
This allows a human to detect signs of corruption by visually inspecting
the streams.
## Limitations
### Limitations
The streams are designed to be read only forward, as they only contain
the size of each event in the header.
Currently, we only support using the threads as sources of events, using
one stream per thread. However, adding support for more streams from
multiple sources is planned for the future.

View File

@ -1,94 +0,0 @@
# Tracing a new program
Read carefully this document before using libovni to instrument a new
component. There are a few rules you must follow to ensure the runtime
trace is correct.
## Trace processes and threads
- Call `ovni_version_check()` once before calling any ovni function.
- Call `ovni_proc_init()` when a new process begins the execution.
- Call `ovni_thread_init()` when a new thread begins the execution
(including the main process thread).
- Call `ovni_thread_require()` with the required model version before
emitting events for that model.
- Call `ovni_flush()` and `ovni_thread_free()` when it finishes (in that
order).
- Call `ovni_proc_fini()` when a process ends, after all threads have
finished.
You can use `ovni_ev_emit()` to record a new event. If you need more
than 16 bytes of payload, use `ovni_ev_jumbo_emit()`. See the [trace
specification](../trace_spec) for more details.
Compile and link with libovni. When you run your program, a new
directory ovni will be created in the current directory `$PWD/ovni`
which contains the execution trace.
You can change the trace directory by defining the `OVNI_TRACEDIR`
environment variable. The envar accepts a trace directory name, a
relative path to the trace directory, or its absolute path. In the
first case, the trace directory will be created in the current
directory `$PWD`.
## Rules
Follow these rules to avoid losing events:
1. No event may be emitted until the process is initialized with
`ovni_proc_init()` and the thread with `ovni_thread_init()`.
2. When a thread ends the execution, it must call `ovni_flush()` to write the
events in the buffer to disk.
3. All threads must have flushed its buffers before calling `ovni_proc_fini()`.
## Select a fast directory
During the execution of your program, a per-thread buffer is kept where the new
events are being recorded. When this buffer is full, it is written to disk and
emptied, an operation known as flush. This may take a while depending on the
underliying filesystem.
Keep in mind that the thread will be blocked until the flush ends, so if your
filesystem is slow it would interrupt the execution of your program for a long
time. It is advisable to use the fastest filesystem available (see the tmpfs(5)
and df(1) manual pages).
You can select the trace directory where the buffers will be flushed during the
execution by setting the environment variable `OVNI_TMPDIR`. The last directory
will be created if doesn't exist. In that case, as soon as a process calls
`ovni_proc_fini()`, the traces of all its threads will be moved to the final
directory at `$PWD/ovni`. Example:
OVNI_TMPDIR=$(mktemp -u /dev/shm/ovni.XXXXXX) srun ./your-app
To test the different filesystem speeds, you can use hyperfine and dd. Take a
closer look at the max time:
```
$ hyperfine 'dd if=/dev/zero of=/gpfs/projects/bsc15/bsc15557/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/gpfs/projects/bsc15/bsc15557/kk bs=2M count=10
Time (mean ± σ): 71.7 ms ± 130.4 ms [User: 0.8 ms, System: 10.2 ms]
Range (min … max): 14.7 ms … 1113.2 ms 162 runs
Warning: Statistical outliers were detected. Consider re-running this
benchmark on a quiet PC without any interferences from other programs. It
might help to use the '--warmup' or '--prepare' options.
$ hyperfine 'dd if=/dev/zero of=/tmp/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/tmp/kk bs=2M count=10
Time (mean ± σ): 56.2 ms ± 5.7 ms [User: 0.6 ms, System: 14.8 ms]
Range (min … max): 45.8 ms … 77.8 ms 63 runs
$ hyperfine 'dd if=/dev/zero of=/dev/shm/kk bs=2M count=10'
Benchmark 1: dd if=/dev/zero of=/dev/shm/kk bs=2M count=10
Time (mean ± σ): 11.4 ms ± 0.4 ms [User: 0.5 ms, System: 11.1 ms]
Range (min … max): 9.7 ms … 12.5 ms 269 runs
```

View File

@ -15,29 +15,33 @@
nosv = prev.nosv.override {
useGit = true;
gitBranch = "master";
gitCommit = "9abad7d31476e97842d3b42f1fc1fb03d4cf817b";
gitCommit = "3ca2f67993f85aa73c53f810ff12148189eae642";
};
nanos6 = prev.nanos6.override {
useGit = true;
gitBranch = "master";
gitCommit = "21fccec383a4136daf5919093a6ffcdc8c139bfe";
gitCommit = "f39ea57c67a613d098050e2bb251116a021e91e5";
};
nodes = prev.nodes.override {
useGit = true;
gitBranch = "master";
gitCommit = "70ce0ed0a20842d8eb3124aa5db5916fb6fc238f";
gitCommit = "c97d7ca6f885500121a94c75df429c788e8d6cf8";
};
clangOmpss2Unwrapped = prev.clangOmpss2Unwrapped.override {
useGit = true;
gitBranch = "master";
gitCommit = "9dc4a4deea5e09850435782026eaae2f5290d886";
gitCommit = "b7af30b36be3e7e90b33c5f01a3f7e3656df785f";
};
openmp = prev.openmp.overrideAttrs (old: {
# Newer version of LLVM OpenMP requires python3
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ final.python3 ];
});
# Use a fixed commit for libovni
ovniFixed = prev.ovni.override {
useGit = true;
gitBranch = "master";
gitCommit = "68fc8b0eba299c3a7fa3833ace2c94933a26749e";
gitCommit = "3bbfe0f0ecdf58e3f46ebafdf2540680f990b76b";
};
# Build with the current source
ovniLocal = prev.ovni.overrideAttrs (old: rec {
@ -134,6 +138,38 @@
export ASAN_OPTIONS=detect_leaks=0
'';
});
ubsan = rt.overrideAttrs (old: {
pname = "ovni-ubsan";
cmakeFlags = old.cmakeFlags ++ [ "-DCMAKE_BUILD_TYPE=Ubsan" ];
});
armv7 = (pkgs.pkgsCross.armv7l-hf-multiplatform.ovniLocal.overrideAttrs (old: {
pname = "ovni-armv7";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
aarch64 = (pkgs.pkgsCross.aarch64-multiplatform.ovniLocal.overrideAttrs (old: {
pname = "ovni-aarch64";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.aarch64-multiplatform.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
riscv64 = (pkgs.pkgsCross.riscv64.ovniLocal.overrideAttrs (old: {
pname = "ovni-riscv64";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.riscv64.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
};
};
}

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: MIT */
#ifndef OVNI_H
@ -18,7 +18,7 @@ extern "C" {
#include <string.h>
#include <sys/types.h>
#define OVNI_METADATA_VERSION 2
#define OVNI_METADATA_VERSION 3
#define OVNI_TRACEDIR "ovni"
#define OVNI_MAX_HOSTNAME 512
@ -31,6 +31,9 @@ extern "C" {
#define OVNI_STREAM_EXT ".obs"
/* Version of the ovni model for events */
#define OVNI_MODEL_VERSION "1.1.0"
/* Follow https://semver.org rules for versioning */
#define OVNI_LIB_VERSION "@PROJECT_VERSION@"
#define OVNI_GIT_COMMIT "@OVNI_GIT_COMMIT@"
@ -130,6 +133,28 @@ void ovni_ev_jumbo_emit(struct ovni_ev *ev, const uint8_t *buf, uint32_t bufsize
void ovni_flush(void);
/* Attributes */
int ovni_attr_has(const char *key);
void ovni_attr_set_double(const char *key, double num);
void ovni_attr_set_boolean(const char *key, int value);
void ovni_attr_set_str(const char *key, const char *value);
void ovni_attr_set_json(const char *key, const char *json);
double ovni_attr_get_double(const char *key);
int ovni_attr_get_boolean(const char *key);
const char *ovni_attr_get_str(const char *key);
char *ovni_attr_get_json(const char *key);
void ovni_attr_flush(void);
/* Mark */
enum ovni_mark_flags {
OVNI_MARK_STACK = 1, /*< Use push/pop instead of set */
};
void ovni_mark_type(int32_t type, long flags, const char *title);
void ovni_mark_label(int32_t type, int64_t value, const char *label);
void ovni_mark_push(int32_t type, int64_t value);
void ovni_mark_pop(int32_t type, int64_t value);
void ovni_mark_set(int32_t type, int64_t value);
#ifdef __cplusplus
}
#endif

View File

@ -23,10 +23,14 @@ markdown_extensions:
nav:
- index.md
- 'User guide':
- user/concepts.md
- user/installation.md
- 'Concepts':
- user/concepts/part-model.md
- user/concepts/trace.md
- 'Runtime':
- user/runtime/tracing.md
- user/runtime/index.md
- user/runtime/env.md
- user/runtime/mark.md
- user/runtime/distributed.md
- user/runtime/kernel.md
- user/runtime/trace_spec.md
@ -39,6 +43,7 @@ nav:
- user/emulation/mpi.md
- user/emulation/openmp.md
- user/emulation/events.md
- user/emulation/versions.md
- CHANGELOG.md
- 'Developer guide':
- dev/index.md

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: MIT */
#include "common.h"
@ -45,7 +45,7 @@ vaerr(const char *prefix, const char *func, const char *errstr, va_list ap)
vfprintf(stderr, errstr, ap);
int len = strlen(errstr);
int len = (int) strlen(errstr);
if (len > 0) {
char last = errstr[len - 1];
@ -103,7 +103,7 @@ mkpath(const char *path, mode_t mode, int is_dir)
char *copypath = strdup(path);
/* Remove trailing slash */
int last = strlen(path) - 1;
int last = (int) strlen(path) - 1;
while (last > 0 && copypath[last] == '/')
copypath[last--] = '\0';

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <inttypes.h>
extern int is_debug_enabled;
@ -18,8 +19,8 @@ int mkpath(const char *path, mode_t mode, int is_dir);
void progname_set(char *name);
const char *progname_get(void);
void enable_debug(void);
void verr(const char *prefix, const char *func, const char *errstr, ...);
void vdie(const char *prefix, const char *func, const char *errstr, ...);
void verr(const char *prefix, const char *func, const char *errstr, ...) __attribute__((format(printf, 3, 4)));
void vdie(const char *prefix, const char *func, const char *errstr, ...) __attribute__((format(printf, 3, 4)));
/* clang-format off */

View File

@ -11,6 +11,7 @@ include_directories(
add_library(emu STATIC
../common.c
bay.c
body.c
chan.c
clkoff.c
cpu.c
@ -29,7 +30,6 @@ add_library(emu STATIC
stream.c
trace.c
loom.c
metadata.c
mux.c
sort.c
path.c
@ -48,9 +48,11 @@ add_library(emu STATIC
value.c
ovni/event.c
ovni/setup.c
ovni/mark.c
nanos6/setup.c
nanos6/event.c
nanos6/breakdown.c
nosv/breakdown.c
nosv/setup.c
nosv/event.c
nodes/setup.c

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "bay.h"
@ -106,7 +106,7 @@ bay_add_cb(struct bay *bay, enum bay_cb_type type,
cb->func = func;
cb->arg = arg;
cb->bchan = bchan;
cb->type = type;
cb->type = (int) type;
cb->enabled = 0;
if (enabled)
@ -168,7 +168,7 @@ propagate_chan(struct bay_chan *bchan, enum bay_cb_type type)
struct bay_cb *cur = NULL;
/* New callbacks cannot be added while propagating a bay_chan */
DL_FOREACH(bchan->cb[type], cur) {
dbg("calling cb %p", cur->func);
dbg("calling cb %"PRIxPTR, (uintptr_t) cur->func);
if (cur->func(bchan->chan, cur->arg) != 0) {
err("callback failed for %s", bchan->chan->name);
return -1;

336
src/emu/body.c Normal file
View File

@ -0,0 +1,336 @@
/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "body.h"
#include "task.h"
#include <string.h>
#include "uthash.h"
#include "utlist.h"
/* Make body private struct */
struct body {
/* Body id consecutive and unique per task */
uint32_t id;
uint32_t taskid;
int flags;
enum body_state state;
UT_hash_handle hh;
struct body_stack *stack;
long iteration;
struct task *task;
/* List handle for nested task support */
struct body *next;
struct body *prev;
/* Create a identification name */
char name[256];
};
struct body *
body_find(struct body_info *info, uint32_t body_id)
{
struct body *body = NULL;
HASH_FIND_INT(info->bodies, &body_id, body);
return body;
}
struct body *
body_create(struct body_info *info, struct task *task, uint32_t body_id, int flags)
{
if (body_id == 0) {
err("body id %u must be non-zero", body_id);
return NULL;
}
if (body_find(info, body_id) != NULL) {
err("body with id %u already exists", body_id);
return NULL;
}
if (task == NULL) {
err("task of body %u is NULL", body_id);
return NULL;
}
struct body *body = calloc(1, sizeof(struct body));
if (body == NULL) {
err("calloc failed:");
return NULL;
}
body->id = body_id;
body->state = BODY_ST_CREATED;
body->iteration = 0;
body->flags = flags;
body->task = task;
body->taskid = task_get_id(task); /* For debug purposes only */
if (snprintf(body->name, sizeof(body->name), "body(id=%u,taskid=%u)",
body->id, body->taskid) >= (int) sizeof(body->name)) {
err("body name too long");
return NULL;
}
/* Add the new body to the hash table */
HASH_ADD_INT(info->bodies, id, body);
return body;
}
/* Transition from Created to Running */
int
body_execute(struct body_stack *stack, struct body *body)
{
if (body == NULL) {
err("body is NULL");
return -1;
}
/* Allow bodies to be executed multiple times */
if (body->state == BODY_ST_DEAD) {
if (!body_can_resurrect(body)) {
err("%s is not allowed to run again", body->name);
return -1;
}
body->state = BODY_ST_CREATED;
body->iteration++;
dbg("%s runs again", body->name);
}
/* Better error for executing a paused task body */
if (body->state == BODY_ST_PAUSED) {
err("refusing to run %s in Paused state, needs to resume intead",
body->name);
return -1;
}
if (body->state != BODY_ST_CREATED) {
err("%s state must be Created but is %s",
body->name, body_get_state_name(body));
return -1;
}
if (body->stack != NULL) {
err("%s stack already set", body->name);
return -1;
}
struct body *top = body_get_running(stack);
if (top != NULL) {
if (top->flags & BODY_FLAG_RELAX_NESTING) {
warn("deprecated nesting %s over already running %s",
body->name, top->name);
} else {
err("cannot nest %s over %s which is already running",
body->name, top->name);
return -1;
}
}
body->stack = stack;
body->state = BODY_ST_RUNNING;
DL_PREPEND(stack->top, body);
dbg("%s state is now Running, iteration %ld",
body->name, body->iteration);
return 0;
}
/* Transition from Running to Paused */
int
body_pause(struct body_stack *stack, struct body *body)
{
if (body == NULL) {
err("body is NULL");
return -1;
}
if (!body_can_pause(body)) {
err("%s is not allowed to pause", body->name);
return -1;
}
if (body->state != BODY_ST_RUNNING) {
err("%s state must be Running but is %s",
body->name, body_get_state_name(body));
return -1;
}
if (body->stack == NULL) {
err("%s stack not set", body->name);
return -1;
}
if (body->stack != stack) {
err("%s has another stack", body->name);
return -1;
}
if (stack->top != body) {
err("%s is not on top of the stack", body->name);
return -1;
}
body->state = BODY_ST_PAUSED;
dbg("%s state is now Paused", body->name);
return 0;
}
/* Transition from Paused to Running */
int
body_resume(struct body_stack *stack, struct body *body)
{
if (body == NULL) {
err("body is NULL");
return -1;
}
if (body->state != BODY_ST_PAUSED) {
err("%s state must be Paused but is %s",
body->name, body_get_state_name(body));
return -1;
}
if (body->stack == NULL) {
err("%s stack not set", body->name);
return -1;
}
if (body->stack != stack) {
err("%s has another stack", body->name);
return -1;
}
if (stack->top != body) {
err("%s is not on top of the stack", body->name);
return -1;
}
body->state = BODY_ST_RUNNING;
dbg("%s state is now Running", body->name);
return 0;
}
/* Transition from Running to Dead */
int
body_end(struct body_stack *stack, struct body *body)
{
if (body == NULL) {
err("body is NULL");
return -1;
}
if (body->state != BODY_ST_RUNNING) {
err("%s state must be Running but is %s",
body->name, body_get_state_name(body));
return -1;
}
if (body->stack == NULL) {
err("%s stack not set", body->name);
return -1;
}
if (body->stack != stack) {
err("%s has another stack", body->name);
return -1;
}
if (stack->top != body) {
err("%s is not on top of the stack", body->name);
return -1;
}
body->state = BODY_ST_DEAD;
/* FIXME: This should me changed:
* "Don't unset the thread from the task, as it will be used
* later to ensure we switch to tasks of the same thread." */
DL_DELETE(stack->top, body);
body->stack = NULL;
dbg("%s state is now Dead, completed iteration %ld",
body->name, body->iteration);
return 0;
}
int
body_can_resurrect(struct body *body)
{
return (body->flags & BODY_FLAG_RESURRECT);
}
int
body_can_pause(struct body *body)
{
return (body->flags & BODY_FLAG_PAUSE);
}
/** Return the iteration number of the body.
*
* Starts at 0 for the first execution and increases every time it is executed
* again */
long
body_get_iteration(struct body *body)
{
return body->iteration;
}
/** Returns the top body in the stack if is running, otherwise NULL. */
struct body *
body_get_running(struct body_stack *stack)
{
struct body *body = stack->top;
if (body && body->state == BODY_ST_RUNNING)
return body;
return NULL;
}
/** Returns the top body in the stack. */
struct body *
body_get_top(struct body_stack *stack)
{
return stack->top;
}
uint32_t
body_get_id(struct body *body)
{
return body->id;
}
struct task *
body_get_task(struct body *body)
{
return body->task;
}
enum body_state
body_get_state(struct body *body)
{
return body->state;
}
const char *
body_get_state_name(struct body *body)
{
const char *name[BODY_ST_MAX] = {
[BODY_ST_CREATED] = "Created",
[BODY_ST_RUNNING] = "Running",
[BODY_ST_PAUSED] = "Paused",
[BODY_ST_DEAD] = "Dead",
};
return name[body->state];
}

58
src/emu/body.h Normal file
View File

@ -0,0 +1,58 @@
/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef BODY_H
#define BODY_H
#include <stdint.h>
#include "common.h"
enum body_flags {
/* Allow bodies to pause */
BODY_FLAG_PAUSE = (1 << 0),
/* Allow bodies to run again after death */
BODY_FLAG_RESURRECT = (1 << 1),
/* Allow nested tasks to begin running without previously pausing the
* current task. This is only added for compatibility with Nanos6. */
BODY_FLAG_RELAX_NESTING = (1 << 2),
};
enum body_state {
BODY_ST_CREATED = 1,
BODY_ST_RUNNING,
BODY_ST_PAUSED,
BODY_ST_DEAD,
BODY_ST_MAX,
};
struct body;
struct task;
struct body_info {
/* Hash map of task bodies for a task */
struct body *bodies;
};
struct body_stack {
struct body *top;
};
USE_RET struct body *body_find(struct body_info *info, uint32_t body_id);
USE_RET struct body *body_create(struct body_info *info, struct task *task, uint32_t body_id, int flags);
USE_RET int body_execute(struct body_stack *stack, struct body *body);
USE_RET int body_pause(struct body_stack *stack, struct body *body);
USE_RET int body_resume(struct body_stack *stack, struct body *body);
USE_RET int body_end(struct body_stack *stack, struct body *body);
USE_RET int body_can_resurrect(struct body *body);
USE_RET int body_can_pause(struct body *body);
USE_RET long body_get_iteration(struct body *body);
USE_RET struct body *body_get_running(struct body_stack *stack);
USE_RET struct body *body_get_top(struct body_stack *stack);
USE_RET struct task *body_get_task(struct body *body);
USE_RET enum body_state body_get_state(struct body *body);
USE_RET uint32_t body_get_id(struct body *body);
USE_RET const char *body_get_state_name(struct body *body);
#endif /* BODY_H */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "chan.h"
@ -15,9 +15,11 @@ chan_init(struct chan *chan, enum chan_type type, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
int n = ARRAYLEN(chan->name);
size_t n = ARRAYLEN(chan->name);
int ret = vsnprintf(chan->name, n, fmt, ap);
if (ret >= n)
if (ret < 0)
die("vsnprintf failed");
else if ((size_t) ret >= n)
die("channel name too long");
va_end(ap);
@ -155,7 +157,7 @@ chan_push(struct chan *chan, struct value value)
/** Remove one value from the stack. Fails if the top of the stack
* doesn't match the expected value.
*
* @param expected The expected value on the top of the stack.
* @param evalue The expected value on the top of the stack.
*
* @return On success returns 0, otherwise returns -1.
*/
@ -182,10 +184,10 @@ chan_pop(struct chan *chan, struct value evalue)
struct value *value = &stack->values[stack->n - 1];
if (!value_is_equal(value, &evalue)) {
err("%s: unexpected value %s (expected %s)",
err("%s: expected value %s different from top of stack %s",
chan->name,
value_str(*value),
value_str(evalue));
value_str(evalue),
value_str(*value));
return -1;
}

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef CHAN_H
@ -70,7 +70,7 @@ chan_read(struct chan *chan, struct value *value)
return 0;
}
void chan_init(struct chan *chan, enum chan_type type, const char *fmt, ...);
void chan_init(struct chan *chan, enum chan_type type, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
USE_RET int chan_set(struct chan *chan, struct value value);
USE_RET int chan_push(struct chan *chan, struct value value);
USE_RET int chan_pop(struct chan *chan, struct value expected);

Some files were not shown because too many files have changed in this diff Show More