Commit c0581c38 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

Merge branch 'add-valgrind-checks' into 'staging'

Add valgrind checks to the CI

See merge request !143
parents 59bc7f76 8118a940
Pipeline #10960 passed with stages
in 3 minutes and 25 seconds
......@@ -118,6 +118,33 @@ make:out-of-tree:
- config.log
- tests/*.log
make:valgrind:
tags:
- nix
- kvm
stage: build
except:
- /^wip.*/
- /^WIP.*/
variables:
CFLAGS: "-std=c99 -pedantic -Wall -Wextra -Werror -Wno-unused-but-set-parameter -Wno-builtin-declaration-mismatch"
VERBOSE: "1"
OMP_NUM_THREADS: "1"
script:
- |
nix-shell --run bash <<< '
./autogen.sh
mkdir build
./configure --prefix=`pwd`/build --enable-valgrind
make
make check-valgrind
'
artifacts:
when: on_failure
paths:
- config.log
- tests/*.log
make:knl:
stage: build
except:
......
......@@ -18,12 +18,8 @@ AM_CFLAGS += $(HWLOC_CFLAGS)
AM_LDFLAGS += $(HWLOC_LIBS)
endif
if HAVE_CUDA
LIBS += $(CUDA_CFLAGS)
LIBS += $(CUDA_LIBS)
AM_CFLAGS += $(CUDA_CFLAGS)
AM_LDFLAGS += $(CUDA_LIBS)
endif
# valgrind support
@VALGRIND_CHECK_RULES@
noinst_LIBRARIES = libkernel.a
libkernel_a_SOURCES = utils.c utils.h blas_l1_kernel.c blas_l1_kernel.h verify_blas_l1.c verify_blas_l1.h
......
......@@ -25,7 +25,7 @@
/* Look into another way to define these parameters */
#define DEFAULT_ARRAY_SIZE (1UL << 20)
#define DEFAULT_ARRAY_SIZE (1UL << 15)
#ifdef NTIMES
#if NTIMES <= 1
......@@ -44,8 +44,6 @@
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
extern int omp_get_num_threads(void);
static double *a, *b, *c;
typedef double (*r)(size_t, double *, double *, double *, double);
......
......@@ -10,7 +10,6 @@
#include <assert.h>
#include <errno.h>
#include <omp.h>
#include <stdio.h>
#include <unistd.h>
......@@ -49,8 +48,6 @@
#define abs(a) ((a) >= 0 ? (a) : -(a))
#endif
extern int omp_get_num_threads(void);
static double *pt;
double run_dasum(size_t tilesize,
......@@ -227,7 +224,7 @@ double run_idmax(size_t tilesize,
#pragma omp parallel
{
double local_max;
double local_max = -DBL_MAX;
size_t local_maxid;
#pragma omp parallel for
for (size_t i = 0; i < ntiles; i++) {
......
......@@ -17,6 +17,12 @@
#ifndef AML_BENCHS_UTILS_H
#define AML_BENCHS_UTILS_H 1
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_num_threads() 1
#endif
void log_init(const char *nm);
void log_msg(const char *level, unsigned int line, const char *fmt, ...);
double mysecond(void);
......
......@@ -158,7 +158,7 @@ main(void)
aml_layout_destroy(&a_layout);
aml_layout_destroy(&b_layout);
aml_layout_destroy(&a_continuous_layout);
aml_layout_destroy(&a_continuous_layout);
aml_layout_destroy(&b_continuous_layout);
aml_dma_linux_par_destroy(&dma);
return 0;
......
......@@ -126,6 +126,7 @@ int main(int argc, char **argv)
aml_layout_destroy(&lay_part);
aml_layout_destroy(&layout_elements);
aml_layout_destroy(&new_layout);
aml_layout_destroy(&layout_energy);
aml_area_munmap(area, particles, sizeof(struct particle) * size);
free(array_coords);
......
......@@ -100,7 +100,10 @@ int dgemm_tiled(struct aml_tiling *tiling_a, struct aml_tiling *tiling_b,
(size_t[]){l, j});
dgemm_layout(mt, nt, kt, ltile_a, ltile_b,
ltile_c);
aml_layout_destroy(&ltile_a);
aml_layout_destroy(&ltile_b);
}
aml_layout_destroy(&ltile_c);
}
}
return AML_SUCCESS;
......@@ -183,6 +186,7 @@ int main(int argc, char **argv)
free(a);
free(b);
free(c);
free(c_ref);
aml_finalize();
......
......@@ -220,8 +220,12 @@ int aml_layout_reshape_column_fprintf(const struct aml_layout_data *data,
fprintf(stream, "%s: ndims: %zu\n", prefix, d->ndims);
fprintf(stream, "%s: target-ndims: %zu\n", prefix, d->target_ndims);
for (size_t i = 0; i < d->ndims; i++) {
fprintf(stream, "%s: %16zu: %16zu %16zu %16zu\n", prefix,
i, d->dims[i], d->coffsets[i], d->target_dims[i]);
fprintf(stream, "%s: %16zu: %16zu %16zu\n", prefix, i,
d->dims[i], d->coffsets[i]);
}
for (size_t i = 0; i < d->target_ndims; i++) {
fprintf(stream, "%s: %16zu: %16zu\n", prefix, i,
d->target_dims[i]);
}
fprintf(stream, "%s: target: begin\n", prefix);
aml_layout_fprintf(stream, prefix, d->target);
......@@ -306,9 +310,14 @@ int aml_layout_reshape_row_fprintf(const struct aml_layout_data *data,
for (size_t i = 0; i < d->ndims; i++) {
size_t j = d->ndims - i - 1;
fprintf(stream, "%s: %16zu: %16zu %16zu %16zu\n", prefix,
i, d->dims[j], d->coffsets[j], d->target_dims[j]);
fprintf(stream, "%s: %16zu: %16zu %16zu\n", prefix, i,
d->dims[j], d->coffsets[j]);
}
for (size_t i = 0; i < d->target_ndims; i++) {
fprintf(stream, "%s: %16zu: %16zu\n", prefix, i,
d->target_dims[i]);
}
fprintf(stream, "%s: target: begin\n", prefix);
aml_layout_fprintf(stream, prefix, d->target);
fprintf(stream, "%s: target: end\n", prefix);
......
......@@ -409,7 +409,7 @@ void aml_active_sched_destroy(struct aml_sched **sched)
{
struct aml_active_sched *data;
if (sched == NULL || *sched != NULL)
if (sched == NULL || *sched == NULL)
return;
data = (struct aml_active_sched *) (*sched)->data;
......
......@@ -150,5 +150,6 @@ int main(void)
test_multiple_nodes();
close(fd);
numa_bitmask_free(nodeset);
return 0;
}
......@@ -24,11 +24,11 @@
struct aml_task_out *aml_task_mockup_work(struct aml_task_in *in)
{
(void)in;
struct timespec us;
long int us = 1000 * (rand() % 10);
long int count = 0;
for (long int i = 0; i < us; i++)
count += i ^ (count + i * 42);
us.tv_sec = 0;
us.tv_nsec = 1000 * (rand() % 10);
nanosleep(&us, NULL);
return NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment