Skip to content

Commit

Permalink
benchmark results
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiesquire committed Aug 8, 2023
1 parent b3b8083 commit 7e7bdc3
Show file tree
Hide file tree
Showing 5 changed files with 97,639 additions and 0 deletions.
65 changes: 65 additions & 0 deletions benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import argparse

import yaml


def build_cc_db(paths):
"""
Build a cosima-cookbook database for a list of paths
"""
import cosima_cookbook as cc

db = "./out/cookbook.db"
session = cc.database.create_session(db)
cc.database.build_index(paths, session, force=False)


def build_nri_cat(paths):
"""
Build an access-nri-intake catalog for a list of paths
"""
from access_nri_intake.catalog.manager import CatalogManager
from access_nri_intake.source.builders import AccessOm2Builder

catalog = CatalogManager("./out/catalog.csv")

for path in paths:
name = path.split("/")[-1]
catalog.build_esm(
name=name,
description=name,
builder=AccessOm2Builder,
path=path,
metadata={"model": ["ACCESS-OM2"]},
directory="./out/catalog_source/",
overwrite=True,
).add()


def main():
parser = argparse.ArgumentParser(
description="Build a test catalog/database for benchmarking."
)
parser.add_argument(
"--database",
choices=["nri", "cc"],
required=True,
help="Whether to build an access-nri-intake catalog ('nri') or a cosima-cookbook database ('cc').",
)

with open("./config/access-om2.yaml") as fobj:
config = yaml.safe_load(fobj)

paths = [source["path"][0] for source in config["sources"]]

args = parser.parse_args()
database = args.database

if database == "nri":
build_nri_cat(paths)
elif database == "cc":
build_cc_db(paths)


if __name__ == "__main__":
main()
15 changes: 15 additions & 0 deletions benchmark_cc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -l

#PBS -P tm70
#PBS -l storage=gdata/tm70+gdata/ik11+gdata/cj50+gdata/hh5
#PBS -q normal
#PBS -l walltime=48:00:00
#PBS -l mem=192gb
#PBS -l ncpus=48
#PBS -l wd
#PBS -j oe

module use /g/data/hh5/public/modules
module load conda/analysis3-unstable

python benchmark.py --database="cc"
495 changes: 495 additions & 0 deletions benchmark_cc.sh.o91615376

Large diffs are not rendered by default.

251 changes: 251 additions & 0 deletions benchmark_cc.sh.o91889431

Large diffs are not rendered by default.

Loading

0 comments on commit 7e7bdc3

Please sign in to comment.