GCC Code Coverage Report


Directory: ./
File: tests/unit/05_api/fortran_api_00.f90
Date: 2026-12-01 10:07:21
Exec Total Coverage
Lines: 35 35 100.0%
Functions: 2 2 100.0%
Branches: 31 62 50.0%

Line Branch Exec Source
1 !-------------------------------------------------------------------------------!
2 ! Copyright 2009-2021 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 1 program test
21 use iso_c_binding
22 implicit none
23 include 'dlbf.h'
24 integer :: err
25 type(c_ptr) :: process_mask = C_NULL_PTR
26
27 1 err = dlb_init(4, C_NULL_PTR, "--drom=0 --barrier=no")
28
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (err /= DLB_SUCCESS) error stop "dlb_init failed"
29
30
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_disable() /= DLB_SUCCESS ) error stop "dlb_disable failed"
31
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_lend() /= DLB_ERR_NOLEWI ) error stop "dlb_lend failed"
32
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_enable() /= DLB_SUCCESS ) error stop "dlb_enable failed"
33
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_setmaxparallelism(1) /= DLB_ERR_NOLEWI ) error stop "dlb_setmaxparallelism failed"
34
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_unsetmaxparallelism() /= DLB_ERR_NOLEWI ) error stop "dlb_unsetmaxparallelism failed"
35
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_setobserverrole(logical(.false.,c_bool)) /= DLB_SUCCESS ) error stop "dlb_setobserverrole failed"
36
37 ! Lend
38
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_lend() /= DLB_ERR_NOLEWI ) error stop "dlb_lend failed"
39
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_lendcpu(0) /= DLB_ERR_NOLEWI ) error stop "dlb_lendcpu failed"
40
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_lendcpus(1) /= DLB_ERR_NOLEWI ) error stop "dlb_lendcpus failed"
41
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_lendcpumask(process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_lendcpumask failed"
42
43 ! Reclaim
44
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_reclaim() /= DLB_ERR_NOLEWI ) error stop "dlb_reclaim failed"
45
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_reclaimcpu(0) /= DLB_ERR_NOLEWI ) error stop "dlb_reclaimcpu failed"
46
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_reclaimcpus(1) /= DLB_ERR_NOLEWI ) error stop "dlb_reclaimcpus failed"
47
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_reclaimcpumask(process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_reclaimcpumask failed"
48
49 ! Acquire
50
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_acquirecpu(0) /= DLB_ERR_NOLEWI ) error stop "dlb_acquirecpu failed"
51
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_acquirecpus(1) /= DLB_ERR_NOLEWI ) error stop "dlb_acquirecpus failed"
52
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_acquirecpumask(process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_acquirecpumask failed"
53
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_acquirecpusinmask(1, process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_acquirecpusinmask failed"
54
55 ! Borrow
56
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_borrow() /= DLB_ERR_NOLEWI ) error stop "dlb_borrow failed"
57
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_borrowcpu(1) /= DLB_ERR_NOLEWI ) error stop "dlb_borrowcpu failed"
58
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_borrowcpus(1) /= DLB_ERR_NOLEWI ) error stop "dlb_borrowcpus failed"
59
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_borrowcpumask(process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_borrowcpumask failed"
60
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_borrowcpusinmask(1, process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_borrowcpusinmask failed"
61
62 ! Return
63
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_return() /= DLB_ERR_NOLEWI ) error stop "dlb_return failed"
64
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_returncpu(0) /= DLB_ERR_NOLEWI ) error stop "dlb_returncpu failed"
65
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_returncpumask(process_mask) /= DLB_ERR_NOLEWI ) error stop "dlb_returncpumask failed"
66
67 ! Barrier
68
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_barrier() /= DLB_ERR_NOCOMP ) error stop "dlb_barrier failed"
69
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_barrierattach() /= DLB_ERR_NOCOMP ) error stop "dlb_barrierattach failed"
70
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (dlb_barrierdetach() /= DLB_ERR_NOCOMP ) error stop "dlb_barrierdetach failed"
71
72 1 err = dlb_finalize()
73
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (err /= DLB_SUCCESS) error stop "dlb_finalize failed"
74 1 end program test
75