Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermediate stage of reading heat flux values from ASCOT5 HDF5 file #8

Merged
merged 23 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0935e5a
Add unit test for reading walltile from ASCOT5 output
bielsnohr Jun 21, 2021
33b7fac
Add HDF5 support to app and unit-app
bielsnohr Jun 22, 2021
b9fa5d3
Redesign opening of HDF5 file in AscotProblem for unit testing
bielsnohr Jun 23, 2021
8a2e854
Add unit test to check the test HDF5 file
bielsnohr Jun 23, 2021
0eebace
Extract walltile dataset from HDF5 in getWallTileHits()
bielsnohr Jun 23, 2021
06f3797
Add correct read routines to getWallTileHits()
bielsnohr Jul 12, 2021
57d415b
Refactor getWallTileHits() and file handling
bielsnohr Jul 13, 2021
926a1ca
Add skeleton unit test for readParticleEnergies()
bielsnohr Jul 14, 2021
9d5d479
Add getActiveEndstate() method and refactor
bielsnohr Jul 14, 2021
48e7451
Start implementation of getParticleEnergies()
bielsnohr Jul 15, 2021
870e3ba
Add calculateRelativisticEnergy() and unit test
bielsnohr Jul 20, 2021
1181981
Complete AscotProblem::getParticleEnergies() and unit test
bielsnohr Jul 22, 2021
ed4c7b3
Fill out docstrings for AscotProblem methods and add outline for sync…
bielsnohr Jul 28, 2021
e70ffab
Build a MOOSE image based on Ubuntu 18.04
bielsnohr Aug 3, 2021
b2b8e1c
Add functioning installations of MOOSE and ASCOT5 to Docker image
bielsnohr Aug 3, 2021
aa37d54
Add include path for HDF5 library to unit makefile
bielsnohr Aug 5, 2021
6d981b5
Update Docker image to use Ubuntu 20.04
bielsnohr Aug 6, 2021
49a72a9
Remove MOOSE submodule and mentions of conda
bielsnohr Aug 6, 2021
1a7fa4e
Update generation of test data in new dev environment
bielsnohr Aug 6, 2021
1027760
Add VS Code settings to version control
bielsnohr Aug 10, 2021
374ab88
Move 'using namespace' out of header files
bielsnohr Aug 10, 2021
7bdb728
Add a development environment section to Dockerfile
bielsnohr Aug 10, 2021
b5f625d
Use magnitude of v/c in calculateParticleEnergies
bielsnohr Aug 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/docker-existing-dockerfile
{
"name": "Phaethon Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-vscode.cpptools-extension-pack", "ms-azuretools.vscode-docker"]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/secrets.dev.yaml
**/values.dev.yaml
/moose
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[submodule "ascot5-python"]
path = ascot5-python
url = [email protected]:ascot/python.git
[submodule "moose"]
path = moose
url = [email protected]:idaholab/moose.git
branch = master
[submodule "ascot5"]
path = ascot5
url = [email protected]:ascot/ascot5.git
44 changes: 44 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"configurations": [
{
"name": "MOOSE-Linux",
"includePath": [
"${workspaceFolder}",
"${workspaceFolder}/build/header_symlinks",
"${workspaceFolder}/unit/build/header_symlinks",
"${MOOSE_DIR}/framework/build/header_symlinks",
"${MOOSE_DIR}/framework/contrib/gtest",
"${MOOSE_DIR}/modules/module_loader/build/header_symlinks",
"${MOOSE_DIR}/framework/contrib/boost/include",
"${MOOSE_DIR}/framework/contrib/hit",
"${MOOSE_DIR}/framework/contrib/json/include",
"${MOOSE_DIR}/libmesh/installed/include",
"/usr/include/hdf5/serial",
"${PETSC_DIR}/include"
],
"defines": [],
"compilerPath": "/usr/bin/mpicxx",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64",
"browse": {
"path": [
"${workspaceFolder}",
"${workspaceFolder}/build/header_symlinks",
"${workspaceFolder}/unit/build/header_symlinks",
"${MOOSE_DIR}/framework/build/header_symlinks",
"${MOOSE_DIR}/framework/contrib/gtest",
"${MOOSE_DIR}/modules/module_loader/build/header_symlinks",
"${MOOSE_DIR}/framework/contrib/boost/include",
"${MOOSE_DIR}/framework/contrib/hit",
"${MOOSE_DIR}/framework/contrib/json/include",
"${MOOSE_DIR}/libmesh/installed/include",
"/usr/include/hdf5/serial",
"${PETSC_DIR}/include"
]
},
"compilerArgs": [ ]
}
],
"version": 4
}
48 changes: 48 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/phaethon-dbg",
"args": [
"-i",
"test/tests/simple_diffusion/simple_diffusion.i"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
}
},
{
"name": "(lldb) Unit Test Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/unit/phaethon-unit-dbg",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
}
}
]
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"files.associations": {
"*.C": "cpp",
"*.h": "cpp",
"cmath": "cpp",
"ratio": "cpp",
"*.tcc": "cpp",
"fstream": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"vector": "cpp"
},
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"restructuredtext.languageServer.disabled": true
}
117 changes: 117 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Unit Tests",
"type": "shell",
"command": "make",
"group": {
"kind": "build",
"isDefault": true
},
"options": {"shell": {"args": ["-ic"]}},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["--directory=${workspaceFolder}/unit", "METHOD=devel", "-j4"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "Makefike debug",
"type": "shell",
"command": "make",
"group": "none",
"options": {"shell": {"args": ["-ic"]}},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["METHOD=dbg", "-j4"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "Makefike clean",
"type": "shell",
"command": "make",
"group": "none",
"options": {"shell": {"args": ["-ic"]}},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["clean"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "Test",
"type": "shell",
"command": "./run_tests",
"group": "test",
"options": {"shell": {"args": ["-ic"]}},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["-j4"]
},
{
"label": "Run Unit Tests",
"type": "shell",
"command": "./unit/run_tests",
"group": {
"kind": "test",
"isDefault": true
},
"options": {"shell": {"args": ["-ic"]}},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["-j4"]
}
]
}
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
####################
# ASCOT5 Build Stage
####################
# TODO should probably move away from using submodules. It means the version
# information of dependencies is scattered, and it would be better to centralise
# it here.
FROM helenbrooks/moose-ubuntu AS ascot5-moose-ubuntu

# Basic environment
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /home/ascot5
# Set path to shared library for Python interface to use and other environment
ENV LD_LIBRARY_PATH=/home/ascot5 EDITOR=vim LC_ALL=C.UTF-8 LANG=C.UTF-8

# ASCOT5 main C program and library
RUN apt-get update && apt-get -y install make libhdf5-dev
COPY ascot5 ./
# This is a completely serial version with no MPI or OpenMP offloading to GPUs
ENV MAKE_OPT='NOGIT=true CC=h5cc MPI=0 FLAGS=-foffload=disable'
RUN make clean ${MAKE_OPT}} && make ascot5_main ${MAKE_OPT} && \
make libascot ${MAKE_OPT} && \
ln -s -t /usr/local/bin/ $(readlink -f ascot5_main)

# ASCOT5 Python
RUN apt-get -y install python3-pip
COPY ascot5-python ./ascot5-python
RUN pip install ascot5-python/a5py

###################################
# Phaethon Dependencies Build Stage
###################################
FROM ascot5-moose-ubuntu AS phaethon-deps

RUN pip install meshio[all] click

##################################
# Phaethon Development Environment
##################################
FROM phaethon-deps as phaethon-dev

ENV METHOD=devel
WORKDIR /home/moose
# Update libMesh and PETSc
RUN ./scripts/update_and_rebuild_petsc.sh --prefix=/home/petsc && \
./scripts/update_and_rebuild_libmesh.sh --with-mpi
# This is needed or it mpiexec complains because docker runs as root
# Discussion on this issue https://github.com/open-mpi/ompi/issues/4451
ENV OMPI_ALLOW_RUN_AS_ROOT=1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
# Re-build MOOSE framework in devel mode
RUN cd test && make -j4 && ./run_tests -j4
RUN cd modules && make -j4 && ./run_tests -j4

RUN apt-get -y install clang-format curl
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get -y install git-lfs && \
git lfs install
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ XFEM := no
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################

# Additional libraries for HDF5 support
ADDITIONAL_INCLUDES := -I/usr/include/hdf5/serial
ADDITIONAL_LIBS := -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_serial_hl -lhdf5_serial

# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := phaethon
Expand Down
Loading