Skip to content

Commit

Permalink
Merge pull request #41 from luca-heltai/new-image
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-heltai authored Apr 30, 2023
2 parents 152654e + 7fc557a commit 6d00429
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -21,7 +21,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image of master
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ./docker/
file: ./docker/Dockerfile.fsi-suite
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: heltai/dealii:vscode
container:
image: heltai/dealii:vscode
options: --user root

steps:
- uses: actions/checkout@v2
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/indentation.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: Indent

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions:
contents: read

jobs:
build:
indent:
# run the indent checks

runs-on: ubuntu-latest
container: heltai/dealii:vscode
name: indent
runs-on: [ubuntu-20.04]
container:
image: heltai/dealii:vscode
options: --user root

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Check indentation
run: |
./scripts/check_indentation.sh
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./scripts/check_indentation.sh
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
debug:

runs-on: ubuntu-latest
container: heltai/dealii:vscode
container:
image: heltai/dealii:vscode
options: --user root

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build debug
run: |
rm -rf build_linux_debug
Expand All @@ -31,10 +33,12 @@ jobs:
release:

runs-on: ubuntu-latest
container: heltai/dealii:vscode
container:
image: heltai/dealii:vscode
options: --user root

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build release
run: |
rm -rf build_linux_release
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
"titleBar.activeBackground": "#dd0531",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#dd053199",
"titleBar.inactiveForeground": "#e7e7e799"
"titleBar.inactiveForeground": "#e7e7e799",
"commandCenter.border": "#e7e7e799"
},
"editor.tokenColorCustomizations": {
"textMateRules": [
Expand Down
43 changes: 24 additions & 19 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This image is pushed to heltai/dealii:vscode
FROM dealii/dealii:master-focal
FROM dealii/dealii:master-jammy

LABEL maintainer="[email protected]"

Expand All @@ -12,7 +12,6 @@ RUN apt-get update \
doxygen \
gdb \
graphviz \
libcgal-dev \
linux-tools-common \
linux-tools-generic \
valgrind \
Expand All @@ -21,23 +20,6 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /root/.vscode-server/extensions \
/root/.vscode-server-insiders/extensions

ENV OMPI_ALLOW_RUN_AS_ROOT 1

ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1

ENV HOME /root

RUN mkdir /root/.ssh

ADD dotgdbinit.py /root/.gdbinit

ADD build.sh copy_test.sh copy_output.sh d2check.sh cwdiff /usr/bin/

RUN mv /usr/local/bin/clang-format /usr/bin/clang-format

# Now install parmoonlith
RUN cd /usr/src/ && \
git clone https://bitbucket.org/zulianp/par_moonolith.git && \
Expand All @@ -46,6 +28,29 @@ RUN cd /usr/src/ && \
cd build && \
cmake .. -G Ninja \
-DBUILD_SHARED_LIBS=ON && \
sed -i '/#include <vector>/a #include <limits>' _deps/benchmark-src/src/benchmark_register.h &&\
ninja && \
ninja install && \
cd ../ && rm -rf build

RUN mkdir -p /root/.vscode-server/extensions \
/root/.vscode-server-insiders/extensions

ENV OMPI_ALLOW_RUN_AS_ROOT 1

ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1

ADD dotgdbinit.py /root/.gdbinit

RUN mv /usr/local/bin/clang-format /usr/bin/clang-format

ADD \
build.sh \
copy_output.sh \
copy_test.sh \
d2check.sh \
cwdiff \
newdocentry.sh \
work_on_test.sh \
/usr/bin/

3 changes: 2 additions & 1 deletion docker/Dockerfile.fsi-suite
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ RUN cd /usr/local/src \
-DCMAKE_BUILD_TYPE=DebugRelease \
.. \
&& ninja install \
&& cd ../ && rm -rf .git build
&& cd ../ && rm -rf .git build

2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
docker pull dealii/dealii:master-focal
docker pull dealii/dealii:master-jammy
docker build -t heltai/dealii:vscode .
docker push heltai/dealii:vscode
11 changes: 8 additions & 3 deletions docker/copy_output.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash
snippetdir=$SNIPPET_DIR
if [ -z "$snippetdir" ]; then
snippetdir=~/c++/snippets/
fi
echo copying
echo ~/c++/snippets/build/output
echo `pwd`/output
echo to
echo `cat /workspace/snippets/.dealii_output_file`
sed 's/^JobId.*//g' ~/c++/snippets/build/output > `cat /workspace/snippets/.dealii_output_file`
echo `cat $snippetdir/.dealii_output_file`
sed 's/^JobId.*//g' `pwd`/output > `cat $snippetdir/.dealii_output_file`
10 changes: 8 additions & 2 deletions docker/copy_test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash
oldtestrel=$1
newtestrel=$2
oldtest="$(cd "$(dirname "$oldtestrel")"; pwd)/$(basename "$oldtestrel")"
newtest="$(cd "$(dirname "$newtestrel")"; pwd)/$(basename "$newtestrel")"
snippetdir=$SNIPPET_DIR
if [ -z "$snippetdir" ]; then
snippetdir=~/c++/snippets/
fi
echo Using snippet dir: $snippetdir
if [ -f $oldtest ]; then
extension=""
for option in "${@:3}"; do
Expand All @@ -19,8 +25,8 @@ if [ -f $oldtest ]; then
touch $output
git add $newtest
git add $output
echo $output > /workspace/snippets/.dealii_output_file
ln -sf $newtest /workspace/snippets/snippet.cc
echo $output > $SNIPPET_DIR/.dealii_output_file
ln -sf $newtest $SNIPPET_DIR/snippet.cc
else
echo File
echo $oldtest
Expand Down
22 changes: 22 additions & 0 deletions docker/newdocentry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
case $2 in
major)
type=major
;;
incompatibilities)
type=incompatibilities
;;
*)
type=minor
;;
esac

filename=../doc/news/changes/$type/`date "+%Y%m%d"`LucaHeltai

echo Writing to $filename
message="$1
<br>
(Luca Heltai, `date "+%Y/%m/%d"`)"

echo "$message" > $filename
git add $filename
38 changes: 38 additions & 0 deletions docker/work_on_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
newtestrel=$1
newtest="$(cd "$(dirname "$newtestrel")"; pwd)/$(basename "$newtestrel")"
snippetdir=$SNIPPET_DIR
if [ -z "$snippetdir" ]; then
snippetdir=~/c++/snippets/
fi
echo Using snippet dir: $snippetdir
if [ -f $newtest ]; then
ln -sf $newtest $snippetdir/snippet.cc
echo Linked
echo $newtest
echo to
echo $snippetdir/snippet.cc
echo
extension=""
for option in "${@:2}"; do
if [[ $option == *"mpirun"* ]]; then
extension=$extension.$option
else
extension=$extension.with_$option=on
fi
done
output=${newtest/\.cc/$extension.output}
if [ -f $output ]; then
echo $output > $snippetdir/.dealii_output_file
echo Stored output name
echo $output
echo in
echo $snippetdir/.dealii_output_file
else
echo Could not find $output file! Did not store its name anywhere
fi
else
echo File
echo $newtest
echo does not exist. Make sure you specify an existing test.
fi
16 changes: 8 additions & 8 deletions include/parsed_tools/grid_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace dealii
const dealii::Patterns::PatternBase &pattern =
*Convert<T>::to_pattern())
{
return dealii::internal::ReferenceCell::make_reference_cell_from_int(
return dealii::internal::make_reference_cell_from_int(
Convert<int>::to_value(s, pattern));
}
};
Expand Down Expand Up @@ -203,36 +203,36 @@ namespace ParsedTools
reference_cell_types = tria.get_reference_cells();

std::set<dealii::types::material_id> m_ids;
for (const auto cell : tria.active_cell_iterators())
for (const auto &cell : tria.active_cell_iterators())
m_ids.insert(cell->material_id());
material_ids.insert(material_ids.end(), m_ids.begin(), m_ids.end());
}

if (info_level > 2)
{
for (const auto id : boundary_ids)
for (const auto &id : boundary_ids)
faces_per_boundary_id[id] = 0;

for (const auto id : material_ids)
for (const auto &id : material_ids)
cells_per_material_id[id] = 0;

for (const auto id : manifold_ids)
for (const auto &id : manifold_ids)
{
faces_per_manifold_id[id] = 0;
cells_per_manifold_id[id] = 0;
}

for (const auto id : reference_cell_types)
for (const auto &id : reference_cell_types)
cells_per_reference_cell_type[id] = 0;

for (const auto cell : tria.active_cell_iterators())
for (const auto &cell : tria.active_cell_iterators())
{
++cells_per_material_id[cell->material_id()];
++cells_per_manifold_id[cell->manifold_id()];
++cells_per_reference_cell_type[cell->reference_cell()];
}

for (const auto f : tria.active_face_iterators())
for (const auto &f : tria.active_face_iterators())
{
if (f->at_boundary())
++faces_per_boundary_id[f->boundary_id()];
Expand Down
6 changes: 3 additions & 3 deletions include/parsed_tools/grid_refinement.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ namespace ParsedTools
}
}
else if (strategy == RefinementStrategy::global)
for (const auto cell : tria.active_cell_iterators())
for (const auto &cell : tria.active_cell_iterators())
cell->set_refine_flag();
else
Assert(false, dealii::ExcInternalError());
Expand Down Expand Up @@ -338,7 +338,7 @@ namespace ParsedTools
}
else if (strategy == RefinementStrategy::global)
{
for (const auto cell : tria.active_cell_iterators())
for (const auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_refine_flag();
}
Expand All @@ -354,7 +354,7 @@ namespace ParsedTools
GridRefinement::limit_levels(dealii::Triangulation<dim, spacedim> &tria) const
{
if (min_level != 0 || max_level != 0)
for (const auto cell : tria.active_cell_iterators())
for (const auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
{
if (min_level != 0 && cell->level() < min_level)
Expand Down

0 comments on commit 6d00429

Please sign in to comment.