Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
# apply inifix-format to all .ini files
ac260f4af48221229aef4fc1f93ffbf9df450739
1ca7676fee7a578bd64e64ec9b6bdfbceb921775

# apply ruff format to all .py files
8d0437bf23d7d8007355fa35b9f094287f7de987
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.8
hooks:
- id: ruff-format
args: [--target-version=py310]
- id: ruff-check
args: [--quiet, --fix, --show-fixes]
args: [--target-version=py310, --quiet, --fix, --show-fixes]

- repo: https://github.com/la-niche/inifix-pre-commit
rev: v1.0.0
Expand Down
51 changes: 28 additions & 23 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

# -- Project information -----------------------------------------------------

project = 'Idefix'
copyright = 'Geoffroy Lesur et al.'
author = 'Geoffroy Lesur'
project = "Idefix"
copyright = "Geoffroy Lesur et al."
author = "Geoffroy Lesur"

# The full version, including alpha/beta/rc tags
release = '2.3.0'

release = "2.3.0"


# -- General configuration ---------------------------------------------------
Expand All @@ -34,20 +33,24 @@
# ones.
extensions = [
"sphinx_rtd_theme",
'sphinx_git',
'matplotlib.sphinxext.plot_directive',
"sphinx_git",
"matplotlib.sphinxext.plot_directive",
"breathe",
"exhale",
"m2r2",
"sphinx_copybutton"
]
"sphinx_copybutton",
]

source_suffix = [".rst", ".md"]

cpp_id_attributes=["KOKKOS_FORCEINLINE_FUNCTION","KOKKOS_INLINE_FUNCTION","KOKKOS_RESTRICT"]
cpp_id_attributes = [
"KOKKOS_FORCEINLINE_FUNCTION",
"KOKKOS_INLINE_FUNCTION",
"KOKKOS_RESTRICT",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -60,45 +63,47 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


def setup(app):
app.add_css_file('my_theme.css')
app.add_css_file("my_theme.css")


##############
# Breathe/Exhale options

# Setup the breathe extension
breathe_projects = {
"Idefix": "./xml"
"Idefix": "./xml",
}
breathe_default_project = "Idefix"

# Setup the exhale extension
exhale_args = {
# These arguments are required
"containmentFolder": "./api",
"rootFileName": "library_root.rst",
"rootFileTitle": "Idefix API",
"containmentFolder": "./api",
"rootFileName": "library_root.rst",
"rootFileTitle": "Idefix API",
# Suggested optional arguments
"createTreeView": False,
"createTreeView": False,
# TIP: if using the sphinx-bootstrap-theme, you need
# "treeViewIsBootstrap": True,
"doxygenStripFromPath": "../../src",
"exhaleExecutesDoxygen": True,
"exhaleDoxygenStdin": textwrap.dedent('''
"exhaleDoxygenStdin": textwrap.dedent("""
INPUT = ../../src
EXCLUDE = ../../src/kokkos
''')
"""),
}

# Tell sphinx what the primary language being documented is.
primary_domain = 'cpp'
primary_domain = "cpp"

# Tell sphinx what the pygments highlight language should be.
highlight_language = 'cpp'
highlight_language = "cpp"
22 changes: 11 additions & 11 deletions doc/source/plot_idefix_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@


def do_plot(title, bench_file, gpumodels):
with open(bench_file, 'r') as f:
with open(bench_file, "r") as f:
benches = json.load(f)

plt.figure()
xmax=0
ymax=0
xmax = 0
ymax = 0
for gpumodel in gpumodels:
select = [bench for bench in benches if bench['gpumodel'] == gpumodel][-1]
select = [bench for bench in benches if bench["gpumodel"] == gpumodel][-1]

xs = [r['nbgpu'] for r in select['results']]
ys = [r['cell_updates'] for r in select['results']]
plt.plot(xs, ys,'o-',label=gpumodel)
xmax=max(xmax,max(xs))
ymax=max(ymax,max(ys))
xs = [r["nbgpu"] for r in select["results"]]
ys = [r["cell_updates"] for r in select["results"]]
plt.plot(xs, ys, "o-", label=gpumodel)
xmax = max(xmax, max(xs))
ymax = max(ymax, max(ys))

plt.xscale("log", base=2)
plt.ylim(0,ymax*1.1)
plt.xlim(1,xmax*1.1)
plt.ylim(0, ymax * 1.1)
plt.xlim(1, xmax * 1.1)
plt.legend()
plt.xlabel("Number of GPUs/GCDs")
plt.ylabel("Performance (cells / second / GPU)")
Expand Down
2 changes: 1 addition & 1 deletion make_tarballs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _make_self_contained_tarball(output_dir, *, suffix="", exclude_list=None):
os.replace(os.path.join(work_dir, tarball), final_tarfile)

filesize = os.path.getsize(final_tarfile)
print("Done ! Final file size is %.1f MB" % (filesize / 1024 ** 2))
print("Done ! Final file size is %.1f MB" % (filesize / 1024**2))


def main(argv=None):
Expand Down
2 changes: 2 additions & 0 deletions pytools/dump_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@author: lesurg
"""

import os
import re
import struct
Expand Down Expand Up @@ -119,6 +120,7 @@ def _read_fields(self, fh):
def __repr__(self):
return "DumpDataset('%s')" % self.filename


# public API
def readDump(filename):
return DumpDataset(filename)
8 changes: 4 additions & 4 deletions pytools/idfx_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

HEADER_SIZE = 128


# There is one .idfx file per processor
class IdfxFileField(object):

def __init__(self, fh, byteorder="little"):
# read entry name
q = fh.read(NAME_SIZE)
Expand All @@ -32,6 +32,7 @@ def __init__(self, fh, byteorder="little"):
raw = struct.unpack(str(ntot) + "d", fh.read(DOUBLE_SIZE * ntot))
self.array = np.asarray(raw).reshape(dims[::-1])


class IdfxFileDataset(object):
def __init__(self, filename):
# identical to DumpDataset
Expand All @@ -45,12 +46,11 @@ def _read_header(self, fh):
# could easily be identical to DumpDataset
headerSize = 128
q = fh.read(headerSize)
n = q.index(b'\x00')
self.header = q[:n].decode('utf-8')
n = q.index(b"\x00")
self.header = q[:n].decode("utf-8")

self.metadata["byteorder"] = "little"


def _read_field(self, fh):
# identical to DumpDataset
if self.metadata["byteorder"] is None:
Expand Down
Loading
Loading