Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Oct 25, 2024
1 parent 52e733e commit 530394b
Show file tree
Hide file tree
Showing 311 changed files with 21,489 additions and 3,523 deletions.
2 changes: 2 additions & 0 deletions .cuda-gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
break abort
break __assert_fail
4 changes: 4 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

break __assert_fail
break abort
catch throw
12 changes: 12 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ex

(
cd /github/workspace
mkdir build && cd build
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DlowResourceTests=ON \
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 -O2" ..
make VERBOSE=1
ctest -j 2 --output-on-failure
)
5 changes: 3 additions & 2 deletions .github/workflows/cmake_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_SAMRAI_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DlowResourceTests=ON \
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 "
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 " \
-DtestDuringBuild=ON
- name: Build
working-directory: ${{runner.workspace}}/build
env:
LIBRARY_PATH: ${{ matrix.dylib_path }} # used by clang, needed to find libquadmath - else link error
run: cmake --build . -j 2
run: cmake --build . -j 1

- name: Test
working-directory: ${{runner.workspace}}/build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.mkn*
bin
build
subprojects
Expand All @@ -22,3 +23,5 @@ perf.*
.vscode
.phare*
PHARE_REPORT.zip
*.mkn
.cache
27 changes: 11 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
cmake_minimum_required (VERSION 3.20.1) # released April 8, 2021 - https://www.kitware.com/cmake-3-20-1-available-for-download/

project(PHARE VERSION 0.1 LANGUAGES CXX C)
set(PHARE_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

include("${PHARE_PROJECT_DIR}/res/cmake/policies.cmake" NO_POLICY_SCOPE)
include(CheckCXXCompilerFlag)


# Release mode default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

if (POLICY CMP0074) # hides warning about ${PACKAGE}_ROOT variables
cmake_policy(SET CMP0074 NEW)
endif()
if (POLICY CMP0069) # allow LTO if available, requires cmake 3.9 (released August 2017)
cmake_policy(SET CMP0069 NEW)
endif()
find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)
include("${PHARE_PROJECT_DIR}/res/cmake/options.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/def.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/coverage.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/dep.cmake")

# Enables -fPIC typically required for shared libraries with dependencies. e.g. pybind modules
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

include(CheckCXXCompilerFlag)
find_program(Git git)
find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)

set(PHARE_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

include_directories(${PHARE_PROJECT_DIR}/src)

include("${PHARE_PROJECT_DIR}/res/cmake/options.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/def.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/coverage.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/dep.cmake")
include("${PHARE_PROJECT_DIR}/res/cmake/cppcheck.cmake")

# set standard after dependencies to avoid potential conflicts
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
1 change: 1 addition & 0 deletions doc/obs/.obsidian/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions doc/obs/.obsidian/appearance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
30 changes: 30 additions & 0 deletions doc/obs/.obsidian/core-plugins-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false
}
20 changes: 20 additions & 0 deletions doc/obs/.obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
"file-explorer",
"global-search",
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"page-preview",
"daily-notes",
"templates",
"note-composer",
"command-palette",
"editor-status",
"bookmarks",
"outline",
"word-count",
"file-recovery"
]
153 changes: 153 additions & 0 deletions doc/obs/.obsidian/workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"main": {
"id": "ebdfe6166647b6c1",
"type": "split",
"children": [
{
"id": "0d59da3f5e2f6cc6",
"type": "tabs",
"children": [
{
"id": "aab21fbc2ddacce1",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "todo.md",
"mode": "source",
"source": false
}
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "e35d4318c9016fd8",
"type": "split",
"children": [
{
"id": "0b0082ef75efe82d",
"type": "tabs",
"children": [
{
"id": "7dc1b9cb3eccb73e",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical"
}
}
},
{
"id": "50e136fb58f0f54f",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
}
}
},
{
"id": "d313742985bf39d7",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {}
}
}
]
}
],
"direction": "horizontal",
"width": 300
},
"right": {
"id": "cc54f2482c16b8a4",
"type": "split",
"children": [
{
"id": "0747445f8f878360",
"type": "tabs",
"children": [
{
"id": "34bdda6cd146cf63",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "todo.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
}
}
},
{
"id": "83058547a4e6c739",
"type": "leaf",
"state": {
"type": "outgoing-link",
"state": {
"file": "todo.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
}
},
{
"id": "451e733254a59cc0",
"type": "leaf",
"state": {
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true
}
}
},
{
"id": "df2f29a5241eb034",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "todo.md"
}
}
}
]
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
},
"left-ribbon": {
"hiddenItems": {
"switcher:Open quick switcher": false,
"graph:Open graph view": false,
"canvas:Create new canvas": false,
"daily-notes:Open today's daily note": false,
"templates:Insert template": false,
"command-palette:Open command palette": false
}
},
"active": "7dc1b9cb3eccb73e",
"lastOpenFiles": [
"todo.md"
]
}
7 changes: 7 additions & 0 deletions doc/obs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# just docker things

### set shm size for mpi

```shell
docker run --shm-size=3256m -w /io --rm -it -v $PWD:/io --name phare registry.lpp.polytechnique.fr/phare/teamcity-fedora_dep:40
```
52 changes: 52 additions & 0 deletions doc/obs/perf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Performance analyses

### via perf

See: https://man7.org/linux/man-pages/man1/perf-record.1.html

```shell
# build with the following
CMAKE_CXX_FLAGS="-g3 -O3 -march=native -mtune=native -fno-omit-frame-pointer"
CMAKE_BUILD_TYPE="RelWithDebInfo"

# build...

perf record -Tga -F 1000 ./build/src/phare/phare-exe path/to/python/script.py
ls -lah perf.data # check file is new/exists
perf script report flamegraph
```

### via perf in vtune

installation see
https://www.intel.com/content/www/us/en/docs/vtune-profiler/installation-guide/2023-0/package-managers.html


```shell
# see above, but rename perf.data to data.perf (vtune only reads .perf files)
```

### via scalasca / scorep

```shell
# install
sudo dnf install scorep-openmpi scalasca-openmpi libunwind-devel binutils-devel elfutils-devel
```

```shell
# usage
CMAKE_CXX_FLAGS="-g3 -O3 -march=native -mtune=native -fno-omit-frame-pointer"
CMAKE_BUILD_TYPE="RelWithDebInfo"
export CXX=scorep-mpicxx CC=scorep-mpicc FC=scorep-gfortran

# build...

# run
# see https://vampir.eu/public/files/pdf/spcheatsheet_a4.pdf
export SCOREP_EXPERIMENT_DIRECTORY=scorep_run_trace
export SCOREP_TOTAL_MEMORY=500M # default is 16MB which will fail
scalasca -analyze mpirun -n 8 ./build/src/phare/phare-exe path/to/python/script.py

# view
scalasca -examine scorep_run_trace
```
1 change: 1 addition & 0 deletions doc/obs/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
multiple gpu https://enccs.github.io/gpu-programming/8-multiple_gpu/
Loading

0 comments on commit 530394b

Please sign in to comment.