Skip to content

Commit

Permalink
split env and benchmark #193
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCladellas committed Dec 13, 2024
1 parent 65cb4ef commit dc6bf90
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 59 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
name: Set HPC systems matrix
run: |
source .venv/bin/activate
matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/ -bcp ./tmp/benchmark_config.json -pcp ./tmp/plots.json)
matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/)
echo $matrix
echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT
- name: pull_images
Expand Down Expand Up @@ -131,8 +131,16 @@ jobs:
with:
name: config-artifacts
path: ./tmp/
- name: Execute benchmarks
- name: Setup machine and env
run: ${{matrix.submit_command}}
- name: Execute benchmarks
run: |
source .venv/bin/activate
execute-benchmark \
-mc ./tmp/machines/${{matrix.machine}} \
-bc ./tmp/benchmark_config.json \
-pc ./tmp/plots.json \
-v
- name: Upload reframe report
uses: actions/upload-artifact@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,8 @@ lfs quota -g $discoverer_project_id /discofs
lfs quota -g $discoverer_project_id /disco2fs
echo "==============================================="

matrix_config=""
benchmark_config=""
plots_config=""

while true; do
case "$1" in
--matrix-config ) matrix_config="$2"; shift 2 ;;
--benchmark-config ) benchmark_config="$2"; shift 2 ;;
--plots-config ) plots_config="$2"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done



/opt/software/python/3.9.7/bin/python3 -m venv .venv
source .venv/bin/activate


.venv/bin/python3.9 -m pip install --upgrade pip
.venv/bin/python3.9 -m pip install -I -r requirements.txt

execute-benchmark \
-mc $matrix_config \
-bc $benchmark_config \
-pc $plots_config \
-v
23 changes: 1 addition & 22 deletions src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
#!/bin/bash -l

matrix_config=""
benchmark_config=""
plots_config=""

while true; do
case "$1" in
--matrix-config ) matrix_config="$2"; shift 2 ;;
--benchmark-config ) benchmark_config="$2"; shift 2 ;;
--plots-config ) plots_config="$2"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done


python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt

execute-benchmark \
-mc $matrix_config \
-bc $benchmark_config \
-pc $plots_config \
-v
python3 -m pip install -r requirements.txt
15 changes: 3 additions & 12 deletions src/feelpp/benchmarking/scripts/hpcSystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ def writeConfig(self,output_dir,machine_data):
with open(self.machine_cfg,"w") as f:
json.dump(machine_data,f)

def createSumbitCommand(self, benchmark_config_path, plots_config_path):
def createSumbitCommand(self):
assert hasattr(self,"machine_cfg") and self.machine_cfg, "machine config path has not been set"

self.submit_command = SubmissionCommandFactory.create(self.submit,self.machine,[
f"--matrix-config {self.machine_cfg} ",
f"--benchmark-config {benchmark_config_path} ",
f"--plots-config {plots_config_path} "
])
self.submit_command = SubmissionCommandFactory.create(self.submit,self.machine)


class HpcSystemFactory:
Expand Down Expand Up @@ -84,8 +80,6 @@ def create(submit,machine,options):
def hpcSystemDispatcher_cli():
parser = ArgumentParser()
parser.add_argument("--machine_config_path", "-mcp", required=True, type=str, help="path to the machines config json")
parser.add_argument("--benchmark_config_path", "-bcp", required=True, type=str, help="path to the benchmark config json")
parser.add_argument("--plots_config_path", "-pcp", required=True, type=str, help="path to the plots config json")
parser.add_argument("--machine_output_dir", "-mod", required=True, type=str, help="path to folder where individual machine configs should be stored")
args = parser.parse_args()

Expand All @@ -100,10 +94,7 @@ def hpcSystemDispatcher_cli():
for machine_data in machines:
hpc_system = HpcSystemFactory().dispatch(machine_data["machine"])
hpc_system.writeConfig(args.machine_output_dir,machine_data)
hpc_system.createSumbitCommand(
args.benchmark_config_path,
args.plots_config_path
)
hpc_system.createSumbitCommand()
matrix.append(hpc_system.toDict())


Expand Down

0 comments on commit dc6bf90

Please sign in to comment.