Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Various OS and Compiler Versions in CI #297

2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
topology:
type: string
machine:
image: ubuntu-2204:2024.04.4
image: ubuntu-2404:edge
resource_class: << parameters.worker_type >>
environment:
CC: nvc
Expand Down
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
osx_m1_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
image: ghcr.io/cirruslabs/macos-sequoia-xcode:latest
timeout_in: 5m
matrix:
env:
Expand Down
35 changes: 8 additions & 27 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
linux-gcc:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
Expand All @@ -22,8 +22,6 @@ jobs:
CXX: g++-${{ matrix.gcc_version }}
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.gcc_version == '13' }}
run: sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
- name: install compiler
run: sudo apt-get install gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
- if: ${{ matrix.topology != 'no' }}
Expand All @@ -41,20 +39,14 @@ jobs:
timeout-minutes: 4

linux-clang:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
clang_version: [11, 12, 13, 14, 15, 16, 17, 18]
clang_version: [14, 15, 16, 17, 18]
scheduler: [nemesis, sherwood, distrib]
topology: [hwloc, binders, no]
include:
- clang_version: 11
gcc_version: 10
- clang_version: 12
gcc_version: 11
- clang_version: 13
gcc_version: 11
- clang_version: 14
gcc_version: 11
- clang_version: 15
Expand All @@ -70,12 +62,6 @@ jobs:
CXX: clang++-${{ matrix.clang_version }}
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.clang_version == '16' || matrix.clang_version == '17' || matrix.clang_version == '18' }}
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
sudo apt-add-repository 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.clang_version }} main' && break || sleep 1
- if: ${{ matrix.gcc_version == '13' }}
run: sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
- name: install gcc
run: sudo apt-get install gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
- name: install clang
Expand All @@ -95,7 +81,7 @@ jobs:
timeout-minutes: 7

linux-icx:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
Expand All @@ -112,13 +98,12 @@ jobs:
hwloc-ls --version
- name: install gcc
run: |
sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
sudo apt-get install gcc-13 g++-13
sudo apt-get install gcc-14 g++-14
- name: install icx
run: |
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add - && break || sleep 1
sudo apt-add-repository 'deb https://apt.repos.intel.com/oneapi all main' && break || sleep 1
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.4
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2024.2
source /opt/intel/oneapi/setvars.sh
icx -v
- name: build qthreads
Expand Down Expand Up @@ -159,7 +144,7 @@ jobs:
run: |
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add - && break || sleep 1
sudo apt-add-repository 'deb https://apt.repos.intel.com/oneapi all main' && break || sleep 1
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.4
source /opt/intel/oneapi/setvars.sh
icc -v
- name: build qthreads
Expand All @@ -176,7 +161,7 @@ jobs:
timeout-minutes: 7

linux-aocc:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
Expand All @@ -193,7 +178,6 @@ jobs:
hwloc-ls --version
- name: install gcc
run: |
sudo apt-add-repository 'ppa:ubuntu-toolchain-r/test' && break || sleep 1
sudo apt-get install gcc-13 g++-13
- name: install aocc
run: |
Expand Down Expand Up @@ -268,7 +252,6 @@ jobs:
- uses: actions/checkout@v4
- if: ${{ ! matrix.use_libcxx }}
run: |
sudo apt-add-repository universe && break || sleep 1
sudo apt-get install gcc-14 g++-14
- name: install compiler
run: |
Expand Down Expand Up @@ -312,7 +295,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-add-repository universe && break || sleep 1
sudo apt-get install gcc-14 g++-14
- if: ${{ matrix.compiler == 'clang' }}
run: |
Expand Down Expand Up @@ -344,7 +326,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-add-repository universe && break || sleep 1
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
sudo apt-add-repository 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' && break || sleep 1
sudo apt-get install clang-format-19
Expand Down
2 changes: 1 addition & 1 deletion include/qt_atomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static inline int QTHREAD_TRYLOCK_TRY(qt_spin_trylock_t *x) {
t.tv_sec = n.tv_sec + ((t.tv_nsec >= 1000000000) ? 1 : 0); \
t.tv_nsec -= ((t.tv_nsec >= 1000000000) ? 1000000000 : 0); \
int val = pthread_cond_timedwait(&(c), &(c##_lock), &t); \
qassert(val == EINVAL || val == EPERM, 0); \
assert(!(val == EINVAL || val == EPERM)); \
} while (0)
#define QTHREAD_COND_WAIT_DUO(c, m) \
do { \
Expand Down
3 changes: 2 additions & 1 deletion test/basics/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ TESTS = \
qthread_stackleft \
qtimer \
qalloc \
queue \
arbitrary_blocking_operation \
sinc_null \
sinc_workers \
Expand Down Expand Up @@ -107,7 +108,7 @@ qthread_timer_wait_SOURCES = qthread_timer_wait.c

qtimer_SOURCES = qtimer.c

#queue_SOURCES = queue.c
queue_SOURCES = queue.c

qthread_fork_precond_SOURCES = qthread_fork_precond.c

Expand Down
22 changes: 11 additions & 11 deletions test/basics/qthread_disable_shepherd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
static aligned_t checkres(void *arg) {
qthread_shepherd_id_t myshep = qthread_shep();

assert(myshep == 1 || myshep == 0 || myshep == 2);
test_check(myshep == 1 || myshep == 0 || myshep == 2);

if ((intptr_t)arg >= 0) {
iprintf(
"checkres: myshep = %i, should be %i\n", myshep, (int)(intptr_t)arg);
assert(myshep == (qthread_shepherd_id_t)(intptr_t)arg);
test_check(myshep == (qthread_shepherd_id_t)(intptr_t)arg);
} else {
iprintf("checkres: myshep = %i, should NOT be %i\n",
myshep,
-1 * (int)(intptr_t)arg);
assert(myshep != (qthread_shepherd_id_t)(-1 * (intptr_t)arg));
test_check(myshep != (qthread_shepherd_id_t)(-1 * (intptr_t)arg));
}

return 0;
Expand All @@ -27,20 +27,20 @@ static aligned_t checkres(void *arg) {
static aligned_t migrant(void *arg) {
int myshep = qthread_shep();

assert(myshep == 1 || myshep == 0);
test_check(myshep == 1 || myshep == 0);

if (myshep == 1) {
qthread_migrate_to(0);
assert(qthread_shep() == 0);
test_check(qthread_shep() == 0);
} else {
qthread_migrate_to(1);
iprintf("migrant starting on %i, aimed at 1, ended up on %i\n",
myshep,
qthread_shep());
if (arg == (void *)2) {
assert(qthread_shep() != 1);
test_check(qthread_shep() != 1);
} else {
assert(qthread_shep() == 1);
test_check(qthread_shep() == 1);
}
}

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

CHECK_VERBOSE();

assert(qthread_readstate(TOTAL_SHEPHERDS) == 3);
assert(qthread_readstate(ACTIVE_SHEPHERDS) == 2);
test_check(qthread_readstate(TOTAL_SHEPHERDS) == 3);
test_check(qthread_readstate(ACTIVE_SHEPHERDS) == 2);
iprintf("now to fork to shepherd 0...\n");
qret = qthread_fork_to(checkres, (void *)0, &ret, 0);
assert(qret == QTHREAD_SUCCESS);
test_check(qret == QTHREAD_SUCCESS);
qthread_readFF(&ret, &ret);
iprintf("\tsuccess in forking to shepherd 0!\n");
iprintf("now to fork to shepherd 1...\n");
Expand All @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
iprintf("\tsuccessfully failed to fork to shepherd 1!\n");
iprintf("now to fork to shepherd 2...\n");
qret = qthread_fork_to(checkres, (void *)2, &ret, 2);
assert(qret == QTHREAD_SUCCESS);
test_check(qret == QTHREAD_SUCCESS);
qthread_readFF(&ret, &ret);
iprintf("\tsuccess in forking to shepherd 2!\n");
iprintf("now to fork the migrant...\n");
Expand Down
120 changes: 60 additions & 60 deletions test/basics/qthread_fp.c
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <math.h>
#include <qthread/qthread.h>
#include <stdio.h>
#include <stdlib.h>
#include "argparsing.h"
// https://www.geeksforgeeks.org/comparison-float-value-c/
// https://dotnettutorials.net/lesson/taylor-series-using-recursion-in-c/
// https://www.studytonight.com/c/programs/important-concepts/sum-of-taylor-series
struct parts {
int length;
float exp;
float ans;
aligned_t cond;
};
// https://www.w3resource.com/c-programming-exercises/math/c-math-exercise-24.php
static float taylor_exponential_core(int n, float x) {
float exp_sum = 1;
for (int i = n - 1; i > 0; --i) { exp_sum = 1 + x * exp_sum / i; }
return exp_sum;
}
static aligned_t taylor_exponential(void *arg) {
struct parts *te = (struct parts *)arg;
te->ans = taylor_exponential_core(te->length, te->exp);
return 0;
}
static void checkFloat(void) {
struct parts teParts = {250, 9.0f, 0.0f};
int ret = -1;
qthread_empty(&teParts.cond);
ret = qthread_fork(taylor_exponential, &teParts, &teParts.cond);
test_check(ret == QTHREAD_SUCCESS);
ret = qthread_readFF(NULL, &teParts.cond);
test_check(ret == QTHREAD_SUCCESS);
}
int main(void) {
float ans = taylor_exponential_core(250, 9.0);
float expected = 8103.083984f;
float rel_error = fabsf(ans - expected) / fabsf(expected);
float threshold = 1E-7f;
test_check(rel_error < threshold);
int status = qthread_initialize();
test_check(status == QTHREAD_SUCCESS);
checkFloat();
return EXIT_SUCCESS;
}
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <math.h>
#include <qthread/qthread.h>
#include <stdio.h>
#include <stdlib.h>

#include "argparsing.h"

// https://www.geeksforgeeks.org/comparison-float-value-c/
// https://dotnettutorials.net/lesson/taylor-series-using-recursion-in-c/
// https://www.studytonight.com/c/programs/important-concepts/sum-of-taylor-series

struct parts {
int length;
float exp;
float ans;
aligned_t cond;
};

// https://www.w3resource.com/c-programming-exercises/math/c-math-exercise-24.php
static float taylor_exponential_core(int n, float x) {
float exp_sum = 1;
for (int i = n - 1; i > 0; --i) { exp_sum = 1 + x * exp_sum / i; }
return exp_sum;
}

static aligned_t taylor_exponential(void *arg) {
struct parts *te = (struct parts *)arg;
te->ans = taylor_exponential_core(te->length, te->exp);
return 0;
}

static void checkFloat(void) {
struct parts teParts = {250, 9.0f, 0.0f};
int ret = -1;
qthread_empty(&teParts.cond);

ret = qthread_fork(taylor_exponential, &teParts, &teParts.cond);
test_check(ret == QTHREAD_SUCCESS);

ret = qthread_readFF(NULL, &teParts.cond);
test_check(ret == QTHREAD_SUCCESS);
}

int main(void) {
float ans = taylor_exponential_core(250, 9.0);
float expected = 8103.083984f;
float rel_error = fabsf(ans - expected) / fabsf(expected);
float threshold = 1E-7f;
test_check(rel_error < threshold);

int status = qthread_initialize();
test_check(status == QTHREAD_SUCCESS);

checkFloat();
return EXIT_SUCCESS;
}
Loading
Loading