Commit 4d0fa3d6 authored by Nicolas Denoyelle's avatar Nicolas Denoyelle Committed by Swann Perarnau

[refactor] redesign areas

parent 36bc84c1
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = jemalloc src include tests
SUBDIRS = src include tests
if ADD_BENCHMARKS
SUBDIRS += benchmarks
......@@ -8,12 +8,4 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = aml.pc
# remove jemalloc tests from make check
check-recursive:
$(MAKE) -C tests check
install-recursive:
$(MAKE) -C src install
$(MAKE) install-am
EXTRA_DIST = autogen.sh aml.pc README.markdown
#!/bin/sh
set -ex
# jemalloc
(cd jemalloc; ./autogen.sh)
# aml
mkdir -p build-aux
aclocal -I m4
autoheader
libtoolize
automake --add-missing --copy
autoconf
autoreconf -fi
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/area/linux.h"
#include <assert.h>
#include <errno.h>
#include <mkl.h>
......@@ -22,35 +23,27 @@
int main(int argc, char *argv[])
{
AML_ARENA_JEMALLOC_DECL(arns);
AML_ARENA_JEMALLOC_DECL(arnf);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
struct bitmask *slowb, *fastb;
struct aml_area *slow, *fast;
struct aml_bitmap slowb, fastb;
struct timespec start, stop;
double *a, *b, *c;
aml_init(&argc, &argv);
assert(argc == 4);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
long int N = atol(argv[3]);
unsigned long memsize = sizeof(double)*N*N;
assert(!aml_arena_jemalloc_init(&arns, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arns, MPOL_BIND, slowb->maskp));
assert(!aml_arena_jemalloc_init(&arnf, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&fast,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arnf, MPOL_BIND, fastb->maskp));
a = aml_area_malloc(&slow, memsize);
b = aml_area_malloc(&slow, memsize);
c = aml_area_malloc(&fast, memsize);
slow = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&slowb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(slow != NULL);
fast = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&fastb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(fast != NULL);
a = aml_area_mmap(slow, NULL, memsize);
b = aml_area_mmap(slow, NULL, memsize);
c = aml_area_mmap(fast, NULL, memsize);
assert(a != NULL && b != NULL && c != NULL);
double alpha = 1.0, beta = 1.0;
......@@ -69,11 +62,11 @@ int main(int argc, char *argv[])
double flops = (2.0*N*N*N)/(time/1e9);
/* print the flops in GFLOPS */
printf("dgemm-mkl: %llu %lld %lld %f\n", N, memsize, time, flops/1e9);
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&fast, c);
aml_area_linux_destroy(&slow);
aml_area_linux_destroy(&fast);
aml_area_munmap(slow, a, memsize);
aml_area_munmap(slow, b, memsize);
aml_area_munmap(fast, c, memsize);
aml_area_linux_destroy(slow);
aml_area_linux_destroy(fast);
aml_finalize();
return 0;
}
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/area/linux.h"
#include <assert.h>
#include <errno.h>
#include <mkl.h>
......@@ -21,9 +22,7 @@
AML_TILING_2D_ROWMAJOR_DECL(tiling_row);
AML_TILING_2D_COLMAJOR_DECL(tiling_col);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
struct aml_area *slow, *fast;
size_t memsize, tilesize, N, T;
double *a, *b, *c;
struct timespec start, stop;
......@@ -59,13 +58,11 @@ void do_work()
int main(int argc, char* argv[])
{
AML_ARENA_JEMALLOC_DECL(arns);
AML_ARENA_JEMALLOC_DECL(arnf);
struct bitmask *slowb, *fastb;
struct aml_bitmap slowb, fastb;
aml_init(&argc, &argv);
assert(argc == 5);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
N = atol(argv[3]);
T = atol(argv[4]);
/* let's not handle messy tile sizes */
......@@ -79,22 +76,17 @@ int main(int argc, char* argv[])
assert(!aml_tiling_init(&tiling_col, AML_TILING_TYPE_2D_COLMAJOR,
tilesize, memsize, N/T , N/T));
assert(!aml_arena_jemalloc_init(&arns, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arns, MPOL_BIND, slowb->maskp));
assert(!aml_arena_jemalloc_init(&arnf, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&fast,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arnf, MPOL_BIND, fastb->maskp));
slow = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&slowb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(slow != NULL);
fast = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&fastb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(fast != NULL);
/* allocation */
a = aml_area_malloc(&slow, memsize);
b = aml_area_malloc(&slow, memsize);
c = aml_area_malloc(&fast, memsize);
a = aml_area_mmap(slow, NULL, memsize);
b = aml_area_mmap(slow, NULL, memsize);
c = aml_area_mmap(fast, NULL, memsize);
assert(a != NULL && b != NULL && c != NULL);
size_t ntilerows, ntilecols, tilerowsize, tilecolsize, rowsize, colsize;
......@@ -158,11 +150,11 @@ int main(int argc, char* argv[])
/* print the flops in GFLOPS */
printf("dgemm-noprefetch: %llu %lld %lld %f\n", N, memsize, time,
flops/1e9);
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&fast, c);
aml_area_linux_destroy(&slow);
aml_area_linux_destroy(&fast);
aml_area_munmap(slow, a, memsize);
aml_area_munmap(slow, b, memsize);
aml_area_munmap(fast, c, memsize);
aml_area_linux_destroy(slow);
aml_area_linux_destroy(fast);
aml_tiling_destroy(&tiling_row, AML_TILING_TYPE_2D_ROWMAJOR);
aml_tiling_destroy(&tiling_col, AML_TILING_TYPE_2D_ROWMAJOR);
aml_finalize();
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include <assert.h>
......@@ -24,11 +25,10 @@
AML_TILING_2D_ROWMAJOR_DECL(tiling_row);
AML_TILING_2D_COLMAJOR_DECL(tiling_col);
AML_TILING_1D_DECL(tiling_prefetch);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
AML_SCRATCH_PAR_DECL(sa);
AML_SCRATCH_PAR_DECL(sb);
struct aml_area *slow, *fast;
size_t memsize, tilesize, N, T;
double *a, *b, *c;
struct timespec start, stop;
......@@ -81,14 +81,12 @@ void do_work()
int main(int argc, char* argv[])
{
AML_ARENA_JEMALLOC_DECL(arns);
AML_ARENA_JEMALLOC_DECL(arnf);
AML_DMA_LINUX_SEQ_DECL(dma);
struct bitmask *slowb, *fastb;
struct aml_bitmap slowb, fastb;
aml_init(&argc, &argv);
assert(argc == 5);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
N = atol(argv[3]);
T = atol(argv[4]);
/* let's not handle messy tile sizes */
......@@ -105,25 +103,20 @@ int main(int argc, char* argv[])
assert(!aml_tiling_init(&tiling_prefetch, AML_TILING_TYPE_1D,
tilesize*(N/T), memsize));
assert(!aml_arena_jemalloc_init(&arns, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arns, MPOL_BIND, slowb->maskp));
assert(!aml_arena_jemalloc_init(&arnf, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&fast,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arnf, MPOL_BIND, fastb->maskp));
slow = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&slowb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(slow != NULL);
fast = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&fastb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(fast != NULL);
assert(!aml_dma_linux_seq_init(&dma, 2));
assert(!aml_scratch_par_init(&sa, &fast, &slow, &dma, &tiling_prefetch, (size_t)2, (size_t)2));
assert(!aml_scratch_par_init(&sb, &fast, &slow, &dma, &tiling_prefetch, (size_t)2, (size_t)2));
/* allocation */
a = aml_area_malloc(&slow, memsize);
b = aml_area_malloc(&slow, memsize);
c = aml_area_malloc(&fast, memsize);
a = aml_area_mmap(slow, NULL, memsize);
b = aml_area_mmap(slow, NULL, memsize);
c = aml_area_mmap(fast, NULL, memsize);
assert(a != NULL && b != NULL && c != NULL);
size_t ntilerows, ntilecols, tilerowsize, tilecolsize, rowsize, colsize;
......@@ -190,11 +183,11 @@ int main(int argc, char* argv[])
aml_scratch_par_destroy(&sa);
aml_scratch_par_destroy(&sb);
aml_dma_linux_seq_destroy(&dma);
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&fast, c);
aml_area_linux_destroy(&slow);
aml_area_linux_destroy(&fast);
aml_area_munmap(slow, a, memsize);
aml_area_munmap(slow, b, memsize);
aml_area_munmap(fast, c, memsize);
aml_area_linux_destroy(slow);
aml_area_linux_destroy(fast);
aml_tiling_destroy(&tiling_row, AML_TILING_TYPE_2D_ROWMAJOR);
aml_tiling_destroy(&tiling_col, AML_TILING_TYPE_2D_ROWMAJOR);
aml_tiling_destroy(&tiling_prefetch, AML_TILING_TYPE_1D);
......
......@@ -12,6 +12,7 @@
#include <errno.h>
#include <omp.h>
#include "aml.h"
#include "aml/area/linux.h"
#include <stdlib.h>
#define ITER 10
......@@ -35,10 +36,7 @@ int main(int argc, char *argv[])
/* we want to back our array on the slow node and use the fast node as
* a faster buffer.
*/
struct aml_area slow, fast;
int type = AML_AREA_TYPE_REGULAR;
assert(!aml_area_from_nodestring(&slow, type, "all"));
assert(!aml_area_from_nodestring(&fast, type, "all"));
struct aml_area *slow = &aml_area_linux, *fast = aml_area_linux;
struct aml_dma dma;
assert(!aml_dma_init(&dma, 0));
......@@ -55,9 +53,9 @@ int main(int argc, char *argv[])
chunk_msz = MEMSIZE/(numthreads*CHUNKING);
esz = chunk_msz/sizeof(unsigned long);
}
a = aml_area_malloc(&slow, MEMSIZE);
b = aml_area_malloc(&slow, MEMSIZE);
c = aml_area_malloc(&slow, MEMSIZE);
a = aml_area_mmap(slow, NULL, MEMSIZE);
b = aml_area_mmap(slow, NULL, MEMSIZE);
c = aml_area_mmap(fast, NULL, MEMSIZE);
assert(a != NULL && b != NULL && c != NULL);
/* create virtually accessible address range, backed by slow memory */
......@@ -98,11 +96,9 @@ int main(int argc, char *argv[])
assert(wc[i] == esize);
}
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&slow, c);
aml_area_destroy(&slow);
aml_area_destroy(&fast);
aml_area_munmap(slow, a, MEMSIZE);
aml_area_munmap(slow, b, MEMSIZE);
aml_area_munmap(fast, c, MEMSIZE);
aml_dma_destroy(&dma);
aml_finalize();
return 0;
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-par.h"
#include "aml/scratch/seq.h"
#include <assert.h>
......@@ -26,8 +27,7 @@
size_t numthreads, tilesz, esz;
unsigned long *a, *b, *c;
AML_TILING_1D_DECL(tiling);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
struct aml_area *slow, *fast;
AML_SCRATCH_SEQ_DECL(sa);
AML_SCRATCH_SEQ_DECL(sb);
......@@ -41,16 +41,14 @@ int kernel(unsigned long *a, unsigned long *b, unsigned long *c, size_t n)
int main(int argc, char *argv[])
{
AML_ARENA_JEMALLOC_DECL(arns);
AML_ARENA_JEMALLOC_DECL(arnf);
AML_DMA_LINUX_PAR_DECL(dma);
struct bitmask *slowb, *fastb;
struct aml_bitmap slowb, fastb;
aml_init(&argc, &argv);
assert(argc == 4);
log_init(argv[0]);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
unsigned long memsize = 1UL << atoi(argv[3]);
/* use openmp env to figure out how many threads we want
......@@ -65,19 +63,12 @@ int main(int argc, char *argv[])
/* initialize all the supporting struct */
assert(!aml_tiling_init(&tiling, AML_TILING_TYPE_1D, tilesz, memsize));
assert(!aml_arena_jemalloc_init(&arns, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arns, MPOL_BIND, slowb->maskp));
assert(!aml_arena_jemalloc_init(&arnf, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&fast,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arnf, MPOL_BIND, fastb->maskp));
slow = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&slowb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(slow != NULL);
fast = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&fastb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(fast != NULL);
assert(!aml_dma_linux_par_init(&dma, numthreads*2, numthreads));
assert(!aml_scratch_seq_init(&sa, &fast, &slow, &dma, &tiling,
(size_t)2*numthreads, (size_t)1));
......@@ -85,9 +76,9 @@ int main(int argc, char *argv[])
(size_t)2*numthreads, (size_t)1));
/* allocation */
a = aml_area_malloc(&slow, memsize);
b = aml_area_malloc(&slow, memsize);
c = aml_area_malloc(&fast, memsize);
a = aml_area_mmap(slow, NULL, memsize);
b = aml_area_mmap(slow, NULL, memsize);
c = aml_area_mmap(fast, NULL, memsize);
assert(a != NULL && b != NULL && c != NULL);
unsigned long esize = memsize/sizeof(unsigned long);
......@@ -129,11 +120,11 @@ int main(int argc, char *argv[])
aml_scratch_seq_destroy(&sa);
aml_scratch_seq_destroy(&sb);
aml_dma_linux_par_destroy(&dma);
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&slow, c);
aml_area_linux_destroy(&slow);
aml_area_linux_destroy(&fast);
aml_area_munmap(slow, a, memsize);
aml_area_munmap(slow, b, memsize);
aml_area_munmap(fast, c, memsize);
aml_area_linux_destroy(slow);
aml_area_linux_destroy(fast);
aml_tiling_destroy(&tiling, AML_TILING_TYPE_1D);
aml_finalize();
return 0;
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include <assert.h>
......@@ -25,8 +26,7 @@
size_t numthreads, tilesz, esz;
unsigned long *a, *b, *c;
AML_TILING_1D_DECL(tiling);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
struct aml_area *slow, *fast;
AML_SCRATCH_PAR_DECL(sa);
AML_SCRATCH_PAR_DECL(sb);
......@@ -71,16 +71,14 @@ void do_work(unsigned long tid)
int main(int argc, char *argv[])
{
AML_ARENA_JEMALLOC_DECL(arns);
AML_ARENA_JEMALLOC_DECL(arnf);
AML_DMA_LINUX_SEQ_DECL(dma);
struct bitmask *slowb, *fastb;
struct aml_bitmap slowb, fastb;
aml_init(&argc, &argv);
assert(argc == 4);
log_init(argv[0]);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
unsigned long memsize = 1UL << atoi(argv[3]);
/* use openmp env to figure out how many threads we want
......@@ -96,18 +94,12 @@ int main(int argc, char *argv[])
/* initialize all the supporting struct */
assert(!aml_tiling_init(&tiling, AML_TILING_TYPE_1D, tilesz, memsize));
assert(!aml_arena_jemalloc_init(&arns, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arns, MPOL_BIND, slowb->maskp));
assert(!aml_arena_jemalloc_init(&arnf, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&fast,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arnf, MPOL_BIND, fastb->maskp));
slow = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&slowb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(slow != NULL);
fast = aml_area_linux_create(AML_AREA_LINUX_MMAP_FLAG_PRIVATE,
&fastb, AML_AREA_LINUX_BINDING_FLAG_BIND);
assert(fast != NULL);
assert(!aml_dma_linux_seq_init(&dma, numthreads*2));
assert(!aml_scratch_par_init(&sa, &fast, &slow, &dma, &tiling,
2*numthreads, numthreads));
......@@ -115,9 +107,9 @@ int main(int argc, char *argv[])
2*numthreads, numthreads));
/* allocation */
a = aml_area_malloc(&slow, memsize);
b = aml_area_malloc(&slow, memsize);
c = aml_area_malloc(&fast, memsize);
a = aml_area_mmap(slow, NULL, memsize);
b = aml_area_mmap(slow, NULL, memsize);
c = aml_area_mmap(fast, NULL, memsize);
assert(a != NULL && b != NULL && c != NULL);
unsigned long esize = memsize/sizeof(unsigned long);
......@@ -141,11 +133,11 @@ int main(int argc, char *argv[])
aml_scratch_par_destroy(&sa);
aml_scratch_par_destroy(&sb);
aml_dma_linux_seq_destroy(&dma);
aml_area_free(&slow, a);
aml_area_free(&slow, b);
aml_area_free(&fast, c);
aml_area_linux_destroy(&slow);
aml_area_linux_destroy(&fast);
aml_area_munmap(slow, a, memsize);
aml_area_munmap(slow, b, memsize);
aml_area_munmap(fast, c, memsize);
aml_area_linux_destroy(slow);
aml_area_linux_destroy(fast);
aml_tiling_destroy(&tiling, AML_TILING_TYPE_1D);
aml_finalize();
return 0;
......
......@@ -15,6 +15,7 @@
#include <stdlib.h>
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include "utils.h"
......@@ -24,9 +25,8 @@
size_t numthreads, tilesz, esz;
unsigned long *a, *b, *c;
struct aml_area *slow, *fast;
AML_TILING_1D_DECL(tiling);
AML_AREA_LINUX_DECL(slow);
AML_AREA_LINUX_DECL(fast);
AML_SCRATCH_PAR_DECL(sa);
AML_SCRATCH_PAR_DECL(sb);
......@@ -78,15 +78,14 @@ void *th_work(void *arg)
}
int main(int argc, char *argv[])
{
AML_ARENA_JEMALLOC_DECL(arena);
AML_DMA_LINUX_SEQ_DECL(dma);
struct bitmask *slowb, *fastb;
struct aml_bitmap slowb, fastb;
aml_init(&argc, &argv);
assert(argc == 4);
log_init(argv[0]);
fastb = numa_parse_nodestring_all(argv[1]);
slowb = numa_parse_nodestring_all(argv[2]);
assert(aml_bitmap_from_string(&fastb, argv[1]) == 0);
assert(aml_bitmap_from_string(&slowb, argv[2]) == 0);
unsigned long memsize = 1UL << atoi(argv[3]);
/* use openmp env to figure out how many threads we want
......@@ -101,18 +100,12 @@ int main(int argc, char *argv[])
/* initialize all the supporting struct */
assert(!aml_tiling_init(&tiling, AML_TILING_TYPE_1D, tilesz, memsize));
assert(!aml_arena_jemalloc_init(&arena, AML_ARENA_JEMALLOC_TYPE_REGULAR));
assert(!aml_area_linux_init(&slow,
AML_AREA_LINUX_MANAGER_TYPE_SINGLE,
AML_AREA_LINUX_MBIND_TYPE_REGULAR,
AML_AREA_LINUX_MMAP_TYPE_ANONYMOUS,
&arena, MPOL_BIND, slowb->maskp));