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

Fix MPI / Ci debug #234

Merged
merged 38 commits into from
Jun 5, 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
59 changes: 46 additions & 13 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,11 @@ jobs:
build/config.log
build/**/tests/*.log

integration-tests:
install_with_mpi:
needs: [babeltrace2, pre_job]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Integration ${{ matrix.bats_file }} ${{matrix.thapi_sync_daemon }}
name: Install with MPI daemon support
runs-on: ubuntu-latest
strategy:
matrix:
thapi_sync_daemon: [ 'fs', 'mpi' ]
bats_file: ['mpi_test', 'sync_daemon_test']
include:
- bats_file: no_mpi
env:
THAPI_TEST_BIN: clinfo
THAPI_BIN_DIR: ./build/ici/bin
THAPI_SYNC_DAEMON: ${{ matrix.thapi_sync_daemon }}
steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
Expand All @@ -122,7 +112,7 @@ jobs:
with:
path: ~/babeltrace2/2.0.4
key: ${{ runner.os }}-build-${{ env.cache-name }}
- run: sudo apt update; sudo apt install -y gcc g++ lttng-tools liblttng-ust-dev ruby ruby-dev elfutils libelf-dev libdw-dev libprotobuf-dev protobuf-compiler bats libpocl2 clinfo valgrind
- run: sudo apt update; sudo apt install -y gcc g++ lttng-tools liblttng-ust-dev ruby ruby-dev elfutils libelf-dev libdw-dev libprotobuf-dev protobuf-compiler
- run: sudo gem install cast-to-yaml nokogiri babeltrace2 opencl_ruby_ffi metababel
- name: Load Babeltrace2
run: |
Expand All @@ -137,6 +127,49 @@ jobs:
working-directory: build
- run: make -j install
working-directory: build
- name: Tar THAPI # https://github.com/actions/download-artifact?tab=readme-ov-file#permission-loss
run: tar -cvf thapi.tar ./build/ici/
- uses: actions/upload-artifact@v4
with:
name: thapi-bin
path: thapi.tar

integration-tests:
needs: [babeltrace2, pre_job, install_with_mpi]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Integration ${{ matrix.bats_file }} ${{matrix.thapi_sync_daemon }}
runs-on: ubuntu-latest
strategy:
matrix:
thapi_sync_daemon: ['fs', 'mpi']
bats_file: ['mpi_sync_daemon', 'mpi_iprof']
include:
- bats_file: 'iprof'
env:
THAPI_TEST_BIN: clinfo
THAPI_BIN_DIR: ./build/ici/bin
THAPI_SYNC_DAEMON: ${{ matrix.thapi_sync_daemon }}
steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
- uses: actions/cache@v4
id: babeltrace2
env:
cache-name: cache-babeltrace2
with:
path: ~/babeltrace2/2.0.4
key: ${{ runner.os }}-build-${{ env.cache-name }}
- uses: actions/download-artifact@v4
with:
name: thapi-bin
- name: Untar THAPI
run: tar -xvf thapi.tar
- run: sudo apt update; sudo apt install -y lttng-tools liblttng-ust-dev ruby ruby-dev libprotobuf-dev libpocl2 clinfo bats
- run: sudo gem install babeltrace2 opencl_ruby_ffi
- name: Load Babeltrace2
run: |
echo "$HOME/babeltrace2/2.0.4/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$HOME/babeltrace2/2.0.4/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: integration test ${{ matrix.bats_file }}
run: |
bats integration_tests/${{ matrix.bats_file }}.bats
Expand Down
18 changes: 12 additions & 6 deletions integration_tests/no_mpi.bats → integration_tests/iprof.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@ teardown_file() {
rm -rf $THAPI_HOME/thapi-traces
}

@test "default" {
@test "default_summary" {
$IPROF $THAPI_TEST_BIN
}

@test "default_trace" {
$IPROF -t $THAPI_TEST_BIN | wc -l
}

@test "default_timeline" {
$IPROF -l -- $THAPI_TEST_BIN
rm out.pftrace
}

@test "replay" {
@test "replay_summary" {
$IPROF $THAPI_TEST_BIN
$IPROF -r
}

@test "no-analsysis" {
@test "no-analysis_all" {
$IPROF --no-analysis -- $THAPI_TEST_BIN
$IPROF -r
$IPROF -t -r | wc -l
$IPROF -l -r
rm out.pftrace
}

@test "trace-output" {
@test "trace-output_all" {
$IPROF --trace-output trace_1 -- $THAPI_TEST_BIN
$IPROF -r trace_1
rm -rf trace_1
Expand All @@ -43,13 +49,13 @@ teardown_file() {
rm -rf trace_3 out.pftrace
}

@test "timeline output" {
@test "timeline_output" {
$IPROF -l roger -- $THAPI_TEST_BIN
rm roger
}

# Assert Failure
@test "failure of replay" {
@test "replay_negative" {
$IPROF -- $THAPI_TEST_BIN
run $IPROF -t -r
[ "$status" != 0 ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bats

setup_file() {
export THAPI_HOME=$PWD
export IPROF=$THAPI_BIN_DIR/iprof
export MPIRUN=${MPIRUN:-mpirun}
export THAPI_SYNC_DAEMON=${THAPI_SYNC_DAEMON:-mpi}
Expand All @@ -10,9 +11,6 @@ teardown_file() {
rm -rf $THAPI_HOME/thapi-traces
}

@test "default_mpi_sync_${THAPI_SYNC_DAEMON}" {
$MPIRUN -n 12 $IPROF --debug 0 $THAPI_TEST_BIN
$MPIRUN -n 12 $IPROF -t $THAPI_TEST_BIN | wc -l
$MPIRUN -n 12 $IPROF --debug 0 -l -- $THAPI_TEST_BIN
rm out.pftrace
@test "default_summary_${THAPI_SYNC_DAEMON}" {
THAPI_JOBID=0 $MPIRUN -n 2 $IPROF --debug 0 -- $THAPI_TEST_BIN
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ setup_file() {
}

@test "sync_daemon_${THAPI_SYNC_DAEMON}" {
$MPIRUN -n 2 ./integration_tests/sync_daemon_test/test.sh
THAPI_JOBID=0 $MPIRUN -n 2 ./integration_tests/sync_daemon_test/test.sh
}
Loading