ovni/test/emu/tampi/ss-comm.c
Rodrigo Arias 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

57 lines
1.3 KiB
C

/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include <stdlib.h>
#include "compat.h"
#include "instr.h"
#include "instr_tampi.h"
int
main(void)
{
/* Test that simulates a communication task executing TAMPI operations */
const int rank = atoi(getenv("OVNI_RANK"));
const int nranks = atoi(getenv("OVNI_NRANKS"));
instr_start(rank, nranks);
instr_tampi_init();
const int ncomms = 100;
/* Simulate multiple task-aware communications */
for (int c = 0; c < ncomms; c++) {
instr_tampi_library_interface_enter();
/* Issue the non-blocking MPI operation and test it */
instr_tampi_issue_nonblk_op_enter();
sleep_us(100);
instr_tampi_issue_nonblk_op_exit();
instr_tampi_test_request_enter();
sleep_us(10);
instr_tampi_test_request_exit();
/* Create a ticket if it was not completed */
if (c % 2 == 0) {
instr_tampi_create_ticket_enter();
instr_tampi_create_ticket_exit();
instr_tampi_add_queues_enter();
instr_tampi_add_queues_exit();
/* Wait the ticket if the operation was blocking */
if (c % 4 == 0) {
instr_tampi_wait_ticket_enter();
sleep_us(100);
instr_tampi_wait_ticket_exit();
}
}
instr_tampi_library_interface_exit();
}
instr_end();
return 0;
}