From f6d85e9af574ba3cddf353b483b2ff287b9f4f67 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 12 Sep 2024 15:56:24 +0200 Subject: [PATCH] Make ovni.require a mandatory attribute We no longer accept streams that don't have the ovni.require attribute. --- src/emu/model.c | 15 ++------------- test/emu/ovni/CMakeLists.txt | 2 +- test/emu/ovni/sort-cpus-by-loom.c | 3 ++- test/emu/ovni/sort-cpus-by-rank.c | 3 ++- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/emu/model.c b/src/emu/model.c index f750784..8e5a96e 100644 --- a/src/emu/model.c +++ b/src/emu/model.c @@ -235,13 +235,6 @@ model_finish(struct model *model, struct emu *emu) static int should_enable(int have[3], struct model_spec *spec, struct thread *t) { - static int compat = 0; - - /* Enable all models if we are in compatibility model. Don't check other - * threads metadata */ - if (compat) - return 1; - if (t->meta == NULL) { err("missing metadata for thread %s", t->id); return -1; @@ -249,12 +242,8 @@ should_enable(int have[3], struct model_spec *spec, struct thread *t) JSON_Object *require = json_object_dotget_object(t->meta, "ovni.require"); if (require == NULL) { - warn("missing 'ovni.require' key in thread %s", t->id); - warn("loading trace in compatibility mode"); - warn("all models will be enabled (expect slowdown)"); - warn("use ovni_thread_require() to enable only required models"); - compat = 1; - return 1; + err("missing 'ovni.require' key in thread %s", t->id); + return -1; } /* May not have the current model */ diff --git a/test/emu/ovni/CMakeLists.txt b/test/emu/ovni/CMakeLists.txt index d01eb2d..d62ec34 100644 --- a/test/emu/ovni/CMakeLists.txt +++ b/test/emu/ovni/CMakeLists.txt @@ -21,7 +21,7 @@ test_emu(sort-cpus-by-rank.c MP) test_emu(tracedir-subdir.c MP DRIVER "tracedir-subdir.driver.sh") test_emu(empty-stream.c SHOULD_FAIL REGEX "missing ovni.finished") test_emu(require-bad-version.c SHOULD_FAIL REGEX "unsupported ovni model version (want 666.66.6, have .*)") -test_emu(require-compat.c REGEX "loading trace in compatibility mode") +test_emu(require-compat.c SHOULD_FAIL REGEX "missing 'ovni.require' key in thread") test_emu(require-repeated.c) test_emu(thread-crash.c SHOULD_FAIL REGEX "missing ovni.finished") test_emu(thread-free-isready.c) diff --git a/test/emu/ovni/sort-cpus-by-loom.c b/test/emu/ovni/sort-cpus-by-loom.c index 7fe4f3f..c143a57 100644 --- a/test/emu/ovni/sort-cpus-by-loom.c +++ b/test/emu/ovni/sort-cpus-by-loom.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ #include @@ -35,6 +35,7 @@ main(void) for (int i = 0; i < N; i++) ovni_add_cpu(i, cpus[i]); + instr_require("ovni"); instr_thread_execute(-1, -1, 0); instr_end(); diff --git a/test/emu/ovni/sort-cpus-by-rank.c b/test/emu/ovni/sort-cpus-by-rank.c index b919cb7..ecb036e 100644 --- a/test/emu/ovni/sort-cpus-by-rank.c +++ b/test/emu/ovni/sort-cpus-by-rank.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ #include @@ -36,6 +36,7 @@ main(void) for (int i = 0; i < N; i++) ovni_add_cpu(i, cpus[i]); + instr_require("ovni"); instr_thread_execute(-1, -1, 0); instr_end();