| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************/ | ||
| 2 | /* Copyright 2009-2026 Barcelona Supercomputing Center */ | ||
| 3 | /* */ | ||
| 4 | /* This file is part of the DLB library. */ | ||
| 5 | /* */ | ||
| 6 | /* DLB is free software: you can redistribute it and/or modify */ | ||
| 7 | /* it under the terms of the GNU Lesser General Public License as published by */ | ||
| 8 | /* the Free Software Foundation, either version 3 of the License, or */ | ||
| 9 | /* (at your option) any later version. */ | ||
| 10 | /* */ | ||
| 11 | /* DLB is distributed in the hope that it will be useful, */ | ||
| 12 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | ||
| 13 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | ||
| 14 | /* GNU Lesser General Public License for more details. */ | ||
| 15 | /* */ | ||
| 16 | /* You should have received a copy of the GNU Lesser General Public License */ | ||
| 17 | /* along with DLB. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 18 | /*********************************************************************************/ | ||
| 19 | |||
| 20 | #include "LB_core/DLB_kernel.h" | ||
| 21 | #include "LB_core/spd.h" | ||
| 22 | #include "dlb_errors.h" | ||
| 23 | #include "mngo/mngo_talp.h" | ||
| 24 | #include "support/mask_utils.h" | ||
| 25 | #include "unique_shmem.h" | ||
| 26 | #include <stdio.h> | ||
| 27 | #include <stdlib.h> | ||
| 28 | #include <string.h> | ||
| 29 | #include <sys/wait.h> | ||
| 30 | |||
| 31 | /* TLS global variable to store the spd pointer */ | ||
| 32 | extern __thread subprocess_descriptor_t *thread_spd; | ||
| 33 | |||
| 34 | static char options[128]; | ||
| 35 | |||
| 36 | ✗ | void initialize(size_t id, const char *mask, subprocess_descriptor_t *spd) { | |
| 37 | } | ||
| 38 | |||
| 39 | ✗ | void finalize(subprocess_descriptor_t *spd) { | |
| 40 | } | ||
| 41 | |||
| 42 | 1 | int main(int argc, char *argv[]) { | |
| 43 | enum { SYS_SIZE = 4 }; | ||
| 44 | 1 | mu_testing_set_sys_size(SYS_SIZE); | |
| 45 | |||
| 46 | enum { SHMEM_SIZE_MULTIPLIER = 1 }; | ||
| 47 | |||
| 48 | cpu_set_t process_mask; | ||
| 49 | 1 | mu_parse_mask("1-4", &process_mask); | |
| 50 | |||
| 51 | 1 | size_t id = 1; | |
| 52 | |||
| 53 | { | ||
| 54 | subprocess_descriptor_t spd; | ||
| 55 | 1 | spd.id = id; | |
| 56 | 1 | thread_spd = &spd; | |
| 57 | |||
| 58 | 1 | strcpy(options, "--talp --shm-key="); | |
| 59 | 1 | strcat(options, SHMEM_KEY); | |
| 60 | |||
| 61 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(Initialize(&spd, id, 2, &process_mask, options) == DLB_SUCCESS); |
| 62 | mngo_talp_region_t region; | ||
| 63 | static char region_name[16] = "test"; | ||
| 64 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(mngo_talp__region_register(&spd, region_name, ®ion) == DLB_SUCCESS); |
| 65 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(strcmp(mngo_talp__get_region_name(®ion), region_name) == 0); |
| 66 | |||
| 67 | mngo_talp_metrics_t metrics; | ||
| 68 | 1 | mngo_talp__take_metrics(&spd, ®ion, &metrics); | |
| 69 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(Finish(&spd) == DLB_SUCCESS); |
| 70 | } | ||
| 71 | |||
| 72 | { | ||
| 73 | subprocess_descriptor_t spd; | ||
| 74 | 1 | spd.id = id; | |
| 75 | 1 | thread_spd = &spd; | |
| 76 | |||
| 77 | 1 | strcpy(options, "--shm-key="); | |
| 78 | 1 | strcat(options, SHMEM_KEY); | |
| 79 | |||
| 80 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(Initialize(&spd, id, 2, &process_mask, options) == DLB_SUCCESS); |
| 81 | mngo_talp_region_t region; | ||
| 82 | static char region_name[16] = "test"; | ||
| 83 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(mngo_talp__region_register(&spd, region_name, ®ion) == DLB_NOUPDT); |
| 84 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | assert(Finish(&spd) == DLB_SUCCESS); |
| 85 | } | ||
| 86 | |||
| 87 | 1 | return 0; | |
| 88 | } | ||
| 89 |