├── bash.sh
├── versions.sh
├── parse.py
├── test.sh
├── test.docker
├── push.sh
├── phylanx.devenv
├── auto.sh
├── apex.devenv
└── activeharmony-4.6.0
└── code-server
└── code_generator.cxx
/bash.sh:
--------------------------------------------------------------------------------
1 | if [ "$USER" = "" ]
2 | then
3 | export USER=jovyan
4 | fi
5 | if [ "$HOME" = "" ]
6 | then
7 | export HOME=/home/jovyan
8 | fi
9 |
--------------------------------------------------------------------------------
/versions.sh:
--------------------------------------------------------------------------------
1 | for v in /hpx /blaze /blaze_tensor /pybind11 ~/phylanx
2 | do
3 | echo -n "VERSION: $v "
4 | cd $v
5 | git log -1 --format=%cd
6 | done
7 |
--------------------------------------------------------------------------------
/parse.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | import re
3 | import sys
4 | fails = 100
5 | success = False
6 | with open(sys.argv[1],"r") as fd:
7 | for line in fd.readlines():
8 | g = re.search(r'tests passed, (\d+) tests failed out of',line)
9 | if g:
10 | fails = int(g.group(1))
11 | success = True
12 | print("Failed:",fails)
13 |
14 | if success and fails < 5:
15 | exit(0)
16 | else:
17 | print("No tests passed")
18 | exit(1)
19 |
--------------------------------------------------------------------------------
/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd
3 | set -x
4 |
5 | export BUILD_DIR=/usr/local/build
6 | export INSTALL_DIR=/usr/local/phylanx
7 | export PYTHONUSERBASE=/usr/local/userbase
8 | #export BRANCH=distributed_performance
9 |
10 | # I don't understand why this is necessary
11 | export PYTHON_DIR=$(python3 -c 'import sys; print("/usr/local/userbase/lib/python%d.%d/site-packages" % (sys.version_info.major, sys.version_info.minor))')
12 |
13 | mkdir -p $PYTHON_DIR
14 | build.sh config install
15 | build.sh tests > test-out.txt 2>&1
16 | bash versions.sh >> test-out.txt
17 | cd ~/phylanx
18 |
19 | # Clean up build
20 | cd $BUILD_DIR
21 | rm -f $(find . -type f -a ! \( -name \*.so\* -o -name physl \) )
22 |
--------------------------------------------------------------------------------
/test.docker:
--------------------------------------------------------------------------------
1 | ARG IMAGE
2 | FROM $IMAGE
3 | USER root
4 | COPY versions.sh /usr/local/bin/
5 | RUN chmod 755 /usr/local/bin/versions.sh
6 | RUN chmod 755 /home/jovyan
7 | RUN mkdir /usr/local/phylanx
8 | RUN mkdir /usr/local/userbase
9 | RUN mkdir /usr/local/build
10 | RUN chown jovyan /usr/local/phylanx
11 | RUN chown jovyan /usr/local/userbase
12 | RUN chown jovyan /usr/local/build
13 | USER jovyan
14 | #RUN bash versions.sh >> test-out.txt
15 | ARG BUILD_TYPE
16 | ENV BUILD_TYPE=$BUILD_TYPE
17 | ARG CPUS
18 | ENV CPUS=$CPUS
19 | COPY test.sh .
20 | RUN bash ./test.sh
21 | USER root
22 | RUN find /home/jovyan -type d| xargs chmod og+rx
23 | RUN find /home/jovyan -type f| xargs chmod og+r
24 | USER jovyan
25 | #RUN cp /home/jovyan/install/phylanx/bin/physl /home/jovyan/phylanx/build/bin/physl
26 | #RUN chmod 755 /home/jovyan/phylanx/build/bin/physl
27 |
--------------------------------------------------------------------------------
/push.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ "$DOCKER_HUB_ACCT" != "" ]
4 | then
5 | docker push ${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:working
6 | docker tag phylanx-test${TAG} ${DOCKER_HUB_ACCT}phylanx${TAG}.test:working
7 | docker push ${DOCKER_HUB_ACCT}phylanx${TAG}.test:working
8 | fi
9 |
10 | # Push to remote machine if there is one.
11 | if [ "${REMOTE}" != "" ]
12 | then
13 | ssh ${REMOTE} singularity build -F ~/images/phylanx-devenv${TAG}.simg docker://${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:working
14 | ssh ${REMOTE} chmod 755 ~/images/phylanx-devenv${TAG}.simg
15 |
16 | ssh ${REMOTE} singularity build -F ~/images/phylanx-test${TAG}.simg docker://${DOCKER_HUB_ACCT}phylanx${TAG}.test:working
17 | ssh ${REMOTE} chmod 755 ~/images/phylanx-test${TAG}.simg
18 | #ssh ${REMOTE} bin/build-image.sh ~/images/phylanx-devenv.simg docker://${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:working
19 | fi
20 |
--------------------------------------------------------------------------------
/phylanx.devenv:
--------------------------------------------------------------------------------
1 | FROM fedora
2 | RUN dnf install -y gcc-c++ gcc make cmake git \
3 | bzip2 hwloc-devel blas blas-devel lapack lapack-devel boost-devel \
4 | libatomic which compat-openssl10 vim-enhanced wget zlib-devel \
5 | python3-flake8 gdb sudo python36 openmpi-devel sqlite-devel sqlite \
6 | findutils openssl-devel lm_sensors-devel
7 |
8 | ARG CPUS
9 | ARG BUILD_TYPE
10 |
11 | RUN ln -s /usr/lib64/openmpi/lib/libmpi_cxx.so /usr/lib64/openmpi/lib/libmpi_cxx.so.1
12 | RUN ln -s /usr/lib64/openmpi/lib/libmpi.so /usr/lib64/openmpi/lib/libmpi.so.12
13 | ENV PYVER 3.6.8
14 | RUN wget https://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tgz
15 | RUN tar xf Python-${PYVER}.tgz
16 | WORKDIR /Python-${PYVER}
17 | RUN ./configure
18 | RUN make -j ${CPUS} install
19 |
20 | # Make headers available
21 | RUN cp /Python-${PYVER}/pyconfig.h /Python-${PYVER}/Include
22 | RUN ln -s /Python-${PYVER}/Include /usr/include/python${PYVER}
23 |
24 | RUN pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org numpy tensorflow keras CNTK pytest
25 | RUN pip3 install numpy tensorflow keras CNTK pytest
26 | WORKDIR /
27 |
28 | RUN git clone --depth 1 https://github.com/STEllAR-GROUP/hpx.git && \
29 | mkdir -p /hpx/build && \
30 | cd /hpx/build && \
31 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
32 | -DHPX_WITH_MALLOC=system \
33 | -DHPX_WITH_MORE_THAN_64_THREADS=ON \
34 | -DHPX_WITH_MAX_CPU_COUNT=80 \
35 | -DHPX_WITH_EXAMPLES=Off \
36 | .. && \
37 | make -j ${CPUS} install && \
38 | rm -f $(find . -name \*.o)
39 |
40 | RUN git clone --depth 1 https://github.com/pybind/pybind11.git && \
41 | mkdir -p /pybind11/build && \
42 | cd /pybind11/build && \
43 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DPYBIND11_PYTHON_VERSION=${PYVER} .. && \
44 | make -j ${CPUS} install && \
45 | rm -f $(find . -name \*.o)
46 |
47 | RUN git clone --depth 1 https://bitbucket.org/blaze-lib/blaze.git && \
48 | cd /blaze && \
49 | mkdir -p /blaze/build && \
50 | cd /blaze/build && \
51 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && \
52 | make -j ${CPUS} install && \
53 | rm -f $(find . -name \*.o)
54 |
55 | RUN git clone --depth 1 https://github.com/STEllAR-GROUP/blaze_tensor.git && \
56 | mkdir -p /blaze_tensor/build && \
57 | cd /blaze_tensor/build && \
58 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && \
59 | make -j ${CPUS} install && \
60 | rm -f $(find . -name \*.o)
61 |
62 | COPY build.sh /usr/local/bin/build.sh
63 | RUN chmod +x /usr/local/bin/build.sh
64 |
65 | RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
66 | COPY phylanx.devenv /Dockerfile
67 | RUN useradd -m jovyan
68 | USER jovyan
69 | WORKDIR /home/jovyan
70 | ENV LD_LIBRARY_PATH /home/jovyan/install/phylanx/lib64:/usr/local/lib64:/home/jovyan/install/phylanx/lib/phylanx:/usr/lib64/openmpi/lib
71 | COPY bash.sh /home/jovyan/.bashrc
72 | CMD ["sleep","infinity"]
73 |
--------------------------------------------------------------------------------
/auto.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Configuration
4 | # Find execution dir
5 | export INSTALL_DIR=$(dirname $(realpath $0))
6 | if [ "$EMAIL" = "" ]
7 | then
8 | export EMAIL=$(grep 'email.*=' ~/.gitconfig|cut -d= -f2|sed 's/\s//g')
9 | else
10 | echo "PLEASE SET UP YOUR GIT EMAIL"
11 | echo "git config --global user.email johndoe@example.com"
12 | exit 2
13 | fi
14 | for bt in Release Debug
15 | do
16 | export BUILD_TYPE=$bt
17 | for img in apex # apex noapex f30
18 | do
19 |
20 | echo "=====[BEGIN $bt $img]====="
21 | # Here we want the dockerhub account with a / or an empty string.
22 | if [ "$DOCKER_HUB_ACCT" = "" ]
23 | then
24 | export DOCKER_HUB_ACCT=$(docker info|grep Username:|cut -d: -f2|sed 's/\s//g'|sed 's|/*$|/|')
25 | fi
26 |
27 | export CPUS=4 #$(($(lscpu|grep '^CPU(s):'|cut -d: -f2|sed 's/\s//g')/2))
28 |
29 | echo "CONFIGURATION INFO:"
30 | echo "EMAIL=($EMAIL)"
31 | echo "INSTALL_DIR=($INSTALL_DIR)"
32 | echo "DOCKER_HUB_ACCT=($DOCKER_HUB_ACCT)"
33 | echo "CPUS=${CPUS}"
34 |
35 | source ~/.bashrc
36 | set -e
37 | set -x
38 | cd $INSTALL_DIR
39 | if [ "$BUILD_TYPE" = "Release" ]
40 | then
41 | export TAG=.rel
42 | else
43 | export TAG=
44 | fi
45 | if [ "$img" = "noapex" ]
46 | then
47 | export TAG="$TAG.noapex"
48 | fi
49 | if [ "$img" = "f30" ]
50 | then
51 | export TAG="$TAG.f30"
52 | fi
53 | echo "BUILD_TYPE=$BUILD_TYPE, TAG=$TAG"
54 | if [ "$img" = "f30" ]
55 | then
56 | docker pull fedora:30
57 | else
58 | docker pull fedora:26
59 | fi
60 | docker build --no-cache --build-arg CPUS=$CPUS --build-arg BUILD_TYPE=$BUILD_TYPE -f ${img}.devenv -t ${DOCKER_HUB_ACCT}phylanx${TAG}.devenv .
61 |
62 | docker build --build-arg CPUS=$CPUS --build-arg BUILD_TYPE=$BUILD_TYPE --build-arg IMAGE=${DOCKER_HUB_ACCT}phylanx${TAG}.devenv -f test.docker -t phylanx-test${TAG} .
63 | docker run --rm phylanx-test${TAG} cat test-out.txt > test-out-$bt-$img.txt
64 | cp test-out-$bt-$img.txt test-out.txt
65 | echo $EMAIL > email-body-$bt-$img.html
66 | echo 'Phylanx Build Status' >> email-body-$bt-$img.html
67 | rm -f email-body-$bt-$img.txt
68 | touch email-body-$bt-$img.txt
69 | set +e
70 | python3 parse.py test-out-$bt-$img.txt
71 | if [ $? = 0 ]
72 | then
73 | docker tag ${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:latest ${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:working
74 | bash push.sh
75 | set +e
76 | docker stop devenv
77 | sleep 5
78 | docker run --name devenv --privileged -v devenv_homefs-phylanx:/home/jovyan -d --rm ${DOCKER_HUB_ACCT}phylanx${TAG}.devenv:working
79 | set -e
80 | echo "Succeeded in building phylanx $bt $img." >> email-body-$bt-$img.txt
81 | else
82 | echo "Failed to build phylanx $bt $img." >> email-body-$bt-$img.txt
83 | fi
84 | echo '' >> email-body-$bt-$img.txt
85 | touch test-out-$bt-$img.txt
86 | tail -20 test-out-$bt-$img.txt >> email-body-$bt-$img.txt
87 | mail -s "Auto Update Phylanx for $bt $img" ${EMAIL} < email-body-$bt-$img.txt
88 | echo "=====[END $bt $img]====="
89 | done
90 | done
91 |
--------------------------------------------------------------------------------
/apex.devenv:
--------------------------------------------------------------------------------
1 | FROM fedora:26
2 | RUN dnf install -y gcc-c++ gcc make git \
3 | bzip2 hwloc-devel blas blas-devel lapack lapack-devel \
4 | libatomic which compat-openssl10 vim-enhanced wget zlib-devel \
5 | python3-flake8 gdb sudo python36 mpich-devel sqlite-devel sqlite \
6 | findutils openssl-devel papi papi-devel lm_sensors-devel hdf5-devel \
7 | libffi-devel file hostname
8 |
9 | ARG CPUS
10 | ARG BUILD_TYPE
11 | WORKDIR /
12 |
13 | ENV CMAKE_VER 3.17.0
14 | RUN curl -LO http://www.cmake.org/files/v$(echo $CMAKE_VER|cut -d. -f1,2)/cmake-${CMAKE_VER}.tar.gz
15 | RUN tar xzf cmake-${CMAKE_VER}.tar.gz
16 | WORKDIR /cmake-${CMAKE_VER}
17 | RUN ./configure && make -j ${CPUS} && make install
18 | WORKDIR /
19 |
20 | ENV BOOST_VER 1_74_0
21 | WORKDIR /usr/install
22 | COPY boost_${BOOST_VER}.tar.bz2 .
23 | RUN tar xjf boost_${BOOST_VER}.tar.bz2
24 | WORKDIR /usr/install/boost_${BOOST_VER}
25 | ENV CPLUS_INCLUDE_PATH /usr/include/python3.5m
26 | RUN bash ./bootstrap.sh
27 | RUN ./b2 -j 5 install
28 | WORKDIR /
29 |
30 | RUN git clone https://github.com/BlueBrain/HighFive.git
31 | WORKDIR /HighFive/build
32 | RUN cmake ..
33 | RUN make install
34 | WORKDIR /
35 |
36 | ENV AH_VER 4.6.0
37 | RUN curl -kLO https://www.dyninst.org/sites/default/files/downloads/harmony/ah-${AH_VER}.tar.gz
38 | RUN tar -xzf ah-${AH_VER}.tar.gz
39 | WORKDIR /activeharmony-${AH_VER}
40 | COPY activeharmony-4.6.0/code-server/code_generator.cxx code-server/code_generator.cxx
41 | RUN make CFLAGS=-fPIC LDFLAGS=-fPIC && make install prefix=/usr/local/activeharmony
42 |
43 | ENV OTF2_VER 2.1.1
44 | WORKDIR /
45 | RUN curl -kLO https://www.vi-hps.org/cms/upload/packages/otf2/otf2-${OTF2_VER}.tar.gz
46 | RUN tar -xzf otf2-${OTF2_VER}.tar.gz
47 | WORKDIR otf2-${OTF2_VER}
48 | RUN ./configure --prefix=/usr/local/otf2 --enable-shared && make && make install
49 |
50 | WORKDIR /
51 |
52 | #RUN ln -s /usr/lib64/openmpi/lib/libmpi_cxx.so /usr/lib64/openmpi/lib/libmpi_cxx.so.1
53 | #RUN ln -s /usr/lib64/openmpi/lib/libmpi.so /usr/lib64/openmpi/lib/libmpi.so.12
54 | ENV PYVER 3.8.6
55 | RUN wget https://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tgz
56 | RUN tar xf Python-${PYVER}.tgz
57 | WORKDIR /Python-${PYVER}
58 | RUN ./configure
59 | RUN make -j ${CPUS} install
60 |
61 | # Make headers available
62 | RUN cp /Python-${PYVER}/pyconfig.h /Python-${PYVER}/Include
63 | RUN ln -s /Python-${PYVER}/Include /usr/include/python${PYVER}
64 |
65 | #RUN pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org numpy tensorflow keras pytest
66 | RUN pip3 install numpy tensorflow keras pytest
67 | WORKDIR /
68 |
69 | ENV PATH /usr/lib64/mpich/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:.
70 | RUN git clone --depth 1 https://github.com/STEllAR-GROUP/hpx.git && \
71 | mkdir -p /hpx/build && \
72 | cd /hpx/build && \
73 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
74 | -DHPX_WITH_PARCELPORT_MPI=ON \
75 | -DHPX_WITH_MALLOC=system \
76 | -DHPX_WITH_MORE_THAN_64_THREADS=ON \
77 | -DHPX_WITH_MAX_CPU_COUNT=80 \
78 | -DHPX_WITH_EXAMPLES=Off \
79 | -DHPX_WITH_APEX=TRUE \
80 | -DAPEX_WITH_ACTIVEHARMONY=TRUE \
81 | -DACTIVEHARMONY_ROOT=/usr/local/activeharmony \
82 | -DAPEX_WITH_OTF2=TRUE \
83 | -DOTF2_ROOT=/usr/local/otf2 \
84 | -DAPEX_USE_CLOCK_TIMESTAMP=TRUE \
85 | -DAPEX_WITH_PAPI=TRUE \
86 | -DHPX_WITH_APEX_NO_UPDATE=TRUE \
87 | -DHPX_WITH_APEX_TAG=develop \
88 | -DAPEX_WITH_BFD=FALSE \
89 | .. && \
90 | make -j ${CPUS} install && \
91 | rm -f $(find . -name \*.o)
92 |
93 | RUN git clone --depth 1 https://github.com/pybind/pybind11.git && \
94 | mkdir -p /pybind11/build && \
95 | cd /pybind11/build && \
96 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DPYBIND11_PYTHON_VERSION=${PYVER} .. && \
97 | make -j ${CPUS} install && \
98 | rm -f $(find . -name \*.o)
99 |
100 | RUN git clone --depth 1 https://bitbucket.org/blaze-lib/blaze.git && \
101 | cd /blaze && \
102 | mkdir -p /blaze/build && \
103 | cd /blaze/build && \
104 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && \
105 | make -j ${CPUS} install && \
106 | rm -f $(find . -name \*.o)
107 |
108 | RUN git clone --depth 1 https://github.com/STEllAR-GROUP/blaze_tensor.git && \
109 | mkdir -p /blaze_tensor/build && \
110 | cd /blaze_tensor/build && \
111 | cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && \
112 | make -j ${CPUS} install && \
113 | rm -f $(find . -name \*.o)
114 |
115 | COPY build-${BUILD_TYPE}.sh /usr/local/bin/build.sh
116 | RUN chmod +x /usr/local/bin/build.sh
117 |
118 | RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
119 | COPY phylanx.devenv /Dockerfile
120 | RUN useradd -m jovyan -d /home/jovyan
121 | #RUN ln /usr/lib64/libhwloc.so /usr/lib64/libhwloc.so.5
122 | USER jovyan
123 | WORKDIR /home/jovyan
124 | ENV LD_LIBRARY_PATH /home/jovyan/install/phylanx/lib64:/usr/local/lib64:/home/jovyan/install/phylanx/lib/phylanx:/usr/lib64/mpich/lib
125 | COPY bash.sh /home/jovyan/.bashrc
126 | CMD ["sleep","infinity"]
127 |
--------------------------------------------------------------------------------
/activeharmony-4.6.0/code-server/code_generator.cxx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003-2016 Jeffrey K. Hollingsworth
3 | *
4 | * This file is part of Active Harmony.
5 | *
6 | * Active Harmony is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Lesser General Public License as published
8 | * by the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * Active Harmony is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public License
17 | * along with Active Harmony. If not, see .
18 | */
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include