Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Aumentar número de cuadros #43

Aumentar número de cuadros

Aumentar número de cuadros #43

name: Compilar y ejecutar memory-management.
on:
pull_request:
push:
branches:
- main
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
memory_management_changed: ${{ steps.filter.outputs.memory-management }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
memory-management:
- 'memory-management/**'
- '.github/workflows/memory-management.yml'
run-memory-management:
runs-on: ubuntu-latest
needs:
- paths-filter
if: needs.paths-filter.outputs.memory_management_changed == 'true'
strategy:
fail-fast: false
matrix:
method:
- random
- locality
- thrashing
queue-type:
- FIFO
- LRU
accesses:
- 10
- 100
- 1000
- 10000
- 100000
- 1000000
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libasan6 libubsan1
- name: Compile and run memory-management
run: |
cd memory-management/
make
./main ${{ matrix.method }} -q ${{ matrix.queue-type }}
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Create metrics file
run: |
cd memory-management/
mkdir -p outputs
python3 scripts/metrics.py simulation_log.txt |
jq -cM '. + {"method": "${{ matrix.method }}", "queue": "${{ matrix.queue-type }}", "accesses": ${{ matrix.accesses }} }' > outputs/metrics-${{ matrix.method }}-${{ matrix.queue-type }}-${{ matrix.accesses }}.json
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.method }}-${{ matrix.queue-type }}-${{ matrix.accesses }}
path: memory-management/outputs/metrics-${{ matrix.method }}-${{ matrix.queue-type }}-${{ matrix.accesses }}.json
retention-days: 7
plot-graphs:
runs-on: ubuntu-latest
needs:
- paths-filter
- run-memory-management
if: needs.paths-filter.outputs.memory_management_changed == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: /tmp/inputs
merge-multiple: true
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install python deps
run: python3 -m pip install -r memory-management/scripts/requirements.txt
- name: Unify metrics
run: |
mkdir -p /tmp/outputs
for file in /tmp/inputs/*.json; do
cat "$file" >> /tmp/outputs/metrics.jsonl
done
- name: Plot graphs
run: |
./memory-management/scripts/graphs.py \
/tmp/outputs/metrics.jsonl \
-o /tmp/outputs
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: metrics
path: /tmp/outputs/**
retention-days: 7
asan-checks:
runs-on: ubuntu-latest
needs:
- paths-filter
if: needs.paths-filter.outputs.memory_management_changed == 'true'
strategy:
fail-fast: false
matrix:
method:
- random
- locality
- thrashing
queue-type:
- FIFO
- LRU
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libasan6 libubsan1
- name: Compile and run memory-management
run: |
cd memory-management/
make asan
./main ${{ matrix.method }} -q ${{ matrix.queue-type }}
lint:
runs-on: ubuntu-latest
needs:
- paths-filter
if: needs.paths-filter.outputs.memory_management_changed == 'true'
steps:
- uses: actions/checkout@v4
- name: Formatting check
run: |
find memory-management/ -type f -name '*.c' -print0 -o -name '*.h' -print0 |
xargs -0 clang-format -Werror --style=file -n
- name: Run clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y bear
bear -- make -C memory-management/
find memory-management/ -type f -name '*.c' -print0 -o -name '*.h' -print0 |
xargs -0 clang-tidy -p compile_commands.json --config-file=.clang-tidy --warnings-as-errors='*'