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

Merge branch 'excit-submodule' into 'staging'

[feature] Add excit as submodule

See merge request !149
parents ff8c19f5 bb22618f
Pipeline #11155 passed with stages
in 4 minutes and 51 seconds
......@@ -2,6 +2,7 @@ variables:
NMC_FE1_SLURM_PARAMETERS: "--nodes=1 --partition=ecp-p9-4v100"
ANL_THETA_PROJECT_SERVICE_USER: "cscstss"
ANL_THETA_SCHEDULER_PARAMETERS: "-A CSC250STPR19 -n 1 -t 20 -q debug-flat-quad"
GIT_SUBMODULE_STRATEGY: "normal"
stages:
- build
......
variables:
ARGOPKGS : "https://xgitlab.cels.anl.gov/argo/argopkgs/-/archive/master/argopkgs-master.tar.gz"
DEFAULT_MERGE_TARGET: "origin/staging"
GIT_SUBMODULE_STRATEGY: "normal"
stages:
- style
......@@ -180,7 +181,8 @@ make:chimera:
- ./autogen.sh
- mkdir build
- ./configure --prefix=`pwd`/build --with-cuda=yes
- make -j check
- make -j
- make check
artifacts:
when: on_failure
paths:
......
[submodule "excit"]
path = excit
url = ../excit.git
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src include tests doc benchmarks
SUBDIRS = src include tests doc benchmarks excit
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = aml.pc
......
......@@ -6,5 +6,5 @@ includedir=@includedir@
Name: libaml
Description: AML: Building Blocks for Memory Management
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -laml
Libs: -L${libdir} -laml -lexcit
Cflags: -I${includedir}
AM_COLOR_TESTS = yes
AM_CFLAGS = -I$(top_srcdir)/include $(PTHREAD_CFLAGS) $(OPENMP_CFLAGS)
AM_LDFLAGS = ../src/libaml.la $(PTHREAD_LIBS) $(OPENMP_CFLAGS)
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/excit/src $(PTHREAD_CFLAGS) $(OPENMP_CFLAGS)
AM_LDFLAGS = ../src/libaml.la $(top_builddir)/excit/src/libexcit.la $(PTHREAD_LIBS) $(OPENMP_CFLAGS)
if HAVE_CUDA
# LIBS is used instead of AM_LDFLAGS on purpose
......
......@@ -180,6 +180,8 @@ AM_EXTRA_RECURSIVE_TARGETS([check-programs])
# Output
########
AC_CONFIG_SUBDIRS([excit])
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_FILES([Makefile
......
......@@ -53,7 +53,7 @@ Download
.. code-block:: console
$ git clone git@xgitlab.cels.anl.gov:argo/aml.git
$ git clone --recurse-submodules git@xgitlab.cels.anl.gov:argo/aml.git
Requirements:
~~~~~~~~~~~~~
......
AM_COLOR_TESTS = yes
AM_CFLAGS = -I$(top_srcdir)/include $(PTHREAD_CFLAGS)
AM_LDFLAGS = $(top_builddir)/src/libaml.la $(PTHREAD_LIBS)
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/excit/src $(PTHREAD_CFLAGS)
AM_LDFLAGS = $(top_builddir)/src/libaml.la $(top_builddir)/excit/src/libexcit.la $(PTHREAD_LIBS)
if HAVE_CUDA
# LIBS is used instead of AM_LDFLAGS on purpose
......
Subproject commit c314d5c006f6d5d5340a037e4b39d04d1b21938a
......@@ -20,6 +20,7 @@
#include <assert.h>
#include <errno.h>
#include <excit.h>
#include <inttypes.h>
#include <numa.h>
#include <numaif.h>
......@@ -33,14 +34,14 @@
#include <sys/mman.h>
#include <unistd.h>
#include "aml/utils/async.h"
#include "aml/utils/bitmap.h"
#include "aml/utils/error.h"
#include "aml/utils/features.h"
#include "aml/utils/inner-malloc.h"
#include "aml/utils/vector.h"
#include "aml/utils/queue.h"
#include "aml/utils/async.h"
#include "aml/utils/vector.h"
#include "aml/utils/version.h"
#include "aml/utils/features.h"
////////////////////////////////////////////////////////////////////////////////
......@@ -841,6 +842,16 @@ int aml_tiling_tileid(const struct aml_tiling *tiling, const size_t *coords);
struct aml_layout *aml_tiling_index_byid(const struct aml_tiling *tiling,
const int uuid);
/**
* Return the tile at the coordinates at the current position of the input
* iterator.
* @param[in] tiling: an initialized tiling
* @param[in] iterator: an initialized iterator
* @return the tile as a layout on success, NULL on error.
*/
struct aml_layout *aml_tiling_index_byiter(const struct aml_tiling *tiling,
const_excit_t iterator);
/**
* Print on the file handle the metadata associated with this tiling.
* @param stream the stream to print on
......
SUFFIXES=.c .cu
AM_CPPFLAGS = -I$(top_srcdir)/include $(PTHREAD_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/excit/src $(PTHREAD_CFLAGS)
AM_LDFLAGS = $(PTHREAD_LIBS)
noinst_LTLIBRARIES=
......
......@@ -110,6 +110,25 @@ struct aml_layout *aml_tiling_index_byid(const struct aml_tiling *t,
return aml_tiling_index_native(t, coords);
}
struct aml_layout *aml_tiling_index_byiter(const struct aml_tiling *t,
const_excit_t iterator)
{
if (t == NULL || t->ops == NULL || iterator == NULL)
return NULL;
ssize_t ncoords;
size_t ndims = aml_tiling_ndims(t);
assert(!excit_dimension(iterator, &ncoords));
if ((size_t)ncoords != ndims)
return NULL;
ssize_t coords[ncoords];
assert(!excit_peek(iterator, coords));
return aml_tiling_index_native(t, (size_t *)coords);
}
int aml_tiling_fprintf(FILE *stream, const char *prefix,
const struct aml_tiling *tiling)
{
......
AM_COLOR_TESTS = yes
AM_CFLAGS = -I$(top_srcdir)/include $(PTHREAD_CFLAGS)
AM_LDFLAGS = ../src/libaml.la $(PTHREAD_LIBS)
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/excit/src $(PTHREAD_CFLAGS)
AM_LDFLAGS = ../src/libaml.la $(top_builddir)/excit/src/libexcit.la $(PTHREAD_LIBS)
if HAVE_CUDA
# LIBS is used instead of AM_LDFLAGS on purpose
......
......@@ -247,6 +247,84 @@ void test_tiling_even(void)
}
void test_tiling_excit(void)
{
int memory[9][10][8];
int memoryres[9][10][8];
size_t dims_col[3] = {8, 10, 9};
size_t stride[3] = {1, 1, 1};
size_t dims_tile_col[3] = {4, 10, 3};
int l = 0;
for (size_t i = 0; i < 9; i++)
for (size_t j = 0; j < 10; j++)
for (size_t k = 0; k < 8; k++, l++) {
memory[i][j][k] = l;
memoryres[i][j][k] = 0.0;
}
struct aml_layout *a, *ares;
aml_layout_dense_create(&a, memory, AML_LAYOUT_ORDER_COLUMN_MAJOR,
sizeof(int), 3, dims_col, stride, dims_col);
aml_layout_dense_create(&ares, memoryres, AML_LAYOUT_ORDER_COLUMN_MAJOR,
sizeof(int), 3, dims_col, stride, dims_col);
struct aml_tiling *t, *tres;
aml_tiling_resize_create(&t, AML_TILING_ORDER_COLUMN_MAJOR, a, 3,
dims_tile_col);
aml_tiling_resize_create(&tres, AML_TILING_ORDER_COLUMN_MAJOR, ares, 3,
dims_tile_col);
excit_t it, iter;
it = excit_alloc(EXCIT_RANGE);
iter = excit_alloc(EXCIT_PRODUCT);
assert(!excit_range_init(it, 0, 1, 1));
assert(!excit_product_add(iter, it));
it = excit_alloc(EXCIT_RANGE);
assert(!excit_range_init(it, 0, 0, 1));
assert(!excit_product_add(iter, it));
it = excit_alloc(EXCIT_RANGE);
assert(!excit_range_init(it, 0, 2, 1));
assert(!excit_product_add(iter, it));
for (ssize_t coords[3]; !excit_next(iter, coords);) {
struct aml_layout *b, *bres;
b = aml_tiling_index(t, (size_t *)coords);
bres = aml_tiling_index(tres, (size_t *)coords);
aml_copy_layout_generic(bres, b, NULL);
aml_layout_destroy(&b);
aml_layout_destroy(&bres);
}
assert(memcmp(memory, memoryres, 8 * 10 * 9 * sizeof(int)) == 0);
memset(memoryres, 0, 8 * 10 * 9 * sizeof(int));
assert(!excit_rewind(iter));
for (; !excit_peek(iter, NULL); excit_next(iter, NULL)) {
struct aml_layout *b, *bres;
b = aml_tiling_index_byiter(t, iter);
bres = aml_tiling_index_byiter(tres, iter);
aml_copy_layout_generic(bres, b, NULL);
aml_layout_destroy(&b);
aml_layout_destroy(&bres);
}
assert(memcmp(memory, memoryres, 8 * 10 * 9 * sizeof(int)) == 0);
excit_free(iter);
aml_layout_destroy(&a);
aml_layout_destroy(&ares);
aml_tiling_resize_destroy(&t);
aml_tiling_resize_destroy(&tres);
}
void test_tiling_uneven(void)
{
......@@ -656,6 +734,7 @@ int main(int argc, char *argv[])
test_tiling_pad_even();
test_tiling_pad_uneven();
test_tiling_excit();
aml_finalize();
return 0;
}
......
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