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

resolves : 193 echo quotas for discoverer #194

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 12 additions & 7 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,9 @@ 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
run: |
source .venv/bin/activate
#ONLY IF NEEDED
- name: Gather arguments
id: gather_arguments
run: |
Expand Down Expand Up @@ -131,8 +127,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 ${{matrix.machine_cfg}} \
-bc ./tmp/benchmark_config.json \
-pc ./tmp/plots.json \
-v
- name: Upload reframe report
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -171,12 +175,13 @@ jobs:
uses: peter-evans/create-pull-request@v7
with:
title: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}"
commit-message: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}"
body: |
Generating reports from staging directory.
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
reviewers: JavierCladellas
labels: new-benchmark
branch: new-benchmark-${{needs.factory.outputs.executable_name}}
branch: new-benchmark
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ifdef::env-github,env-browser,env-vscode[:imagesprefix: ../images/]
= Benchmarking
:page-layout: toolboxes
:page-tags: catalog, catalog-index
:docdatetime: 2024-12-13T13:45:00
:docdatetime: 2024-12-13T15:38:32
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
'feelpp.benchmarking' = ['reframe/config/machineConfigs/hpc.env']

[project]
name = "benchmarking"
version = "0.0.1"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ nbmake
traitlets
tabulate
typing-extensions>=4.12.2
python-dotenv
.
5 changes: 3 additions & 2 deletions src/feelpp/benchmarking/reframe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def main_cli():

reframe_cmd = cmd_builder.buildCommand( app_reader.config.timeout )

exit_code = os.system(reframe_cmd)
exit_code = subprocess.run(reframe_cmd, shell=True)

#============ CREATING RESULT ITEM ================#
with open(os.path.join(report_folder_path,"plots.json"),"w") as f:
Expand Down Expand Up @@ -134,4 +134,5 @@ def main_cli():
subprocess.run(["npm","run","antora"])
subprocess.run(["npm","run","start"])

return exit_code
# return exit_code.returncode
return 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from dotenv import load_dotenv
from pathlib import Path
import os

load_dotenv(os.path.join(Path(__file__).resolve().parent,"hpc.env"))

project_id = os.getenv("discoverer_project_id")

site_configuration = {
'systems':[
{
Expand All @@ -11,7 +19,7 @@
'scheduler': 'slurm',
'launcher': 'srun',
'max_jobs': 8,
'access': ['--partition=cn --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047'],
'access': [f"--partition=cn --account={project_id} --qos={project_id}"],
'environs': ['default'],
'processor': {
'num_cpus': 128
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
#!/bin/bash -l
#SBATCH --nodes=1 # number of nodes
#SBATCH --ntasks=1 # number of tasks
#SBATCH --qos=default # SLURM qos
#SBATCH --ntasks-per-node=8 # number of tasks per node
#SBATCH --cpus-per-task=1 # number of cores per task
#SBATCH --time=02:00:00 # time (HH:MM:SS)
#SBATCH --partition=cn # partition
#SBATCH --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047 # project account

SCRIPT_DIR=$(dirname "$0")
source "$SCRIPT_DIR/hpc.env"

source /etc/profile.d/modules.sh
export MODULEPATH=/opt/software/modulefiles
echo "================================================"
sacctmgr show association where account=$discoverer_project_id

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
sshare -A $discoverer_project_id -u " " -o account,user,GrpTRESRaw%80,GrpTRESMins,RawUsage

lfs quota -g $discoverer_project_id /discofs
lfs quota -g $discoverer_project_id /disco2fs
echo "==============================================="


/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
30 changes: 1 addition & 29 deletions src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
#!/bin/bash -l
#SBATCH --nodes=1 # number of nodes
#SBATCH --ntasks=1 # number of tasks
##SBATCH --qos=default # SLURM qos
#SBATCH --ntasks-per-node=8 # number of tasks per node
#SBATCH --cpus-per-task=1 # number of cores per task
#SBATCH --time=02:00:00 # time (HH:MM:SS)
#SBATCH --partition=public

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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
discoverer_project_id="ehpc-dev-2024d05-047"
19 changes: 5 additions & 14 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 @@ -70,12 +66,12 @@ def __init__(self,machine):
super().__init__(machine)
self.executable = "bash"

def buildCommand(self, options):
def buildCommand(self, options=[]):
return " ".join([self.executable, self.script] + options)

class SubmissionCommandFactory:
@staticmethod
def create(submit,machine,options):
def create(submit,machine,options=[]):
if submit == "cli":
return Cli(machine).buildCommand(options)
else:
Expand All @@ -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
Loading