Skip to content

Commit 08b3ead

Browse files
authored
Merge pull request #178 from OpenSEMBA/dev
Merge pull request #166 from OpenSEMBA/feature/mtl_mpi Feature/mtl mpi
2 parents dd8b3e5 + 4b86b56 commit 08b3ead

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+18855
-5036
lines changed

.github/workflows/ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
os: [ubuntu-latest]
2323
compiler: [
24-
{name: 'intel', version: '2025.0'},
24+
{name: 'intel', version: '2025.1'},
2525
{name: 'gcc', version: 11}
2626
]
2727
build-type: ["Release"]
@@ -56,7 +56,7 @@ jobs:
5656
double-precision: "No"
5757

5858
- os: ubuntu-latest # This is the only test with double precision.
59-
compiler: {name: 'intel', version: '2025.0'}
59+
compiler: {name: 'intel', version: '2025.1'}
6060
build-type: "Release"
6161
mpi: "Yes"
6262
mtln: "No"

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020

2121
[submodule "external/googletest"]
2222
path = external/googletest
23-
url = https://github.com/google/googletest.git
23+
url = https://github.com/google/googletest.git

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
7878
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model fast=2w")
7979

8080
if(SEMBA_FDTD_ENABLE_INTEL_IPO)
81+
include(CheckIPOSupported)
82+
check_ipo_supported(RESULT iporesult)
83+
if(iporesult)
84+
message (STATUS "IPO is supported and being enabled")
85+
else()
86+
message(FATAL_ERROR "IPO is not supported")
87+
endif()
8188
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
89+
set(CMAKE_C_FLAGS_RELEASE "-ipo")
90+
set(CMAKE_CXX_FLAGS_RELEASE "-ipo")
91+
set(CMAKE_Fortran_FLAGS_RELEASE "-ipo")
8292
else()
8393
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
8494
endif()
@@ -248,6 +258,7 @@ if (SEMBA_FDTD_EXECUTABLE)
248258
target_link_libraries(semba-fdtd ${MPI_Fortran_LIBRARIES})
249259
endif()
250260

261+
251262
include_directories(${CMAKE_BINARY_DIR}/mod)
252263
include_directories(${HDF5_INCLUDE_DIRS})
253-
include_directories(${FHASH_INCLUDES})
264+
include_directories(${FHASH_INCLUDES})

doc/development.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ To run the tests:
301301

302302
## Debugging the project
303303

304-
For a correct debugging experience is needed to configure a launch.json file. This file usually is created by vscode automatically. In case it does not exist. You can create your own on .vscode folder.
304+
For a correct debugging experience configuring a launch.json file is needed. This file usually is created by vscode automatically. In case it does not exist. You can create your own on .vscode folder.
305305

306306
An example of launch.json filke is given. This will use a file as argument when calling to semba-fdtd.
307307
```json
@@ -323,3 +323,56 @@ An example of launch.json filke is given. This will use a file as argument when
323323
```
324324

325325
Now you are ready to work with the project.
326+
327+
### Debugging with MPI
328+
329+
gdb is a serial debugger, but can be attached to one of the parallel processes after they have started running.
330+
331+
332+
1. Modify the file launch.json to attach to a running process after launching the debugger:
333+
334+
```json
335+
{
336+
"version": "0.2.0",
337+
"configurations": [
338+
{
339+
"name": "(gdb) Attach",
340+
"type": "cppdbg",
341+
"request": "attach",
342+
"processId": "${command:pickProcess}",
343+
"program": "${workspaceFolder}/build/bin/semba-fdtd",
344+
"MIMode": "gdb",
345+
"miDebuggerPath": "/usr/bin/gdb",
346+
"setupCommands": [
347+
{
348+
"description": "Enable pretty-printing for gdb",
349+
"text": "-enable-pretty-printing",
350+
"ignoreFailures": true
351+
},
352+
{
353+
"description": "Set Disassembly Flavor to Intel",
354+
"text": "-gdb-set disassembly-flavor intel",
355+
"ignoreFailures": true
356+
}
357+
]
358+
}
359+
]
360+
}
361+
```
362+
363+
2. Use *mpirun* to execute semba-fdtd paralellized in 'np' processes:
364+
```
365+
mpirun -np 2 build/bin/semba-fdtd -i input_file.fdtd.json -args
366+
```
367+
368+
3. Once mpirun is running, launch the debuuger. A selection box will ask which process to attach to. Type *semba-fdtd* and all mpirun processes running semba will display. Selecto which process the debugger should attach to
369+
370+
#### Troubleshooting
371+
372+
1. After selecting the process the debugger should attach to, a new terminal opens with the message "Superuser access is required to attach to a process"
373+
374+
Run the following command as super user:
375+
```
376+
echo 0| sudo tee /proc/sys/kernel/yama/ptrace_scope
377+
```
378+
([source](https://github.com/Microsoft/MIEngine/wiki/Troubleshoot-attaching-to-processes-using-GDB))

0 commit comments

Comments
 (0)