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

CI: 4 Cores Linux/Win, 3 Cores macOS #523

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Build (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
$CMAKE --build build -j 2
$CMAKE --build build -j 4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
-DImpactX_PRECISION=SINGLE \
-DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \
-DAMReX_CUDA_ERROR_CAPTURE_THIS=ON
cmake --build build -j 2
cmake --build build -j 4
2 changes: 1 addition & 1 deletion .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
-DAMReX_AMD_ARCH=gfx900 \
-DImpactX_COMPUTE=HIP \
-DImpactX_PYTHON=ON
cmake --build build -j 2
cmake --build build -j 4
5 changes: 3 additions & 2 deletions .github/workflows/tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ jobs:
cmake -S . -B build \
-DImpactX_PYTHON=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build --parallel 2
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DMPIEXEC_POSTFLAGS="--use-hwthread-cpus"
cmake --build build --parallel 4

- name: run tests
run: |
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
CMAKE_GENERATOR: Ninja
CXXFLAGS: "-Werror"
OMP_NUM_THREADS: 2
OMP_NUM_THREADS: 4
steps:
- uses: actions/checkout@v3

Expand All @@ -35,15 +35,21 @@ jobs:
ccache-openmp-gcc-${{ hashFiles('.github/workflows/ubuntu.yml') }}-
ccache-openmp-gcc-

- name: system info
run: |
cat /proc/cpuinfo
lscpu

- name: build ImpactX
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DImpactX_PYTHON=ON
cmake --build build -j 2
-DImpactX_PYTHON=ON \
-DMPIEXEC_POSTFLAGS="--use-hwthread-cpus"
cmake --build build -j 4

- name: run tests
run: |
Expand Down Expand Up @@ -76,7 +82,7 @@ jobs:
env:
CMAKE_GENERATOR: Ninja
CXXFLAGS: "-Werror"
OMP_NUM_THREADS: 2
OMP_NUM_THREADS: 4
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -106,7 +112,7 @@ jobs:
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DImpactX_MPI=OFF \
-DImpactX_PYTHON=ON
cmake --build build -j 2
cmake --build build -j 4

- name: run tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
-DHDF5_ENABLE_SZIP_SUPPORT=OFF `
-DHDF5_ENABLE_Z_LIB_SUPPORT=OFF
if(!$?) { Exit $LASTEXITCODE }
cmake --build build_hdf5 --config RelWithDebInfo --target install --parallel 2
cmake --build build_hdf5 --config RelWithDebInfo --target install --parallel 4
if(!$?) { Exit $LASTEXITCODE }

$env:HDF5_DIR = "C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
Expand All @@ -71,7 +71,7 @@ jobs:
-DopenPMD_USE_HDF5=ON `
-DPython_EXECUTABLE=python3
if(!$?) { Exit $LASTEXITCODE }
cmake --build build --config RelWithDebInfo --parallel 2
cmake --build build --config RelWithDebInfo --parallel 4
if(!$?) { Exit $LASTEXITCODE }
- name: Test
run: |
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
-DHDF5_ENABLE_SZIP_SUPPORT=OFF ^
-DHDF5_ENABLE_Z_LIB_SUPPORT=OFF
if errorlevel 1 exit 1
cmake --build build_hdf5 --config Release --target install --parallel 2
cmake --build build_hdf5 --config Release --target install --parallel 4
if errorlevel 1 exit 1

set "HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
-DopenPMD_USE_HDF5=ON ^
-DPython_EXECUTABLE=python3
if errorlevel 1 exit 1
cmake --build build --parallel 2
cmake --build build --parallel 4
if errorlevel 1 exit 1
- name: Test
shell: cmd
Expand Down
6 changes: 4 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ if(ImpactX_MPI)
set(MPI_TEST_EXE
${MPIEXEC_EXECUTABLE}
${MPI_ALLOW_ROOT}
${MPIEXEC_NUMPROC_FLAG} 2
${MPIEXEC_NUMPROC_FLAG} 3
${MPIEXEC_POSTFLAGS}
${MPIEXEC_PREFLAGS}
)
endif()

Expand Down Expand Up @@ -81,7 +83,7 @@ function(add_impactx_test name input is_mpi is_python analysis_script plot_scrip
if(is_mpi)
set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=1")
else()
set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=2")
set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=3")
endif()

# analysis and plots
Expand Down
2 changes: 1 addition & 1 deletion examples/apochromatic/analysis_apochromatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_moments(beam):
)

atol = 0.0 # ignored
rtol = 19.0 * num_particles**-0.5 # from random sampling of a smooth distribution
rtol = 26.0 * num_particles**-0.5 # from random sampling of a smooth distribution
print(f" rtol={rtol} (ignored: atol~={atol})")

assert np.allclose(
Expand Down
2 changes: 1 addition & 1 deletion examples/epac2004_benchmarks/analysis_bithermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_moments(beam):
)

atol = 0.0 # ignored
rtol = 3.5 * num_particles**-0.5 # from random sampling of a smooth distribution
rtol = 4.0 * num_particles**-0.5 # from random sampling of a smooth distribution
print(f" rtol={rtol} (ignored: atol~={atol})")

assert np.allclose(
Expand Down
2 changes: 1 addition & 1 deletion examples/positron_channel/analysis_positron.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_moments(beam):
)

atol = 0.0 # ignored
rtol = 1.8 * num_particles**-0.5 # from random sampling of a smooth distribution
rtol = 2.1 * num_particles**-0.5 # from random sampling of a smooth distribution
print(f" rtol={rtol} (ignored: atol~={atol})")

assert np.allclose(
Expand Down
2 changes: 1 addition & 1 deletion tests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_test(NAME ${pytest_name}
)

# limit threads
set_property(TEST ${pytest_name} APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=2")
set_property(TEST ${pytest_name} APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=3")

# set PYTHONPATH and PATH (for .dll files)
impactx_test_set_pythonpath(${pytest_name})
Loading