Skip to content

Commit

Permalink
Merge pull request #679 from lyndonhenry/master
Browse files Browse the repository at this point in the history
New MPI execution engine for -e option.
  • Loading branch information
mmcgr committed Jul 18, 2018
2 parents b880e81 + 5a70e03 commit 2913672
Show file tree
Hide file tree
Showing 55 changed files with 2,138 additions and 1,513 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ cmake-build-debug/
*.deb
#macosx
.DS_Store

stamp-h1
/CMakeLists.txt
31 changes: 24 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ dist: trusty

aliases:
- &linux_deps
- build-essential
- automake
- autoconf
- bison
- mcpp
- build-essential
- flex
- lsb-release
- libncurses5-dev
- libtool
- lsb-release
- mcpp
- &linuxgcc
stage: Testing
sudo: false
Expand Down Expand Up @@ -45,11 +45,17 @@ aliases:
before_script: ".travis/init_test.sh"
script: ".travis/run_test.sh"
after_failure: ".travis/after_failure.sh"
- &linuxpackage
stage: Packaging
- &docker
os: linux
sudo: false
services: docker
sudo: false
- &linuxmpi
<<: *docker
stage: Testing
script: ".travis/run_docker.sh"
- &linuxpackage
<<: *docker
stage: Packaging
- &osxgcc
stage: Testing
os: osx
Expand Down Expand Up @@ -123,6 +129,18 @@ jobs:
- *gcc_environment
- SOUFFLE_CATEGORY=FastEvaluation,Interface,Profile,Provenance SOUFFLE_CONFS="-c -j8 -efile"

# Testing stage with mpi (-c -j8 -empi, FastEvaluation and select others)
- <<: *linuxmpi
env:
- "gcc-empi"
- *gcc_environment
- SOUFFLE_DOCKER_BASE_IMAGE="souffle/ubuntu:bionic-base"
# TODO (lyndonhenry): should get this working with Interface, Profile, and Provenance (it does work already with Syntactic and Semantic)
- SOUFFLE_CATEGORY="Unit,FastEvaluation"
- SOUFFLE_CONFIGURE_OPTIONS="--enable-mpi"
- SOUFFLE_CONFS="-c -j8 -empi"
- SOUFFLE_MAKE_JOBS="2"

# Testing stage (-j8,-c -j8)
- <<: *linuxgcc
env:
Expand Down Expand Up @@ -260,4 +278,3 @@ jobs:
on:
branch: master
condition: -v $GHPAGES_TOKEN

35 changes: 35 additions & 0 deletions .travis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG SOUFFLE_DOCKER_BASE_IMAGE

FROM ${SOUFFLE_DOCKER_BASE_IMAGE}

ARG CC
ARG CXX

ARG SOUFFLE_CATEGORY
ARG SOUFFLE_CONFS
ARG SOUFFLE_CONFIGURE_OPTIONS
ARG SOUFFLE_MAKE_JOBS

ENV CC="${CC}"
ENV CXX="${CXX}"

ENV SOUFFLE_CATEGORY="${SOUFFLE_CATEGORY}"
ENV SOUFFLE_CONFS="${SOUFFLE_CONFS}"
ENV SOUFFLE_CONFIGURE_OPTIONS="${SOUFFLE_CONFIGURE_OPTIONS}"
ENV SOUFFLE_MAKE_JOBS="${SOUFFLE_MAKE_JOBS}"

COPY . /home/souffle/souffle

WORKDIR /home/souffle/souffle

USER root

RUN chown -R souffle .

USER souffle

RUN ./bootstrap
RUN ./configure ${SOUFFLE_CONFIGURE_OPTIONS}
RUN make -j${SOUFFLE_MAKE_JOBS}

ENTRYPOINT ["./.travis/run_docker.sh", "souffle"]
30 changes: 30 additions & 0 deletions .travis/run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -ouex pipefail

if [ $# == 0 ]
then
SOUFFLE_DOCKER_TAG="$(echo ${SOUFFLE_DOCKER_BASE_IMAGE} | sed 's/-base/-test/g')"
docker build \
--tag ${SOUFFLE_DOCKER_TAG} \
--file .travis/Dockerfile \
--build-arg CC="${CC}" \
--build-arg CXX="${CXX}" \
--build-arg SOUFFLE_CATEGORY="${SOUFFLE_CATEGORY}" \
--build-arg SOUFFLE_CONFS="${SOUFFLE_CONFS}" \
--build-arg SOUFFLE_CONFIGURE_OPTIONS="${SOUFFLE_CONFIGURE_OPTIONS}" \
--build-arg SOUFFLE_DOCKER_BASE_IMAGE="${SOUFFLE_DOCKER_BASE_IMAGE}" \
--build-arg SOUFFLE_MAKE_JOBS="${SOUFFLE_MAKE_JOBS}" \
.
docker run \
--interactive \
--tty \
${SOUFFLE_DOCKER_TAG}
else
ulimit -c unlimited -S
if [[ "${SOUFFLE_CATEGORY}" != *"Unit"* ]]
then
cd tests
fi
TESTSUITEFLAGS="-j${SOUFFLE_MAKE_JOBS}" make check -j${SOUFFLE_MAKE_JOBS}
fi
138 changes: 0 additions & 138 deletions CMakeLists.txt

This file was deleted.

16 changes: 14 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ AC_ARG_ENABLE(
)

AS_IF([test "x$enable_debug" = "xyes"], [CXXFLAGS="$CXXFLAGS -O0 -g3"],
[test "x$enable_debug" != "xyes"], [CXXFLAGS="$CXXFLAGS -O3"]
[test "x$enable_debug" != "xyes"], [CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG"]
)

if test "$BUILD_TYPE" == "Debug" ; then
Expand All @@ -67,6 +67,18 @@ if test "$BUILD_TYPE" == "Debug" ; then
CXXFLAGS="$CXXFLAGS -O0 -g3"
fi

# Enable MPI
AC_ARG_ENABLE(
[mpi],
[AS_HELP_STRING([--enable-mpi], [Enable MPI])]
)
AS_IF([test "x$enable_mpi" = "xyes"], [
AS_VAR_APPEND(CXXFLAGS, [" -DUSE_MPI "])
AS_VAR_APPEND(CXXFLAGS, [" $(mpiCC --showme:compile) "])
AS_VAR_APPEND(LDFLAGS, [" $(mpiCC --showme:link) "])
])
AM_CONDITIONAL([MPI], [test "x$enable_mpi" = "xyes"])

AC_ISC_POSIX
AC_PROG_CPP
AC_PROG_CC
Expand Down Expand Up @@ -272,7 +284,6 @@ AC_CONFIG_LINKS([include/souffle/IODirectives.h:src/IODirectives.h])
AC_CONFIG_LINKS([include/souffle/IOSystem.h:src/IOSystem.h])
AC_CONFIG_LINKS([include/souffle/IterUtils.h:src/IterUtils.h])
AC_CONFIG_LINKS([include/souffle/Logger.h:src/Logger.h])
AC_CONFIG_LINKS([include/souffle/Macro.h:src/Macro.h])
AC_CONFIG_LINKS([include/souffle/ParallelUtils.h:src/ParallelUtils.h])
AC_CONFIG_LINKS([include/souffle/ProfileDatabase.h:src/ProfileDatabase.h])
AC_CONFIG_LINKS([include/souffle/ProfileEvent.h:src/ProfileEvent.h])
Expand All @@ -291,6 +302,7 @@ AC_CONFIG_LINKS([include/souffle/Util.h:src/Util.h])
AC_CONFIG_LINKS([include/souffle/WriteStream.h:src/WriteStream.h])
AC_CONFIG_LINKS([include/souffle/WriteStreamCSV.h:src/WriteStreamCSV.h])
AC_CONFIG_LINKS([include/souffle/WriteStreamSQLite.h:src/WriteStreamSQLite.h])
AC_CONFIG_LINKS([include/souffle/Mpi.h:src/Mpi.h])
AC_CONFIG_LINKS([include/souffle/gzfstream.h:src/gzfstream.h])
AC_CONFIG_LINKS([include/souffle/htmx86.h:src/htmx86.h])
AC_CONFIG_LINKS([include/souffle/json11.h:src/json11.h])
Expand Down
3 changes: 1 addition & 2 deletions src/AstClause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "AstClause.h"
#include "AstLiteral.h"
#include "AstVisitor.h"
#include "Macro.h"
#include <algorithm>

namespace souffle {
Expand All @@ -44,7 +43,7 @@ void AstClause::addToBody(std::unique_ptr<AstLiteral> l) {

/* Set the head of clause to h */
void AstClause::setHead(std::unique_ptr<AstAtom> h) {
ASSERT(!head && "Head is already set");
assert(!head && "Head is already set");
head = std::move(h);
}

Expand Down
7 changes: 3 additions & 4 deletions src/AstProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "AstLiteral.h"
#include "AstRelation.h"
#include "ErrorReport.h"
#include "Macro.h"
#include "Util.h"
#include <sstream>

Expand Down Expand Up @@ -109,19 +108,19 @@ AstRelation* AstProgram::getRelation(const AstRelationIdentifier& name) const {

/* Add a clause to the program */
void AstProgram::addClause(std::unique_ptr<AstClause> clause) {
ASSERT(clause && "NULL clause");
assert(clause && "NULL clause");
clauses.push_back(std::move(clause));
}

/* Add a clause to the program */
void AstProgram::addIODirective(std::unique_ptr<AstIODirective> directive) {
ASSERT(directive && "NULL IO directive");
assert(directive && "NULL IO directive");
ioDirectives.push_back(std::move(directive));
}

/* Add a pragma to the program */
void AstProgram::addPragma(std::unique_ptr<AstPragma> pragma) {
ASSERT(pragma && "NULL IO directive");
assert(pragma && "NULL IO directive");
pragmaDirectives.push_back(std::move(pragma));
}

Expand Down
10 changes: 5 additions & 5 deletions src/AstRelation.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AstRelation : public AstNode {

/** Add a new used type to this relation */
void addAttribute(std::unique_ptr<AstAttribute> attr) {
ASSERT(attr && "Undefined attribute");
assert(attr && "Undefined attribute");
attributes.push_back(std::move(attr));
}

Expand Down Expand Up @@ -306,9 +306,9 @@ class AstRelation : public AstNode {

/** Add a clause to the relation */
void addClause(std::unique_ptr<AstClause> clause) {
ASSERT(clause && "Undefined clause");
ASSERT(clause->getHead() && "Undefined head of the clause");
ASSERT(clause->getHead()->getName() == name &&
assert(clause && "Undefined clause");
assert(clause->getHead() && "Undefined head of the clause");
assert(clause->getHead()->getName() == name &&
"Name of the atom in the head of the clause and the relation do not match");
clauses.push_back(std::move(clause));
}
Expand Down Expand Up @@ -345,7 +345,7 @@ class AstRelation : public AstNode {
}

void addIODirectives(std::unique_ptr<AstIODirective> directive) {
ASSERT(directive && "Undefined directive");
assert(directive && "Undefined directive");
// Make sure the old style qualifiers still work.
if (directive->isInput()) {
qualifier |= INPUT_RELATION;
Expand Down
Loading

0 comments on commit 2913672

Please sign in to comment.