Skip to content

Commit

Permalink
Merge branch 'main' into c-cpp-example-ci-gha
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorhardy authored Jan 14, 2025
2 parents 606c292 + 73b6c1f commit 8790491
Show file tree
Hide file tree
Showing 77 changed files with 457 additions and 971 deletions.
236 changes: 120 additions & 116 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,124 +1,128 @@
jobs:
- job: Native
strategy:
matrix:
Linux:
imageName: "ubuntu-22.04"
macOS:
imageName: "macos-13"
Windows:
imageName: "windows-2019"
pool:
vmImage: $(imageName)
# Disabling Azure pipelines until we can get them working correctly
trigger: none
pr: none

steps:
# -----------------------
# Install dependencies
# -----------------------
# Linux
- bash: |
sudo apt-get update
sudo apt-get install -y libzmq5-dev ninja-build
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Linux - Install ZeroMQ and Ninja
# macOS
- bash: |
brew install zeromq ninja boost
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: macOS - Install Boost, ZeroMQ, and Ninja
# jobs:
# - job: Native
# strategy:
# matrix:
# Linux:
# imageName: "ubuntu-22.04"
# macOS:
# imageName: "macos-13"
# Windows:
# imageName: "windows-2019"
# pool:
# vmImage: $(imageName)

# -----------------------
# Checkout HELICS
# -----------------------
- bash: |
cmake --version
git clone https://github.com/GMLC-TDC/HELICS
cd HELICS
git checkout ${HELICS_COMMITISH:-develop}
if [[ "${HELICS_PR_TARGET}" != "" ]]; then
git config --global user.email "[email protected]"
git config --global user.name "HELICS-bot"
git merge --no-commit --no-ff origin/${HELICS_PR_TARGET} || exit $?
fi
git submodule update --init --recursive
displayName: Checkout HELICS
# steps:
# # -----------------------
# # Install dependencies
# # -----------------------
# # Linux
# - bash: |
# sudo apt-get update
# sudo apt-get install -y libzmq5-dev ninja-build
# condition: eq( variables['Agent.OS'], 'Linux' )
# displayName: Linux - Install ZeroMQ and Ninja
# # macOS
# - bash: |
# brew install zeromq ninja boost
# condition: eq( variables['Agent.OS'], 'Darwin' )
# displayName: macOS - Install Boost, ZeroMQ, and Ninja

# -----------------------
# Configure HELICS
# -----------------------
# Linux, macOS
- task: CMake@1
inputs:
workingDirectory: HELICS/build
cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=Release -DHELICS_BUILD_CXX_SHARED_LIB=ON ..
displayName: 'Linux/macOS - Configure HELICS'
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# Windows
- task: CMake@1
inputs:
workingDirectory: HELICS/build
cmakeArgs: -Ax64 -DCMAKE_BUILD_TYPE=Release -DHELICS_BUILD_CXX_SHARED_LIB=ON ..
displayName: 'Windows - Configure HELICS'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
# # -----------------------
# # Checkout HELICS
# # -----------------------
# - bash: |
# cmake --version
# git clone https://github.com/GMLC-TDC/HELICS
# cd HELICS
# git checkout ${HELICS_COMMITISH:-develop}
# if [[ "${HELICS_PR_TARGET}" != "" ]]; then
# git config --global user.email "[email protected]"
# git config --global user.name "HELICS-bot"
# git merge --no-commit --no-ff origin/${HELICS_PR_TARGET} || exit $?
# fi
# git submodule update --init --recursive
# displayName: Checkout HELICS

# -----------------------
# Install HELICS
# -----------------------
- bash: |
if [ -x "$(command -v sudo)" ]; then
sudo cmake --build . --target install
else
cmake --build . --target install
fi
displayName: 'Install HELICS'
workingDirectory: HELICS/build
# # -----------------------
# # Configure HELICS
# # -----------------------
# # Linux, macOS
# - task: CMake@1
# inputs:
# workingDirectory: HELICS/build
# cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=Release -DHELICS_BUILD_CXX_SHARED_LIB=ON ..
# displayName: 'Linux/macOS - Configure HELICS'
# condition: ne( variables['Agent.OS'], 'Windows_NT' )
# # Windows
# - task: CMake@1
# inputs:
# workingDirectory: HELICS/build
# cmakeArgs: -Ax64 -DCMAKE_BUILD_TYPE=Release -DHELICS_BUILD_CXX_SHARED_LIB=ON ..
# displayName: 'Windows - Configure HELICS'
# condition: eq( variables['Agent.OS'], 'Windows_NT' )

# # -----------------------
# # Install HELICS
# # -----------------------
# - bash: |
# if [ -x "$(command -v sudo)" ]; then
# sudo cmake --build . --target install
# else
# cmake --build . --target install
# fi
# displayName: 'Install HELICS'
# workingDirectory: HELICS/build

# -----------------------
# Set HELICS_DIR env var
# -----------------------
# Windows
- bash: |
dir=$(find C:/local -mindepth 1 -maxdepth 1 -type d -iname 'helics*')
echo "##vso[task.setvariable variable=HELICS_DIR]$dir"
displayName: 'Windows - Set HELICS_DIR env var'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
# # -----------------------
# # Set HELICS_DIR env var
# # -----------------------
# # Windows
# - bash: |
# dir=$(find C:/local -mindepth 1 -maxdepth 1 -type d -iname 'helics*')
# echo "##vso[task.setvariable variable=HELICS_DIR]$dir"
# displayName: 'Windows - Set HELICS_DIR env var'
# condition: eq( variables['Agent.OS'], 'Windows_NT' )

# -----------------------
# Configure Examples
# -----------------------
# Linux, macOS
- task: CMake@1
inputs:
cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=Release ..
displayName: 'Linux/macOS - Configure HELICS-Examples'
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# Windows
- task: CMake@1
inputs:
cmakeArgs: -Ax64 -DCMAKE_BUILD_TYPE=Release ..
displayName: 'Windows - Configure HELICS-Examples'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
# # -----------------------
# # Configure Examples
# # -----------------------
# # Linux, macOS
# - task: CMake@1
# inputs:
# cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=Release ..
# displayName: 'Linux/macOS - Configure HELICS-Examples'
# condition: ne( variables['Agent.OS'], 'Windows_NT' )
# # Windows
# - task: CMake@1
# inputs:
# cmakeArgs: -Ax64 -DCMAKE_BUILD_TYPE=Release ..
# displayName: 'Windows - Configure HELICS-Examples'
# condition: eq( variables['Agent.OS'], 'Windows_NT' )

# -----------------------
# Build Examples
# -----------------------
- bash: |
if [ -x "$(command -v sudo)" ]; then
sudo cmake --build .
else
cmake --build .
fi
displayName: 'Build Examples'
workingDirectory: build
# # -----------------------
# # Build Examples
# # -----------------------
# - bash: |
# if [ -x "$(command -v sudo)" ]; then
# sudo cmake --build .
# else
# cmake --build .
# fi
# displayName: 'Build Examples'
# workingDirectory: build

- job: Report_Results
displayName: Report Results
dependsOn: Native
condition: and(succeededOrFailed(), variables['HELICS_PR_TARGET'], variables['HELICS_PR_SLUG'], variables['HELICS_PR_NUM'])
variables:
PR_STATUS_REPORT: $[ dependencies.Native.result ]
steps:
- bash: |
.ci/report-results.sh
env:
HELICSBOT_GH_TOKEN: $(HELICSBot.GH.Token)
# - job: Report_Results
# displayName: Report Results
# dependsOn: Native
# condition: and(succeededOrFailed(), variables['HELICS_PR_TARGET'], variables['HELICS_PR_SLUG'], variables['HELICS_PR_NUM'])
# variables:
# PR_STATUS_REPORT: $[ dependencies.Native.result ]
# steps:
# - bash: |
# .ci/report-results.sh
# env:
# HELICSBOT_GH_TOKEN: $(HELICSBot.GH.Token)
19 changes: 15 additions & 4 deletions .github/workflows/user-guide-python-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,24 @@ jobs:
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install latest HELICS PyPI release with CLI
run: pip install helics[cli]
- name: Run user guide examples
timeout-minutes: 2
run: pip install helics[cli] helics_apps
# - name: Run fundamental user guide examples
# timeout-minutes: 2
# run: |
# ./run_fundamental_user_guide_examples.sh
- name: Print out OS information
run: cat /etc/os-release
- name: Print out HELICS installation information
run: helics --version
- name: Run fundamental User Guide examples
timeout-minutes: 7
run: |
./run_fundamental_user_guide_examples.sh
- name: Run advanced User Guide examples
timeout-minutes: 10
run: |
./run_advanced_user_guide_examples.sh
# - name: Test with pytest
# run: |
# pytest
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def destroy_federate(fed):
'''
# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateDestroy(fed)
logger.info('Federate finalized')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def destroy_federate(fed):

# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateFree(fed)
h.helicsCloseLibrary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def destroy_federate(fed):
'''
# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateFree(fed)
h.helicsCloseLibrary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def destroy_federate(fed):
'''
# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateFree(fed)
h.helicsFederateFree(fed)
logger.info('Federate finalized')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def destroy_federate(fed):

# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateDestroy(fed)
logger.info('Federate finalized')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def destroy_federate(fed):
'''
# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateDestroy(fed)
logger.info('Federate finalized')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# HELICS User Guide Advanced Topics - Broker Hierarchies

This example does not currently work. [HELICS-Examples issue #125](https://github.com/GMLC-TDC/HELICS-Examples/issues/125) is tracking this example.

This example demonstrates how to implement a broker that can use multiple messaging technologies (ZMQ, MPI, etc) when required by the computing environment. A full description of the example can be found in the [HELICS User Guide](https://docs.helics.org/en/latest/user-guide/examples/advanced_examples/advanced_brokers_multibroker.html).
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def destroy_federate(fed):
'''
# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateDestroy(fed)
logger.info('Federate finalized')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def destroy_federate(fed):

# Adding extra time request to clear out any pending messages to avoid
# annoying errors in the broker log. Any message are tacitly disregarded.
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME - 1)
status = h.helicsFederateDisconnect(fed)
h.helicsFederateDestroy(fed)
logger.info('Federate finalized')
Expand Down
Loading

0 comments on commit 8790491

Please sign in to comment.