Commit Graph

419 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
55318d9da7 Update OpenMP emulation model
Add more tests, subsystem states and documentation.
2024-03-12 11:35:18 +01:00
Raúl Peñacoba Veigas
bf2b3b73a0 Add OpenMP emulation model
For now it only has support for subsystems

Co-authored-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-03-08 13:04:45 +01:00
454504d0cc Poison usleep()
It has been deprecated in POSIX.1-2001 and removed in POSIX.1-2008.
2024-02-20 14:01:18 +01:00
4993197fb9 Add nOS-V attach and detach API events
Instead of showing the "attached" state with the VH{aA} events, we show
when the call to nosv_attach() and nosv_detach() take place. The old
VH{aA} events are now ignored. Bumps the nOS-V model version to 1.1.0.
2024-02-15 17:59:41 +01:00
68fc8b0eba Encode ovnievents output for HTML 2024-01-30 12:02:02 +01:00
028aa48b98 Add ovnievents tool to dump event definition
The tool dumps the list of events in Markdown, suitable to replace the
documentation page for the emulation events.
2024-01-30 12:02:02 +01:00
b878e5290a Add ovnidump(1) manual page 2024-01-30 12:02:02 +01:00
1792c650ec Add definitions for emulator events
Implements a small language parser to define the emulator events. The
event specification is parsed at emulation (when the emulator runs).
The ovnidump output now prints the events with the arguments formatted
as given in the event description.

It also introduces some consistency checks over the event MCVs, which
must begin with the model identifier and cannot be duplicated.
2024-01-30 12:01:56 +01:00
6bfacf0e1e Check the thread is ready before adding events
Prevents segmentation faults when accessing the NULL stream buffer
without a clear message of what is happening.
2023-12-19 17:30:31 +01:00
0439399f05 Fix ovni_thread_isready() after ovni_thread_free()
Until now, the value returned by ovni_thread_isready() was still
non-zero when the thread stream was destroyed in ovni_thread_free()
This was making it impossible to detect when a stream was destroyed.

This change makes it return 0 after ovni_thread_free() by using a new
finished flag. The flag keeps track on then the stream is destroyed,
preventing double initialization of a free stream.
2023-12-19 17:30:20 +01:00
0496aeffc6 Close stream FD on ovni_thread_free()
This is required on FS like NFS as the cache coherence model states that
only after the file is closed the changes are actually propagated to the
server. It is not recomended to use NFS as OVNI_TMPDIR anyway.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/168
2023-12-14 16:08:25 +01:00
bf2b4af15a Ensure we use RUNPATH for ovniver
As cmake doesn't provide a way to use the RPATH or the RUNPATH, we
explicitly set the --enable-new-dtags linker flag. If the flag is not
supported by the compiler, the build is aborted.
2023-12-12 17:06:24 +01:00
6d584c646c Install ovniver with the runpath set
When running ovniver without LD_LIBRARY_PATH set, the loader couldn't
find any ovni installation and therefore was failing to start the
program. With this change we set the RUNPATH (not RPATH) of ovniver to
the installation libdir, so when no other libovni library is loaded via
LD_LIBRARY_PATH the one provided by the same source as ovniver is used.

The value of LD_LIBRARY_PATH is also printed so we can determine where
it may be loading libovni. Using LD_DEBUG=libs will give more
information of the search process.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/163
2023-12-12 17:06:24 +01:00
0f7ccc89de Add -a flag in ovniemu to enable all models
The experimental flag -a is used to ease the transition to the usage of
ovni_thread_require(), as it may be posible to have traces in which not
all libraries have requested their model. The flag causes all emulation
models to be enabled. This flag is considered experimental and it may be
removed or renamed in future versions.
2023-12-11 14:29:40 +01:00
998200d507 Always check thread metadata
The thread metadata file is mandatory for trace version 2, so the
emulator should fail if the file is not there or has the wrong version.
Old traces with version 1 are not supported.
2023-11-22 10:38:46 +01:00
3267ea873f Clean tmp directories when finishing
There were leftover temporal directories when using the OVNI_TMPDIR
variable, as we only remove the proccess ones. This change only attempts
to remove them if they are empty, and doesn't care about race
conditions. The removal process is just "best effort".
2023-11-16 12:39:15 +01:00
effdf36f7e Print the list of models in the emulator 2023-11-16 12:39:14 +01:00
927837df25 Don't write thread metadata on flush
The metadata was being written to the final directory, which may be too
slow to accept writes during runtime. The thread metadata needs to be
written anyway at ovni_thread_free() to set the finished flag, so we can
simply skip it.
2023-11-16 12:39:14 +01:00
c7e8b256d2 Fix gcc uninitialization warning confusion 2023-11-16 12:39:14 +01:00
855dd76678 Report libovni version from trace 2023-11-16 12:39:14 +01:00
70e886fcfe Remove old model_version key from proc metadata 2023-11-16 12:39:14 +01:00
58fe0d1b4b Improve error message for disabled model 2023-11-16 12:39:14 +01:00
72b7eb8332 Mark the finalization of streams
The emulator will now check that all threads are properly finalyzed by
calling ovni_thread_free(), as required by the specification. For now
only a warning is issued, which is enough to determine the cause of
potential emulator panics.

The ovni model is now always enabled.
2023-11-16 12:39:14 +01:00
fa436604b7 Improve compatibility warning messages 2023-11-16 12:39:14 +01:00
6f7ce4063f Enable all models if the require key is missing
Allows programs to update to a new libovni library without breaking the
instrumentation. Only until the first call to ovni_thread_require() the
models are enabled on demand.
2023-11-16 12:39:14 +01:00
59385fad03 Add compatibility mode for missing require key
Traces with metadata version 1 don't use per-thread information, so we
cannot read the 'require' key. All models will be enabled for old traces
(which will cause performance problems).
2023-11-16 12:39:14 +01:00
30d5e4b0ca Show state for all models 2023-11-16 12:39:14 +01:00
d45041e00c Disable delayed connect 2023-11-16 12:39:14 +01:00
354f2f50eb Register emulation models only if required
Until now, emulation models were always being registered via probe(),
which causes the emulator to initialize all the channels. To reduce the
overhead, the channels were not connected or registered in the bay
until the first event of that model was received. This delayed connect
was causing issues in muxes where the newly connected model required
refreshing the touched channels. Which in turn was causing unexpected
PRV events.

By determining which models we need to enable, we can remove the delayed
connect mechanism and just enable those models at initialization time,
and connect the channels.
2023-11-16 12:39:05 +01:00
3d10bef305 Load thread metadata from the JSON file 2023-11-16 12:21:50 +01:00
ab42ac4557 Add thread metadata 2023-11-16 12:21:50 +01:00
5d9aef4ed8 Remove rthread and rproc definitions from ovni.h 2023-11-16 12:21:50 +01:00
c13d57f0f6 Fix for nOS-V with ovni.level=2
When running without all the subsystem events enabled in nOS-V, it is
possible to emit two consecutive VTx events, which would push twice the
same value ST_TASK_BODY into the subsystem channel. This change relaxes
the subsystem channel to accept duplicate stacked values. A regression
test is also added.

Reported-By: Raúl Peñacoba Veigas <raul.penacoba@bsc.es>
2023-11-14 17:26:43 +01:00
4b4f1bd218 Don't modify nOS-V subsystem state on task pause
In nOS-V, when a task was paused via the VTp event, two things were
happening: 1) the task state was set to pause and 2) the subsystem state
"Task: Running" was being popped.

This causes a problem when a task calls nosv_submit() in blocking mode,
as it will call nosv_pause() which will emit a VTp event from a
subsystem different than "Task: Running".

To solve this conflict, we handle the subsystems state and the task
state separately with the VTp and VTr events. The subsystem state "Task:
Running" no longer is connected to the state of the task and only shows
if we entered the body of the task or not. It has now been renamed to
"Task: In body".

The new state "Task: In body" represents that the task body has begun
the execution and is still in the stack, but the task may be paused. The
subsystem is not changed by the VTp (pause) or VTr (resume) events.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/128
2023-10-23 11:26:17 +02:00
0df018cf5f Fix segfault reading empty streams
The check_clock_gate() was trying to access to the first event in all
streams. However, streams that are empty don't have any event, so they
cause a NULL dereference. Skipping not active streams avoids the
problem.
2023-10-23 10:07:44 +02:00
Kevin Sala
7b4ebca002 Add OVNI_TRACEDIR envar to change trace directory
This commit introduces the OVNI_TRACEDIR environment variable to change
the directory where traces are generated. By default, when the envar is
not defined, the trace is still generated in the ovni directory. The
envar can take a trace directory name, a relative path to the directory,
or its absolute path. In the first case, the directory is created in the
current path $PWD.

Both libovni (rt) and ovnisync read this environment variable.
2023-10-23 07:49:28 +00:00
Kevin Sala
24252ebbb3 Use common's progname functions in ovnisync
This commit adds the progname_get function in common.h header and
extends the ovnisync tool to use them
2023-10-23 07:49:28 +00:00
Kevin Sala
9a628e78ca Add MPI model with interface view 2023-09-06 18:11:18 +02:00
Kevin Sala
276afd5479 Add TAMPI model with subsystems view 2023-08-22 18:13:29 +02:00
Kevin Sala
9269dd7202 Add nosv create and destroy API subsystem states 2023-08-17 13:23:59 +02:00
a3ffb2443a Report the commit too with ovniver 2023-07-26 17:13:28 +02:00
bf8a2213c1 Add the ovniver program to report the version 2023-07-26 16:31:56 +02:00
97c936d41f Add ovni_version_get() function
Allows the reding the version of the libovni.so currently loaded.
2023-07-26 16:31:30 +02:00
f08595b3a7 Report open error for missing trace directory 2023-07-26 13:51:35 +02:00
f8c6b7c7c0 Improve the version error message
Use the terminology want/got to determine which version the user is
requested and the version the library provides.
2023-07-25 19:55:51 +02:00
48df02f102 Always use the project version
Don't duplicated versions so we avoid the problem of missing one
instance to be updated.
2023-07-07 10:42:40 +02:00
ee9111a1ec Move ovni.pc.in into src/ 2023-07-05 13:13:53 +02:00
4abd92e139 Make ovni.h a public header of ovni target 2023-07-05 13:11:18 +02:00
cd2e844066 Use the installation directories provided by cmake
Some systems will define the library path as lib64. Also update other
install commands to use the values discovered by the GNUInstallDirs
module.
2023-07-05 12:52:56 +02:00
5a9086e6d1 Fix ovnisort with flush events
Sort the events in the sorting region before injecting them back in the
stream. This solves the problem with flush events OF[ and OF].
2023-06-29 13:25:15 +02:00
05979df34d Install ovnitop.1 into man1 subdirectory 2023-06-02 17:12:17 +02:00
d9b82494d0 Free the table at the end in ovnitop 2023-06-01 18:38:26 +02:00
c1b0768e7d Add ovnitop(1) manual page 2023-05-31 17:23:25 +00:00
553d0a1c62 Add ovnitop command 2023-05-31 17:23:25 +00:00
44d120d7a8 Version 1.2.0 2023-05-01 09:19:05 +02:00
c2b6bfd3a8 Set the size of the channel property arrays
Arrays which don't initialize the last elements of the enumeration are
shorter and will cause a buffer overflow when read in a loop.
2023-04-24 12:37:20 +02:00
a8944b3763 Fix buffer overflow in sort_replace()
The access to the array was done before the out of bound check.
2023-04-24 11:47:46 +02:00
49f915fda5 Add FIXME notice for taskiter support
Set the task->thread to NULL if we re-execute a task from the Dead
state, so it follows the behavior of a Created task.
2023-04-17 15:58:19 +00:00
David Alvarez
26d01d18eb Support taskiter by allowing tasks to re-launch 2023-04-17 15:58:19 +00:00
1ec6f799f1 Add missing label for sponge state 2023-04-14 13:39:37 +00:00
b16c30a5e6 Add Absorbing state to the idle view in Nanos6 2023-04-14 13:39:37 +00:00
6cafd347ce Add support for sponge subsystem state in Nanos6 2023-04-14 13:39:37 +00:00
171e439bd4 Allow builds without MPI with -DUSE_MPI=OFF 2023-04-14 11:27:30 +00:00
6eead7e28e Warn if some looms don't have the rank
Fallback to sorting by loom name instead.
2023-04-14 12:13:49 +02:00
bfff1a815e Don't set rank_min multiple times 2023-04-14 12:01:47 +02:00
9568d4f379 Inform the user of the sorting method selected 2023-04-14 08:35:21 +00:00
676e30b4ca Order looms and processes by rank if given 2023-04-14 08:35:21 +00:00
80b8b209fa Skip repeated hostnames in ovnisync 2023-04-06 17:52:28 +02:00
9e105413fd Replace brk with breakdown 2023-04-06 17:38:37 +02:00
602daabe23 Fix copyright years 2023-04-06 15:33:15 +00:00
7aa3434e79 Remove ENABLE_DEBUG comments 2023-04-06 15:33:15 +00:00
29a7011141 Consider the -b option experimental 2023-04-06 15:33:15 +00:00
999a79b074 Run Nanos6 connect hook at init for breakdown 2023-04-06 15:33:15 +00:00
1c82470bfc Remove initial subsystem by default 2023-04-06 15:33:15 +00:00
b17ff6d166 Add unknown subsystem state for Nanos6 2023-04-06 15:33:15 +00:00
1582a60522 Set tr mux output to unknown subsystem on NULL 2023-04-06 15:33:15 +00:00
a827113c2a Increasing breakdown row padding to match CPU 2023-04-06 15:33:15 +00:00
881e556e06 Fix pcf_sdd_value() return check 2023-04-06 15:33:15 +00:00
cc09920c80 Remove unused i variable in emu/nanos6/breakdown.c 2023-04-06 15:33:15 +00:00
6711afdb58 Fix include headers following IWYU 2023-04-06 15:33:15 +00:00
5b64737ad9 Fix pcf_labels type 2023-04-06 15:33:15 +00:00
30f68ea5df Add missing headers 2023-04-06 15:33:15 +00:00