From 3b2a432490540a06892565054cfc99a5a7389782 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Tue, 7 Jan 2025 15:32:38 -0700 Subject: [PATCH 01/14] Disambiguate some attribute placement relative to gcc's more strict rules. --- .clang-format | 2 +- src/ds/dictionary/dictionary_shavit.c | 29 ++++++------ src/ds/dictionary/dictionary_simple.c | 29 ++++++------ src/ds/dictionary/dictionary_trie.c | 33 +++++++------- src/ds/qarray.c | 14 +++--- src/ds/qdqueue.c | 10 ++--- src/ds/qlfqueue.c | 10 ++--- src/ds/qpool.c | 10 ++--- src/ds/qswsrqueue.c | 10 ++--- src/patterns/allpairs.c | 5 +-- src/qalloc.c | 16 +++---- src/qloop.c | 65 ++++++++++++--------------- src/qthread.c | 30 +++++-------- 13 files changed, 123 insertions(+), 140 deletions(-) diff --git a/.clang-format b/.clang-format index 85c350860..d42ff4ca1 100644 --- a/.clang-format +++ b/.clang-format @@ -4,7 +4,7 @@ AllowShortCaseLabelsOnASingleLine: true AllowShortIfStatementsOnASingleLine: AllIfsAndElse AllowShortLoopsOnASingleLine: true AlwaysBreakTemplateDeclarations: Yes -AttributeMacros: ['Q_UNUSED', 'STACKLEFT_NOINLINE'] +AttributeMacros: ['Q_UNUSED', 'STACKLEFT_NOINLINE', 'API_FUNC'] BinPackArguments: false BinPackParameters: false BreakArrays: false diff --git a/src/ds/dictionary/dictionary_shavit.c b/src/ds/dictionary/dictionary_shavit.c index 356db8df3..5342d32a3 100644 --- a/src/ds/dictionary/dictionary_shavit.c +++ b/src/ds/dictionary/dictionary_shavit.c @@ -340,13 +340,12 @@ qt_hash_put(qt_hash h, qt_key_t key, void *value, int put_choice) { return ret->value; } -void *API_FUNC qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { +API_FUNC void *qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { return qt_hash_put(dict, key, value, PUT_ALWAYS); } -void *API_FUNC qt_dictionary_put_if_absent(qt_dictionary *dict, - void *key, - void *value) { +API_FUNC void * +qt_dictionary_put_if_absent(qt_dictionary *dict, void *key, void *value) { return qt_hash_put(dict, key, value, PUT_IF_ABSENT); } @@ -368,7 +367,7 @@ static inline void *qt_hash_get(qt_hash h, qt_key_t const key) { &(h->B[bucket]), so_regularkey(lkey), key, NULL, NULL, NULL, h->op_equals); } -void *API_FUNC qt_dictionary_get(qt_dictionary *dict, void *key) { +API_FUNC void *qt_dictionary_get(qt_dictionary *dict, void *key) { return qt_hash_get(dict, key); } @@ -392,7 +391,7 @@ static inline int qt_hash_remove(qt_hash h, qt_key_t const key) { return 1; } -void *API_FUNC qt_dictionary_delete(qt_dictionary *dict, void *key) { +API_FUNC void *qt_dictionary_delete(qt_dictionary *dict, void *key) { void *val = qt_hash_get(dict, key); // TODO : this is inefficient! int ret = qt_hash_remove(dict, key); @@ -472,7 +471,7 @@ static inline qt_hash qt_hash_create(qt_dict_key_equals_f eq, return tmp; } -qt_dictionary *API_FUNC qt_dictionary_create(qt_dict_key_equals_f eq, +API_FUNC qt_dictionary *qt_dictionary_create(qt_dict_key_equals_f eq, qt_dict_hash_f hash, qt_dict_cleanup_f cleanup) { return qt_hash_create(eq, hash, cleanup); @@ -499,7 +498,7 @@ static inline void qt_hash_destroy(qt_hash h) { FREE(h, sizeof(qt_hash)); } -void API_FUNC qt_dictionary_destroy(qt_dictionary *d) { qt_hash_destroy(d); } +API_FUNC void qt_dictionary_destroy(qt_dictionary *d) { qt_hash_destroy(d); } /* * void qt_hash_destroy_deallocate(qt_hash h, @@ -557,7 +556,7 @@ struct qt_dictionary_iterator { int bkt; // = -1 if iterator is newly created; =1 otherwise. }; -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_create(qt_dictionary *dict) { if (dict == NULL) { return ERROR; } qt_dictionary_iterator *it = @@ -568,7 +567,7 @@ qt_dictionary_iterator_create(qt_dictionary *dict) { return it; } -void API_FUNC qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { +API_FUNC void qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { if (it == NULL) { return; } FREE(it, sizeof(qt_dictionary_iterator)); } @@ -595,7 +594,7 @@ qt_dictionary_iterator_next_element(qt_dictionary_iterator *it) { return it->crt; } -list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { +API_FUNC list_entry *qt_dictionary_iterator_next(qt_dictionary_iterator *it) { list_entry *ret = qt_dictionary_iterator_next_element(it); while (ret != ERROR && ret != NULL && ret->key == NULL) { @@ -604,7 +603,7 @@ list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { return ret; } -list_entry *API_FUNC +API_FUNC list_entry * qt_dictionary_iterator_get(qt_dictionary_iterator const *it) { if ((it == NULL) || (it->dict == NULL)) { return ERROR; } qt_dictionary *h = it->dict; @@ -612,20 +611,20 @@ qt_dictionary_iterator_get(qt_dictionary_iterator const *it) { return it->crt; } -qt_dictionary_iterator *API_FUNC qt_dictionary_end(qt_dictionary *dict) { +API_FUNC qt_dictionary_iterator *qt_dictionary_end(qt_dictionary *dict) { qt_dictionary_iterator *ret = qt_dictionary_iterator_create(dict); ret->bkt = 1; return ret; } -int API_FUNC qt_dictionary_iterator_equals(qt_dictionary_iterator *a, +API_FUNC int qt_dictionary_iterator_equals(qt_dictionary_iterator *a, qt_dictionary_iterator *b) { if ((a == NULL) || (b == NULL)) { return a == b; } return (a->crt == b->crt) && (a->dict == b->dict) && (a->bkt == b->bkt); } -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_copy(qt_dictionary_iterator *b) { if (b == NULL) { return NULL; } qt_dictionary_iterator *ret = qt_dictionary_iterator_create(b->dict); diff --git a/src/ds/dictionary/dictionary_simple.c b/src/ds/dictionary/dictionary_simple.c index aaad97ece..6f717b36b 100644 --- a/src/ds/dictionary/dictionary_simple.c +++ b/src/ds/dictionary/dictionary_simple.c @@ -102,7 +102,7 @@ static int qthread_library_initialized = 1; extern int qthread_library_initialized; #endif -qt_dictionary *API_FUNC qt_dictionary_create(qt_dict_key_equals_f eq, +API_FUNC qt_dictionary *qt_dictionary_create(qt_dict_key_equals_f eq, qt_dict_hash_f hash, qt_dict_cleanup_f cleanup) { assert(qthread_library_initialized && @@ -120,7 +120,7 @@ qt_dictionary *API_FUNC qt_dictionary_create(qt_dict_key_equals_f eq, return ret; } -void API_FUNC qt_dictionary_destroy(qt_dictionary *d) { +API_FUNC void qt_dictionary_destroy(qt_dictionary *d) { int i; for (i = 0; i < NO_BUCKETS; i++) { @@ -256,17 +256,16 @@ void *qt_dictionary_put_helper(qt_dictionary *dict, } #endif /* ifdef DICTIONARY_ADD_TO_HEAD */ -void *API_FUNC qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { +API_FUNC void *qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { return qt_dictionary_put_helper(dict, key, value, PUT_ALWAYS); } -void *API_FUNC qt_dictionary_put_if_absent(qt_dictionary *dict, - void *key, - void *value) { +API_FUNC void * +qt_dictionary_put_if_absent(qt_dictionary *dict, void *key, void *value) { return qt_dictionary_put_helper(dict, key, value, PUT_IF_ABSENT); } -void *API_FUNC qt_dictionary_get(qt_dictionary *dict, void *key) { +API_FUNC void *qt_dictionary_get(qt_dictionary *dict, void *key) { int hash = dict->op_hash(key); int bucket = GET_BUCKET(hash); @@ -285,7 +284,7 @@ void *API_FUNC qt_dictionary_get(qt_dictionary *dict, void *key) { return NULL; } -void *API_FUNC qt_dictionary_delete(qt_dictionary *dict, void *key) { +API_FUNC void *qt_dictionary_delete(qt_dictionary *dict, void *key) { void *to_ret = NULL; list_entry *to_free = NULL; int hash = dict->op_hash(key); @@ -342,7 +341,7 @@ void *API_FUNC qt_dictionary_delete(qt_dictionary *dict, void *key) { return to_ret; } -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_create(qt_dictionary *dict) { if ((dict == NULL) || (dict->content == NULL)) { return ERROR; } qt_dictionary_iterator *it = @@ -356,12 +355,12 @@ qt_dictionary_iterator_create(qt_dictionary *dict) { return it; } -void API_FUNC qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { +API_FUNC void qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { if (it == NULL) { return; } FREE(it, sizeof(qt_dictionary_iterator)); } -list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { +API_FUNC list_entry *qt_dictionary_iterator_next(qt_dictionary_iterator *it) { if ((it == NULL) || (it->dict == NULL) || (it->dict->content == NULL)) { return ERROR; } @@ -403,7 +402,7 @@ list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { return NULL; } -list_entry *API_FUNC +API_FUNC list_entry * qt_dictionary_iterator_get(qt_dictionary_iterator const *it) { if ((it == NULL) || (it->dict == NULL) || (it->dict->content == NULL)) { printf(" Inside dictionary get, found NULL, will return ERROR\n"); @@ -413,7 +412,7 @@ qt_dictionary_iterator_get(qt_dictionary_iterator const *it) { return it->crt; } -qt_dictionary_iterator *API_FUNC qt_dictionary_end(qt_dictionary *dict) { +API_FUNC qt_dictionary_iterator *qt_dictionary_end(qt_dictionary *dict) { if ((dict == NULL) || (dict->content == NULL)) { return NULL; } qt_dictionary_iterator *it = qt_dictionary_iterator_create(dict); it->crt = NULL; @@ -422,13 +421,13 @@ qt_dictionary_iterator *API_FUNC qt_dictionary_end(qt_dictionary *dict) { return it; } -int API_FUNC qt_dictionary_iterator_equals(qt_dictionary_iterator *a, +API_FUNC int qt_dictionary_iterator_equals(qt_dictionary_iterator *a, qt_dictionary_iterator *b) { if ((a == NULL) || (b == NULL)) { return a == b; } return (a->crt == b->crt) && (a->dict == b->dict) && (a->bkt == b->bkt); } -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_copy(qt_dictionary_iterator *b) { if (b == NULL) { return NULL; } qt_dictionary_iterator *ret = qt_dictionary_iterator_create(b->dict); diff --git a/src/ds/dictionary/dictionary_trie.c b/src/ds/dictionary/dictionary_trie.c index 40b6b4614..d498f4464 100644 --- a/src/ds/dictionary/dictionary_trie.c +++ b/src/ds/dictionary/dictionary_trie.c @@ -107,7 +107,7 @@ static inline qt_hash qt_hash_create(qt_dict_key_equals_f eq, return tmp; } -qt_dictionary *API_FUNC qt_dictionary_create(qt_dict_key_equals_f eq, +API_FUNC qt_dictionary *qt_dictionary_create(qt_dict_key_equals_f eq, qt_dict_hash_f hash, qt_dict_cleanup_f cleanup) { return qt_hash_create(eq, hash, cleanup); @@ -227,7 +227,7 @@ static void destroy_element(hash_entry *element, qt_dict_cleanup_f f) { FREE(element, sizeof(hash_entry)); } -void API_FUNC qt_dictionary_destroy(qt_hash h) { +API_FUNC void qt_dictionary_destroy(qt_hash h) { assert(h); assert(h->spines); for (size_t i = 0; i < BASE_SPINE_LENGTH; ++i) { @@ -401,19 +401,18 @@ void *qt_hash_put_helper(qt_dictionary *h, } while (1); } -void *API_FUNC qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { +API_FUNC void *qt_dictionary_put(qt_dictionary *dict, void *key, void *value) { return qt_hash_put_helper(dict, key, value, PUT_ALWAYS); } -void *API_FUNC qt_dictionary_put_if_absent(qt_dictionary *dict, - void *key, - void *value) { +API_FUNC void * +qt_dictionary_put_if_absent(qt_dictionary *dict, void *key, void *value) { return qt_hash_put_helper(dict, key, value, PUT_IF_ABSENT); } -int API_FUNC qt_dictionary_remove(qt_dictionary *h, qt_key_t const key); +API_FUNC int qt_dictionary_remove(qt_dictionary *h, qt_key_t const key); -int API_FUNC qt_dictionary_remove(qt_dictionary *h, qt_key_t const key) { +API_FUNC int qt_dictionary_remove(qt_dictionary *h, qt_key_t const key) { uint64_t lkey = (uint64_t)(uintptr_t)(h->op_hash(key)); HASH_KEY(lkey); @@ -495,7 +494,7 @@ int API_FUNC qt_dictionary_remove(qt_dictionary *h, qt_key_t const key) { } while (1); } -void *API_FUNC qt_dictionary_delete(qt_dictionary *dict, void *key) { +API_FUNC void *qt_dictionary_delete(qt_dictionary *dict, void *key) { void *val = qt_dictionary_get(dict, key); // TODO : this is inefficient! int ret = qt_dictionary_remove(dict, key); @@ -506,7 +505,7 @@ void *API_FUNC qt_dictionary_delete(qt_dictionary *dict, void *key) { } } -void *API_FUNC qt_dictionary_get(qt_dictionary *h, qt_key_t const key) { +API_FUNC void *qt_dictionary_get(qt_dictionary *h, qt_key_t const key) { uint64_t lkey = (uint64_t)(uintptr_t)(h->op_hash(key)); HASH_KEY(lkey); @@ -614,7 +613,7 @@ struct qt_dictionary_iterator { int base_index; }; -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_create(qt_dictionary *dict) { if (dict == NULL) { return ERROR; } qt_dictionary_iterator *it = @@ -627,12 +626,12 @@ qt_dictionary_iterator_create(qt_dictionary *dict) { return it; } -void API_FUNC qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { +API_FUNC void qt_dictionary_iterator_destroy(qt_dictionary_iterator *it) { if (it == NULL) { return; } FREE(it, sizeof(qt_dictionary_iterator)); } -list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { +API_FUNC list_entry *qt_dictionary_iterator_next(qt_dictionary_iterator *it) { if ((it == NULL) || (it->dict == NULL)) { return ERROR; } if ((it->crt != NULL) && (it->crt->next != NULL)) { @@ -674,26 +673,26 @@ list_entry *API_FUNC qt_dictionary_iterator_next(qt_dictionary_iterator *it) { return NULL; } -list_entry *API_FUNC +API_FUNC list_entry * qt_dictionary_iterator_get(qt_dictionary_iterator const *it) { if ((it == NULL) || (it->dict == NULL)) { return ERROR; } return it->crt; } -qt_dictionary_iterator *API_FUNC qt_dictionary_end(qt_dictionary *dict) { +API_FUNC qt_dictionary_iterator *qt_dictionary_end(qt_dictionary *dict) { qt_dictionary_iterator *ret = qt_dictionary_iterator_create(dict); ret->bkt = ret->dict->maxspines; return ret; } -int API_FUNC qt_dictionary_iterator_equals(qt_dictionary_iterator *a, +API_FUNC int qt_dictionary_iterator_equals(qt_dictionary_iterator *a, qt_dictionary_iterator *b) { if ((a == NULL) || (b == NULL)) { return a == b; } return (a->crt == b->crt) && (a->dict == b->dict) && (a->bkt == b->bkt); } -qt_dictionary_iterator *API_FUNC +API_FUNC qt_dictionary_iterator * qt_dictionary_iterator_copy(qt_dictionary_iterator *b) { if (b == NULL) { return NULL; } qt_dictionary_iterator *ret = qt_dictionary_iterator_create(b->dict); diff --git a/src/ds/qarray.c b/src/ds/qarray.c index 445941646..e8e8cfab0 100644 --- a/src/ds/qarray.c +++ b/src/ds/qarray.c @@ -392,17 +392,17 @@ static qarray *qarray_create_internal(size_t const count, return NULL; } /*}}} */ -qarray *API_FUNC qarray_create(size_t const count, +API_FUNC qarray *qarray_create(size_t const count, size_t const obj_size) { /*{{{ */ return qarray_create_internal(count, obj_size, FIXED_HASH, 0, 0); } /*}}} */ -qarray *API_FUNC qarray_create_tight(size_t const count, +API_FUNC qarray *qarray_create_tight(size_t const count, size_t const obj_size) { /*{{{ */ return qarray_create_internal(count, obj_size, FIXED_HASH, 1, 0); } /*}}} */ -qarray *API_FUNC qarray_create_configured(size_t const count, +API_FUNC qarray *qarray_create_configured(size_t const count, size_t const obj_size, distribution_t const d, char const tight, @@ -410,7 +410,7 @@ qarray *API_FUNC qarray_create_configured(size_t const count, return qarray_create_internal(count, obj_size, d, tight, seg_pages); } /*}}} */ -void API_FUNC qarray_destroy(qarray *a) { /*{{{ */ +API_FUNC void qarray_destroy(qarray *a) { /*{{{ */ qassert_retvoid((a != NULL)); qassert_retvoid((a->base_ptr != NULL)); switch (a->dist_type) { @@ -826,7 +826,7 @@ static aligned_t qarray_loopaccum_strider(void *arg_void) { /*{{{ */ return 0; } /*}}} */ -void API_FUNC qarray_iter(qarray *a, +API_FUNC void qarray_iter(qarray *a, size_t const startat, size_t const stopat, qthread_f func) { /*{{{ */ @@ -880,7 +880,7 @@ void API_FUNC qarray_iter(qarray *a, } } /*}}} */ -void API_FUNC qarray_iter_loop(qarray *a, +API_FUNC void qarray_iter_loop(qarray *a, size_t const startat, size_t const stopat, qa_loop_f func, @@ -1028,7 +1028,7 @@ void qarray_iter_constloop(qarray const *a, } } /*}}} */ -void API_FUNC qarray_iter_loopaccum(qarray *a, +API_FUNC void qarray_iter_loopaccum(qarray *a, size_t const startat, size_t const stopat, qa_loopr_f func, diff --git a/src/ds/qdqueue.c b/src/ds/qdqueue.c index d54876740..3b26ec2ed 100644 --- a/src/ds/qdqueue.c +++ b/src/ds/qdqueue.c @@ -264,7 +264,7 @@ qdqueue_internal_getneighbors(qthread_shepherd_id_t shep, } /*}}} */ /* Create a new qdqueue */ -qdqueue_t *API_FUNC qdqueue_create(void) { /*{{{ */ +API_FUNC qdqueue_t *qdqueue_create(void) { /*{{{ */ qdqueue_t *ret; qthread_shepherd_id_t curshep; int **sheparray; @@ -328,7 +328,7 @@ qdqueue_t *API_FUNC qdqueue_create(void) { /*{{{ */ } /*}}} */ /* destroy that queue */ -int API_FUNC qdqueue_destroy(qdqueue_t *q) { /*{{{ */ +API_FUNC int qdqueue_destroy(qdqueue_t *q) { /*{{{ */ qthread_shepherd_id_t i; qassert_ret((q != NULL), QTHREAD_BADARGS); @@ -351,7 +351,7 @@ int API_FUNC qdqueue_destroy(qdqueue_t *q) { /*{{{ */ } /*}}} */ /* enqueue something in the queue */ -int API_FUNC qdqueue_enqueue(qdqueue_t *q, void *elem) { /*{{{ */ +API_FUNC int qdqueue_enqueue(qdqueue_t *q, void *elem) { /*{{{ */ int stat; struct qdsubqueue_s *myq; @@ -422,7 +422,7 @@ int qdqueue_enqueue_there(qdqueue_t *q, } /*}}} */ /* dequeue something from the queue (returns NULL for an empty queue) */ -void *API_FUNC qdqueue_dequeue(qdqueue_t *q) { /*{{{ */ +API_FUNC void *qdqueue_dequeue(qdqueue_t *q) { /*{{{ */ struct qdsubqueue_s *myq; void *ret; @@ -488,7 +488,7 @@ void *API_FUNC qdqueue_dequeue(qdqueue_t *q) { /*{{{ */ } /*}}} */ /* returns 1 if the queue is empty, 0 otherwise */ -int API_FUNC qdqueue_empty(qdqueue_t *q) { /*{{{ */ +API_FUNC int qdqueue_empty(qdqueue_t *q) { /*{{{ */ struct qdsubqueue_s *myq; qassert_ret(q, 0); diff --git a/src/ds/qlfqueue.c b/src/ds/qlfqueue.c index 40351999a..722aab010 100644 --- a/src/ds/qlfqueue.c +++ b/src/ds/qlfqueue.c @@ -39,7 +39,7 @@ static void qlfqueue_internal_cleanup(void) { * http://www.research.ibm.com/people/m/michael/ieeetpds-2004.pdf */ -qlfqueue_t *API_FUNC qlfqueue_create(void) { /*{{{ */ +API_FUNC qlfqueue_t *qlfqueue_create(void) { /*{{{ */ qlfqueue_t *q; if (qlfqueue_node_pool == NULL) { @@ -69,7 +69,7 @@ qlfqueue_t *API_FUNC qlfqueue_create(void) { /*{{{ */ return q; } /*}}} */ -int API_FUNC qlfqueue_destroy(qlfqueue_t *q) { /*{{{ */ +API_FUNC int qlfqueue_destroy(qlfqueue_t *q) { /*{{{ */ qassert_ret((q != NULL), QTHREAD_BADARGS); while (q->head != q->tail) { qlfqueue_dequeue(q); @@ -81,7 +81,7 @@ int API_FUNC qlfqueue_destroy(qlfqueue_t *q) { /*{{{ */ return QTHREAD_SUCCESS; } /*}}} */ -int API_FUNC qlfqueue_enqueue(qlfqueue_t *q, void *elem) { /*{{{ */ +API_FUNC int qlfqueue_enqueue(qlfqueue_t *q, void *elem) { /*{{{ */ qlfqueue_node_t *tail; qlfqueue_node_t *next; qlfqueue_node_t *node; @@ -122,7 +122,7 @@ static void qlfqueue_pool_free_wrapper(void *p) { /*{{{*/ qpool_free(qlfqueue_node_pool, p); } /*}}}*/ -void *API_FUNC qlfqueue_dequeue(qlfqueue_t *q) { /*{{{ */ +API_FUNC void *qlfqueue_dequeue(qlfqueue_t *q) { /*{{{ */ void *p = NULL; qlfqueue_node_t *head; qlfqueue_node_t *tail; @@ -157,7 +157,7 @@ void *API_FUNC qlfqueue_dequeue(qlfqueue_t *q) { /*{{{ */ return p; } /*}}} */ -int API_FUNC qlfqueue_empty(qlfqueue_t *q) { /*{{{ */ +API_FUNC int qlfqueue_empty(qlfqueue_t *q) { /*{{{ */ qlfqueue_node_t *head; qlfqueue_node_t *tail; qlfqueue_node_t *next; diff --git a/src/ds/qpool.c b/src/ds/qpool.c index e4b77bdbc..effda201a 100644 --- a/src/ds/qpool.c +++ b/src/ds/qpool.c @@ -8,21 +8,21 @@ #include "qt_visibility.h" #include "qthread/qpool.h" -qpool *API_FUNC qpool_create_aligned(size_t const isize, +API_FUNC qpool *qpool_create_aligned(size_t const isize, size_t alignment) { /*{{{ */ return qt_mpool_create_aligned(isize, alignment); } /*}}} */ -qpool *API_FUNC qpool_create(size_t const item_size) { /*{{{ */ +API_FUNC qpool *qpool_create(size_t const item_size) { /*{{{ */ return qpool_create_aligned(item_size, 0); } /*}}} */ -void *API_FUNC qpool_alloc(qpool *pool) { return qt_mpool_alloc(pool); } +API_FUNC void *qpool_alloc(qpool *pool) { return qt_mpool_alloc(pool); } -void API_FUNC qpool_free(qpool *restrict pool, void *restrict mem) { +API_FUNC void qpool_free(qpool *restrict pool, void *restrict mem) { qt_mpool_free(pool, mem); } -void API_FUNC qpool_destroy(qpool *pool) { qt_mpool_destroy(pool); } +API_FUNC void qpool_destroy(qpool *pool) { qt_mpool_destroy(pool); } /* vim:set expandtab: */ diff --git a/src/ds/qswsrqueue.c b/src/ds/qswsrqueue.c index 544f3ed78..fed74fb74 100644 --- a/src/ds/qswsrqueue.c +++ b/src/ds/qswsrqueue.c @@ -21,7 +21,7 @@ struct qswsrqueue_s { /* typedef'd to qswsrqueue_t */ void *elements[]; }; -qswsrqueue_t *API_FUNC qswsrqueue_create(size_t elements) { /*{{{ */ +API_FUNC qswsrqueue_t *qswsrqueue_create(size_t elements) { /*{{{ */ qswsrqueue_t *q; if ((elements * sizeof(void *)) < CACHELINE_WIDTH) { @@ -42,14 +42,14 @@ qswsrqueue_t *API_FUNC qswsrqueue_create(size_t elements) { /*{{{ */ return q; } /*}}} */ -int API_FUNC qswsrqueue_destroy(qswsrqueue_t *q) { /*{{{ */ +API_FUNC int qswsrqueue_destroy(qswsrqueue_t *q) { /*{{{ */ qassert_ret((q != NULL), QTHREAD_BADARGS); qt_internal_aligned_free( q, sizeof(struct qswsrqueue_s) + (q->size * sizeof(void *))); return QTHREAD_SUCCESS; } /*}}} */ -int API_FUNC qswsrqueue_enqueue(qswsrqueue_t *q, void *elem) { /*{{{ */ +API_FUNC int qswsrqueue_enqueue(qswsrqueue_t *q, void *elem) { /*{{{ */ uint32_t cur_tail = q->tail; uint32_t next_tail = (cur_tail + 1) % q->size; MACHINE_FENCE; @@ -78,7 +78,7 @@ int qswsrqueue_enqueue_blocking(qswsrqueue_t *q, void *elem) { /*{{{ */ } while (1); } /*}}} */ -void *API_FUNC qswsrqueue_dequeue(qswsrqueue_t *q) { /*{{{ */ +API_FUNC void *qswsrqueue_dequeue(qswsrqueue_t *q) { /*{{{ */ void *item; uint32_t cur_head = q->head; MACHINE_FENCE; @@ -106,7 +106,7 @@ void *qswsrqueue_dequeue_blocking(qswsrqueue_t *q) { /*{{{ */ } /*}}} */ /* returns 1 if the queue is empty, 0 otherwise */ -int API_FUNC qswsrqueue_empty(qswsrqueue_t *q) { /*{{{ */ +API_FUNC int qswsrqueue_empty(qswsrqueue_t *q) { /*{{{ */ return (q->head == q->tail); } /*}}} */ diff --git a/src/patterns/allpairs.c b/src/patterns/allpairs.c index c2bd8424e..de7c819ce 100644 --- a/src/patterns/allpairs.c +++ b/src/patterns/allpairs.c @@ -326,9 +326,8 @@ void API_FUNC qt_allpairs_output(qarray const *array1, qt_allpairs_internal(array1, array2, df, 1, output, outsize); } -void API_FUNC qt_allpairs(qarray const *array1, - qarray const *array2, - dist_f distfunc) { +void API_FUNC +qt_allpairs(qarray const *array1, qarray const *array2, dist_f distfunc) { const union distfuncunion df = {distfunc}; qt_allpairs_internal(array1, array2, df, 0, NULL, 0); diff --git a/src/qalloc.c b/src/qalloc.c index e6be2fba5..4a38546a0 100644 --- a/src/qalloc.c +++ b/src/qalloc.c @@ -188,7 +188,7 @@ static inline void *qalloc_getfile(off_t const filesize, return ret; } /*}}} */ -void *API_FUNC qalloc_makestatmap(off_t const filesize, +API_FUNC void *qalloc_makestatmap(off_t const filesize, void *addr, char const *filename, size_t itemsize, @@ -272,7 +272,7 @@ void *API_FUNC qalloc_makestatmap(off_t const filesize, return NULL; } /*}}} */ -void *API_FUNC qalloc_makedynmap(off_t const filesize, +API_FUNC void *qalloc_makedynmap(off_t const filesize, void *addr, char const *filename, size_t const streams) { /*{{{ */ @@ -376,7 +376,7 @@ void *qalloc_loadmap(char const *filename) { /*{{{ */ } } /*}}} */ -void API_FUNC qalloc_cleanup(void) { /*{{{ */ +API_FUNC void qalloc_cleanup(void) { /*{{{ */ qalloc_checkpoint(); while (mmaps) { struct mapinfo_s *m; @@ -406,7 +406,7 @@ void API_FUNC qalloc_cleanup(void) { /*{{{ */ * imbalance (i.e. one thread is making all of the qalloc_malloc() calls). * Could probably do more aggressive memory stealing from the next stream if * that becomes a problem */ -void *API_FUNC qalloc_statmalloc(struct mapinfo_s *m) { /*{{{ */ +API_FUNC void *qalloc_statmalloc(struct mapinfo_s *m) { /*{{{ */ pthread_t me = pthread_self(); size_t stream = (size_t)me % m->streamcount; size_t firststream = stream; @@ -653,7 +653,7 @@ static inline bigblock_header_t *qalloc_find_bigblock_header_entry( return bbh; } /*}}} */ -void *API_FUNC qalloc_dynmalloc(struct dynmapinfo_s *m, size_t size) { /*{{{ */ +API_FUNC void *qalloc_dynmalloc(struct dynmapinfo_s *m, size_t size) { /*{{{ */ pthread_t me = pthread_self(); size_t stream = (size_t)me % m->streamcount; size_t original_stream; @@ -764,7 +764,7 @@ void *API_FUNC qalloc_dynmalloc(struct dynmapinfo_s *m, size_t size) { /*{{{ */ return ret; } /*}}} */ -void *API_FUNC qalloc_malloc(void *mapinfo, size_t size) { /*{{{ */ +API_FUNC void *qalloc_malloc(void *mapinfo, size_t size) { /*{{{ */ if (((struct mapinfo_s *)mapinfo)->dynflag == 0) { return qalloc_statmalloc((struct mapinfo_s *)mapinfo); } else { @@ -850,7 +850,7 @@ void qalloc_dynfree(void *block, struct dynmapinfo_s *m) { /*{{{ */ /* XXX: consider freeing unused smallblocks or bigblock header blocks */ } /*}}} */ -void API_FUNC qalloc_free(void *block, void *mapinfo) { /*{{{ */ +API_FUNC void qalloc_free(void *block, void *mapinfo) { /*{{{ */ if (((struct mapinfo_s *)mapinfo)->dynflag == 0) { qalloc_statfree(block, (struct mapinfo_s *)mapinfo); } else { @@ -858,7 +858,7 @@ void API_FUNC qalloc_free(void *block, void *mapinfo) { /*{{{ */ } } /*}}} */ -void API_FUNC qalloc_checkpoint(void) { /*{{{ */ +API_FUNC void qalloc_checkpoint(void) { /*{{{ */ struct mapinfo_s *m = mmaps; struct dynmapinfo_s *dm = dynmmaps; diff --git a/src/qloop.c b/src/qloop.c index 049d27b81..48f4e5f91 100644 --- a/src/qloop.c +++ b/src/qloop.c @@ -273,45 +273,37 @@ static void qt_loop_inner(size_t const start, qt_loop_balance_inner(start, stop, qt_loop_spawner, &a, flags, sync_type); } /*}}}*/ -void API_FUNC qt_loop(size_t start, - size_t stop, - qt_loop_f func, - void *argptr) { /*{{{ */ +API_FUNC void +qt_loop(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{ */ qt_loop_inner(start, stop, func, argptr, 0, DONECOUNT); } /*}}} */ -void API_FUNC qt_loop_simple(size_t start, +API_FUNC void qt_loop_simple(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{*/ qt_loop_inner(start, stop, func, argptr, 2, SINC_T); } /*}}}*/ -void API_FUNC qt_loop_sv(size_t start, - size_t stop, - qt_loop_f func, - void *argptr) { /*{{{ */ +API_FUNC void +qt_loop_sv(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{ */ qt_loop_inner(start, stop, func, argptr, 0, SYNCVAR_T); } /*}}} */ -void API_FUNC qt_loop_dc(size_t start, - size_t stop, - qt_loop_f func, - void *argptr) { /*{{{ */ +API_FUNC void +qt_loop_dc(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{ */ qt_loop_inner(start, stop, func, argptr, 0, DONECOUNT); } /*}}} */ -void API_FUNC qt_loop_aligned(size_t start, +API_FUNC void qt_loop_aligned(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{ */ qt_loop_inner(start, stop, func, argptr, 0, ALIGNED); } /*}}} */ -void API_FUNC qt_loop_sinc(size_t start, - size_t stop, - qt_loop_f func, - void *argptr) { /*{{{ */ +API_FUNC void +qt_loop_sinc(size_t start, size_t stop, qt_loop_f func, void *argptr) { /*{{{ */ qt_loop_inner(start, stop, func, argptr, 0, SINC_T); } /*}}} */ @@ -446,14 +438,14 @@ static inline void qt_loop_balance_inner(size_t const start, FREE(qwa, sizeof(struct qloop_wrapper_args) * maxworkers); } /*}}} */ -void API_FUNC qt_loop_balance(size_t const start, +API_FUNC void qt_loop_balance(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{ */ qt_loop_balance_inner(start, stop, func, argptr, 0, DONECOUNT); } /*}}} */ -void API_FUNC qt_loop_balance_simple(size_t const start, +API_FUNC void qt_loop_balance_simple(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{*/ @@ -461,28 +453,28 @@ void API_FUNC qt_loop_balance_simple(size_t const start, start, stop, func, argptr, QT_LOOP_BALANCE_SIMPLE, DONECOUNT); } /*}}}*/ -void API_FUNC qt_loop_balance_sv(size_t const start, +API_FUNC void qt_loop_balance_sv(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{ */ qt_loop_balance_inner(start, stop, func, argptr, 0, SYNCVAR_T); } /*}}} */ -void API_FUNC qt_loop_balance_dc(size_t const start, +API_FUNC void qt_loop_balance_dc(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{ */ qt_loop_balance_inner(start, stop, func, argptr, 0, DONECOUNT); } /*}}} */ -void API_FUNC qt_loop_balance_aligned(size_t const start, +API_FUNC void qt_loop_balance_aligned(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{ */ qt_loop_balance_inner(start, stop, func, argptr, 0, ALIGNED); } /*}}} */ -void API_FUNC qt_loop_balance_sinc(size_t const start, +API_FUNC void qt_loop_balance_sinc(size_t const start, size_t const stop, qt_loop_f const func, void *argptr) { /*{{{ */ @@ -686,7 +678,7 @@ static inline void qt_loopaccum_balance_inner(size_t const start, FREE(qwa, sizeof(struct qloopaccum_wrapper_args) * maxworkers); } /*}}} */ -void API_FUNC qt_loopaccum_balance(size_t const start, +API_FUNC void qt_loopaccum_balance(size_t const start, size_t const stop, size_t const size, void *restrict out, @@ -697,7 +689,7 @@ void API_FUNC qt_loopaccum_balance(size_t const start, start, stop, size, out, func, argptr, acc, 0, SYNCVAR_T); } /*}}} */ -void API_FUNC qt_loopaccum_balance_sinc(size_t const start, +API_FUNC void qt_loopaccum_balance_sinc(size_t const start, size_t const stop, size_t const size, void *restrict out, @@ -708,7 +700,7 @@ void API_FUNC qt_loopaccum_balance_sinc(size_t const start, start, stop, size, out, func, argptr, acc, 0, SINC_T); } /*}}} */ -void API_FUNC qt_loopaccum_balance_sv(size_t const start, +API_FUNC void qt_loopaccum_balance_sv(size_t const start, size_t const stop, size_t const size, void *restrict out, @@ -719,7 +711,7 @@ void API_FUNC qt_loopaccum_balance_sv(size_t const start, start, stop, size, out, func, argptr, acc, 0, SYNCVAR_T); } /*}}} */ -void API_FUNC qt_loopaccum_balance_dc(size_t const start, +API_FUNC void qt_loopaccum_balance_dc(size_t const start, size_t const stop, size_t const size, void *restrict out, @@ -1026,7 +1018,7 @@ static aligned_t qqloop_wrapper(void *arg_void) { /*{{{*/ return 0; } /*}}}*/ -qqloop_handle_t *API_FUNC +API_FUNC qqloop_handle_t * qt_loop_queue_create(qt_loop_queue_type const type, size_t const start, size_t const stop, @@ -1065,12 +1057,12 @@ qt_loop_queue_create(qt_loop_queue_type const type, } } /*}}}*/ -void API_FUNC qt_loop_queue_setchunk(qqloop_handle_t *l, size_t chunk) { /*{{{*/ +API_FUNC void qt_loop_queue_setchunk(qqloop_handle_t *l, size_t chunk) { /*{{{*/ assert(l->stat.get == qqloop_get_iterations_chunked); l->stat.chunksize = chunk; } /*}}}*/ -void API_FUNC qt_loop_queue_run(qqloop_handle_t *loop) { /*{{{*/ +API_FUNC void qt_loop_queue_run(qqloop_handle_t *loop) { /*{{{*/ qassert_retvoid(loop); assert(qthread_library_initialized); { @@ -1096,7 +1088,7 @@ void API_FUNC qt_loop_queue_run(qqloop_handle_t *loop) { /*{{{*/ } } /*}}}*/ -void API_FUNC qt_loop_queue_run_there(qqloop_handle_t *loop, +API_FUNC void qt_loop_queue_run_there(qqloop_handle_t *loop, qthread_shepherd_id_t shep) { /*{{{*/ assert(qthread_library_initialized); qassert_retvoid(loop); @@ -1124,8 +1116,9 @@ void API_FUNC qt_loop_queue_run_there(qqloop_handle_t *loop, /* The easiest way to get shepherds/workers to REJOIN when/if shepherds are * re-enabled is to make the user do it. */ -void API_FUNC qt_loop_queue_addworker( - qqloop_handle_t *loop, qthread_shepherd_id_t const shep) { /*{{{*/ +API_FUNC void +qt_loop_queue_addworker(qqloop_handle_t *loop, + qthread_shepherd_id_t const shep) { /*{{{*/ assert(qthread_library_initialized); qthread_incr(&(loop->stat.activesheps), 1); MACHINE_FENCE; @@ -1165,7 +1158,7 @@ void API_FUNC qt_loop_queue_addworker( static void qt##initials##_acc(void *restrict a, const void *restrict b) { \ *(type *)a = _op_(*(type *)a, *(type *)b); \ } \ - type API_FUNC qt_##shorttype##_##category( \ + API_FUNC type qt_##shorttype##_##category( \ type *array, size_t length, int checkfeb) { \ type ret; \ assert(qthread_library_initialized); \ @@ -1455,7 +1448,7 @@ static aligned_t qt_qsort_inner(const struct qt_qsort_iargs *a) { /*{{{ */ return 0; } /*}}} */ -void API_FUNC qt_qsort(double *array, size_t const length) { /*{{{ */ +API_FUNC void qt_qsort(double *array, size_t const length) { /*{{{ */ struct qt_qsort_iargs arg; arg.array = array; diff --git a/src/qthread.c b/src/qthread.c index 7cf8d63db..47b9166da 100644 --- a/src/qthread.c +++ b/src/qthread.c @@ -588,11 +588,10 @@ int API_FUNC qthread_init(qthread_shepherd_id_t nshepherds) { /*{{{ */ * @error ENOMEM Not enough memory could be allocated. */ -int API_FUNC qthread_initialize_agg(int (*agg_cost)(int count, - qthread_f *f, - void **arg), - qthread_agg_f agg_f, - int max_c) { +int API_FUNC +qthread_initialize_agg(int (*agg_cost)(int count, qthread_f *f, void **arg), + qthread_agg_f agg_f, + int max_c) { int r = qthread_initialize(); if (agg_cost != NULL) qlib->agg_cost = agg_cost; if (agg_f != NULL) qlib->agg_f = agg_f; @@ -1537,10 +1536,8 @@ extern void *qthread_fence2; __asm__ __volatile__(#name ":") #endif /* ifdef QTHREAD_ALLOW_HPCTOOLKIT_STACK_UNWINDING */ -void API_FUNC qthread_call_method(qthread_f f, - void *arg, - void *ret, - uint16_t flags) { +void API_FUNC +qthread_call_method(qthread_f f, void *arg, void *ret, uint16_t flags) { if (ret) { if (flags & QTHREAD_RET_IS_SINC) { if (flags & QTHREAD_RET_IS_VOID_SINC) { @@ -2018,15 +2015,13 @@ int API_FUNC qthread_spawn(qthread_f f, return QTHREAD_SUCCESS; } /*}}}*/ -int API_FUNC qthread_fork(qthread_f f, - void const *arg, - aligned_t *ret) { /*{{{*/ +int API_FUNC +qthread_fork(qthread_f f, void const *arg, aligned_t *ret) { /*{{{*/ return qthread_spawn(f, arg, 0, ret, 0, NULL, NO_SHEPHERD, 0); } /*}}}*/ -int API_FUNC qthread_fork_net(qthread_f f, - void const *arg, - aligned_t *ret) { /*{{{*/ +int API_FUNC +qthread_fork_net(qthread_f f, void const *arg, aligned_t *ret) { /*{{{*/ return qthread_spawn( f, arg, 0, ret, 0, NULL, NO_SHEPHERD, QTHREAD_SPAWN_NETWORK); } /*}}}*/ @@ -2200,9 +2195,8 @@ int API_FUNC qthread_fork_syncvar_copyargs_simple(qthread_f f, QTHREAD_SPAWN_SIMPLE | QTHREAD_SPAWN_RET_SYNCVAR_T); } /*}}} */ -int API_FUNC qthread_fork_syncvar(qthread_f f, - void const *arg, - syncvar_t *ret) { /*{{{ */ +int API_FUNC +qthread_fork_syncvar(qthread_f f, void const *arg, syncvar_t *ret) { /*{{{ */ return qthread_spawn( f, arg, 0, ret, 0, NULL, NO_SHEPHERD, QTHREAD_SPAWN_RET_SYNCVAR_T); } /*}}} */ From faa8178ecb9ae24e91eae53da2e4c35596be3b94 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 14:03:35 -0700 Subject: [PATCH 02/14] Explicitly specify the C++11 version to use when building the C++ tests using CMake. --- test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ebc2839ff..40c77ed2e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_CXX_STANDARD 11) + set(QTHREADS_BUILD_TESTS ON CACHE BOOL "Whether or not to build the qthreads tests.") if (${QTHREADS_BUILD_TESTS}) From 7dbc89038ea1182cb84b35638379d13afb1f9597 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Tue, 7 Jan 2025 13:56:11 -0700 Subject: [PATCH 03/14] Switch GitHub Actions CI to use CMake. --- .github/workflows/CI.yml | 130 +++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 52 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7680d9dce..15b5d15eb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,12 +30,16 @@ jobs: hwloc-ls --version - name: build qthreads run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} - make -j2 - make tests -j2 - - name: make check - run: timeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests + run: | + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 linux-clang: @@ -72,12 +76,16 @@ jobs: hwloc-ls --version - name: build qthreads run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} - make -j2 - make tests -j2 - - name: make check - run: timeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests + run: | + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 linux-icx: @@ -109,14 +117,17 @@ jobs: - name: build qthreads run: | source /opt/intel/oneapi/setvars.sh - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} || cat config.log - make -j2 - make tests -j2 - - name: make check - run: | + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests + run: | + pushd build source /opt/intel/oneapi/setvars.sh - timeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 linux-icc: @@ -150,14 +161,17 @@ jobs: - name: build qthreads run: | source /opt/intel/oneapi/setvars.sh - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} || cat config.log - make -j2 - make tests -j2 - - name: make check - run: | + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests + run: | + pushd build source /opt/intel/oneapi/setvars.sh - timeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 linux-aocc: @@ -186,13 +200,16 @@ jobs: clang -v - name: build qthreads run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} || cat config.log - make -j2 - make tests -j2 - - name: make check + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests run: | - timeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 mac: @@ -209,7 +226,7 @@ jobs: - uses: actions/checkout@v4 - name: install deps run: | - brew install autoconf automake libtool coreutils # coreutils is to get gtimeout for CI and is not universally required by qthreads. + brew install coreutils # coreutils is to get gtimeout for CI and is not universally required by qthreads. - if: ${{ matrix.topology != 'no' }} run: | brew install hwloc @@ -219,16 +236,19 @@ jobs: export CFLAGS="-I$(brew --prefix)/include $CFLAGS" export CXXFLAGS="-I$(brew --prefix)/include $CXXFLAGS" export LDFLAGS="-L$(brew --prefix)/lib $LDFLAGS" - ./autogen.sh - ./configure $QTHREADS_ENABLE_ASSERTS --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} - make -j3 - make tests -j3 - - name: make check + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j3 VERBOSE=1 + popd + - name: run tests run: | # commented example for how to get a backtrace from CI usign lldb on OSX: #echo "settings set target.process.stop-on-exec false" > ~/.lldbinit #QT_NUM_SHEPHERDS=2 QT_NUM_WORKERS_PER_SHEPHERD=1 lldb bash --batch --one-line 'process launch' --one-line-on-crash 'bt' --one-line-on-crash 'quit' -- test/basics/hello_world - gtimeout -k 10s --foreground 12m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 gtimeout -k 10s --foreground 12m make test VERBOSE=1 + popd timeout-minutes: 13 sanitizers: @@ -279,15 +299,17 @@ jobs: hwloc-ls --version - name: build qthreads run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} - make -j2 - make tests -j2 - - name: make check + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests run: | - export QTHREADS_DIR="$(pwd)" + pushd build if [[ "${{ matrix.sanitizer }}" == "thread" ]]; then cd test/basics; fi - timeout -k 10s --foreground 18m make check || ( cd $QTHREADS_DIR && cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 18m make test VERBOSE=1 + popd timeout-minutes: 19 linux-thorough: @@ -325,12 +347,16 @@ jobs: hwloc-ls --version - name: build qthreads run: | - ./autogen.sh - ./configure $QTHREADS_ENABLE_ASSERTS --enable-picky --with-scheduler=${{ matrix.scheduler }} --with-topology=${{ matrix.topology }} - make -j2 - make tests -j2 - - name: make check - run: timeout -k 10s --foreground 18m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + make -j2 VERBOSE=1 + popd + - name: run tests + run: | + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout -k 10s --foreground 18m make test VERBOSE=1 + popd timeout-minutes: 19 clang-format: From cc8559ead246a70f29e659d00b8d470685316200 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 14:00:41 -0700 Subject: [PATCH 04/14] Explicitly specify the OSX version to use in actions CI. --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 15b5d15eb..7e27dabfd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -213,7 +213,7 @@ jobs: timeout-minutes: 13 mac: - runs-on: macos-latest + runs-on: macos-15 continue-on-error: true strategy: matrix: From 5e0dea03b1eb602081525f6ef26c0a4c421e5c70 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 14:29:49 -0700 Subject: [PATCH 05/14] Make CircleCI builds use CMake instead of autotools. --- .circleci/config.yml | 98 +++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71c68ed0a..5788294b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,15 +19,19 @@ jobs: - run: | sudo apt-add-repository -y universe sudo apt-get install -y gcc-14 g++-14 - sudo apt-get install -y autoconf automake libtool + sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev - run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=<< parameters.scheduler >> --with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + popd - run: - command: timeout --foreground -k 10s 2m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + command: | + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 2m make test VERBOSE=1 + popd no_output_timeout: 180s arm_clang: @@ -47,18 +51,22 @@ jobs: - run: | sudo apt-add-repository -y universe sudo apt-get install -y gcc-14 g++-14 - sudo apt-get install -y autoconf automake libtool + sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository -y 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' sudo apt-get install -y clang-19 - run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + popd - run: - command: timeout --foreground -k 10s 2m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + command: | + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 2m make test VERBOSE=1 + popd no_output_timeout: 180s arm_sanitizers: @@ -85,22 +93,23 @@ jobs: - run: | sudo apt-add-repository -y universe sudo apt-get install -y gcc-14 g++-14 - sudo apt-get install -y autoconf automake libtool + sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository -y 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' sudo apt-get install -y clang-19 - run: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + popd - run: command: | - export QTHREADS_DIR="$(pwd)" + pushd build if [[ "<< parameters.sanitizer >>" == "thread" ]]; then cd test/basics; fi - timeout --foreground -k 10s 4m make check || ( cd $QTHREADS_DIR && cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) - no_output_timeout: 120s + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 4m make test VERBOSE=1 + no_output_timeout: 180s arm_acfl: parameters: @@ -117,8 +126,11 @@ jobs: steps: - checkout - run: | + # Set up apt to get a more recent CMake directly from Kitware. + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null sudo apt-get update -y - sudo apt-get install -y autoconf automake libtool + sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev wget -O acfl.tar https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_Ubuntu-22.04_aarch64.tar tar -vxf acfl.tar @@ -130,14 +142,17 @@ jobs: armclang -v - run: | export PATH=$PATH:/opt/arm/arm-linux-compiler-24.04_Ubuntu-22.04/bin - ./autogen.sh - ./configure --enable-picky --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + popd - run: command: | export PATH=$PATH:/opt/arm/arm-linux-compiler-24.04_Ubuntu-22.04/bin - timeout --foreground -k 10s 4m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 4m make test VERBOSE=1 + popd no_output_timeout: 180s nvc: @@ -163,20 +178,23 @@ jobs: if [ ${MACHINE_TYPE} == 'aarch64' ]; then echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/arm64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list; fi sudo apt-get update -y sudo apt-get install -y nvhpc-24-9 - sudo apt-get install -y autoconf automake libtool + sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev - run: | export MACHINE_TYPE=`uname -m` if [ ${MACHINE_TYPE} == 'x86_64' ]; then export PATH="$PATH:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/bin"; fi if [ ${MACHINE_TYPE} == 'aarch64' ]; then export PATH="$PATH:/opt/nvidia/hpc_sdk/Linux_aarch64/24.9/compilers/bin"; fi nvc --version - ./autogen.sh - ./configure --enable-picky --disable-fastcontext --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + popd - run: command: | - timeout --foreground -k 10s 4m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 4m make test VERBOSE=1 + popd no_output_timeout: 180s musl: @@ -193,14 +211,18 @@ jobs: steps: - checkout - run: | - apk add --no-cache --no-progress bash make musl-dev hwloc-dev libtool autoconf automake gcc g++ + apk add --no-cache --no-progress bash make musl-dev hwloc-dev cmake gcc g++ - run: | - bash autogen.sh - bash configure --enable-picky --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >> - make -j2 - make tests -j2 + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. + make -j2 VERBOSE=1 + cd .. - run: - command: make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + command: | + cd build + CTEST_OUTPUT_ON_FAILURE=1 make test VERBOSE=1 + cd .. no_output_timeout: 180s workflows: From b1c6ff74f7a7c8e3023e831bf1281271e8b7ff5f Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 14:48:07 -0700 Subject: [PATCH 06/14] Update all the Cirrus CI builds other than the FreeBSD one to use CMake. --- .cirrus.yml | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9127a4e4a..b7febe709 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -31,21 +31,24 @@ osx_m1_task: QTHREADS_SCHEDULER: distrib QTHREADS_TOPOLOGY: binders install_deps_script: | - brew install autoconf automake libtool coreutils # coreutils is to get gtimeout for CI and is not universally required by qthreads. + brew install cmake coreutils # coreutils is to get gtimeout for CI and is not universally required by qthreads. if [ "$QTHREADS_TOPOLOGY" != "no" ]; then brew install hwloc; fi build_script: | export CFLAGS="-g -I$(brew --prefix)/include $CFLAGS" export CXXFLAGS="-g -I$(brew --prefix)/include $CXXFLAGS" export LDFLAGS="-g -L$(brew --prefix)/lib $LDFLAGS" - ./autogen.sh - ./configure --enable-picky --with-scheduler=$QTHREADS_SCHEDULER --with-topology=$QTHREADS_TOPOLOGY - make -j$CIRRUS_CPU - make tests -j$CIRRUS_CPU + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=$QTHREADS_SCHEDULER -DQTHREADS_TOPOLOGY=$QTHREADS_TOPOLOGY .. + make -j$CIRRUS_CPU VERBOSE=1 + popd test_script: | # commented example for how to get a backtrace from CI usign lldb on OSX: #echo "settings set target.process.stop-on-exec false" > ~/.lldbinit #QT_NUM_SHEPHERDS=2 QT_NUM_WORKERS_PER_SHEPHERD=1 lldb bash --batch --one-line 'process launch' --one-line-on-crash 'bt' --one-line-on-crash 'quit' -- test/basics/hello_world - gtimeout --foreground 3m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 gtimeout --foreground 3m make test VERBOSE=1 + popd freebsd_task: freebsd_instance: @@ -92,15 +95,18 @@ arm_linux_task: QTHREADS_TOPOLOGY: no install_deps_script: | apt-get update -y - apt-get install -y autoconf automake libtool + apt-get install -y cmake apt-get install -y hwloc libhwloc-dev build_script: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=$QTHREADS_SCHEDULER --with-topology=$QTHREADS_TOPOLOGY - make -j$CIRRUS_CPU - make tests -j$CIRRUS_CPU + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=$QTHREADS_SCHEDULER -DQTHREADS_TOPOLOGY=$QTHREADS_TOPOLOGY .. + make -j$CIRRUS_CPU VERBOSE=1 + popd test_script: | - timeout --foreground -k 10s 5m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 5m make test VERBOSE=1 + popd arm_linux_clang_task: arm_container: @@ -143,13 +149,16 @@ arm_linux_clang_task: apt-add-repository -y 'deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-19 main' apt-add-repository -y 'deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-19 main' # Something's buggy upstream but running this twice fixes it. apt-get install -y clang-19 - apt-get install -y autoconf automake libtool + apt-get install -y cmake apt-get install -y hwloc libhwloc-dev build_script: | - ./autogen.sh - ./configure --enable-picky --with-scheduler=$QTHREADS_SCHEDULER --with-topology=$QTHREADS_TOPOLOGY - make -j$CIRRUS_CPU - make tests -j$CIRRUS_CPU + mkdir build + pushd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=$QTHREADS_SCHEDULER -DQTHREADS_TOPOLOGY=$QTHREADS_TOPOLOGY .. + make -j$CIRRUS_CPU VERBOSE=1 + popd test_script: | - timeout --foreground -k 10s 5m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + pushd build + CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 5m make test VERBOSE=1 + popd From f9e6844bd78fd2c70b592dbd06322dd7394fa02a Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 15:15:55 -0700 Subject: [PATCH 07/14] Test OSX builds on ARM and X86 in GitHub Actions CI. The different version images correspond to different architectures. --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7e27dabfd..4617c4f41 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -213,13 +213,14 @@ jobs: timeout-minutes: 13 mac: - runs-on: macos-15 continue-on-error: true strategy: matrix: + image: [macos-15, macos-13] # Test on both ARM and X86 scheduler: [nemesis, sherwood, distrib] topology: [hwloc, binders, no] use_asserts: [true, false] + runs-on: ${{ matrix.image }} env: QTHREADS_ENABLE_ASSERTS: ${{ matrix.use_asserts && '--enable-asserts' || '' }} steps: From dfa907eae9366ebe5950e66dc46a94bf7a4eeb22 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 15:21:49 -0700 Subject: [PATCH 08/14] Test with both clang and g++ on osx. --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4617c4f41..0125fb819 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -220,6 +220,7 @@ jobs: scheduler: [nemesis, sherwood, distrib] topology: [hwloc, binders, no] use_asserts: [true, false] + compiler: [gcc, clang] runs-on: ${{ matrix.image }} env: QTHREADS_ENABLE_ASSERTS: ${{ matrix.use_asserts && '--enable-asserts' || '' }} @@ -234,6 +235,7 @@ jobs: hwloc-ls --version - name: build qthreads run: | + if [[ "${{ matrix.compiler }}" == "gcc" ]]; then export CC=gcc && export CXX=g++ ; fi export CFLAGS="-I$(brew --prefix)/include $CFLAGS" export CXXFLAGS="-I$(brew --prefix)/include $CXXFLAGS" export LDFLAGS="-L$(brew --prefix)/lib $LDFLAGS" From a45e6ee2027d6cf08896c4537616fb9b50ce14d4 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Wed, 8 Jan 2025 15:48:05 -0700 Subject: [PATCH 09/14] Update the ACFL version used in CI. --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5788294b3..82dea1479 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -132,16 +132,19 @@ jobs: sudo apt-get update -y sudo apt-get install -y cmake sudo apt-get install -y hwloc libhwloc-dev - wget -O acfl.tar https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_Ubuntu-22.04_aarch64.tar + wget -O acfl.tar https://developer.arm.com/-/cdn-downloads/permalink/Arm-Compiler-for-Linux/Version_24.10.1/arm-compiler-for-linux_24.10.1_Ubuntu-22.04_aarch64.tar tar -vxf acfl.tar - ./arm-compiler-for-linux_24.04_Ubuntu-22.04/arm-compiler-for-linux_24.04_Ubuntu-22.04.sh -a -f -s acfl + ls + ls arm-compiler-for-linux_24.10.1_Ubuntu-22.04 + ./arm-compiler-for-linux_24.10.1_Ubuntu-22.04/arm-compiler-for-linux_24.10.1_Ubuntu-22.04.sh -a -f -s acfl rm acfl.tar - sudo apt install -y ./acfl/gcc-13.2.0_Ubuntu-22.04.deb ./acfl/arm-linux-compiler-24.04_Ubuntu-22.04.deb + ls acfl + sudo apt install -y ./acfl/gcc-14.2.0_Ubuntu-22.04.deb ./acfl/arm-linux-compiler-24.10.1_Ubuntu-22.04.deb rm -rf acfl - export PATH=$PATH:/opt/arm/arm-linux-compiler-24.04_Ubuntu-22.04/bin + export PATH=$PATH:/opt/arm/arm-linux-compiler-24.10.1_Ubuntu-22.04/bin armclang -v - run: | - export PATH=$PATH:/opt/arm/arm-linux-compiler-24.04_Ubuntu-22.04/bin + export PATH=$PATH:/opt/arm/arm-linux-compiler-24.10.1_Ubuntu-22.04/bin mkdir build pushd build cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. @@ -149,7 +152,7 @@ jobs: popd - run: command: | - export PATH=$PATH:/opt/arm/arm-linux-compiler-24.04_Ubuntu-22.04/bin + export PATH=$PATH:/opt/arm/arm-linux-compiler-24.10.1_Ubuntu-22.04/bin pushd build CTEST_OUTPUT_ON_FAILURE=1 timeout --foreground -k 10s 4m make test VERBOSE=1 popd From d4b21dd663f3fe3ed2a79202e5d96df4314af1c2 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Thu, 9 Jan 2025 11:27:00 -0700 Subject: [PATCH 10/14] Add a switch in the CMake build to allow falling back to the system swapcontext. --- config/qthread_check_swapcontext.m4 | 2 +- include/fastcontext/386-ucontext.h | 2 -- include/fastcontext/power-ucontext.h | 2 -- include/fastcontext/taskimpl.h | 4 ---- include/qt_context.h | 2 +- src/CMakeLists.txt | 15 ++++++++++----- src/qthread.c | 20 ++++++++++---------- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/config/qthread_check_swapcontext.m4 b/config/qthread_check_swapcontext.m4 index 5d57d4628..fa541c1e3 100644 --- a/config/qthread_check_swapcontext.m4 +++ b/config/qthread_check_swapcontext.m4 @@ -83,7 +83,7 @@ int main() [qthread_cv_swapcontext_works=yes])], [qthread_cv_swapcontext_works=yes])])]) AS_IF([test "$qthread_cv_swapcontext_works" = yes], - [AC_DEFINE([HAVE_NATIVE_MAKECONTEXT], [1], [The system provides functional native make/swap/get-context functions]) + [AC_DEFINE([USE_SYSTEM_SWAPCONTEXT], [1], [Use the system provided functional native make/swap/get-context functions]) QTHREAD_CHECK_MAKECONTEXT_SPLIT_ARGS( [AC_DEFINE([QTHREAD_MAKECONTEXT_SPLIT],[1],[makecontext()passes args as int-size, not long-size])]) $1], diff --git a/include/fastcontext/386-ucontext.h b/include/fastcontext/386-ucontext.h index 2c7af744f..42f4b2f14 100644 --- a/include/fastcontext/386-ucontext.h +++ b/include/fastcontext/386-ucontext.h @@ -2,9 +2,7 @@ #include #endif -#ifdef HAVE_STDARG_H #include /* for the qt_makectxt prototype */ -#endif #include /* for size_t, per C89 */ #include diff --git a/include/fastcontext/power-ucontext.h b/include/fastcontext/power-ucontext.h index e54bf94ca..30a8d2c1c 100644 --- a/include/fastcontext/power-ucontext.h +++ b/include/fastcontext/power-ucontext.h @@ -1,6 +1,4 @@ -#ifdef HAVE_STDARG_H #include /* for the qt_makectxt prototype */ -#endif #include "qt_visibility.h" diff --git a/include/fastcontext/taskimpl.h b/include/fastcontext/taskimpl.h index e663a8d7d..21b2dde42 100644 --- a/include/fastcontext/taskimpl.h +++ b/include/fastcontext/taskimpl.h @@ -22,16 +22,12 @@ #define NEEDSWAPCONTEXT #include "power-ucontext.h" #elif (QTHREAD_ASSEMBLY_ARCH == QTHREAD_ARM) -#ifdef HAVE_STDARG_H #include -#endif #define NEEDARMMAKECONTEXT #define NEEDSWAPCONTEXT #include "arm-ucontext.h" #elif (QTHREAD_ASSEMBLY_ARCH == QTHREAD_ARMV8_A64) -#ifdef HAVE_STDARG_H #include -#endif #define NEEDARMA64MAKECONTEXT #define NEEDSWAPCONTEXT #include "arm-ucontext.h" diff --git a/include/qt_context.h b/include/qt_context.h index 8d3615e9a..aad369a9a 100644 --- a/include/qt_context.h +++ b/include/qt_context.h @@ -1,7 +1,7 @@ #ifndef QT_CONTEXT_H #define QT_CONTEXT_H -#if defined(HAVE_UCONTEXT_H) && defined(HAVE_NATIVE_MAKECONTEXT) +#if defined(USE_SYSTEM_SWAPCONTEXT) #include /* for ucontext_t */ typedef ucontext_t qt_context_t; #else diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0f835f0c..345d11faf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,7 @@ set(QTHREADS_DEFAULT_STACK_SIZE 32768 CACHE STRING "Default qthread stack size." set(QTHREADS_HASHMAP hashmap CACHE STRING "Which hashmap implementation to use. Valid values are \"hashmap\" and \"lf_hashmap\".") set(QTHREADS_DICT_TYPE shavit CACHE STRING "Which dictionary implementation to use. Valid values are \"shavit\", \"trie\", and \"simple\".") set(QTHREADS_TIMER_TYPE gettimeofday CACHE STRING "Which timer implementation to use. Valid values are \"clock_gettime\", \"mach\", \"gettimeofday\", and \"gethrtime\".") +set(QTHREADS_CONTEXT_SWAP_IMPL fastcontext CACHE STRING "Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".") set(QTHREADS_SOURCES cacheline.c @@ -34,8 +35,6 @@ set(QTHREADS_SOURCES touch.c tls.c teams.c - fastcontext/asm.S - fastcontext/context.c ${QTHREADS_HASHMAP}.c ds/qarray.c ds/qdqueue.c @@ -60,10 +59,16 @@ set(QTHREADS_SOURCES patterns/wavefront.c ) -# TODO: switch/checks necessary to include the correct -# fastcontext version when we need the fallback. - add_library(qthread SHARED ${QTHREADS_SOURCES}) + +if ("${QTHREADS_CONTEXT_SWAP_IMPL}" STREQUAL "fastcontext") + target_sources(qthread PRIVATE fastcontext/asm.S fastcontext/context.c) +elseif ("${QTHREADS_CONTEXT_SWAP_IMPL}" STREQUAL "system") + target_compile_definitions(qthread PRIVATE USE_SYSTEM_SWAPCONTEXT) +else() + message(FATAL_ERROR "The specified context swap implementation does not match any known implementations.") +endif() + target_include_directories(qthread PRIVATE "../include" ) diff --git a/src/qthread.c b/src/qthread.c index 47b9166da..57b6dc6c2 100644 --- a/src/qthread.c +++ b/src/qthread.c @@ -439,7 +439,7 @@ static void *qthread_master(void *arg) { *current = t; -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT getcontext(&my_context); #endif qthread_exec(t, &my_context); @@ -846,7 +846,7 @@ int API_FUNC qthread_initialize(void) { /*{{{ */ qthread_before_swap_to_main(); -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT qassert( swapcontext(&qlib->mccoy_thread->rdata->context, &(qlib->master_context)), 0); @@ -938,21 +938,21 @@ static inline void qthread_makecontext(qt_context_t *const c, #ifdef UCSTACK_HAS_SSFLAGS c->uc_stack.ss_flags = 0; #endif -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT /* the makecontext man page (Linux) says: set the uc_link FIRST. * why? no idea */ c->uc_link = returnc; /* NULL pthread_exit() */ #endif -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT #ifdef QTHREAD_MAKECONTEXT_SPLIT makecontext(c, func, 2, high, low); #else /* QTHREAD_MAKECONTEXT_SPLIT */ makecontext(c, func, 1, arg); #endif /* QTHREAD_MAKECONTEXT_SPLIT */ assert((void *)c->uc_link == (void *)returnc); -#else /* ifdef HAVE_NATIVE_MAKECONTEXT */ +#else /* ifdef USE_SYSTEM_SWAPCONTEXT */ qt_makectxt(c, func, 1, arg); -#endif /* ifdef HAVE_NATIVE_MAKECONTEXT */ +#endif /* ifdef USE_SYSTEM_SWAPCONTEXT */ } /*}}} */ /* this adds a function to the list of cleanup functions to call at finalize; @@ -1743,7 +1743,7 @@ void INTERNAL qthread_exec(qthread_t *t, qt_context_t *c) { /*{{{ */ (void (*)(void))qthread_wrapper, t, c); -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT } else { t->rdata->context.uc_link = c; /* NULL pthread_exit() */ #endif @@ -1766,7 +1766,7 @@ void INTERNAL qthread_exec(qthread_t *t, qt_context_t *c) { /*{{{ */ qthread_before_swap_to_qthread(t); -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT qassert(swapcontext(atomic_load_explicit(&t->rdata->return_context, memory_order_relaxed), &t->rdata->context), @@ -2233,7 +2233,7 @@ void INTERNAL qthread_back_to_master(qthread_t *t) { /*{{{ */ sizeof(qt_context_t)); #endif qthread_before_swap_from_qthread(t); -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT qassert(swapcontext(&t->rdata->context, atomic_load_explicit(&t->rdata->return_context, memory_order_relaxed)), @@ -2262,7 +2262,7 @@ void INTERNAL qthread_back_to_master2(qthread_t *t) { /*{{{ */ atomic_load_explicit(&t->rdata->return_context, memory_order_relaxed), sizeof(qt_context_t)); #endif -#ifdef HAVE_NATIVE_MAKECONTEXT +#ifdef USE_SYSTEM_SWAPCONTEXT setcontext( atomic_load_explicit(&t->rdata->return_context, memory_order_relaxed)); #else From d6d20c0b7427f0bc9fa92a6207c62ee7d01f75cf Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Thu, 9 Jan 2025 11:35:17 -0700 Subject: [PATCH 11/14] Move freebsd build to use CMake. --- .cirrus.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index b7febe709..5e92dec44 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -62,16 +62,15 @@ freebsd_task: env: QTHREADS_SCHEDULER: distrib install_deps_script: | - pkg install -y bash - pkg install -y llvm autoconf automake libtool + pkg install -y llvm cmake pkg install -y coreutils # to get gtimeout for CI. The built-in timeout sometimes fails to kill the process. build_script: | - bash autogen.sh - bash configure --enable-picky --with-scheduler=$QTHREADS_SCHEDULER --with-topology=no - make -j$CIRRUS_CPU - make tests -j$CIRRUS_CPU + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=$QTHREADS_SCHEDULER -DQTHREADS_TOPOLOGY=no -DQTHREADS_CONTEXT_SWAP_IMPL=system .. + make -j$CIRRUS_CPU VERBOSE=1 test_script: | - gtimeout --foreground -k 10s 2m make check || ( cat test/basics/test-suite.log && cat test/features/test-suite.log && cat test/stress/test-suite.log && exit 1 ) + CTEST_OUTPUT_ON_FAILURE=1 gtimeout --foreground -k 10s 2m make test VERBOSE=1 arm_linux_task: arm_container: From f91a1f42542e63919cb5cd35a2d4cb4a4ded180d Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Thu, 9 Jan 2025 12:08:45 -0700 Subject: [PATCH 12/14] Add clang/MUSL builds. --- .circleci/config.yml | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82dea1479..bc19d2882 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -208,6 +208,8 @@ jobs: type: string topology: type: string + compiler: + type: string docker: - image: alpine:latest resource_class: << parameters.worker_type >> @@ -215,7 +217,9 @@ jobs: - checkout - run: | apk add --no-cache --no-progress bash make musl-dev hwloc-dev cmake gcc g++ + if [ "<< parameters.compiler >>" == "clang" ]; then apk add clang; fi - run: | + if [ "<< parameters.compiler >>" == "clang" ]; then export CC=clang && export CXX=clang++; fi mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=<< parameters.scheduler >> -DQTHREADS_TOPOLOGY=<< parameters.topology >> .. @@ -301,29 +305,70 @@ workflows: worker_type: [medium, arm.medium] scheduler: [nemesis, sherwood, distrib] topology: ['no', binders, hwloc] + compiler: [clang, gcc] exclude: - worker_type: medium scheduler: sherwood topology: binders + compiler: gcc + - worker_type: medium + scheduler: sherwood + topology: hwloc + compiler: gcc + - worker_type: medium + scheduler: distrib + topology: binders + compiler: gcc + - worker_type: medium + scheduler: distrib + topology: hwloc + compiler: gcc + - worker_type: arm.medium + scheduler: sherwood + topology: binders + compiler: gcc + - worker_type: arm.medium + scheduler: sherwood + topology: hwloc + compiler: gcc + - worker_type: arm.medium + scheduler: distrib + topology: binders + compiler: gcc + - worker_type: arm.medium + scheduler: distrib + topology: hwloc + compiler: gcc + - worker_type: medium + scheduler: sherwood + topology: binders + compiler: clang - worker_type: medium scheduler: sherwood topology: hwloc + compiler: clang - worker_type: medium scheduler: distrib topology: binders + compiler: clang - worker_type: medium scheduler: distrib topology: hwloc + compiler: clang - worker_type: arm.medium scheduler: sherwood topology: binders + compiler: clang - worker_type: arm.medium scheduler: sherwood topology: hwloc + compiler: clang - worker_type: arm.medium scheduler: distrib topology: binders + compiler: clang - worker_type: arm.medium scheduler: distrib topology: hwloc + compiler: clang From 7fce68241027182f4f34bf402258e413687685e3 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Thu, 9 Jan 2025 14:40:44 -0700 Subject: [PATCH 13/14] Remove all dependencies on the old autotools config header. --- config/qthread_check_hwloc.m4 | 4 +-- config/qthread_check_makecontext.m4 | 5 +-- configure.ac | 25 ------------- include/fastcontext/386-ucontext.h | 4 --- include/fastcontext/arm-ucontext.h | 5 +-- include/fastcontext/taskimpl.h | 4 --- include/qt_affinity.h | 18 +--------- include/qt_alloc.h | 6 ++-- include/qt_asserts.h | 4 --- include/qt_expect.h | 10 ------ include/qt_gcd.h | 4 --- include/qt_hash.h | 4 --- include/qt_macros.h | 4 --- include/qt_qthread_struct.h | 4 --- include/qt_shepherd_innards.h | 3 -- include/qthread_innards.h | 6 +--- src/CMakeLists.txt | 4 +++ src/affinity/hwloc.c | 35 ++----------------- src/affinity/no.c | 4 --- src/affinity/shepcomp.h | 16 --------- src/alloc/base.c | 7 ---- src/alloc/chapel.c | 5 --- src/barrier/array.c | 4 --- src/barrier/feb.c | 4 --- src/barrier/log.c | 4 --- src/barrier/sinc.c | 4 --- src/cacheline.c | 3 -- src/ds/dictionary/dictionary_shavit.c | 4 --- src/ds/dictionary/dictionary_trie.c | 4 --- src/ds/dictionary/hash.c | 4 --- src/ds/qarray.c | 25 ++++++------- src/ds/qdqueue.c | 12 ------- src/ds/qlfqueue.c | 4 --- src/ds/qpool.c | 6 +--- src/ds/qswsrqueue.c | 4 --- src/envariables.c | 4 --- src/fastcontext/context.c | 4 --- src/feb.c | 3 -- src/hashmap.c | 4 --- src/hazardptrs.c | 4 --- src/io.c | 4 --- src/lf_hashmap.c | 4 --- src/locks.c | 4 --- src/mpool.c | 4 --- src/patterns/allpairs.c | 3 -- src/patterns/wavefront.c | 4 --- src/qalloc.c | 13 ++----- src/qloop.c | 4 --- src/qthread.c | 16 ++------- src/qtimer/gethrtime.c | 15 ++------ src/qtimer/gettime.c | 4 --- src/qtimer/gettimeofday.c | 14 ++------ src/qtimer/mach.c | 13 +------ src/queue.c | 4 --- src/qutil.c | 4 --- src/shepherds.c | 4 --- src/sincs/donecount.c | 4 --- src/sincs/donecount_cas.c | 4 --- src/sincs/original.c | 7 ---- src/sincs/snzi.c | 7 ---- src/syncvar.c | 4 --- src/syscalls/accept.c | 4 --- src/syscalls/connect.c | 4 --- src/syscalls/poll.c | 4 --- src/syscalls/pread.c | 4 --- src/syscalls/pwrite.c | 4 --- src/syscalls/read.c | 4 --- src/syscalls/select.c | 4 --- src/syscalls/system.c | 4 --- src/syscalls/user_defined.c | 4 --- src/syscalls/wait4.c | 4 --- src/syscalls/write.c | 4 --- src/teams.c | 4 --- src/threadqueues/distrib_threadqueues.c | 4 --- src/threadqueues/nemesis_threadqueues.c | 4 --- src/threadqueues/sherwood_threadqueues.c | 10 +----- src/touch.c | 6 ---- src/workers.c | 4 --- test/basics/aligned_prodcons.c | 4 --- test/basics/aligned_purge_basic.c | 4 --- test/basics/aligned_purge_wakes.c | 4 --- test/basics/aligned_readXX_basic.c | 4 --- test/basics/aligned_writeFF_basic.c | 4 --- test/basics/aligned_writeFF_waits.c | 4 --- test/basics/hello_world.c | 4 --- test/basics/hello_world_multi.c | 4 --- test/basics/qalloc.c | 4 --- test/basics/qthread_cacheline.c | 3 -- test/basics/qthread_fork_precond.c | 4 --- test/basics/qthread_fp.c | 4 --- test/basics/qthread_fp_double.c | 4 --- test/basics/qthread_readstate.c | 4 --- test/basics/qthread_stackleft.c | 3 -- test/basics/qthread_timer_wait.c | 4 --- test/basics/sinc.c | 4 --- test/basics/sinc_null.c | 4 --- test/basics/test_subteams.c | 4 --- test/basics/test_teams.c | 4 --- test/benchmarks/generic/time_gcd.c | 3 -- test/benchmarks/generic/time_qt_loopaccums.c | 3 -- test/benchmarks/generic/time_qt_loops.c | 3 -- test/benchmarks/mt/time_cilk_eager_future.c | 4 --- test/benchmarks/mt/time_cilk_task_spawn.c | 4 --- test/benchmarks/mt/time_eager_future.c | 4 --- test/benchmarks/mt/time_omp_eager_future.c | 4 --- test/benchmarks/mt/time_omp_task_spawn.c | 4 --- test/benchmarks/mt/time_task_spawn.c | 4 --- test/benchmarks/mt/time_tbb_eager_future.cc | 4 --- test/benchmarks/mt/time_tbb_task_spawn.cc | 4 --- test/benchmarks/mtaap08/time_chain_bench.c | 3 -- .../mtaap08/time_chain_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_cncthr_bench.c | 3 -- .../mtaap08/time_cncthr_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_incr_bench.c | 3 -- .../mtaap08/time_incr_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_lul_bench.c | 3 -- .../mtaap08/time_lul_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_mutex_bench.c | 3 -- .../mtaap08/time_mutex_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_spin_bench.c | 3 -- .../mtaap08/time_spin_bench_pthread.c | 3 -- test/benchmarks/mtaap08/time_thrcrt_bench.c | 3 -- .../mtaap08/time_thrcrt_bench_pthread.c | 3 -- test/benchmarks/pmea09/time_qlfqueue.c | 3 -- test/benchmarks/pmea09/time_qpool.c | 3 -- test/benchmarks/sc12/spawn_parallel_cilk.c | 4 --- test/benchmarks/sc12/spawn_parallel_omp.c | 4 --- .../benchmarks/sc12/spawn_parallel_qthreads.c | 4 --- test/benchmarks/sc12/spawn_parallel_tbb.cc | 4 --- test/benchmarks/sc12/spawn_sequential_cilk.c | 4 --- test/benchmarks/sc12/spawn_sequential_omp.c | 4 --- .../sc12/spawn_sequential_qthreads.c | 4 --- test/benchmarks/sc12/spawn_sequential_tbb.cc | 4 --- test/benchmarks/sc12/uts_cilk.c | 4 --- test/benchmarks/sc12/uts_omp.c | 4 --- test/benchmarks/sc12/uts_qthreads.c | 4 --- test/benchmarks/sc12/uts_tbb.cc | 4 --- test/benchmarks/thesis/time_allpairs.c | 3 -- test/benchmarks/thesis/time_qutil_qsort.c | 4 --- test/benchmarks/uts/time_uts_aligned.c | 4 --- test/benchmarks/uts/time_uts_cilk.c | 4 --- test/benchmarks/uts/time_uts_donecount.c | 4 --- test/benchmarks/uts/time_uts_donecount2.c | 4 --- test/benchmarks/uts/time_uts_donecount3.c | 4 --- test/benchmarks/uts/time_uts_sinc.c | 4 --- test/benchmarks/uts/time_uts_syncvar.c | 4 --- test/benchmarks/uts/time_uts_tbb.cc | 4 --- test/features/allpairs.c | 3 -- test/features/qloop_utils.c | 3 -- test/features/qt_loop.c | 3 -- test/features/qt_loop_balance.c | 3 -- test/features/qt_loop_balance_simple.c | 3 -- test/features/qt_loop_balance_sinc.c | 3 -- test/features/qt_loop_queue.c | 3 -- test/features/qt_loop_simple.c | 3 -- test/features/qt_loop_sinc.c | 3 -- test/features/qutil.c | 3 -- test/features/qutil_qsort.c | 4 --- test/features/subteams.c | 4 --- test/stress/precond_spawn_simple.c | 4 --- test/stress/subteams_uts.c | 4 --- test/stress/task_spawn.c | 4 --- test/stress/test_spawn_simple.c | 4 --- 163 files changed, 40 insertions(+), 766 deletions(-) diff --git a/config/qthread_check_hwloc.m4 b/config/qthread_check_hwloc.m4 index dd00ef3ab..20e70b2b2 100644 --- a/config/qthread_check_hwloc.m4 +++ b/config/qthread_check_hwloc.m4 @@ -61,7 +61,7 @@ int main() ]) AS_IF([test "x$qt_allgoodsofar" = xyes], # we can use hwloc and do action-if-found - [AC_DEFINE([QTHREAD_HAVE_HWLOC],[1],[if I can use the hwloc topology interface]) + [AC_DEFINE([USE_HWLOC],[1],[if I can use the hwloc topology interface]) $1], # restore CPPFLAGS and LDFLAGS if hwloc is unavailable [CPPFLAGS="$hwloc_saved_CPPFLAGS" @@ -70,7 +70,7 @@ int main() $2])], # don't do configuration checks, assume hwloc works [AC_MSG_NOTICE([skipping hwloc link checks]) - AC_DEFINE([QTHREAD_HAVE_HWLOC],[1],[if I can use the hwloc topology interface]) + AC_DEFINE([USE_HWLOC],[1],[if I can use the hwloc topology interface]) # default to having distance if not specified AS_IF([test "x$qt_allgoodsofar" = xyes && test "x$enable_hwloc_has_distance" = x], [AC_MSG_NOTICE([enabling hwloc distance support]) diff --git a/config/qthread_check_makecontext.m4 b/config/qthread_check_makecontext.m4 index d18f24837..11225142c 100644 --- a/config/qthread_check_makecontext.m4 +++ b/config/qthread_check_makecontext.m4 @@ -81,9 +81,6 @@ AC_CACHE_CHECK([for hand-implemented makecontext], esac]) AS_IF([test "$qthread_cv_makecontext" = "yes"], - [AC_CHECK_FUNCS([memmove], [], - [AC_MSG_ERROR([A functional memmove is required for the included makecontext.])]) - AC_CHECK_HEADERS([sys/ucontext.h stdarg.h sched.h signal.h sys/utsname.h]) - $1], + [$1], [$2]) ]) diff --git a/configure.ac b/configure.ac index 2d35bbb1b..d58026266 100644 --- a/configure.ac +++ b/configure.ac @@ -229,16 +229,6 @@ AC_SEARCH_LIBS([accept], [xnet "socket -lnsl"]) AC_CACHE_SAVE -## ----------------------- ## -## Checks for header files ## -## ----------------------- ## -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_HEADER_TIME -AC_CHECK_HEADERS([fcntl.h ucontext.h sys/time.h sys/resource.h mach/mach_time.h malloc.h math.h sys/types.h sys/sysctl.h]) - -AC_CACHE_SAVE - ## -------------------- ## ## Check for structures ## ## -------------------- ## @@ -280,13 +270,6 @@ AS_IF([test "x$enable_precache_guard_pages" = "xyes"], [enable_precache_guard_pages="no"]) -AC_CACHE_SAVE - -## --------------------------- ## -## Check for library functions ## -## --------------------------- ## -AC_CHECK_FUNCS([memalign memcpy fstat64 lseek64 sched_yield sysconf getcontext]) - AC_CACHE_SAVE ## ------------------------- ## @@ -371,13 +354,6 @@ AS_IF([test "x$enable_asserts" != "xyes"], AS_IF([test "x$with_stack_alignment" = "x"], [with_stack_alignment=16]) -AC_LINK_IFELSE([AC_LANG_SOURCE([[ -#include - -int main() { - return sysconf(_SC_CLK_TCK); -}]])], - [AC_DEFINE([HAVE_SC_CLK_TCK], [1], [Define if _SC_CLK_TCK is available.])]) dnl Which timer do we want to use qthread_timer_type=gettimeofday AS_IF([test "x$qthread_timer_type" = "xgettimeofday"], @@ -445,7 +421,6 @@ AM_CONDITIONAL([COMPILE_TBB_BENCHMARKS], [test "x$have_tbb" = "xyes"]) AM_CONDITIONAL([COMPILE_CILK_BENCHMARKS], [test "x$have_cilk" = "xyes"]) AM_CONDITIONAL([COMPILE_LF_HASH], [test "x$enable_lf_febs" = "xyes"]) -AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_FILES([Makefile src/Makefile man/Makefile diff --git a/include/fastcontext/386-ucontext.h b/include/fastcontext/386-ucontext.h index 42f4b2f14..3e3a8b0c8 100644 --- a/include/fastcontext/386-ucontext.h +++ b/include/fastcontext/386-ucontext.h @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include /* for the qt_makectxt prototype */ #include /* for size_t, per C89 */ #include diff --git a/include/fastcontext/arm-ucontext.h b/include/fastcontext/arm-ucontext.h index cf842dfba..445c90319 100644 --- a/include/fastcontext/arm-ucontext.h +++ b/include/fastcontext/arm-ucontext.h @@ -1,7 +1,4 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - +#include "qthread/common.h" #if (QTHREAD_ASSEMBLY_ARCH == QTHREAD_ARMV8_A64) #define NEEDARMA64CONTEXT #endif diff --git a/include/fastcontext/taskimpl.h b/include/fastcontext/taskimpl.h index 21b2dde42..ca0ff692d 100644 --- a/include/fastcontext/taskimpl.h +++ b/include/fastcontext/taskimpl.h @@ -1,10 +1,6 @@ #ifndef TASKIMPL_H #define TASKIMPL_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "qthread/common.h" #if (QTHREAD_ASSEMBLY_ARCH == QTHREAD_IA32) diff --git a/include/qt_affinity.h b/include/qt_affinity.h index 761afb3d5..a35751b7d 100644 --- a/include/qt_affinity.h +++ b/include/qt_affinity.h @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "qthread/qthread.h" #include "qt_shepherd_innards.h" @@ -12,18 +8,6 @@ typedef struct qthread_shepherd_s qthread_shepherd_t; #endif -#if defined(QTHREAD_HAVE_HWLOC) && (HWLOC_API_VERSION > 0x00010000) -#define QTHREAD_HAVE_MEM_AFFINITY -#endif - -#ifdef QTHREAD_HAVE_MEM_AFFINITY -#define MEM_AFFINITY_ONLY_ARG(x) x, -#define MEM_AFFINITY_ONLY(x) x -#else -#define MEM_AFFINITY_ONLY_ARG(x) -#define MEM_AFFINITY_ONLY(x) -#endif - /** * qt_topology_init() - initialize topology layer * @nbshepherds: The number of shepherds (after return). @@ -91,7 +75,7 @@ void INTERNAL qt_affinity_set(qthread_worker_t *me, int qt_affinity_gendists(qthread_shepherd_t *sheps, qthread_shepherd_id_t nshepherds); -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY void INTERNAL *qt_affinity_alloc(size_t bytes); void INTERNAL *qt_affinity_alloc_onnode(size_t bytes, int node); void INTERNAL qt_affinity_mem_tonode(void *addr, size_t bytes, int node); diff --git a/include/qt_alloc.h b/include/qt_alloc.h index 712f567bb..c132131e6 100644 --- a/include/qt_alloc.h +++ b/include/qt_alloc.h @@ -1,5 +1,5 @@ -#ifndef HAVE_QT_ALIGNED_ALLOC_H -#define HAVE_QT_ALIGNED_ALLOC_H +#ifndef QT_ALLOC_H +#define QT_ALLOC_H #include #include @@ -28,5 +28,5 @@ void INTERNAL qt_internal_alignment_init(void); #endif extern size_t _pagesize; #define pagesize ((size_t)_pagesize) -#endif // ifndef HAVE_QT_ALIGNED_ALLOC_H +#endif // ifndef QT_ALLOC_H /* vim:set expandtab: */ diff --git a/include/qt_asserts.h b/include/qt_asserts.h index 7de29cd98..197125a76 100644 --- a/include/qt_asserts.h +++ b/include/qt_asserts.h @@ -4,10 +4,6 @@ #define QTHREAD_ASSERTS_H #endif -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* for assert() */ #ifdef qassert diff --git a/include/qt_expect.h b/include/qt_expect.h index f2bcc078f..eebd5dbb7 100644 --- a/include/qt_expect.h +++ b/include/qt_expect.h @@ -1,18 +1,8 @@ #ifndef QTHREAD_EXPECT_H #define QTHREAD_EXPECT_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef QTHREAD_EXPECT_OKAY #define QTHREAD_EXPECT(x, y) __builtin_expect(!!(x), (y)) #define QTHREAD_LIKELY(x) __builtin_expect(!!(x), 1) #define QTHREAD_UNLIKELY(x) __builtin_expect(!!(x), 0) -#else -#define QTHREAD_EXPECT(x, y) (x) -#define QTHREAD_LIKELY(x) (x) -#define QTHREAD_UNLIKELY(x) (x) -#endif #endif diff --git a/include/qt_gcd.h b/include/qt_gcd.h index be94ccc30..07f725a74 100644 --- a/include/qt_gcd.h +++ b/include/qt_gcd.h @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include static inline size_t qt_gcd(size_t a, size_t b) { diff --git a/include/qt_hash.h b/include/qt_hash.h index 649445398..220db6c55 100644 --- a/include/qt_hash.h +++ b/include/qt_hash.h @@ -1,10 +1,6 @@ #ifndef QT_HASH_H #define QT_HASH_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include diff --git a/include/qt_macros.h b/include/qt_macros.h index 96b827816..107008edc 100644 --- a/include/qt_macros.h +++ b/include/qt_macros.h @@ -12,10 +12,6 @@ #error "C11 is required" #endif -#ifdef HAVE_CONFIG_H -#include -#endif - #ifdef __GNUC__ #define Q_UNUSED(x) __attribute__((unused)) x #else diff --git a/include/qt_qthread_struct.h b/include/qt_qthread_struct.h index d070b143d..d9f2cca56 100644 --- a/include/qt_qthread_struct.h +++ b/include/qt_qthread_struct.h @@ -9,10 +9,6 @@ #endif #endif -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "qthread/barrier.h" #include "qt_blocking_structs.h" diff --git a/include/qt_shepherd_innards.h b/include/qt_shepherd_innards.h index f2833227c..03ff6eec8 100644 --- a/include/qt_shepherd_innards.h +++ b/include/qt_shepherd_innards.h @@ -56,9 +56,6 @@ struct qthread_shepherd_s { _Atomic uintptr_t active; /* affinity information */ unsigned int node; /* whereami */ -#ifdef QTHREAD_HAVE_LGRP - unsigned int lgrp; -#endif unsigned int *shep_dists; qthread_shepherd_id_t *sorted_sheplist; unsigned int stealing; /* True when a worker is in the steal (attempt) process diff --git a/include/qthread_innards.h b/include/qthread_innards.h index 9236593a0..7069b6856 100644 --- a/include/qthread_innards.h +++ b/include/qthread_innards.h @@ -1,16 +1,12 @@ #ifndef QTHREAD_INNARDS_H #define QTHREAD_INNARDS_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include -#ifdef QTHREAD_HAVE_HWLOC +#ifdef USE_HWLOC #include #if (HWLOC_API_VERSION < 0x00010000) #error HWLOC version unrecognized diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 345d11faf..3c0af9d6e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -78,6 +78,10 @@ if ("${QTHREADS_TOPOLOGY}" STREQUAL "hwloc" OR "${QTHREADS_TOPOLOGY}" STREQUAL " # TODO: pull this out into a simple module file so we can just do find_package instead. find_library(HWLOC_LIBRARY NAMES hwloc PATH_SUFFIXES lib lib64) target_link_libraries(qthread PUBLIC "${HWLOC_LIBRARY}") + target_compile_definitions(qthread PRIVATE USE_HWLOC) + if ("${QTHREADS_TOPOLOGY}" STREQUAL "hwloc") + target_compile_definitions(qthread PRIVATE USE_HWLOC_MEM_AFFINITY) + endif() endif() target_include_directories(qthread PUBLIC diff --git a/src/affinity/hwloc.c b/src/affinity/hwloc.c index 7e215a81b..88a1abca5 100644 --- a/src/affinity/hwloc.c +++ b/src/affinity/hwloc.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include "qt_affinity.h" @@ -263,7 +259,7 @@ void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds, void INTERNAL qt_affinity_deinit(void) {} -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY void INTERNAL qt_affinity_mem_tonode(void *addr, size_t bytes, int node) { /*{{{ */ @@ -299,7 +295,7 @@ void INTERNAL qt_affinity_free(void *ptr, size_t bytes) { /*{{{ */ hwloc_free(topology, ptr, bytes); } /*}}} */ -#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#endif /* ifdef USE_HWLOC_MEM_AFFINITY */ qthread_shepherd_id_t INTERNAL guess_num_shepherds(void) { /*{{{ */ qthread_shepherd_id_t ret = 1; @@ -481,37 +477,10 @@ int INTERNAL qt_affinity_gendists(qthread_shepherd_t *sheps, qt_calloc(nshepherds - 1, sizeof(qthread_shepherd_id_t)); sheps[i].shep_dists = qt_calloc(nshepherds, sizeof(unsigned int)); } -#ifdef QTHREAD_HAVE_HWLOC_DISTS - const struct hwloc_distances_s *matrix = - hwloc_get_whole_distance_matrix_by_type(topology, HWLOC_OBJ_NODE); - if (matrix) { assert(matrix->latency); } - size_t node_to_NUMAnode[num_extant_objs]; - for (size_t i = 0; i < num_extant_objs; ++i) { - hwloc_obj_t node_obj = hwloc_get_obj_inside_cpuset_by_depth( - topology, allowed_cpuset, shep_depth, i); - while (node_obj->type > HWLOC_OBJ_NODE) { - node_obj = node_obj->parent; - assert(node_obj); - } - node_to_NUMAnode[i] = node_obj->logical_index; - } -#endif /* ifdef QTHREAD_HAVE_HWLOC_DISTS */ for (size_t i = 0; i < nshepherds; ++i) { for (size_t j = 0, k = 0; j < nshepherds; ++j) { if (j != i) { -#ifdef QTHREAD_HAVE_HWLOC_DISTS - if (matrix) { - sheps[i].shep_dists[j] = - matrix->latency[node_to_NUMAnode[sheps[i].node] + - matrix->nbobjs * node_to_NUMAnode[sheps[j].node]] * - 10; - } else { - // handle what is fundamentally a bug in old versions of hwloc - sheps[i].shep_dists[j] = 10; - } -#else /* ifdef QTHREAD_HAVE_HWLOC_DISTS */ sheps[i].shep_dists[j] = 10; -#endif /* ifdef QTHREAD_HAVE_HWLOC_DISTS */ sheps[i].sorted_sheplist[k++] = j; } } diff --git a/src/affinity/no.c b/src/affinity/no.c index 2f0d8bd32..2c686463a 100644 --- a/src/affinity/no.c +++ b/src/affinity/no.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "qt_affinity.h" #include "qt_alloc.h" #include "qt_asserts.h" diff --git a/src/affinity/shepcomp.h b/src/affinity/shepcomp.h index 9dd1dcf2d..fad7a17b7 100644 --- a/src/affinity/shepcomp.h +++ b/src/affinity/shepcomp.h @@ -1,19 +1,5 @@ #include -#ifdef HAVE_QSORT_R -#if !defined(__linux__) -static int qthread_internal_shepcomp(void *src, void const *a, void const *b) -#else -static int qthread_internal_shepcomp(void const *a, void const *b, void *src) -#endif -{ - int a_dist = qthread_distance((qthread_shepherd_id_t)(intptr_t)src, - *(qthread_shepherd_id_t *)a); - int b_dist = qthread_distance((qthread_shepherd_id_t)(intptr_t)src, - *(qthread_shepherd_id_t *)b); - return a_dist - b_dist; -} -#else static qthread_shepherd_id_t shepcomp_src; static int qthread_internal_shepcomp(void const *a, void const *b) { @@ -22,5 +8,3 @@ static int qthread_internal_shepcomp(void const *a, void const *b) { return a_dist - b_dist; } -#endif - diff --git a/src/alloc/base.c b/src/alloc/base.c index c565f8274..3423203b5 100644 --- a/src/alloc/base.c +++ b/src/alloc/base.c @@ -1,14 +1,7 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include /* System Headers */ -#if (HAVE_MEMALIGN && HAVE_MALLOC_H) -#include /* for memalign() */ -#endif #include /* for getpagesize() */ /* Internal Headers */ diff --git a/src/alloc/chapel.c b/src/alloc/chapel.c index 84fbad9db..40eb42546 100644 --- a/src/alloc/chapel.c +++ b/src/alloc/chapel.c @@ -1,8 +1,3 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include diff --git a/src/barrier/array.c b/src/barrier/array.c index bc8314305..52a04ed51 100644 --- a/src/barrier/array.c +++ b/src/barrier/array.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include diff --git a/src/barrier/feb.c b/src/barrier/feb.c index 480f727ad..c1ca99dbc 100644 --- a/src/barrier/feb.c +++ b/src/barrier/feb.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/barrier/log.c b/src/barrier/log.c index 9891cccbb..38d6484ad 100644 --- a/src/barrier/log.c +++ b/src/barrier/log.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - // a logrithmic self-cleaning barrier -- requires the size to be known // Follows a strategy that the MTA used - so might work better if it used the // full/empty implementation, but orginal developement predated it's inclusion diff --git a/src/barrier/sinc.c b/src/barrier/sinc.c index 81ee453ee..e48d54e37 100644 --- a/src/barrier/sinc.c +++ b/src/barrier/sinc.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/cacheline.c b/src/cacheline.c index 7f14246d0..36083d6cb 100644 --- a/src/cacheline.c +++ b/src/cacheline.c @@ -4,9 +4,6 @@ #include "qt_visibility.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include diff --git a/src/ds/dictionary/dictionary_shavit.c b/src/ds/dictionary/dictionary_shavit.c index 5342d32a3..1d6de721a 100644 --- a/src/ds/dictionary/dictionary_shavit.c +++ b/src/ds/dictionary/dictionary_shavit.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include /* for printf() */ #include /* for malloc/free/etc */ diff --git a/src/ds/dictionary/dictionary_trie.c b/src/ds/dictionary/dictionary_trie.c index d498f4464..20f509836 100644 --- a/src/ds/dictionary/dictionary_trie.c +++ b/src/ds/dictionary/dictionary_trie.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/ds/dictionary/hash.c b/src/ds/dictionary/hash.c index 4fb24551f..02158bea4 100644 --- a/src/ds/dictionary/hash.c +++ b/src/ds/dictionary/hash.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* Qthreads Headers */ #include #include diff --git a/src/ds/qarray.c b/src/ds/qarray.c index e8e8cfab0..8e5a59a7e 100644 --- a/src/ds/qarray.c +++ b/src/ds/qarray.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include /* for calloc() */ #include @@ -17,6 +13,7 @@ #include "qthread/qarray.h" /* Local Headers */ +#include "qt_affinity.h" #include "qt_alloc.h" #include "qt_asserts.h" #include "qt_gcd.h" /* for qt_lcm() */ @@ -287,7 +284,7 @@ static qarray *qarray_create_internal(size_t const count, break; default: ret->dist_specific.dist_shep = NO_SHEPHERD; } -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY switch (d) { case ALL_LOCAL: case ALL_RAND: @@ -314,11 +311,11 @@ static qarray *qarray_create_internal(size_t const count, break; } if (ret->base_ptr == NULL) {} -#else /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#else /* ifdef USE_HWLOC_MEM_AFFINITY */ /* For speed, we want page-aligned memory, if we can get it */ ret->base_ptr = qt_internal_aligned_alloc(segment_count * ret->segment_bytes, pagesize); -#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#endif /* ifdef USE_HWLOC_MEM_AFFINITY */ qassert_goto((ret->base_ptr != NULL), badret_exit); /******************************************** @@ -368,7 +365,7 @@ static qarray *qarray_create_internal(size_t const count, qarray_internal_segment_shep_write(ret, seghead, target_shep); } assert(target_shep < max_sheps); -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY { /* make sure this shep has a node; if it does, put this segment there */ unsigned int target_node = qthread_internal_shep_to_node(target_shep); @@ -378,7 +375,7 @@ static qarray *qarray_create_internal(size_t const count, qt_affinity_mem_tonode(seghead, ret->segment_bytes, target_node); } } -#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#endif /* ifdef USE_HWLOC_MEM_AFFINITY */ qthread_incr(&chunk_distribution_tracker[target_shep], 1); } } @@ -446,7 +443,7 @@ API_FUNC void qarray_destroy(qarray *a) { /*{{{ */ ((a->count % a->segment_size) ? 1 : 0))); break; } -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY qt_affinity_free(a->base_ptr, a->segment_bytes * (a->count / a->segment_size + ((a->count % a->segment_size) ? 1 : 0))); @@ -1193,14 +1190,14 @@ void qarray_set_shepof(qarray *a, if (a->dist_specific.dist_shep != shep) { size_t segment_count = (a->count / a->segment_size); segment_count += (a->count % a->segment_size) ? 1 : 0; -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY unsigned int target_node = qthread_internal_shep_to_node(shep); if (target_node != QTHREAD_NO_NODE) { size_t num_segments = a->count / a->segment_size; size_t array_size = a->segment_bytes * num_segments; qt_affinity_mem_tonode(a->base_ptr, array_size, target_node); } -#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#endif /* ifdef USE_HWLOC_MEM_AFFINITY */ qthread_incr(&chunk_distribution_tracker[shep], segment_count); qthread_incr(&chunk_distribution_tracker[a->dist_specific.dist_shep], ((aligned_t)-1) * segment_count); @@ -1215,14 +1212,14 @@ void qarray_set_shepof(qarray *a, qarray_internal_segment_shep_read(a, seghead); assert(cur_shep < qthread_num_shepherds()); if (cur_shep != shep) { -#ifdef QTHREAD_HAVE_MEM_AFFINITY +#ifdef USE_HWLOC_MEM_AFFINITY unsigned int target_node = qthread_internal_shep_to_node(shep); if (target_node != QTHREAD_NO_NODE) { qt_affinity_mem_tonode(a->base_ptr + (a->segment_bytes * segment), a->segment_bytes, target_node); } -#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */ +#endif /* ifdef USE_HWLOC_MEM_AFFINITY */ qthread_incr(&chunk_distribution_tracker[shep], 1); qthread_incr(&chunk_distribution_tracker[cur_shep], (aligned_t)-1); qarray_internal_segment_shep_write(a, seghead, shep); diff --git a/src/ds/qdqueue.c b/src/ds/qdqueue.c index 3b26ec2ed..57d33c2ac 100644 --- a/src/ds/qdqueue.c +++ b/src/ds/qdqueue.c @@ -1,13 +1,5 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include -#ifdef HAVE_SYS_LGRP_USER_H -#include -#endif - #include #include #include @@ -218,11 +210,7 @@ qdqueue_internal_getneighbors(qthread_shepherd_id_t shep, qthread_shepherd_id_t *temp; size_t j, numN = 0; -#ifdef HAVE_SYS_LGRP_USER_H -#define NONME_DIST 5 -#else #define NONME_DIST 10 -#endif /* find the smallest non-me distance */ int mindist = INT_MAX; diff --git a/src/ds/qlfqueue.c b/src/ds/qlfqueue.c index 722aab010..dc93d5226 100644 --- a/src/ds/qlfqueue.c +++ b/src/ds/qlfqueue.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include diff --git a/src/ds/qpool.c b/src/ds/qpool.c index effda201a..53564b695 100644 --- a/src/ds/qpool.c +++ b/src/ds/qpool.c @@ -1,12 +1,8 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* Internal Headers */ +#include "qthread/qpool.h" #include "qt_asserts.h" #include "qt_mpool.h" #include "qt_visibility.h" -#include "qthread/qpool.h" API_FUNC qpool *qpool_create_aligned(size_t const isize, size_t alignment) { /*{{{ */ diff --git a/src/ds/qswsrqueue.c b/src/ds/qswsrqueue.c index fed74fb74..736ed894e 100644 --- a/src/ds/qswsrqueue.c +++ b/src/ds/qswsrqueue.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* API */ #include #include diff --git a/src/envariables.c b/src/envariables.c index 8d4bb9d09..63083d15b 100644 --- a/src/envariables.c +++ b/src/envariables.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* for fprintf() */ #include /* for getenv() and strtoul() */ #include diff --git a/src/fastcontext/context.c b/src/fastcontext/context.c index f28efa41d..207b6ae65 100644 --- a/src/fastcontext/context.c +++ b/src/fastcontext/context.c @@ -2,10 +2,6 @@ */ /* Portions of this file are Copyright (c) 2006-2011 Sandia National * Laboratories */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include diff --git a/src/feb.c b/src/feb.c index d0ccf4847..ad7aca55c 100644 --- a/src/feb.c +++ b/src/feb.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif /* The API */ #include "qthread/qthread.h" diff --git a/src/hashmap.c b/src/hashmap.c index d9a3f366a..0b3f339ef 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/hazardptrs.c b/src/hazardptrs.c index 9ebe47a6e..7d4b7fcd9 100644 --- a/src/hazardptrs.c +++ b/src/hazardptrs.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* The API */ #include "qthread/qthread.h" diff --git a/src/io.c b/src/io.c index aae8c9be1..ce49afdcb 100644 --- a/src/io.c +++ b/src/io.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/lf_hashmap.c b/src/lf_hashmap.c index 3b44ff51b..d5099d401 100644 --- a/src/lf_hashmap.c +++ b/src/lf_hashmap.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include /* for malloc/free/etc */ diff --git a/src/locks.c b/src/locks.c index b55cb09c3..c519aa26f 100644 --- a/src/locks.c +++ b/src/locks.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include diff --git a/src/mpool.c b/src/mpool.c index 5c3c45065..f76504fbf 100644 --- a/src/mpool.c +++ b/src/mpool.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Includes */ #include diff --git a/src/patterns/allpairs.c b/src/patterns/allpairs.c index de7c819ce..9763edc10 100644 --- a/src/patterns/allpairs.c +++ b/src/patterns/allpairs.c @@ -3,9 +3,6 @@ #include /* for getpagesize() */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include #include diff --git a/src/patterns/wavefront.c b/src/patterns/wavefront.c index 350656480..1c5403956 100644 --- a/src/patterns/wavefront.c +++ b/src/patterns/wavefront.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include /* for malloc */ #include diff --git a/src/qalloc.c b/src/qalloc.c index 4a38546a0..7bc077dbc 100644 --- a/src/qalloc.c +++ b/src/qalloc.c @@ -1,22 +1,15 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #define _GNU_SOURCE +#include #include /* for open() */ #include #include /* for perror() */ #include /* for exit() */ +#include /* for memset() */ #include /* for mmap() */ #include /* for open() */ #include /* for mmap() */ #include /* for fstat() */ -#ifdef HAVE_INTTYPES_H -#include /* for funky print statements */ -#endif -#include -#include /* for memset() */ #include "qt_alloc.h" #include "qt_asserts.h" @@ -106,7 +99,7 @@ struct mapinfo_s { static struct mapinfo_s *mmaps = NULL; static struct dynmapinfo_s *dynmmaps = NULL; -#if defined(HAVE_FSTAT64) && defined(HAVE_LSEEK64) +#ifdef __GLIBC__ #define fstat fstat64 #define lseek lseek64 typedef struct stat64 statstruct_t; diff --git a/src/qloop.c b/src/qloop.c index 48f4e5f91..33bbd32d1 100644 --- a/src/qloop.c +++ b/src/qloop.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/qthread.c b/src/qthread.c index 57b6dc6c2..46a3cbb53 100644 --- a/src/qthread.c +++ b/src/qthread.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /******************************************************/ /* The API */ /******************************************************/ @@ -11,23 +7,17 @@ /* System Headers */ /******************************************************/ #include /* for INT_MAX */ +#include +#include #include /* for va_list, va_start() and va_end() */ #include #include #include #include /* for malloc() and abort() */ #include /* for memset() */ -#include /* for getpagesize() */ -#if !HAVE_MEMCPY -#define memcpy(d, s, n) bcopy((s), (d), (n)) -#define memmove(d, s, n) bcopy((s), (d), (n)) -#endif -#include #include #include -#ifdef HAVE_SCHED_H -#include -#endif +#include /* for getpagesize() */ #ifdef QTHREAD_USE_VALGRIND #include #endif diff --git a/src/qtimer/gethrtime.c b/src/qtimer/gethrtime.c index b96a33cc1..b2c930ccd 100644 --- a/src/qtimer/gethrtime.c +++ b/src/qtimer/gethrtime.c @@ -1,9 +1,7 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include +#include + #include #include "qt_alloc.h" @@ -23,14 +21,7 @@ void API_FUNC qtimer_stop(qtimer_t q) { q->stop = gethrtime(); } double qtimer_wtime(void) { return ((double)gethrtime()) * 1e-9; } -double qtimer_res(void) { -#if defined(HAVE_SYSCONF) && defined(HAVE_SC_CLK_TCK) - return 1.0 / sysconf(_SC_CLK_TCK); - ; -#else - return 1e-9; -#endif -} +double qtimer_res(void) { return 1.0 / sysconf(_SC_CLK_TCK); } double API_FUNC qtimer_secs(qtimer_t q) { return ((double)(q->stop - q->start)) * 1e-9; diff --git a/src/qtimer/gettime.c b/src/qtimer/gettime.c index aabdec184..b684bcd27 100644 --- a/src/qtimer/gettime.c +++ b/src/qtimer/gettime.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include diff --git a/src/qtimer/gettimeofday.c b/src/qtimer/gettimeofday.c index a5086c95b..67c96ee2b 100644 --- a/src/qtimer/gettimeofday.c +++ b/src/qtimer/gettimeofday.c @@ -1,10 +1,7 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include +#include #include @@ -30,14 +27,7 @@ double qtimer_wtime(void) { return s.tv_sec + (s.tv_usec * 1e-6); } -double qtimer_res(void) { -#if defined(HAVE_SYSCONF) && defined(HAVE_SC_CLK_TCK) - return 1.0 / sysconf(_SC_CLK_TCK); - ; -#else - return 1e-9; -#endif -} +double qtimer_res(void) { return 1.0 / sysconf(_SC_CLK_TCK); } void API_FUNC qtimer_stop(qtimer_t q) { gettimeofday(&(q->stop), NULL); } diff --git a/src/qtimer/mach.c b/src/qtimer/mach.c index 7ec42214d..a89867e73 100644 --- a/src/qtimer/mach.c +++ b/src/qtimer/mach.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include @@ -47,14 +43,7 @@ void API_FUNC qtimer_stop(qtimer_t q) { q->stop = mach_absolute_time(); } double qtimer_wtime(void) { return conversion * mach_absolute_time(); } -double qtimer_res(void) { -#if defined(HAVE_SYSCONF) && defined(HAVE_SC_CLK_TCK) - return 1.0 / sysconf(_SC_CLK_TCK); - ; -#else - return 1e-9; -#endif -} +double qtimer_res(void) { return 1.0 / sysconf(_SC_CLK_TCK); } double API_FUNC qtimer_secs(qtimer_t q) { uint64_t difference = q->stop - q->start; diff --git a/src/queue.c b/src/queue.c index e4357a38b..4e10b1526 100644 --- a/src/queue.c +++ b/src/queue.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "qthread/qthread.h" #include "qt_alloc.h" diff --git a/src/qutil.c b/src/qutil.c index 4a1daa436..9f2d57e76 100644 --- a/src/qutil.c +++ b/src/qutil.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/shepherds.c b/src/shepherds.c index dae4adec7..35e9d7732 100644 --- a/src/shepherds.c +++ b/src/shepherds.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include /* for random(), according to P2001 */ #include diff --git a/src/sincs/donecount.c b/src/sincs/donecount.c index b1cf48ce3..ee73680b0 100644 --- a/src/sincs/donecount.c +++ b/src/sincs/donecount.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/sincs/donecount_cas.c b/src/sincs/donecount_cas.c index 6a5b2e2e9..5455683de 100644 --- a/src/sincs/donecount_cas.c +++ b/src/sincs/donecount_cas.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/sincs/original.c b/src/sincs/original.c index 2e3da4632..d3a74c8d3 100644 --- a/src/sincs/original.c +++ b/src/sincs/original.c @@ -1,14 +1,7 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include #include -#if (HAVE_MEMALIGN && HAVE_MALLOC_H) -#include /* for memalign() */ -#endif /* API Headers */ #include "qthread/cacheline.h" diff --git a/src/sincs/snzi.c b/src/sincs/snzi.c index b0fa8bad4..780ccd7bd 100644 --- a/src/sincs/snzi.c +++ b/src/sincs/snzi.c @@ -1,13 +1,6 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include -#if (HAVE_MEMALIGN && HAVE_MALLOC_H) -#include /* for memalign() */ -#endif #include "qt_alloc.h" #include "qt_asserts.h" diff --git a/src/syncvar.c b/src/syncvar.c index 1de6b7b1b..83f8faf6c 100644 --- a/src/syncvar.c +++ b/src/syncvar.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include /* for INT_MAX */ #include diff --git a/src/syscalls/accept.c b/src/syscalls/accept.c index d56ee84ae..776177807 100644 --- a/src/syscalls/accept.c +++ b/src/syscalls/accept.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/connect.c b/src/syscalls/connect.c index 111f8a6f8..debebc47e 100644 --- a/src/syscalls/connect.c +++ b/src/syscalls/connect.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/poll.c b/src/syscalls/poll.c index f9be5f857..d21b98c64 100644 --- a/src/syscalls/poll.c +++ b/src/syscalls/poll.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include /* for SYS_accept and others */ diff --git a/src/syscalls/pread.c b/src/syscalls/pread.c index 133b59bf2..e83af90f5 100644 --- a/src/syscalls/pread.c +++ b/src/syscalls/pread.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/pwrite.c b/src/syscalls/pwrite.c index db0538687..23ceccd32 100644 --- a/src/syscalls/pwrite.c +++ b/src/syscalls/pwrite.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/read.c b/src/syscalls/read.c index 1de21984a..9d1f4b340 100644 --- a/src/syscalls/read.c +++ b/src/syscalls/read.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/select.c b/src/syscalls/select.c index 01347834c..9c1d065f5 100644 --- a/src/syscalls/select.c +++ b/src/syscalls/select.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/system.c b/src/syscalls/system.c index 2e2a4bfec..3bdc53762 100644 --- a/src/syscalls/system.c +++ b/src/syscalls/system.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/user_defined.c b/src/syscalls/user_defined.c index 547782bf0..1fc471e83 100644 --- a/src/syscalls/user_defined.c +++ b/src/syscalls/user_defined.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/wait4.c b/src/syscalls/wait4.c index 64a05af7a..bc69c54b4 100644 --- a/src/syscalls/wait4.c +++ b/src/syscalls/wait4.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/syscalls/write.c b/src/syscalls/write.c index d6d4bdf48..6b41139dc 100644 --- a/src/syscalls/write.c +++ b/src/syscalls/write.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include /* System Headers */ diff --git a/src/teams.c b/src/teams.c index a0ad0607e..60b14e326 100644 --- a/src/teams.c +++ b/src/teams.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* The API */ #include "qthread/qthread.h" diff --git a/src/threadqueues/distrib_threadqueues.c b/src/threadqueues/distrib_threadqueues.c index cb9fc9a8f..87d8dbb15 100644 --- a/src/threadqueues/distrib_threadqueues.c +++ b/src/threadqueues/distrib_threadqueues.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/threadqueues/nemesis_threadqueues.c b/src/threadqueues/nemesis_threadqueues.c index 85a27c5c0..5dc0e9f51 100644 --- a/src/threadqueues/nemesis_threadqueues.c +++ b/src/threadqueues/nemesis_threadqueues.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include diff --git a/src/threadqueues/sherwood_threadqueues.c b/src/threadqueues/sherwood_threadqueues.c index 513b5bb5b..5a1b5cccd 100644 --- a/src/threadqueues/sherwood_threadqueues.c +++ b/src/threadqueues/sherwood_threadqueues.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* System Headers */ #include #include @@ -901,11 +897,7 @@ qthread_steal(qthread_shepherd_t *thief_shepherd) { /*{{{*/ i++; i *= (i < qlib->nshepherds - 1); - if (i == 0) { -#if defined(HAVE_SCHED_YIELD) - sched_yield(); -#endif - } + if (i == 0) { sched_yield(); } SPINLOCK_BODY(); } thief_shepherd->stealing = 0; diff --git a/src/touch.c b/src/touch.c index 988678b14..a7ce6bd02 100644 --- a/src/touch.c +++ b/src/touch.c @@ -1,9 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* System Headers */ - /* Internal Headers */ #include "qt_qthread_mgmt.h" /* for qthread_internal_self() */ #include "qt_shepherd_innards.h" diff --git a/src/workers.c b/src/workers.c index 991ef77d9..f7846cb66 100644 --- a/src/workers.c +++ b/src/workers.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* The API */ #include "qthread/qthread.h" diff --git a/test/basics/aligned_prodcons.c b/test/basics/aligned_prodcons.c index 2d2d499c4..58204f985 100644 --- a/test/basics/aligned_prodcons.c +++ b/test/basics/aligned_prodcons.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/aligned_purge_basic.c b/test/basics/aligned_purge_basic.c index 05a885620..7fe0b26d2 100644 --- a/test/basics/aligned_purge_basic.c +++ b/test/basics/aligned_purge_basic.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/aligned_purge_wakes.c b/test/basics/aligned_purge_wakes.c index a96957fa2..da686879f 100644 --- a/test/basics/aligned_purge_wakes.c +++ b/test/basics/aligned_purge_wakes.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/aligned_readXX_basic.c b/test/basics/aligned_readXX_basic.c index 28a4d5c12..a8774e8da 100644 --- a/test/basics/aligned_readXX_basic.c +++ b/test/basics/aligned_readXX_basic.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/aligned_writeFF_basic.c b/test/basics/aligned_writeFF_basic.c index bba389a78..3937467a0 100644 --- a/test/basics/aligned_writeFF_basic.c +++ b/test/basics/aligned_writeFF_basic.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/aligned_writeFF_waits.c b/test/basics/aligned_writeFF_waits.c index 9b1b5224c..147f64214 100644 --- a/test/basics/aligned_writeFF_waits.c +++ b/test/basics/aligned_writeFF_waits.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/hello_world.c b/test/basics/hello_world.c index 9083ec807..108804bea 100644 --- a/test/basics/hello_world.c +++ b/test/basics/hello_world.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/hello_world_multi.c b/test/basics/hello_world_multi.c index a73630ccf..89e96c246 100644 --- a/test/basics/hello_world_multi.c +++ b/test/basics/hello_world_multi.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/qalloc.c b/test/basics/qalloc.c index 011960ff1..3a22a4f72 100644 --- a/test/basics/qalloc.c +++ b/test/basics/qalloc.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include diff --git a/test/basics/qthread_cacheline.c b/test/basics/qthread_cacheline.c index e8d41f8f1..ae47cd9a8 100644 --- a/test/basics/qthread_cacheline.c +++ b/test/basics/qthread_cacheline.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif #include "argparsing.h" #include #include diff --git a/test/basics/qthread_fork_precond.c b/test/basics/qthread_fork_precond.c index 9db47e8c8..fc0833c0b 100644 --- a/test/basics/qthread_fork_precond.c +++ b/test/basics/qthread_fork_precond.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/qthread_fp.c b/test/basics/qthread_fp.c index 959f52671..e6ce39618 100644 --- a/test/basics/qthread_fp.c +++ b/test/basics/qthread_fp.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include diff --git a/test/basics/qthread_fp_double.c b/test/basics/qthread_fp_double.c index 09a63d5b7..aaecebece 100644 --- a/test/basics/qthread_fp_double.c +++ b/test/basics/qthread_fp_double.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include diff --git a/test/basics/qthread_readstate.c b/test/basics/qthread_readstate.c index ece06dbf3..74de831f1 100644 --- a/test/basics/qthread_readstate.c +++ b/test/basics/qthread_readstate.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/qthread_stackleft.c b/test/basics/qthread_stackleft.c index db3ac9c86..d591bc509 100644 --- a/test/basics/qthread_stackleft.c +++ b/test/basics/qthread_stackleft.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "argparsing.h" #include #include diff --git a/test/basics/qthread_timer_wait.c b/test/basics/qthread_timer_wait.c index 80ed7e9fa..627b37baa 100644 --- a/test/basics/qthread_timer_wait.c +++ b/test/basics/qthread_timer_wait.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "qthread/qtimer.h" #include #include diff --git a/test/basics/sinc.c b/test/basics/sinc.c index 0b03f0319..0e9f5a043 100644 --- a/test/basics/sinc.c +++ b/test/basics/sinc.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/sinc_null.c b/test/basics/sinc_null.c index dd49583d6..300d8e94c 100644 --- a/test/basics/sinc_null.c +++ b/test/basics/sinc_null.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/test_subteams.c b/test/basics/test_subteams.c index 4050979f9..62f1d5310 100644 --- a/test/basics/test_subteams.c +++ b/test/basics/test_subteams.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/basics/test_teams.c b/test/basics/test_teams.c index 5bf059a37..c5b5e95f0 100644 --- a/test/basics/test_teams.c +++ b/test/basics/test_teams.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/generic/time_gcd.c b/test/benchmarks/generic/time_gcd.c index 758c3cbda..116ff2606 100644 --- a/test/benchmarks/generic/time_gcd.c +++ b/test/benchmarks/generic/time_gcd.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "argparsing.h" #include "qt_gcd.h" #include diff --git a/test/benchmarks/generic/time_qt_loopaccums.c b/test/benchmarks/generic/time_qt_loopaccums.c index 8cf311e30..f17e0b5c3 100644 --- a/test/benchmarks/generic/time_qt_loopaccums.c +++ b/test/benchmarks/generic/time_qt_loopaccums.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include // for DBL_MAX, from C89 diff --git a/test/benchmarks/generic/time_qt_loops.c b/test/benchmarks/generic/time_qt_loops.c index a89a21104..142d98778 100644 --- a/test/benchmarks/generic/time_qt_loops.c +++ b/test/benchmarks/generic/time_qt_loops.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mt/time_cilk_eager_future.c b/test/benchmarks/mt/time_cilk_eager_future.c index ff7813021..6e840b710 100644 --- a/test/benchmarks/mt/time_cilk_eager_future.c +++ b/test/benchmarks/mt/time_cilk_eager_future.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/mt/time_cilk_task_spawn.c b/test/benchmarks/mt/time_cilk_task_spawn.c index 794808d12..4bf7941f3 100644 --- a/test/benchmarks/mt/time_cilk_task_spawn.c +++ b/test/benchmarks/mt/time_cilk_task_spawn.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/mt/time_eager_future.c b/test/benchmarks/mt/time_eager_future.c index 2668885b4..a863f520d 100644 --- a/test/benchmarks/mt/time_eager_future.c +++ b/test/benchmarks/mt/time_eager_future.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/mt/time_omp_eager_future.c b/test/benchmarks/mt/time_omp_eager_future.c index 44bb4dffb..530c0982a 100644 --- a/test/benchmarks/mt/time_omp_eager_future.c +++ b/test/benchmarks/mt/time_omp_eager_future.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/mt/time_omp_task_spawn.c b/test/benchmarks/mt/time_omp_task_spawn.c index 4b65ebe6c..26eed4dbc 100644 --- a/test/benchmarks/mt/time_omp_task_spawn.c +++ b/test/benchmarks/mt/time_omp_task_spawn.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/mt/time_task_spawn.c b/test/benchmarks/mt/time_task_spawn.c index 97ca27700..6dffb9e96 100644 --- a/test/benchmarks/mt/time_task_spawn.c +++ b/test/benchmarks/mt/time_task_spawn.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/mt/time_tbb_eager_future.cc b/test/benchmarks/mt/time_tbb_eager_future.cc index d1a16ca77..3fb0b4768 100644 --- a/test/benchmarks/mt/time_tbb_eager_future.cc +++ b/test/benchmarks/mt/time_tbb_eager_future.cc @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/mt/time_tbb_task_spawn.cc b/test/benchmarks/mt/time_tbb_task_spawn.cc index b0581abba..bd031f627 100644 --- a/test/benchmarks/mt/time_tbb_task_spawn.cc +++ b/test/benchmarks/mt/time_tbb_task_spawn.cc @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/mtaap08/time_chain_bench.c b/test/benchmarks/mtaap08/time_chain_bench.c index 2a54b83fa..409e87acf 100644 --- a/test/benchmarks/mtaap08/time_chain_bench.c +++ b/test/benchmarks/mtaap08/time_chain_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_chain_bench_pthread.c b/test/benchmarks/mtaap08/time_chain_bench_pthread.c index e3cbd0db2..b1411e682 100644 --- a/test/benchmarks/mtaap08/time_chain_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_chain_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_cncthr_bench.c b/test/benchmarks/mtaap08/time_cncthr_bench.c index 1011ef1e3..db4af0c04 100644 --- a/test/benchmarks/mtaap08/time_cncthr_bench.c +++ b/test/benchmarks/mtaap08/time_cncthr_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_cncthr_bench_pthread.c b/test/benchmarks/mtaap08/time_cncthr_bench_pthread.c index d444766c0..78ca8bd0b 100644 --- a/test/benchmarks/mtaap08/time_cncthr_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_cncthr_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_incr_bench.c b/test/benchmarks/mtaap08/time_incr_bench.c index 4d0e43684..7941cfedb 100644 --- a/test/benchmarks/mtaap08/time_incr_bench.c +++ b/test/benchmarks/mtaap08/time_incr_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_incr_bench_pthread.c b/test/benchmarks/mtaap08/time_incr_bench_pthread.c index 9a068bfad..1b3a59961 100644 --- a/test/benchmarks/mtaap08/time_incr_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_incr_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_lul_bench.c b/test/benchmarks/mtaap08/time_lul_bench.c index 67d5dbcd8..dc5a2e829 100644 --- a/test/benchmarks/mtaap08/time_lul_bench.c +++ b/test/benchmarks/mtaap08/time_lul_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_lul_bench_pthread.c b/test/benchmarks/mtaap08/time_lul_bench_pthread.c index 088c98530..40f7d985d 100644 --- a/test/benchmarks/mtaap08/time_lul_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_lul_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_mutex_bench.c b/test/benchmarks/mtaap08/time_mutex_bench.c index 80562210c..b96503c6e 100644 --- a/test/benchmarks/mtaap08/time_mutex_bench.c +++ b/test/benchmarks/mtaap08/time_mutex_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_mutex_bench_pthread.c b/test/benchmarks/mtaap08/time_mutex_bench_pthread.c index 292fd2090..db36211b9 100644 --- a/test/benchmarks/mtaap08/time_mutex_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_mutex_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_spin_bench.c b/test/benchmarks/mtaap08/time_spin_bench.c index 48f0de767..d768d4dc6 100644 --- a/test/benchmarks/mtaap08/time_spin_bench.c +++ b/test/benchmarks/mtaap08/time_spin_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_spin_bench_pthread.c b/test/benchmarks/mtaap08/time_spin_bench_pthread.c index a03a31270..8b924dca0 100644 --- a/test/benchmarks/mtaap08/time_spin_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_spin_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_thrcrt_bench.c b/test/benchmarks/mtaap08/time_thrcrt_bench.c index c470dc298..1f870371a 100644 --- a/test/benchmarks/mtaap08/time_thrcrt_bench.c +++ b/test/benchmarks/mtaap08/time_thrcrt_bench.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/mtaap08/time_thrcrt_bench_pthread.c b/test/benchmarks/mtaap08/time_thrcrt_bench_pthread.c index faab5c34d..f63880b84 100644 --- a/test/benchmarks/mtaap08/time_thrcrt_bench_pthread.c +++ b/test/benchmarks/mtaap08/time_thrcrt_bench_pthread.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/pmea09/time_qlfqueue.c b/test/benchmarks/pmea09/time_qlfqueue.c index a467397b6..bb088560b 100644 --- a/test/benchmarks/pmea09/time_qlfqueue.c +++ b/test/benchmarks/pmea09/time_qlfqueue.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include #include diff --git a/test/benchmarks/pmea09/time_qpool.c b/test/benchmarks/pmea09/time_qpool.c index a9957a310..4d7e42e9c 100644 --- a/test/benchmarks/pmea09/time_qpool.c +++ b/test/benchmarks/pmea09/time_qpool.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/sc12/spawn_parallel_cilk.c b/test/benchmarks/sc12/spawn_parallel_cilk.c index 205739cb1..85ef9530f 100644 --- a/test/benchmarks/sc12/spawn_parallel_cilk.c +++ b/test/benchmarks/sc12/spawn_parallel_cilk.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_parallel_omp.c b/test/benchmarks/sc12/spawn_parallel_omp.c index 6ca09185d..bea1f1489 100644 --- a/test/benchmarks/sc12/spawn_parallel_omp.c +++ b/test/benchmarks/sc12/spawn_parallel_omp.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_parallel_qthreads.c b/test/benchmarks/sc12/spawn_parallel_qthreads.c index a375a26b3..477f50830 100644 --- a/test/benchmarks/sc12/spawn_parallel_qthreads.c +++ b/test/benchmarks/sc12/spawn_parallel_qthreads.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_parallel_tbb.cc b/test/benchmarks/sc12/spawn_parallel_tbb.cc index 04d4d8abb..71966abd5 100644 --- a/test/benchmarks/sc12/spawn_parallel_tbb.cc +++ b/test/benchmarks/sc12/spawn_parallel_tbb.cc @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_sequential_cilk.c b/test/benchmarks/sc12/spawn_sequential_cilk.c index bab5587fe..a0d9b0b6d 100644 --- a/test/benchmarks/sc12/spawn_sequential_cilk.c +++ b/test/benchmarks/sc12/spawn_sequential_cilk.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_sequential_omp.c b/test/benchmarks/sc12/spawn_sequential_omp.c index 947acfff7..5dce44de6 100644 --- a/test/benchmarks/sc12/spawn_sequential_omp.c +++ b/test/benchmarks/sc12/spawn_sequential_omp.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_sequential_qthreads.c b/test/benchmarks/sc12/spawn_sequential_qthreads.c index 7514cc472..e3636e193 100644 --- a/test/benchmarks/sc12/spawn_sequential_qthreads.c +++ b/test/benchmarks/sc12/spawn_sequential_qthreads.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/spawn_sequential_tbb.cc b/test/benchmarks/sc12/spawn_sequential_tbb.cc index 7f3384cbb..1f9a6f83a 100644 --- a/test/benchmarks/sc12/spawn_sequential_tbb.cc +++ b/test/benchmarks/sc12/spawn_sequential_tbb.cc @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/uts_cilk.c b/test/benchmarks/sc12/uts_cilk.c index 1da248aac..8e2bb4413 100644 --- a/test/benchmarks/sc12/uts_cilk.c +++ b/test/benchmarks/sc12/uts_cilk.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/sc12/uts_omp.c b/test/benchmarks/sc12/uts_omp.c index 4b99b6e5e..a8801102c 100644 --- a/test/benchmarks/sc12/uts_omp.c +++ b/test/benchmarks/sc12/uts_omp.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include /* for INT_MAX */ #include /* for floor, log, sin */ diff --git a/test/benchmarks/sc12/uts_qthreads.c b/test/benchmarks/sc12/uts_qthreads.c index 0b44f5b9c..01c8d2277 100644 --- a/test/benchmarks/sc12/uts_qthreads.c +++ b/test/benchmarks/sc12/uts_qthreads.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include /* for INT_MAX */ #include /* for floor, log, sin */ diff --git a/test/benchmarks/sc12/uts_tbb.cc b/test/benchmarks/sc12/uts_tbb.cc index ae82450a8..f27f07598 100644 --- a/test/benchmarks/sc12/uts_tbb.cc +++ b/test/benchmarks/sc12/uts_tbb.cc @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/benchmarks/thesis/time_allpairs.c b/test/benchmarks/thesis/time_allpairs.c index 7830a3b51..780988ef0 100644 --- a/test/benchmarks/thesis/time_allpairs.c +++ b/test/benchmarks/thesis/time_allpairs.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/benchmarks/thesis/time_qutil_qsort.c b/test/benchmarks/thesis/time_qutil_qsort.c index 98d97a897..57931787b 100644 --- a/test/benchmarks/thesis/time_qutil_qsort.c +++ b/test/benchmarks/thesis/time_qutil_qsort.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include /* for DBL_EPSILON (according to C89) */ #include /* for INT_MIN & friends (according to C89) */ diff --git a/test/benchmarks/uts/time_uts_aligned.c b/test/benchmarks/uts/time_uts_aligned.c index 22fd65bc4..f2be678c0 100644 --- a/test/benchmarks/uts/time_uts_aligned.c +++ b/test/benchmarks/uts/time_uts_aligned.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_cilk.c b/test/benchmarks/uts/time_uts_cilk.c index 19c2d6ba3..63b5cdf21 100644 --- a/test/benchmarks/uts/time_uts_cilk.c +++ b/test/benchmarks/uts/time_uts_cilk.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/benchmarks/uts/time_uts_donecount.c b/test/benchmarks/uts/time_uts_donecount.c index b5e064260..8aa576308 100644 --- a/test/benchmarks/uts/time_uts_donecount.c +++ b/test/benchmarks/uts/time_uts_donecount.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_donecount2.c b/test/benchmarks/uts/time_uts_donecount2.c index 81d6caf66..d7e5b3342 100644 --- a/test/benchmarks/uts/time_uts_donecount2.c +++ b/test/benchmarks/uts/time_uts_donecount2.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_donecount3.c b/test/benchmarks/uts/time_uts_donecount3.c index 8a610dddc..0417a5b96 100644 --- a/test/benchmarks/uts/time_uts_donecount3.c +++ b/test/benchmarks/uts/time_uts_donecount3.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_sinc.c b/test/benchmarks/uts/time_uts_sinc.c index fbd551582..c07522702 100644 --- a/test/benchmarks/uts/time_uts_sinc.c +++ b/test/benchmarks/uts/time_uts_sinc.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_syncvar.c b/test/benchmarks/uts/time_uts_syncvar.c index ff96f0f40..ea10898a9 100644 --- a/test/benchmarks/uts/time_uts_syncvar.c +++ b/test/benchmarks/uts/time_uts_syncvar.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include /* for INT_MAX */ diff --git a/test/benchmarks/uts/time_uts_tbb.cc b/test/benchmarks/uts/time_uts_tbb.cc index 5e07ce8eb..95bcc7388 100644 --- a/test/benchmarks/uts/time_uts_tbb.cc +++ b/test/benchmarks/uts/time_uts_tbb.cc @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include #include diff --git a/test/features/allpairs.c b/test/features/allpairs.c index 130cfcbb2..3959a54b0 100644 --- a/test/features/allpairs.c +++ b/test/features/allpairs.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qloop_utils.c b/test/features/qloop_utils.c index cbb12d079..541991ee5 100644 --- a/test/features/qloop_utils.c +++ b/test/features/qloop_utils.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include /* for DBL_MIN & friends (according to C89) */ #include /* for INT_MIN & friends (according to C89) */ diff --git a/test/features/qt_loop.c b/test/features/qt_loop.c index 137e4ad60..4faab4e3b 100644 --- a/test/features/qt_loop.c +++ b/test/features/qt_loop.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qt_loop_balance.c b/test/features/qt_loop_balance.c index 5da9f060f..15e800148 100644 --- a/test/features/qt_loop_balance.c +++ b/test/features/qt_loop_balance.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qt_loop_balance_simple.c b/test/features/qt_loop_balance_simple.c index 02bdb7f3e..9470bb11f 100644 --- a/test/features/qt_loop_balance_simple.c +++ b/test/features/qt_loop_balance_simple.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qt_loop_balance_sinc.c b/test/features/qt_loop_balance_sinc.c index 55e0f88c9..49799f519 100644 --- a/test/features/qt_loop_balance_sinc.c +++ b/test/features/qt_loop_balance_sinc.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qt_loop_queue.c b/test/features/qt_loop_queue.c index ddb4bef22..65931149d 100644 --- a/test/features/qt_loop_queue.c +++ b/test/features/qt_loop_queue.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include /* for DBL_MIN & friends (according to C89) */ #include /* for INT_MIN & friends (according to C89) */ diff --git a/test/features/qt_loop_simple.c b/test/features/qt_loop_simple.c index ec526efab..64d5d1a55 100644 --- a/test/features/qt_loop_simple.c +++ b/test/features/qt_loop_simple.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qt_loop_sinc.c b/test/features/qt_loop_sinc.c index a49c07929..81aa5912e 100644 --- a/test/features/qt_loop_sinc.c +++ b/test/features/qt_loop_sinc.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include "argparsing.h" #include #include diff --git a/test/features/qutil.c b/test/features/qutil.c index ea5218e87..1427c6173 100644 --- a/test/features/qutil.c +++ b/test/features/qutil.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif #include /* for DBL_EPSILON (according to C89) */ #include /* for INT_MIN & friends (according to C89) */ #include /* for fabs() */ diff --git a/test/features/qutil_qsort.c b/test/features/qutil_qsort.c index 1a1b7d561..1fd196a45 100644 --- a/test/features/qutil_qsort.c +++ b/test/features/qutil_qsort.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include /* for DBL_EPSILON (according to C89) */ #include /* for INT_MIN & friends (according to C89) */ #include /* for fabs() */ diff --git a/test/features/subteams.c b/test/features/subteams.c index 52c6ff4d8..e6aa2aa7b 100644 --- a/test/features/subteams.c +++ b/test/features/subteams.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include #include "argparsing.h" diff --git a/test/stress/precond_spawn_simple.c b/test/stress/precond_spawn_simple.c index fbfe35e17..a10106249 100644 --- a/test/stress/precond_spawn_simple.c +++ b/test/stress/precond_spawn_simple.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/stress/subteams_uts.c b/test/stress/subteams_uts.c index b59c870d0..c5f2f96de 100644 --- a/test/stress/subteams_uts.c +++ b/test/stress/subteams_uts.c @@ -4,10 +4,6 @@ * http://sourceforge.net/projects/uts-benchmark * ******************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include /* for INT_MAX */ #include /* for floor, log, sin */ diff --git a/test/stress/task_spawn.c b/test/stress/task_spawn.c index ac2ab1843..1a44f4ede 100644 --- a/test/stress/task_spawn.c +++ b/test/stress/task_spawn.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include diff --git a/test/stress/test_spawn_simple.c b/test/stress/test_spawn_simple.c index 29a5689e0..68a6cae27 100644 --- a/test/stress/test_spawn_simple.c +++ b/test/stress/test_spawn_simple.c @@ -1,7 +1,3 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" /* for _GNU_SOURCE */ -#endif - #include "argparsing.h" #include #include From 42cbfd7d5f7ee9f0a84eb117a37922964fceaae2 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Thu, 9 Jan 2025 15:46:53 -0700 Subject: [PATCH 14/14] Properly pipe CI debug/release build type into CMake. --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0125fb819..2f89ecf80 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -219,7 +219,7 @@ jobs: image: [macos-15, macos-13] # Test on both ARM and X86 scheduler: [nemesis, sherwood, distrib] topology: [hwloc, binders, no] - use_asserts: [true, false] + build_type: [Release, Debug] compiler: [gcc, clang] runs-on: ${{ matrix.image }} env: @@ -241,7 +241,7 @@ jobs: export LDFLAGS="-L$(brew --prefix)/lib $LDFLAGS" mkdir build pushd build - cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. make -j3 VERBOSE=1 popd - name: run tests @@ -324,7 +324,7 @@ jobs: scheduler: [nemesis, sherwood, distrib] topology: [hwloc, binders, no] use_libcxx: [false] # disable testing on libcxx since its effect seems very limited for now. - use_asserts: [true, false] + build_type: [Release, Debug] exclude: - compiler: gcc use_libcxx: true @@ -352,7 +352,7 @@ jobs: run: | mkdir build pushd build - cmake -DCMAKE_BUILD_TYPE=Release -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DQTHREADS_SCHEDULER=${{ matrix.scheduler }} -DQTHREADS_TOPOLOGY=${{ matrix.topology }} .. make -j2 VERBOSE=1 popd - name: run tests