Skip to content

Commit e10c378

Browse files
Merge pull request #297 from insertinterestingnamehere/ci
Increase Various OS and Compiler Versions in CI
2 parents 87e6f08 + d1196d9 commit e10c378

File tree

11 files changed

+233
-247
lines changed

11 files changed

+233
-247
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
topology:
147147
type: string
148148
machine:
149-
image: ubuntu-2204:2024.04.4
149+
image: ubuntu-2404:edge
150150
resource_class: << parameters.worker_type >>
151151
environment:
152152
CC: nvc

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
osx_m1_task:
22
macos_instance:
3-
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
3+
image: ghcr.io/cirruslabs/macos-sequoia-xcode:latest
44
timeout_in: 5m
55
matrix:
66
env:

.github/workflows/CI.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
linux-gcc:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
continue-on-error: true
1515
strategy:
1616
matrix:
@@ -22,8 +22,6 @@ jobs:
2222
CXX: g++-${{ matrix.gcc_version }}
2323
steps:
2424
- uses: actions/checkout@v4
25-
- if: ${{ matrix.gcc_version == '13' }}
26-
run: sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
2725
- name: install compiler
2826
run: sudo apt-get install gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
2927
- if: ${{ matrix.topology != 'no' }}
@@ -41,20 +39,14 @@ jobs:
4139
timeout-minutes: 4
4240

4341
linux-clang:
44-
runs-on: ubuntu-22.04
42+
runs-on: ubuntu-24.04
4543
continue-on-error: true
4644
strategy:
4745
matrix:
48-
clang_version: [11, 12, 13, 14, 15, 16, 17, 18]
46+
clang_version: [14, 15, 16, 17, 18]
4947
scheduler: [nemesis, sherwood, distrib]
5048
topology: [hwloc, binders, no]
5149
include:
52-
- clang_version: 11
53-
gcc_version: 10
54-
- clang_version: 12
55-
gcc_version: 11
56-
- clang_version: 13
57-
gcc_version: 11
5850
- clang_version: 14
5951
gcc_version: 11
6052
- clang_version: 15
@@ -70,12 +62,6 @@ jobs:
7062
CXX: clang++-${{ matrix.clang_version }}
7163
steps:
7264
- uses: actions/checkout@v4
73-
- if: ${{ matrix.clang_version == '16' || matrix.clang_version == '17' || matrix.clang_version == '18' }}
74-
run: |
75-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
76-
sudo apt-add-repository 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.clang_version }} main' && break || sleep 1
77-
- if: ${{ matrix.gcc_version == '13' }}
78-
run: sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
7965
- name: install gcc
8066
run: sudo apt-get install gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
8167
- name: install clang
@@ -95,7 +81,7 @@ jobs:
9581
timeout-minutes: 7
9682

9783
linux-icx:
98-
runs-on: ubuntu-22.04
84+
runs-on: ubuntu-24.04
9985
continue-on-error: true
10086
strategy:
10187
matrix:
@@ -112,13 +98,12 @@ jobs:
11298
hwloc-ls --version
11399
- name: install gcc
114100
run: |
115-
sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
116-
sudo apt-get install gcc-13 g++-13
101+
sudo apt-get install gcc-14 g++-14
117102
- name: install icx
118103
run: |
119104
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add - && break || sleep 1
120105
sudo apt-add-repository 'deb https://apt.repos.intel.com/oneapi all main' && break || sleep 1
121-
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.4
106+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2024.2
122107
source /opt/intel/oneapi/setvars.sh
123108
icx -v
124109
- name: build qthreads
@@ -159,7 +144,7 @@ jobs:
159144
run: |
160145
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add - && break || sleep 1
161146
sudo apt-add-repository 'deb https://apt.repos.intel.com/oneapi all main' && break || sleep 1
162-
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1
147+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.4
163148
source /opt/intel/oneapi/setvars.sh
164149
icc -v
165150
- name: build qthreads
@@ -176,7 +161,7 @@ jobs:
176161
timeout-minutes: 7
177162

178163
linux-aocc:
179-
runs-on: ubuntu-22.04
164+
runs-on: ubuntu-24.04
180165
continue-on-error: true
181166
strategy:
182167
matrix:
@@ -193,7 +178,6 @@ jobs:
193178
hwloc-ls --version
194179
- name: install gcc
195180
run: |
196-
sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
197181
sudo apt-get install gcc-13 g++-13
198182
- name: install aocc
199183
run: |
@@ -268,7 +252,6 @@ jobs:
268252
- uses: actions/checkout@v4
269253
- if: ${{ ! matrix.use_libcxx }}
270254
run: |
271-
sudo apt-add-repository universe && break || sleep 1
272255
sudo apt-get install gcc-14 g++-14
273256
- name: install compiler
274257
run: |
@@ -312,7 +295,6 @@ jobs:
312295
steps:
313296
- uses: actions/checkout@v4
314297
- run: |
315-
sudo apt-add-repository universe && break || sleep 1
316298
sudo apt-get install gcc-14 g++-14
317299
- if: ${{ matrix.compiler == 'clang' }}
318300
run: |
@@ -344,7 +326,6 @@ jobs:
344326
steps:
345327
- uses: actions/checkout@v4
346328
- run: |
347-
sudo apt-add-repository universe && break || sleep 1
348329
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
349330
sudo apt-add-repository 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' && break || sleep 1
350331
sudo apt-get install clang-format-19

include/qt_atomics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static inline int QTHREAD_TRYLOCK_TRY(qt_spin_trylock_t *x) {
184184
t.tv_sec = n.tv_sec + ((t.tv_nsec >= 1000000000) ? 1 : 0); \
185185
t.tv_nsec -= ((t.tv_nsec >= 1000000000) ? 1000000000 : 0); \
186186
int val = pthread_cond_timedwait(&(c), &(c##_lock), &t); \
187-
qassert(val == EINVAL || val == EPERM, 0); \
187+
assert(!(val == EINVAL || val == EPERM)); \
188188
} while (0)
189189
#define QTHREAD_COND_WAIT_DUO(c, m) \
190190
do { \

test/basics/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ TESTS = \
2424
qthread_stackleft \
2525
qtimer \
2626
qalloc \
27+
queue \
2728
arbitrary_blocking_operation \
2829
sinc_null \
2930
sinc_workers \
@@ -107,7 +108,7 @@ qthread_timer_wait_SOURCES = qthread_timer_wait.c
107108

108109
qtimer_SOURCES = qtimer.c
109110

110-
#queue_SOURCES = queue.c
111+
queue_SOURCES = queue.c
111112

112113
qthread_fork_precond_SOURCES = qthread_fork_precond.c
113114

test/basics/qthread_disable_shepherd.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
static aligned_t checkres(void *arg) {
99
qthread_shepherd_id_t myshep = qthread_shep();
1010

11-
assert(myshep == 1 || myshep == 0 || myshep == 2);
11+
test_check(myshep == 1 || myshep == 0 || myshep == 2);
1212

1313
if ((intptr_t)arg >= 0) {
1414
iprintf(
1515
"checkres: myshep = %i, should be %i\n", myshep, (int)(intptr_t)arg);
16-
assert(myshep == (qthread_shepherd_id_t)(intptr_t)arg);
16+
test_check(myshep == (qthread_shepherd_id_t)(intptr_t)arg);
1717
} else {
1818
iprintf("checkres: myshep = %i, should NOT be %i\n",
1919
myshep,
2020
-1 * (int)(intptr_t)arg);
21-
assert(myshep != (qthread_shepherd_id_t)(-1 * (intptr_t)arg));
21+
test_check(myshep != (qthread_shepherd_id_t)(-1 * (intptr_t)arg));
2222
}
2323

2424
return 0;
@@ -27,20 +27,20 @@ static aligned_t checkres(void *arg) {
2727
static aligned_t migrant(void *arg) {
2828
int myshep = qthread_shep();
2929

30-
assert(myshep == 1 || myshep == 0);
30+
test_check(myshep == 1 || myshep == 0);
3131

3232
if (myshep == 1) {
3333
qthread_migrate_to(0);
34-
assert(qthread_shep() == 0);
34+
test_check(qthread_shep() == 0);
3535
} else {
3636
qthread_migrate_to(1);
3737
iprintf("migrant starting on %i, aimed at 1, ended up on %i\n",
3838
myshep,
3939
qthread_shep());
4040
if (arg == (void *)2) {
41-
assert(qthread_shep() != 1);
41+
test_check(qthread_shep() != 1);
4242
} else {
43-
assert(qthread_shep() == 1);
43+
test_check(qthread_shep() == 1);
4444
}
4545
}
4646

@@ -60,11 +60,11 @@ int main(int argc, char *argv[]) {
6060

6161
CHECK_VERBOSE();
6262

63-
assert(qthread_readstate(TOTAL_SHEPHERDS) == 3);
64-
assert(qthread_readstate(ACTIVE_SHEPHERDS) == 2);
63+
test_check(qthread_readstate(TOTAL_SHEPHERDS) == 3);
64+
test_check(qthread_readstate(ACTIVE_SHEPHERDS) == 2);
6565
iprintf("now to fork to shepherd 0...\n");
6666
qret = qthread_fork_to(checkres, (void *)0, &ret, 0);
67-
assert(qret == QTHREAD_SUCCESS);
67+
test_check(qret == QTHREAD_SUCCESS);
6868
qthread_readFF(&ret, &ret);
6969
iprintf("\tsuccess in forking to shepherd 0!\n");
7070
iprintf("now to fork to shepherd 1...\n");
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
7474
iprintf("\tsuccessfully failed to fork to shepherd 1!\n");
7575
iprintf("now to fork to shepherd 2...\n");
7676
qret = qthread_fork_to(checkres, (void *)2, &ret, 2);
77-
assert(qret == QTHREAD_SUCCESS);
77+
test_check(qret == QTHREAD_SUCCESS);
7878
qthread_readFF(&ret, &ret);
7979
iprintf("\tsuccess in forking to shepherd 2!\n");
8080
iprintf("now to fork the migrant...\n");

test/basics/qthread_fp.c

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
#ifdef HAVE_CONFIG_H
2-
#include <config.h>
3-
#endif
4-
5-
#include <math.h>
6-
#include <qthread/qthread.h>
7-
#include <stdio.h>
8-
#include <stdlib.h>
9-
10-
#include "argparsing.h"
11-
12-
// https://www.geeksforgeeks.org/comparison-float-value-c/
13-
// https://dotnettutorials.net/lesson/taylor-series-using-recursion-in-c/
14-
// https://www.studytonight.com/c/programs/important-concepts/sum-of-taylor-series
15-
16-
struct parts {
17-
int length;
18-
float exp;
19-
float ans;
20-
aligned_t cond;
21-
};
22-
23-
// https://www.w3resource.com/c-programming-exercises/math/c-math-exercise-24.php
24-
static float taylor_exponential_core(int n, float x) {
25-
float exp_sum = 1;
26-
for (int i = n - 1; i > 0; --i) { exp_sum = 1 + x * exp_sum / i; }
27-
return exp_sum;
28-
}
29-
30-
static aligned_t taylor_exponential(void *arg) {
31-
struct parts *te = (struct parts *)arg;
32-
te->ans = taylor_exponential_core(te->length, te->exp);
33-
return 0;
34-
}
35-
36-
static void checkFloat(void) {
37-
struct parts teParts = {250, 9.0f, 0.0f};
38-
int ret = -1;
39-
qthread_empty(&teParts.cond);
40-
41-
ret = qthread_fork(taylor_exponential, &teParts, &teParts.cond);
42-
test_check(ret == QTHREAD_SUCCESS);
43-
44-
ret = qthread_readFF(NULL, &teParts.cond);
45-
test_check(ret == QTHREAD_SUCCESS);
46-
}
47-
48-
int main(void) {
49-
float ans = taylor_exponential_core(250, 9.0);
50-
float expected = 8103.083984f;
51-
float rel_error = fabsf(ans - expected) / fabsf(expected);
52-
float threshold = 1E-7f;
53-
test_check(rel_error < threshold);
54-
55-
int status = qthread_initialize();
56-
test_check(status == QTHREAD_SUCCESS);
57-
58-
checkFloat();
59-
return EXIT_SUCCESS;
60-
}
1+
#ifdef HAVE_CONFIG_H
2+
#include <config.h>
3+
#endif
4+
5+
#include <math.h>
6+
#include <qthread/qthread.h>
7+
#include <stdio.h>
8+
#include <stdlib.h>
9+
10+
#include "argparsing.h"
11+
12+
// https://www.geeksforgeeks.org/comparison-float-value-c/
13+
// https://dotnettutorials.net/lesson/taylor-series-using-recursion-in-c/
14+
// https://www.studytonight.com/c/programs/important-concepts/sum-of-taylor-series
15+
16+
struct parts {
17+
int length;
18+
float exp;
19+
float ans;
20+
aligned_t cond;
21+
};
22+
23+
// https://www.w3resource.com/c-programming-exercises/math/c-math-exercise-24.php
24+
static float taylor_exponential_core(int n, float x) {
25+
float exp_sum = 1;
26+
for (int i = n - 1; i > 0; --i) { exp_sum = 1 + x * exp_sum / i; }
27+
return exp_sum;
28+
}
29+
30+
static aligned_t taylor_exponential(void *arg) {
31+
struct parts *te = (struct parts *)arg;
32+
te->ans = taylor_exponential_core(te->length, te->exp);
33+
return 0;
34+
}
35+
36+
static void checkFloat(void) {
37+
struct parts teParts = {250, 9.0f, 0.0f};
38+
int ret = -1;
39+
qthread_empty(&teParts.cond);
40+
41+
ret = qthread_fork(taylor_exponential, &teParts, &teParts.cond);
42+
test_check(ret == QTHREAD_SUCCESS);
43+
44+
ret = qthread_readFF(NULL, &teParts.cond);
45+
test_check(ret == QTHREAD_SUCCESS);
46+
}
47+
48+
int main(void) {
49+
float ans = taylor_exponential_core(250, 9.0);
50+
float expected = 8103.083984f;
51+
float rel_error = fabsf(ans - expected) / fabsf(expected);
52+
float threshold = 1E-7f;
53+
test_check(rel_error < threshold);
54+
55+
int status = qthread_initialize();
56+
test_check(status == QTHREAD_SUCCESS);
57+
58+
checkFloat();
59+
return EXIT_SUCCESS;
60+
}

0 commit comments

Comments
 (0)