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

Automated enabling of MPI support #34

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 1 addition & 0 deletions py/orbit/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import orbit_mpi
10 changes: 10 additions & 0 deletions py/orbit/core/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

py_sources = files([
'__init__.py',
])

python.install_sources(
py_sources,
subdir: 'orbit/core',
# pure: true,
)
1 change: 1 addition & 0 deletions py/orbit/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

subdir('bumps')
subdir('core')
subdir('matching')
subdir('time_dep')
subdir('bunch_utils')
Expand Down
111 changes: 0 additions & 111 deletions src/libmain/libmain.cc

This file was deleted.

15 changes: 0 additions & 15 deletions src/libmain/module_template/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/libmain/orbit/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions src/libmain/orbit/_module_loader.py

This file was deleted.

32 changes: 0 additions & 32 deletions src/libmain/orbit/pyORBIT.py

This file was deleted.

20 changes: 12 additions & 8 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ dependencies = []

dependencies += dependency('fftw3', version: '>= 3.0.0', required: true)

# Detecting if MPICH is installed and enabling support if present
mpi_dependency = dependency('mpich', version: '>= 4.0.0', required: false)

if mpi_dependency.found()
cpp_args = ['-fPIC', '-std=c++11', '-DUSE_MPI=1']
dependencies += mpi_dependency
else
cpp_args = ['-fPIC', '-std=c++11']
endif

sources = files([
'linac/wrap_linacmodule.cc',
'linac/tracking/linac_tracking.cc',
Expand Down Expand Up @@ -111,7 +121,6 @@ sources = files([
'trackerrk4/PyExternalEffects.cc',
'trackerrk4/RungeKuttaTracker.cc',
'trackerrk4/wrap_ext_effects_container.cc',
'libmain/libmain.cc',
'mpi/wrap_orbit_mpi.cc',
'mpi/wrap_mpi_comm.cc',
'mpi/orbit_mpi.cc',
Expand Down Expand Up @@ -237,7 +246,6 @@ inc = include_directories([
'orbit/BunchDiagnostics',
'orbit',
'utils/integration',
'libmain',
'orbit/Apertures'

])
Expand All @@ -246,22 +254,18 @@ inc = include_directories([
core_lib = library('core',
sources: sources,
include_directories: inc,
cpp_args: ['-fPIC', '-std=c++11'],
cpp_args: cpp_args,
override_options: ['b_lundef=false'],
dependencies: dependencies,
install: true,

)

core_dep = declare_dependency(link_with : core_lib)




python.extension_module('orbit_mpi',
sources: [base + '/mpi_init.cc'],
include_directories: inc,
cpp_args: ['-fPIC', '-std=c++11'],
cpp_args: cpp_args,
dependencies: [core_dep],
install: true,
subdir: 'orbit/core',
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/wrap_orbit_mpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace wrap_orbit_mpi{
};

PyMODINIT_FUNC initorbit_mpi(void) {
// Initialize MPI
// Initialize MPI
ORBIT_MPI_Init();

PyObject *m, *d;
Expand Down