Fix: add HybridMesher as normal source folder (not submodule)

main
Qi Jian Lim 4 weeks ago
parent 46ad7f2ab3
commit 6c05defaa1
  1. 1
      HybridMesher
  2. BIN
      HybridMesher/Geometry.cpython-39-x86_64-linux-gnu.so
  3. 125
      HybridMesher/Makefile
  4. 25
      HybridMesher/PRE_SETUP
  5. 36
      HybridMesher/README.rst
  6. 258
      HybridMesher/SETUP
  7. 240
      HybridMesher/SingaporeVersion.py
  8. 9
      HybridMesher/build/cpu/IO.d
  9. 10
      HybridMesher/build/cpu/MeshAlgorithms.d
  10. BIN
      HybridMesher/build/cpu/MeshAlgorithms.o
  11. 1
      HybridMesher/build/cpu/PyBind.d
  12. BIN
      HybridMesher/build/cpu/PyBind.o
  13. 124
      HybridMesher/build/py_cpu/Geometry.cu.d
  14. BIN
      HybridMesher/build/py_cpu/Geometry.cu.o
  15. 124
      HybridMesher/build/py_cpu/IO.d
  16. BIN
      HybridMesher/build/py_cpu/IO.o
  17. 124
      HybridMesher/build/py_cpu/MeshAlgorithms.d
  18. BIN
      HybridMesher/build/py_cpu/MeshAlgorithms.o
  19. 124
      HybridMesher/build/py_cpu/PyBind.d
  20. BIN
      HybridMesher/build/py_cpu/PyBind.o
  21. 2579
      HybridMesher/docs/Doxyfile
  22. 20
      HybridMesher/docs/Makefile
  23. 35
      HybridMesher/docs/make.bat
  24. 4
      HybridMesher/docs/requirements.txt
  25. 14
      HybridMesher/docs/source/.auctex-auto/refs.el
  26. BIN
      HybridMesher/docs/source/_static/images/cube_tetra_tiling.png
  27. 129
      HybridMesher/docs/source/_static/images/leapfrog.svg
  28. 89
      HybridMesher/docs/source/_static/images/reference_tetrahedron.svg
  29. 39
      HybridMesher/docs/source/_static/js/mathjax-config.js
  30. 81
      HybridMesher/docs/source/classes.rst
  31. 54
      HybridMesher/docs/source/conf.py
  32. 21
      HybridMesher/docs/source/index.rst
  33. 85
      HybridMesher/docs/source/refs.bib
  34. 132
      HybridMesher/docs/source/usage.rst
  35. 845
      HybridMesher/libraries/CudaTools/include/Array.h
  36. 627
      HybridMesher/libraries/CudaTools/include/BLAS.h
  37. 683
      HybridMesher/libraries/CudaTools/include/Core.h
  38. 311
      HybridMesher/libraries/CudaTools/include/Macros.h
  39. 166
      HybridMesher/libraries/CudaTools/include/Types.h
  40. 66
      HybridMesher/libraries/EXODUS/include/SeacasConfig.cmake
  41. 36
      HybridMesher/libraries/EXODUS/include/Seacas_version_date.h
  42. 1829
      HybridMesher/libraries/EXODUS/include/exodusII.h
  43. 892
      HybridMesher/libraries/EXODUS/include/exodusII_int.h
  44. 18
      HybridMesher/libraries/EXODUS/include/exodusII_par.h
  45. 22
      HybridMesher/libraries/EXODUS/include/exodus_config.h
  46. 222
      HybridMesher/libraries/EXODUS/lib/cmake/SEACAS/SEACASConfig.cmake
  47. 123
      HybridMesher/libraries/EXODUS/lib/cmake/SEACAS/SEACASTargets.cmake
  48. 181
      HybridMesher/libraries/EXODUS/lib/cmake/SEACASExodus/SEACASExodusConfig.cmake
  49. 19
      HybridMesher/libraries/EXODUS/lib/cmake/SEACASExodus/SEACASExodusTargets-release.cmake
  50. 116
      HybridMesher/libraries/EXODUS/lib/cmake/SEACASExodus/SEACASExodusTargets.cmake
  51. 202
      HybridMesher/libraries/EXODUS/lib/cmake/Seacas/SeacasConfig.cmake
  52. 70
      HybridMesher/libraries/EXODUS/lib/cmake/Seacas/SeacasConfigVersion.cmake
  53. 1
      HybridMesher/libraries/EXODUS/lib/exodus.py
  54. 5456
      HybridMesher/libraries/EXODUS/lib/exodus2.py
  55. 6905
      HybridMesher/libraries/EXODUS/lib/exodus3.py
  56. 1
      HybridMesher/libraries/EXODUS/lib/exomerge.py
  57. 8900
      HybridMesher/libraries/EXODUS/lib/exomerge2.py
  58. 8698
      HybridMesher/libraries/EXODUS/lib/exomerge3.py
  59. 23
      HybridMesher/libraries/EXODUS/lib/external_packages/DLlib/DLlibConfig.cmake
  60. 14
      HybridMesher/libraries/EXODUS/lib/external_packages/DLlib/DLlibConfigVersion.cmake
  61. 62
      HybridMesher/libraries/EXODUS/lib/external_packages/Netcdf/NetcdfConfig.cmake
  62. 14
      HybridMesher/libraries/EXODUS/lib/external_packages/Netcdf/NetcdfConfigVersion.cmake
  63. 1
      HybridMesher/libraries/EXODUS/lib/libexoIIv2c.a
  64. BIN
      HybridMesher/libraries/EXODUS/lib/libexodus.a
  65. 1
      HybridMesher/libraries/EXODUS/lib/libexodus.so
  66. 1
      HybridMesher/libraries/EXODUS/lib/libexodus.so.2
  67. BIN
      HybridMesher/libraries/EXODUS/lib/libexodus.so.2.0
  68. BIN
      HybridMesher/libraries/EXODUS/lib/tests/exomerge_unit_test.e
  69. 1886
      HybridMesher/libraries/EXODUS/lib/tests/exomerge_unit_test.py
  70. BIN
      HybridMesher/libraries/EXODUS/lib/tests/test-assembly.exo
  71. 379
      HybridMesher/libraries/EXODUS/lib/tests/test_exodus3.py
  72. 391
      HybridMesher/libraries/HDF5-1.14.1/bin/h5cc
  73. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5clear
  74. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5copy
  75. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5debug
  76. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5delete
  77. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5diff
  78. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5dump
  79. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5format_convert
  80. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5import
  81. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5jam
  82. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5ls
  83. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5mkgrp
  84. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5perf_serial
  85. 215
      HybridMesher/libraries/HDF5-1.14.1/bin/h5redeploy
  86. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5repack
  87. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5repart
  88. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5stat
  89. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5unjam
  90. BIN
      HybridMesher/libraries/HDF5-1.14.1/bin/h5watch
  91. 781
      HybridMesher/libraries/HDF5-1.14.1/include/H5ACpublic.h
  92. 1254
      HybridMesher/libraries/HDF5-1.14.1/include/H5Apublic.h
  93. 59
      HybridMesher/libraries/HDF5-1.14.1/include/H5Cpublic.h
  94. 250
      HybridMesher/libraries/HDF5-1.14.1/include/H5DOpublic.h
  95. 413
      HybridMesher/libraries/HDF5-1.14.1/include/H5DSpublic.h
  96. 1859
      HybridMesher/libraries/HDF5-1.14.1/include/H5Dpublic.h
  97. 52
      HybridMesher/libraries/HDF5-1.14.1/include/H5ESdevelop.h
  98. 384
      HybridMesher/libraries/HDF5-1.14.1/include/H5ESpublic.h
  99. 441
      HybridMesher/libraries/HDF5-1.14.1/include/H5Epubgen.h
  100. 946
      HybridMesher/libraries/HDF5-1.14.1/include/H5Epublic.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1 +0,0 @@
Subproject commit 30f75424f6f8b54d5ae32510d714ad1c506e58ac

@ -0,0 +1,125 @@
CC := g++-10
NVCC := nvcc
CFLAGS := -std=c++17 -fpic -MMD -Wall -fopenmp
NVCC_FLAGS := -std=c++17 -fpic -MMD -Xcudafe="--diag_suppress=20012 --diag_suppress=20236" -Xcompiler -fopenmp
INCLUDE := libraries/include libraries/include/NetCDF-C
LIBS_DIR := libraries/lib
LIBS_DIR_GPU := /usr/local/cuda/lib64
LIBS := exodus netcdf hdf5_hl hdf5 z tet dl zip
LIBS_GPU := cuda cudart cublas
TARGET = Geometry
SRC_DIR = src
BUILD_DIR = build
# Should not need to modify below.
CPU_BUILD_DIR = $(BUILD_DIR)/cpu
GPU_BUILD_DIR = $(BUILD_DIR)/gpu
PY_CPU_BUILD_DIR = $(BUILD_DIR)/py_cpu
SRC = $(wildcard $(SRC_DIR)/*/*.cpp) $(wildcard $(SRC_DIR)/*.cpp)
# Get source files and object files.
GCC_SRC = $(filter-out %.cu.cpp ,$(SRC))
NVCC_SRC = $(filter %.cu.cpp, $(SRC))
GCC_OBJ = $(GCC_SRC:$(SRC_DIR)/%.cpp=%.o)
NVCC_OBJ = $(NVCC_SRC:$(SRC_DIR)/%.cpp=%.o)
# If compiling for CPU, all go to GCC. Otherwise, they are split.
CPU_OBJ = $(addprefix $(CPU_BUILD_DIR)/,$(GCC_OBJ)) $(addprefix $(CPU_BUILD_DIR)/,$(NVCC_OBJ))
GPU_GCC_OBJ = $(addprefix $(GPU_BUILD_DIR)/,$(GCC_OBJ))
GPU_NVCC_OBJ = $(addprefix $(GPU_BUILD_DIR)/,$(NVCC_OBJ))
PY_CPU_OBJ = $(addprefix $(PY_CPU_BUILD_DIR)/,$(GCC_OBJ)) $(addprefix $(PY_CPU_BUILD_DIR)/,$(NVCC_OBJ))
# $(info $$GCC_SRC is [${GCC_SRC}])
# $(info $$NVCC_SRC is [${NVCC_SRC}])
# $(info $$GCC_OBJ is [${GCC_OBJ}])
# $(info $$NVCC_OBJ is [${NVCC_OBJ}])
# $(info $$CPU_OBJ is [${CPU_OBJ}])
# $(info $$GPU_GCC_OBJ is [${GPU_GCC_OBJ}])
# $(info $$GPU_NVCC_OBJ is [${GPU_NVCC_OBJ}])
HEADER = $(wildcard $(SRC_DIR)/*/*.h) $(wildcard $(SRC_DIR)/*.h)
CPU_DEPS = $(wildcard $(CPU_BUILD_DIR)/*.d)
GPU_DEPS = $(wildcard $(GPU_BUILD_DIR)/*.d)
SPACE := $(subst ,, )
COMMA := ,
INC := $(INCLUDE:%=-I%)
LIB := $(LIBS_DIR:%=-L%)
RPATH := $(subst $(SPACE),$(COMMA),$(LIBS_DIR))
LIB_GPU := $(LIBS_DIR_GPU:%=-L%)
LD := $(LIBS:%=-l%)
LD_GPU := $(LIBS_GPU:%=-l%)
PY_EXT := $(shell python3-config --extension-suffix)
PY_INC := $(shell python3-config --includes)
# Reminder:
# $< = first prerequisite
# $@ = the target which matched the rule
# $^ = all prerequisites
.PHONY: all docs clean
all : cpu gpu python docs
cpu: $(TARGET)CPU
gpu: $(TARGET)GPU
python: $(TARGET)PY
docs: SHELL:=/bin/bash
docs:
if [ ! -d "docs/.venv" ]; then python3 -m venv "docs/.venv"; fi
( \
source docs/.venv/bin/activate;\
pip install -r docs/requirements.txt; \
doxygen docs/Doxyfile; \
sphinx-build -b html docs/source docs/build/html; \
deactivate \
)
# CPU ONLY
$(TARGET)CPU: $(CPU_OBJ)
$(CC) $(CFLAGS) $^ -o $@ $(LIB) $(LD) -Wl,-rpath,$(RPATH)
$(CPU_BUILD_DIR)/%.o $(CPU_BUILD_DIR)/%.cu.o: $(SRC_DIR)/%.cpp | $(CPU_BUILD_DIR)
$(CC) $(CFLAGS) -c -o $@ $< $(INC) $(PY_INC)
# GPU ONLY
# For GPU, we need to build the NVCC objects, the NVCC linked object, and the
# regular ones. Then, we link them all together.
$(TARGET)GPU: $(GPU_BUILD_DIR)/link.o $(GPU_GCC_OBJ) | $(GPU_BUILD_DIR)
$(CC) -g -DCUDA $(CFLAGS) $(GPU_NVCC_OBJ) $^ -o $@ $(INC) $(LIB) $(LIB_GPU) $(LD) $(LD_GPU) -Wl,-rpath,$(RPATH)
$(GPU_BUILD_DIR)/link.o: $(GPU_NVCC_OBJ) | $(GPU_BUILD_DIR)
$(NVCC) --device-link $^ -o $@
$(GPU_BUILD_DIR)/%.cu.o: $(SRC_DIR)/%.cu.cpp | $(GPU_BUILD_DIR)
$(NVCC) $(NVCC_FLAGS) -DCUDA -x cu --device-c -o $@ $< $(INC)
$(GPU_BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp | $(GPU_BUILD_DIR)
$(CC) $(CFLAGS) -g -DCUDA -c -o $@ $< $(INC)
# PYTHON CPU
$(TARGET)PY: $(PY_CPU_OBJ)
$(CC) $(CFLAGS) $^ -shared -o $(TARGET)$(PY_EXT) $(LIB) -Wl,--whole-archive $(LD) -Wl,--no-whole-archive
$(PY_CPU_BUILD_DIR)/%.o $(PY_CPU_BUILD_DIR)/%.cu.o: $(SRC_DIR)/%.cpp | $(PY_CPU_BUILD_DIR)
$(CC) $(CFLAGS) -DPYTHON -c -o $@ $< $(INC) $(PY_INC)
-include $(CPU_DEPS)
-include $(GPU_DEPS)
$(CPU_BUILD_DIR) $(GPU_BUILD_DIR) $(PY_CPU_BUILD_DIR):
mkdir -p $@
clean:
rm -Rf $(BUILD_DIR) $(TARGET)* docs/build docs/.venv

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import os
import subprocess
from pathlib import Path
def main():
libraries_dir = "libraries"
# Unzip lib.zip in the libraries directory
subprocess.run(["unzip", "libs.zip"], cwd=libraries_dir, check=True)
# Make clone directory
subprocess.run(["mkdir", "-p", "clone"], cwd=libraries_dir)
# Move everything except 'libs.zip'
directories = [f.name for f in Path(libraries_dir).iterdir() if f.is_dir()]
for dir in directories:
if(dir != "clone"):
subprocess.run(["mv", dir, "clone/"], cwd=libraries_dir)
if __name__ == "__main__":
main()

@ -0,0 +1,36 @@
========
Geometry
========
This repository contains code for the Geometry library, which is available both as a
C++ library and a Python module. The documentation is up `here <https://acem.ece.illinois.edu/docs/Geometry/>`__.
Building
--------
All that is required is a working Python installation. First, clone the repository
.. code-block:: sh
$ git clone https://git.acem.ece.illinois.edu/gonzalo9/HybridMesher.git
$ cd HybridMesher
You may also need to install a few other tools, such as ``m4`` and ``cmake`` if they are not
already installed. A new version of ``cmake`` is needed. Next, we build the dependencies by running
.. code-block:: sh
$ ./PRE_SETUP
$ ./SETUP
Lastly, you can build the Python module by running the Makefile
.. code-block:: sh
$ make python
Documentation
-------------
To build the documentation, you simply only need to run the Makefile
.. code-block:: sh
$ make docs

@ -0,0 +1,258 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse, subprocess, shutil, os
from enum import Enum
from pathlib import Path
LIB_DIR = Path("libraries/clone")
INSTALL_DIR = Path("libraries")
SYSTEM_INSTALL_DIR = Path("/usr/local")
Compatibility = Enum('Compatibility', ['Equal', 'AtLeast', 'AtMost'])
CompatSymbol = {Compatibility.Equal: '==', Compatibility.AtLeast: ">=", Compatibility.AtMost: "<="}
SymbolCompat = {'==': Compatibility.Equal, ">=": Compatibility.AtLeast, "<=": Compatibility.AtMost}
def make_box(string: str):
length = len(string) - 3
print("╔" + "="*(length-2) + "╗")
print(f"┇ {string} ┇")
print("╚" + "="*(length-2) + "╝ ")
def error(predicate: bool, error: str):
if predicate:
print(f'[\033[1;31mERROR\033[0m] {error}')
quit()
class Library:
def __init__(self, name: str, version: str, compatibility: Compatibility):
self.name = name
self.version = [int(x) for x in version.split(".")]
self.compatibility = compatibility
self.id = name if version == "0.0.0" else f'{name}-{version}'
def exists(self):
return (INSTALL_DIR / self.id).is_dir()
def is_satisfied_by(self, dep: Library):
if self.compatibility == Compatibility.Equal:
return self.version == dep.version
elif self.compatibility == Compatibility.AtLeast:
return self.version <= dep.version
elif self.compatibility == Compatibility.AtMost:
return self.version >= dep.version
@staticmethod
def from_name(name: str) -> Library:
ind = name.rfind("-")
if ind == -1:
return Library(name, "0.0.0", Compatibility.Equal)
else:
error(not name[ind+1].isnumeric(), f"The library '{name}' has an invalid name.")
return Library(name[:ind], name[ind+1:], Compatibility.Equal)
@staticmethod
def from_line(line: str) -> Library:
line = line.split(" ")
if len(line) == 1:
return Library(line[0], "0.0.0", Compatibility.AtLeast)
try:
return Library(line[0], line[2], SymbolCompat[line[1]])
except (KeyError, IndexError):
error(True, f"The dependency line '{line}' is formatted improperly.")
class Node:
def __init__(self, lib: Library):
self.lib = lib
self.parent = None
self.dependencies = []
self.visited = False
def build(self, prefix: Path, verbose: bool) -> int:
head = " ── "
space = " "
ok = " [\033[1;32mOK\033[0m] "
err = " [\033[1;31mERR\033[0m] "
lib_prefix = prefix / self.lib.id
setup = LIB_DIR / self.lib.id / "SETUP"
error(not setup.is_file(), f"The library '{self.lib.id}' does not have a SETUP file.")
make_box(f"Building '\033[1;96m{self.lib.id}\033[0m'")
if lib_prefix.is_dir():
print(f"{ok}Library is already built, installation at '{lib_prefix}'\n")
return 0
deps = " ".join([str(prefix / dep) for dep in self.dependencies])
commands = f"{setup} {lib_prefix} {deps}".split(" ")
if verbose:
p = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
else:
p = subprocess.Popen(commands, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, text=True)
rows, _ = shutil.get_terminal_size((80, 20))
s = rows - 10 - len(head)
for line in (p.stdout if verbose else p.stderr):
line = "\n".join([(head if i == 0 else space) + line[i: i + s] for i in range(0, len(line), s)])
print(line, end="")
returncode = p.poll()
if returncode == 0:
print(f"{ok}Finished building library, installation at '{lib_prefix}'\n")
return 0
else:
print(f"{err}Error while building library. Return code: {returncode}\n")
return 1
class DependencyTree:
def __init__(self):
self.all_deps = dict()
self.roots = []
def add_library(self, lib_dir: Path):
lib = Library.from_name(lib_dir.name)
if lib.id not in self.all_deps:
self.all_deps[lib.id] = Node(lib)
else:
error(True, "Duplicate libaries, shouldn't be possible.")
dep_file = lib_dir / "DEPENDENCIES"
error(not dep_file.is_file(), f"The library '{lib.id}' does not have a DEPENDENCIES file.")
lib_deps = open(dep_file, "r").read().splitlines()
for dep_line in lib_deps:
lib_dep = Library.from_line(dep_line)
self.all_deps[lib.id].dependencies.append(lib_dep)
def build(self):
# Validate dependencies and build tree.
for node in self.all_deps.values():
satisfied_deps = []
for dep in node.dependencies:
fails = ""
satisfied = False
for node_check in self.all_deps.values():
if node_check.lib.name != dep.name:
continue
if dep.is_satisfied_by(node_check.lib):
satisfied = True
satisfied_deps.append(node_check.lib.id)
node_check.parent = node.lib.id
break
else:
fails += f', {node_check.lib.id}'
if not satisfied:
vers = ".".join([str(x) for x in dep.version])
dep_line = f'{dep.name} {CompatSymbol[dep.compatibility]} {vers}'
error(True, f"Dependency '{dep_line}' from '{node.lib.id}' is not satisfied "\
f"by any of the following:{fails[1:]}")
self.all_deps[node.lib.id].dependencies = satisfied_deps
# Get roots of the tree.
for node in self.all_deps.values():
if node.parent is None:
self.roots.append(node.lib.id)
def __repr__(self):
return self.string_helper(0, self.roots)[:-1]
def string_helper(self, layer, deps):
line = ""
for i, node_id in enumerate(deps):
node = self.all_deps[node_id]
line += "│ "*layer + f"├─{node.lib.id}\n"
line += self.string_helper(layer+1, node.dependencies)
return line
def reverse_traversal(self) -> List[Node]:
rt = self.reverse_helper(self.roots)[::-1]
seen = set()
return [x for x in rt if not (x in seen or seen.add(x))]
def reverse_helper(self, libs):
traversal = []
for node_id in libs:
node = self.all_deps[node_id]
traversal.append(node_id)
traversal += self.reverse_helper(node.dependencies)
return traversal
def main():
parser = argparse.ArgumentParser(description="Sets up the libraries necessary in " \
"the local 'libraries/' environment, unless otherwise specified. " \
"Searches the 'libraries/clone' to install libaries.")
parser.add_argument("--verbose", help="Output all setup information.", action="store_true")
parser.add_argument("--tree", help="Visualize the dependency tree.", action="store_true")
parser.add_argument("--system", help="Install packages to the system '/usr/local' folder.", action="store_true")
args = parser.parse_args()
tree = DependencyTree()
for lib_dir in LIB_DIR.iterdir():
tree.add_library(lib_dir)
tree.build()
# Build libraries
lib_build_order = tree.reverse_traversal()
if args.tree:
print(lib_build_order)
quit()
failed = 0
for lib_id in lib_build_order:
prefix = SYSTEM_INSTALL_DIR if args.system else INSTALL_DIR
failed += tree.all_deps[lib_id].build(prefix.resolve(), args.verbose)
total = len(lib_build_order)
print("Building process finished:")
if not failed:
print(f" [\033[1;32mPASS\033[0m] ({total - failed}/{total})")
inc_dir, lib_dir = INSTALL_DIR / "include", INSTALL_DIR / "lib"
inc_dir.mkdir(exist_ok=True)
lib_dir.mkdir(exist_ok=True)
for sym in inc_dir.iterdir():
sym.unlink()
for sym in lib_dir.iterdir():
if not sym.is_dir(): sym.unlink()
lib_names = dict() # name, id
for lib_id in lib_build_order:
name = tree.all_deps[lib_id].lib.name
if name in lib_names: # Name already exists, so include version in name.
if lib_names[name] != 0: # Name hasn't been marked as duplicate.
lib_names[lib_names[name]] = lib_names[name] # Make old id as a new pair.
lib_names[name] = 0 # Mark the old name as 0.
lib_names[lib_id] = lib_id # Add the new one as an id pair.
else: # Make (name, id) pair.
lib_names[name] = lib_id
# Apply include symlinks.
for lib_name, lib_id in lib_names.items():
(inc_dir / lib_name).symlink_to(INSTALL_DIR.resolve() / lib_id / "include", target_is_directory=True)
# Apply lib symlinks.
for lib_id in lib_build_order:
library_lib_dir = INSTALL_DIR / lib_id / "lib"
if not library_lib_dir.is_dir(): continue
for f in library_lib_dir.iterdir():
if f.suffix == ".a": (lib_dir / f.name).symlink_to(f.resolve())
print("Applied symlinks in 'libraries/include' and 'libraries/lib'")
else:
print(f" [\033[1;31mFAIL\033[0m] ({total - failed}/{total})")
if __name__ == "__main__":
main()
main()

@ -0,0 +1,240 @@
import sys
sys.path.append('.')
import Geometry as geo
import numpy as np
import pandas as pd
from numpy import linalg as la
#######################################################
#######################################################
## ##
## PART TO MODIFY ##
## ##
#######################################################
#######################################################
directory = "/home/user/Projects/problems/testCylinder/" # Absolute path to the model files
fileName = "test_cylinder" # Name of the .g and .json files
unit = 1.0 # Unit of the input (in meters) -> 1.0 for meters or 2.54e-2 for inches
mesh_size = 0.08 # Mesh size in the unit used
unit2trunc = 4 # Number of significant digits in the regular mesh
PEC = 1 # PEC in the .bc file
ABC = 2 # PW in the .bc file
#######################################################
#######################################################
## ##
## DO NOT CHANGE FROM HERE ##
## ##
#######################################################
#######################################################
########################################
## AUXILIARY FUNCTIONS ##
########################################
def floor(number, sig_figs):
return np.trunc(number * (10 ** sig_figs)) / (10 ** sig_figs)
def truncate_to_significant_figures(number, sig_figs):
isNumber = False
if not isinstance(number, np.ndarray):
number = np.array([number])
isNumber = True
maskLower = number < 0
maskGreater = number > 0
order_of_magnitude = np.zeros_like(number)
order_of_magnitude[maskGreater] = np.floor(np.log10(number[maskGreater]))
order_of_magnitude[maskLower] = np.floor(np.log10(-number[maskLower]))
if isNumber:
return floor(number, -(order_of_magnitude - sig_figs + 1))[0]
return floor(number, -(order_of_magnitude - sig_figs + 1))
########################################
## MAIN FUNCTION ##
########################################
def main():
name = f"{directory}/{fileName}"
regularElementSize = truncate_to_significant_figures(mesh_size, 4)
print(f"Using {directory}/{fileName}.g")
mesh = geo.VolumeMesh.from_exodus(f"{directory}/{fileName}.g")
config = mesh.apply_config(f"{directory}/{fileName}.json")
BC = geo.BoundaryCondition
regular = mesh.make_grid_mesh(regularElementSize, mesh.face_sets_with_bc(BC.PEC))
irregular = mesh.make_hybrid_mesh(regularElementSize, mesh.face_sets_with_bc(BC.PEC), max_volume=pow(regularElementSize,3)*np.sqrt(2)/12)
surfs = irregular.extract_surfaces(irregular.face_sets_with_bc(BC.PEC))
surfs.save_stl(f"{name}_pec_surfaces.stl")
surfs = regular.extract_surfaces(regular.face_sets_with_bc(BC.NCB))
surfs.save_stl(f"{name}_ncbc_surfaces.stl")
surfs = regular.extract_surfaces(regular.face_sets_with_bc(BC.ABC))
surfs.save_stl(f"{name}_acb_surfaces.stl")
regularVertices = regular.vertices.shape[1]
regVertices = np.array(regular.vertices)
referenceNode = regular.vertices[:,0]
center = referenceNode - np.floor((np.absolute(referenceNode) + (regularElementSize / 2.0)) / regularElementSize) * regularElementSize * np.sign(referenceNode)
center = floor(center, unit2trunc)
regVertices = np.floor((np.absolute(regVertices - center.reshape((3,1))) + (regularElementSize / 2.0)) / regularElementSize) * regularElementSize * np.sign(regVertices) + center.reshape((3,1))
regVertices = regVertices.T
totalNodes = np.vstack((np.array(regular.vertices).T, np.array(irregular.vertices).T))
totalNodes, indices, verticesMap, _ = np.unique(totalNodes, axis=0, return_index=True, return_inverse=True, return_counts=True)
np.savetxt(f'{name}.node', totalNodes, newline="\n3 0 0\n" , fmt='%f', header=f"{unit}\n{totalNodes.shape[0]}", comments='')
totalNodes = np.vstack((regVertices, np.array(irregular.vertices).T))[indices, :]
########################################
## REGULAR ELEMENTS ##
########################################
dimRegular = (regular.info.num_elems, 4)
regularFacesBC = np.zeros(dimRegular)
NCBC = 1000
for i in range(regular.info.num_face_sets):
bcValue = 0
if (regular.get_face_set_bc(i) == BC.PEC):
bcValue = PEC
elif (regular.get_face_set_bc(i) == BC.ABC):
bcValue = ABC
elif (regular.get_face_set_bc(i) == BC.NCB):
bcValue = NCBC
else:
bcValue = 0
for j in range(len(regular.face_set(i))):
regularFacesBC[regular.face_set(i)[j] // 4][regular.face_set(i)[j] % 4] = int(bcValue)
elementArray = np.empty((regular.info.num_elems, 4), dtype=np.int64)
bcArray = np.zeros((regular.info.num_elems, 4), dtype=np.int64)
nElements = 0
for i in range(regular.info.num_elem_sets):
elemSet = np.array(regular.elem_set(i))
num_elements = elemSet.shape[1]
row_range = range(nElements, nElements + num_elements)
elementArray[row_range, :] = verticesMap[elemSet].T
bcArray[row_range, :] = regularFacesBC[row_range][:, [3, 1, 2, 0]]
nElements += num_elements
sorted_indices = np.argsort(elementArray, axis=1)
elementArray = np.take_along_axis(elementArray, sorted_indices, axis=1)
bcArray = np.take_along_axis(bcArray, sorted_indices, axis=1)
#################################
## GROUP REGULARS ##
#################################
nodesArray = np.empty((regular.info.num_elems, 4, 3))
nodesArray[:,0,:] = [totalNodes[i][:3] for i in elementArray[:, 0]]
nodesArray[:,1,:] = [totalNodes[i][:3] for i in elementArray[:, 1]]
nodesArray[:,2,:] = [totalNodes[i][:3] for i in elementArray[:, 2]]
nodesArray[:,3,:] = [totalNodes[i][:3] for i in elementArray[:, 3]]
edgesArray = np.empty((regular.info.num_elems, 3, 3))
edgesArray[:,0,:] = nodesArray[:,0,:] - nodesArray[:,1,:]
edgesArray[:,1,:] = nodesArray[:,0,:] - nodesArray[:,2,:]
edgesArray[:,2,:] = nodesArray[:,0,:] - nodesArray[:,3,:]
tolerance = 1e-10
_, indices = np.unique(np.round(edgesArray / tolerance) * tolerance, axis=0, return_inverse=True)
indices = indices + np.ones_like(indices)
indices[np.any(bcArray != 0, axis=1)] = 0
uniqueValues, indices = np.unique(indices, axis=0, return_inverse=True)
indices = np.hstack((indices, np.zeros((irregular.info.num_elems,),dtype=np.int64)))
########################################
## IRREGULAR ELEMENTS ##
########################################
dimIrregular = (irregular.info.num_elems, 4)
irregularFacesBC = np.zeros(dimIrregular)
for i in range(irregular.info.num_face_sets):
bcValue = 0
if (irregular.get_face_set_bc(i) == BC.PEC):
bcValue = PEC
elif (irregular.get_face_set_bc(i) == BC.ABC):
bcValue = ABC
elif (irregular.get_face_set_bc(i) == BC.NCB):
bcValue = NCBC
else:
bcValue = 0
for j in range(len(irregular.face_set(i))):
irregularFacesBC[irregular.face_set(i)[j] // 4][irregular.face_set(i)[j] % 4] = int(bcValue)
irregularElementArray = np.empty((irregular.info.num_elems, 4), dtype=np.int64)
irregularBcArray = np.zeros((irregular.info.num_elems, 4), dtype=np.int64)
nElements = 0
for i in range(irregular.info.num_elem_sets):
elemSet = np.array(irregular.elem_set(i))
num_elements = elemSet.shape[1]
row_range = range(nElements, nElements + num_elements)
irregularElementArray[row_range, :] = verticesMap[elemSet + regularVertices].T
irregularBcArray[row_range, :] = irregularFacesBC[row_range][:, [3, 1, 2, 0]]
nElements += num_elements
########################################
## JOIN ##
########################################
elementArray = np.vstack((elementArray, irregularElementArray))
bcArray = np.vstack((bcArray, irregularBcArray))
np.savetxt(f'{name}.regular', indices, fmt='%d', header=str(uniqueValues.shape[0]), comments='')
bcArray[bcArray == NCBC] = 0
print(f"The number of elements is {bcArray.shape[0]}")
########################################
## PRINT ##
########################################
c_with_extra = np.ones((2 * (regular.info.num_elems + irregular.info.num_elems), 4 + 1), dtype=np.int64) * (-1)
c_with_extra[::2] = np.hstack((np.ones(((regular.info.num_elems + irregular.info.num_elems),1), dtype=np.int64) * 0, elementArray))
c_with_extra[1::2, 1:] = bcArray
df = pd.DataFrame(c_with_extra, dtype=np.int64)
mask = df != -1
df = df.where(mask, other=np.nan)
new_row = pd.Series([(regular.info.num_elems + irregular.info.num_elems)] + [np.nan] * (df.shape[1] - 1), index=df.columns)
# Insert the new row at the top
df = pd.concat([new_row.to_frame().T, df], ignore_index=True)
df = df.astype('Int64')
df.to_csv(f'{name}.tetra', sep=' ', index=False, header=False)
if __name__ == '__main__':
main()

@ -0,0 +1,9 @@
build/cpu/IO.o: src/IO.cpp libraries/include/nlohmann-json/json.hpp \
src/Geometry.hpp src/IO.hpp libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Macros.h libraries/include/CudaTools/Types.h \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

@ -0,0 +1,10 @@
build/cpu/MeshAlgorithms.o: src/MeshAlgorithms.cpp \
libraries/include/TetGen/tetgen.h src/Geometry.hpp src/IO.hpp \
libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Macros.h libraries/include/CudaTools/Types.h \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

@ -0,0 +1 @@
build/cpu/PyBind.o: src/PyBind.cpp

Binary file not shown.

@ -0,0 +1,124 @@
build/py_cpu/Geometry.cu.o: src/Geometry.cu.cpp \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
src/Geometry.hpp libraries/include/pybind11/numpy.h \
libraries/include/pybind11/pybind11.h \
libraries/include/pybind11/detail/class.h \
libraries/include/pybind11/detail/../attr.h \
libraries/include/pybind11/detail/../detail/common.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/Python.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/patchlevel.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/exports.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacro.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymath.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pytime.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/typeslots.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyhash.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pydebug.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longintrepr.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/boolobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/floatobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/complexobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/rangeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/memoryobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/odictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/enumobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/setobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/moduleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/funcobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/classobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pycapsule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyframe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sliceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cellobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/iterobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/initconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/descrobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genericaliasobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/warnings.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/weakrefobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/structseq.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/namespaceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/picklebufobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/codecs.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/context.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyarena.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/modsupport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/compile.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythonrun.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/osmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/intrcheck.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bltinmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/eval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyctype.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrtod.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrcmp.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyfpe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tracemalloc.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
libraries/include/pybind11/detail/../cast.h \
libraries/include/pybind11/detail/../detail/descr.h \
libraries/include/pybind11/detail/../detail/type_caster_base.h \
libraries/include/pybind11/detail/../detail/../pytypes.h \
libraries/include/pybind11/detail/../detail/../buffer_info.h \
libraries/include/pybind11/detail/../detail/internals.h \
libraries/include/pybind11/detail/../detail/typeid.h \
libraries/include/pybind11/detail/../options.h \
libraries/include/pybind11/detail/init.h \
libraries/include/pybind11/gil.h libraries/include/pybind11/complex.h \
src/IO.hpp libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Types.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

@ -0,0 +1,124 @@
build/py_cpu/IO.o: src/IO.cpp libraries/include/nlohmann-json/json.hpp \
src/Geometry.hpp libraries/include/pybind11/numpy.h \
libraries/include/pybind11/pybind11.h \
libraries/include/pybind11/detail/class.h \
libraries/include/pybind11/detail/../attr.h \
libraries/include/pybind11/detail/../detail/common.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/Python.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/patchlevel.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/exports.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacro.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymath.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pytime.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/typeslots.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyhash.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pydebug.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longintrepr.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/boolobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/floatobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/complexobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/rangeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/memoryobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/odictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/enumobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/setobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/moduleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/funcobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/classobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pycapsule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyframe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sliceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cellobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/iterobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/initconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/descrobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genericaliasobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/warnings.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/weakrefobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/structseq.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/namespaceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/picklebufobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/codecs.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/context.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyarena.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/modsupport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/compile.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythonrun.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/osmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/intrcheck.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bltinmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/eval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyctype.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrtod.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrcmp.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyfpe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tracemalloc.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
libraries/include/pybind11/detail/../cast.h \
libraries/include/pybind11/detail/../detail/descr.h \
libraries/include/pybind11/detail/../detail/type_caster_base.h \
libraries/include/pybind11/detail/../detail/../pytypes.h \
libraries/include/pybind11/detail/../detail/../buffer_info.h \
libraries/include/pybind11/detail/../detail/internals.h \
libraries/include/pybind11/detail/../detail/typeid.h \
libraries/include/pybind11/detail/../options.h \
libraries/include/pybind11/detail/init.h \
libraries/include/pybind11/gil.h libraries/include/pybind11/complex.h \
src/IO.hpp libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Macros.h libraries/include/CudaTools/Types.h \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

Binary file not shown.

@ -0,0 +1,124 @@
build/py_cpu/MeshAlgorithms.o: src/MeshAlgorithms.cpp \
libraries/include/TetGen/tetgen.h src/Geometry.hpp \
libraries/include/pybind11/numpy.h libraries/include/pybind11/pybind11.h \
libraries/include/pybind11/detail/class.h \
libraries/include/pybind11/detail/../attr.h \
libraries/include/pybind11/detail/../detail/common.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/Python.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/patchlevel.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/exports.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacro.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymath.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pytime.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/typeslots.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyhash.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pydebug.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longintrepr.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/boolobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/floatobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/complexobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/rangeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/memoryobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/odictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/enumobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/setobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/moduleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/funcobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/classobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pycapsule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyframe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sliceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cellobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/iterobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/initconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/descrobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genericaliasobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/warnings.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/weakrefobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/structseq.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/namespaceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/picklebufobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/codecs.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/context.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyarena.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/modsupport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/compile.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythonrun.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/osmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/intrcheck.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bltinmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/eval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyctype.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrtod.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrcmp.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyfpe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tracemalloc.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
libraries/include/pybind11/detail/../cast.h \
libraries/include/pybind11/detail/../detail/descr.h \
libraries/include/pybind11/detail/../detail/type_caster_base.h \
libraries/include/pybind11/detail/../detail/../pytypes.h \
libraries/include/pybind11/detail/../detail/../buffer_info.h \
libraries/include/pybind11/detail/../detail/internals.h \
libraries/include/pybind11/detail/../detail/typeid.h \
libraries/include/pybind11/detail/../options.h \
libraries/include/pybind11/detail/init.h \
libraries/include/pybind11/gil.h libraries/include/pybind11/complex.h \
src/IO.hpp libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Macros.h libraries/include/CudaTools/Types.h \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

@ -0,0 +1,124 @@
build/py_cpu/PyBind.o: src/PyBind.cpp libraries/include/pybind11/numpy.h \
libraries/include/pybind11/pybind11.h \
libraries/include/pybind11/detail/class.h \
libraries/include/pybind11/detail/../attr.h \
libraries/include/pybind11/detail/../detail/common.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/Python.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/patchlevel.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/exports.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymacro.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymath.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pytime.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/object.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pymem.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/objimpl.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/typeslots.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyhash.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pydebug.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytearrayobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/bytesobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/unicodeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/longintrepr.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/boolobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/floatobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/complexobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/rangeobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/memoryobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/tupleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/listobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/dictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/odictobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/enumobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/setobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/methodobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/moduleobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/funcobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/classobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pycapsule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/code.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyframe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/traceback.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sliceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cellobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/iterobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/initconfig.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pystate.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/descrobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/genericaliasobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/warnings.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/weakrefobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/structseq.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/namespaceobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/picklebufobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/codecs.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pyerrors.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/context.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyarena.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/modsupport.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/compile.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythonrun.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/pylifecycle.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/ceval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/sysmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/osmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/intrcheck.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/import.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/abstract.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/bltinmodule.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/eval.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyctype.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrtod.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pystrcmp.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/fileutils.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pyfpe.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/tracemalloc.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/cpython/frameobject.h \
/opt/intel/oneapi/intelpython/python3.9/include/python3.9/pythread.h \
libraries/include/pybind11/detail/../cast.h \
libraries/include/pybind11/detail/../detail/descr.h \
libraries/include/pybind11/detail/../detail/type_caster_base.h \
libraries/include/pybind11/detail/../detail/../pytypes.h \
libraries/include/pybind11/detail/../detail/../buffer_info.h \
libraries/include/pybind11/detail/../detail/internals.h \
libraries/include/pybind11/detail/../detail/typeid.h \
libraries/include/pybind11/detail/../options.h \
libraries/include/pybind11/detail/init.h \
libraries/include/pybind11/gil.h libraries/include/pybind11/complex.h \
libraries/include/pybind11/operators.h libraries/include/pybind11/stl.h \
src/Geometry.hpp src/IO.hpp libraries/include/EXODUS/exodusII.h \
libraries/include/EXODUS/exodus_config.h \
libraries/include/NetCDF-C/netcdf.h \
libraries/include/NetCDF-C/netcdf_meta.h src/Types.hpp \
libraries/include/CudaTools/Array.h libraries/include/CudaTools/Core.h \
libraries/include/CudaTools/Macros.h libraries/include/CudaTools/Types.h \
libraries/include/CudaTools/Core.h libraries/include/CudaTools/Macros.h \
libraries/include/CudaTools/Types.h

File diff suppressed because it is too large Load Diff

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

@ -0,0 +1,4 @@
Sphinx>=5.1.1
sphinx-rtd-theme>=1.0.0
sphinxcontrib-bibtex>=2.5.0
breathe>=4.34.0

@ -0,0 +1,14 @@
(TeX-add-style-hook
"refs"
(lambda ()
(LaTeX-add-bibitems
""
"alvarez_2014"
"rognes_2010"
"sevilla_2014"
"tian_2017"
"webb_1999"
"dunavant_1985"
"fezoui_2005"))
:bibtex)

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="177.564pt" height="46.432pt" viewBox="0 0 177.564 46.432" version="1.1">
<defs>
<g>
<symbol overflow="visible" id="glyph0-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph0-1">
<path style="stroke:none;" d="M 2.375 -3.625 C 0.390625 -2.546875 0.28125 -1.25 0.28125 -1.015625 C 0.28125 -0.265625 1.015625 0.21875 1.96875 0.21875 C 3.625 0.21875 4.96875 -1.359375 4.96875 -1.5625 C 4.96875 -1.625 4.921875 -1.640625 4.859375 -1.640625 C 4.75 -1.640625 4.359375 -1.5 4.140625 -1.203125 C 3.921875 -0.90625 3.515625 -0.328125 2.625 -0.328125 C 1.90625 -0.328125 1.125 -0.703125 1.125 -1.453125 C 1.125 -1.9375 1.6875 -3.40625 3.265625 -3.46875 C 3.734375 -3.484375 4.078125 -3.84375 4.078125 -3.953125 C 4.078125 -4 4.03125 -4.015625 3.984375 -4.015625 C 2.578125 -4.078125 2.296875 -4.765625 2.296875 -5.15625 C 2.296875 -5.390625 2.4375 -6.484375 3.84375 -6.484375 C 4.03125 -6.484375 4.78125 -6.453125 4.78125 -5.9375 C 4.78125 -5.765625 4.703125 -5.625 4.671875 -5.578125 C 4.640625 -5.546875 4.609375 -5.5 4.609375 -5.46875 C 4.609375 -5.390625 4.6875 -5.390625 4.71875 -5.390625 C 5.015625 -5.390625 5.625 -5.78125 5.625 -6.34375 C 5.625 -6.9375 4.9375 -7.03125 4.5 -7.03125 C 3.140625 -7.03125 1.453125 -5.953125 1.453125 -4.734375 C 1.453125 -4.140625 1.890625 -3.78125 2.375 -3.625 Z M 2.375 -3.625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-2">
<path style="stroke:none;" d="M 3.296875 -3.34375 C 3.421875 -3.8125 3.5625 -4.3125 3.65625 -4.796875 C 3.78125 -5.46875 3.84375 -6.125 3.84375 -6.25 C 3.84375 -6.8125 3.296875 -6.8125 3.1875 -6.8125 C 2.421875 -6.8125 1.75 -6.53125 1.28125 -6.203125 C 0.46875 -5.65625 0.203125 -5 0.203125 -4.9375 C 0.203125 -4.875 0.28125 -4.875 0.3125 -4.875 C 0.390625 -4.875 0.859375 -5 1.0625 -5.375 C 1.328125 -5.875 1.625 -6.265625 2.515625 -6.265625 C 2.9375 -6.265625 3 -5.984375 3 -5.828125 C 3 -5.8125 2.96875 -5.34375 2.84375 -4.65625 C 2.796875 -4.375 2.765625 -4.203125 2.5625 -3.34375 L 2.203125 -3.34375 C 1.921875 -3.328125 1.46875 -3.015625 1.46875 -2.859375 C 1.46875 -2.796875 1.46875 -2.796875 1.6875 -2.796875 L 2.40625 -2.796875 C 2.203125 -2.09375 1.921875 -1.140625 1.46875 0.078125 C 1.375 0.3125 1.375 0.328125 1.375 0.34375 C 1.375 0.40625 1.453125 0.40625 1.46875 0.40625 C 1.609375 0.40625 1.921875 0.28125 2.125 0.078125 C 2.171875 0.015625 2.1875 0 2.234375 -0.09375 C 2.578125 -0.984375 2.875 -1.875 3.140625 -2.796875 L 5.390625 -2.796875 C 5.5 -2.796875 5.6875 -2.796875 5.84375 -2.890625 C 5.734375 -2.46875 5.328125 -0.84375 5.328125 -0.0625 C 5.328125 0.234375 5.5 0.484375 5.921875 0.484375 C 7.25 0.484375 7.984375 -0.34375 7.984375 -0.65625 C 7.984375 -0.71875 7.9375 -0.734375 7.890625 -0.734375 C 7.8125 -0.734375 7.28125 -0.59375 7.125 -0.203125 C 7.09375 -0.125 7.078125 -0.125 6.890625 -0.09375 C 6.78125 -0.0625 6.59375 -0.0625 6.578125 -0.0625 C 6.40625 -0.0625 6.171875 -0.171875 6.171875 -0.484375 C 6.171875 -0.609375 6.234375 -1.15625 6.265625 -1.375 C 6.4375 -2.484375 6.921875 -4.359375 7.78125 -6.625 C 7.8125 -6.703125 7.8125 -6.71875 7.8125 -6.734375 C 7.8125 -6.8125 7.75 -6.8125 7.71875 -6.8125 C 7.5625 -6.8125 7.28125 -6.671875 7.09375 -6.5 C 7.078125 -6.484375 7.015625 -6.4375 6.984375 -6.34375 C 6.578125 -5.359375 6.265625 -4.359375 5.96875 -3.34375 Z M 3.296875 -3.34375 "/>
</symbol>
<symbol overflow="visible" id="glyph1-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph1-1">
<path style="stroke:none;" d="M 0.84375 -0.4375 C 0.828125 -0.34375 0.78125 -0.171875 0.78125 -0.15625 C 0.78125 0 0.90625 0.0625 1.015625 0.0625 C 1.140625 0.0625 1.25 -0.015625 1.296875 -0.078125 C 1.328125 -0.140625 1.375 -0.375 1.421875 -0.515625 C 1.453125 -0.640625 1.53125 -0.96875 1.5625 -1.140625 C 1.609375 -1.296875 1.65625 -1.453125 1.6875 -1.609375 C 1.765625 -1.890625 1.78125 -1.953125 1.984375 -2.234375 C 2.171875 -2.515625 2.5 -2.875 3.03125 -2.875 C 3.421875 -2.875 3.4375 -2.515625 3.4375 -2.390625 C 3.4375 -1.96875 3.140625 -1.203125 3.03125 -0.90625 C 2.953125 -0.703125 2.921875 -0.640625 2.921875 -0.53125 C 2.921875 -0.15625 3.21875 0.0625 3.578125 0.0625 C 4.28125 0.0625 4.578125 -0.890625 4.578125 -1 C 4.578125 -1.09375 4.5 -1.09375 4.46875 -1.09375 C 4.375 -1.09375 4.375 -1.046875 4.34375 -0.96875 C 4.1875 -0.40625 3.875 -0.125 3.609375 -0.125 C 3.453125 -0.125 3.421875 -0.21875 3.421875 -0.375 C 3.421875 -0.53125 3.46875 -0.625 3.59375 -0.9375 C 3.671875 -1.15625 3.953125 -1.890625 3.953125 -2.28125 C 3.953125 -2.953125 3.421875 -3.078125 3.046875 -3.078125 C 2.46875 -3.078125 2.078125 -2.71875 1.875 -2.4375 C 1.828125 -2.921875 1.421875 -3.078125 1.125 -3.078125 C 0.828125 -3.078125 0.671875 -2.859375 0.578125 -2.703125 C 0.421875 -2.4375 0.328125 -2.046875 0.328125 -2 C 0.328125 -1.921875 0.421875 -1.921875 0.453125 -1.921875 C 0.546875 -1.921875 0.546875 -1.9375 0.59375 -2.125 C 0.703125 -2.53125 0.84375 -2.875 1.109375 -2.875 C 1.296875 -2.875 1.34375 -2.71875 1.34375 -2.53125 C 1.34375 -2.40625 1.28125 -2.140625 1.21875 -1.953125 C 1.171875 -1.765625 1.109375 -1.484375 1.078125 -1.328125 Z M 0.84375 -0.4375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph2-1">
<path style="stroke:none;" d="M 3.21875 -1.578125 L 5.359375 -1.578125 C 5.453125 -1.578125 5.609375 -1.578125 5.609375 -1.734375 C 5.609375 -1.921875 5.453125 -1.921875 5.359375 -1.921875 L 3.21875 -1.921875 L 3.21875 -4.0625 C 3.21875 -4.140625 3.21875 -4.3125 3.0625 -4.3125 C 2.890625 -4.3125 2.890625 -4.15625 2.890625 -4.0625 L 2.890625 -1.921875 L 0.75 -1.921875 C 0.65625 -1.921875 0.484375 -1.921875 0.484375 -1.75 C 0.484375 -1.578125 0.640625 -1.578125 0.75 -1.578125 L 2.890625 -1.578125 L 2.890625 0.5625 C 2.890625 0.65625 2.890625 0.828125 3.046875 0.828125 C 3.21875 0.828125 3.21875 0.65625 3.21875 0.5625 Z M 3.21875 -1.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph2-2">
<path style="stroke:none;" d="M 2.328125 -4.4375 C 2.328125 -4.625 2.328125 -4.625 2.125 -4.625 C 1.671875 -4.1875 1.046875 -4.1875 0.765625 -4.1875 L 0.765625 -3.9375 C 0.921875 -3.9375 1.390625 -3.9375 1.765625 -4.125 L 1.765625 -0.578125 C 1.765625 -0.34375 1.765625 -0.25 1.078125 -0.25 L 0.8125 -0.25 L 0.8125 0 C 0.9375 0 1.796875 -0.03125 2.046875 -0.03125 C 2.265625 -0.03125 3.140625 0 3.296875 0 L 3.296875 -0.25 L 3.03125 -0.25 C 2.328125 -0.25 2.328125 -0.34375 2.328125 -0.578125 Z M 2.328125 -4.4375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-3">
<path style="stroke:none;" d="M 3.515625 -1.265625 L 3.28125 -1.265625 C 3.265625 -1.109375 3.1875 -0.703125 3.09375 -0.640625 C 3.046875 -0.59375 2.515625 -0.59375 2.40625 -0.59375 L 1.125 -0.59375 C 1.859375 -1.234375 2.109375 -1.4375 2.515625 -1.765625 C 3.03125 -2.171875 3.515625 -2.609375 3.515625 -3.265625 C 3.515625 -4.109375 2.78125 -4.625 1.890625 -4.625 C 1.03125 -4.625 0.4375 -4.015625 0.4375 -3.375 C 0.4375 -3.03125 0.734375 -2.984375 0.8125 -2.984375 C 0.96875 -2.984375 1.171875 -3.109375 1.171875 -3.359375 C 1.171875 -3.484375 1.125 -3.734375 0.765625 -3.734375 C 0.984375 -4.21875 1.453125 -4.375 1.78125 -4.375 C 2.484375 -4.375 2.84375 -3.828125 2.84375 -3.265625 C 2.84375 -2.65625 2.40625 -2.1875 2.1875 -1.9375 L 0.515625 -0.265625 C 0.4375 -0.203125 0.4375 -0.1875 0.4375 0 L 3.3125 0 Z M 3.515625 -1.265625 "/>
</symbol>
<symbol overflow="visible" id="glyph3-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph3-1">
<path style="stroke:none;" d="M 1.984375 -3.171875 C 1.984375 -3.3125 1.96875 -3.3125 1.796875 -3.3125 C 1.453125 -3 0.890625 -3 0.796875 -3 L 0.71875 -3 L 0.71875 -2.78125 L 0.796875 -2.78125 C 0.90625 -2.78125 1.234375 -2.796875 1.53125 -2.921875 L 1.53125 -0.421875 C 1.53125 -0.28125 1.53125 -0.21875 1 -0.21875 L 0.75 -0.21875 L 0.75 0 C 1.015625 -0.015625 1.46875 -0.015625 1.75 -0.015625 C 2.046875 -0.015625 2.484375 -0.015625 2.765625 0 L 2.765625 -0.21875 L 2.515625 -0.21875 C 1.984375 -0.21875 1.984375 -0.28125 1.984375 -0.421875 Z M 1.984375 -3.171875 "/>
</symbol>
<symbol overflow="visible" id="glyph3-2">
<path style="stroke:none;" d="M 2.9375 -0.96875 L 2.71875 -0.96875 C 2.71875 -0.875 2.65625 -0.5625 2.578125 -0.515625 C 2.546875 -0.484375 2.125 -0.484375 2.046875 -0.484375 L 1.078125 -0.484375 C 1.40625 -0.71875 1.765625 -1 2.0625 -1.203125 C 2.515625 -1.515625 2.9375 -1.796875 2.9375 -2.328125 C 2.9375 -2.96875 2.328125 -3.3125 1.625 -3.3125 C 0.953125 -3.3125 0.453125 -2.9375 0.453125 -2.4375 C 0.453125 -2.1875 0.671875 -2.140625 0.75 -2.140625 C 0.875 -2.140625 1.03125 -2.234375 1.03125 -2.4375 C 1.03125 -2.609375 0.90625 -2.71875 0.75 -2.71875 C 0.890625 -2.953125 1.1875 -3.09375 1.515625 -3.09375 C 2 -3.09375 2.40625 -2.8125 2.40625 -2.328125 C 2.40625 -1.90625 2.109375 -1.578125 1.734375 -1.265625 L 0.515625 -0.234375 C 0.46875 -0.1875 0.453125 -0.1875 0.453125 -0.15625 L 0.453125 0 L 2.765625 0 Z M 2.9375 -0.96875 "/>
</symbol>
<symbol overflow="visible" id="glyph3-3">
<path style="stroke:none;" d="M 1.640625 -1.65625 C 2.109375 -1.65625 2.40625 -1.359375 2.40625 -0.875 C 2.40625 -0.359375 2.09375 -0.09375 1.65625 -0.09375 C 1.59375 -0.09375 1 -0.09375 0.75 -0.359375 C 0.953125 -0.390625 1.015625 -0.53125 1.015625 -0.65625 C 1.015625 -0.84375 0.875 -0.96875 0.703125 -0.96875 C 0.546875 -0.96875 0.40625 -0.859375 0.40625 -0.640625 C 0.40625 -0.125 0.984375 0.109375 1.671875 0.109375 C 2.484375 0.109375 2.984375 -0.390625 2.984375 -0.875 C 2.984375 -1.28125 2.625 -1.625 2.0625 -1.75 C 2.65625 -1.953125 2.8125 -2.328125 2.8125 -2.609375 C 2.8125 -3.015625 2.3125 -3.3125 1.6875 -3.3125 C 1.0625 -3.3125 0.578125 -3.0625 0.578125 -2.609375 C 0.578125 -2.375 0.765625 -2.3125 0.859375 -2.3125 C 1 -2.3125 1.140625 -2.421875 1.140625 -2.609375 C 1.140625 -2.71875 1.078125 -2.859375 0.90625 -2.890625 C 1.109375 -3.109375 1.5625 -3.125 1.671875 -3.125 C 2.03125 -3.125 2.28125 -2.953125 2.28125 -2.609375 C 2.28125 -2.3125 2.09375 -1.859375 1.578125 -1.828125 C 1.4375 -1.828125 1.421875 -1.828125 1.28125 -1.8125 C 1.234375 -1.8125 1.171875 -1.8125 1.171875 -1.734375 C 1.171875 -1.65625 1.21875 -1.65625 1.3125 -1.65625 Z M 1.640625 -1.65625 "/>
</symbol>
<symbol overflow="visible" id="glyph4-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph4-1">
<path style="stroke:none;" d="M 2.046875 -3.984375 L 2.984375 -3.984375 C 3.1875 -3.984375 3.296875 -3.984375 3.296875 -4.1875 C 3.296875 -4.296875 3.1875 -4.296875 3.015625 -4.296875 L 2.140625 -4.296875 C 2.5 -5.71875 2.546875 -5.90625 2.546875 -5.96875 C 2.546875 -6.140625 2.421875 -6.234375 2.25 -6.234375 C 2.21875 -6.234375 1.9375 -6.234375 1.859375 -5.875 L 1.46875 -4.296875 L 0.53125 -4.296875 C 0.328125 -4.296875 0.234375 -4.296875 0.234375 -4.109375 C 0.234375 -3.984375 0.3125 -3.984375 0.515625 -3.984375 L 1.390625 -3.984375 C 0.671875 -1.15625 0.625 -0.984375 0.625 -0.8125 C 0.625 -0.265625 1 0.109375 1.546875 0.109375 C 2.5625 0.109375 3.125 -1.34375 3.125 -1.421875 C 3.125 -1.53125 3.046875 -1.53125 3.015625 -1.53125 C 2.921875 -1.53125 2.90625 -1.5 2.859375 -1.390625 C 2.4375 -0.34375 1.90625 -0.109375 1.5625 -0.109375 C 1.359375 -0.109375 1.25 -0.234375 1.25 -0.5625 C 1.25 -0.8125 1.28125 -0.875 1.3125 -1.046875 Z M 2.046875 -3.984375 "/>
</symbol>
</g>
<clipPath id="clip1">
<path d="M 0 21 L 177.5625 21 L 177.5625 23 L 0 23 Z M 0 21 "/>
</clipPath>
</defs>
<g id="surface1">
<g clip-path="url(#clip1)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:2.98883,2.98883;stroke-miterlimit:10;" d="M -88.582781 0.00078125 L 88.585188 0.00078125 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
</g>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -70.883562 0.00078125 L -70.883562 7.086719 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -35.442156 0.00078125 L -35.442156 -7.085156 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -0.00075 0.00078125 L -0.00075 7.086719 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 35.440656 0.00078125 L 35.440656 -7.085156 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 70.882063 0.00078125 L 70.882063 7.086719 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -70.883562 7.086719 L -0.00075 7.086719 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -0.00075 7.086719 L 70.882063 7.086719 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -35.442156 -7.085156 L 35.440656 -7.085156 " transform="matrix(1,0,0,-1,88.782,21.95)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="12.559" y="10.958"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="17.817" y="12.453"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-2" x="40.474" y="38.255"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="48.887" y="40.711"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="53.812" y="40.711"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-1" x="61.124" y="38.034"/>
</g>
<path style="fill:none;stroke-width:0.398;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.001 -0.00175 L 3.391625 -0.00175 " transform="matrix(1,0,0,-1,61.124,38.967)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-2" x="61.124" y="43.111"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="78.398" y="10.128"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="83.656" y="11.622"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="88.581" y="11.622"/>
<use xlink:href="#glyph2-2" x="94.697023" y="11.622"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-2" x="111.356" y="38.255"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="119.77" y="40.711"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="124.695" y="40.711"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-3" x="132.006" y="38.034"/>
</g>
<path style="fill:none;stroke-width:0.398;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.0018125 -0.00175 L 3.388531 -0.00175 " transform="matrix(1,0,0,-1,132.006,38.967)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph3-2" x="132.006" y="43.111"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="149.28" y="10.128"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="154.538" y="11.622"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="159.463" y="11.622"/>
<use xlink:href="#glyph2-3" x="165.579023" y="11.622"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph4-1" x="168.479" y="31.598"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="265.96pt" height="212.916pt" viewBox="0 0 265.96 212.916" version="1.1">
<defs>
<g>
<symbol overflow="visible" id="glyph0-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph0-1">
<path style="stroke:none;" d="M 1.53125 -3.046875 C 0.453125 -2.328125 0.234375 -1.390625 0.234375 -1.03125 C 0.234375 -0.5625 0.5 -0.28125 0.515625 -0.25 C 0.84375 0.078125 0.921875 0.125 1.671875 0.40625 L 2.875 0.875 C 3.03125 0.9375 3.234375 1 3.234375 1.296875 C 3.234375 1.53125 3.046875 1.828125 2.734375 1.828125 C 2.296875 1.828125 1.96875 1.578125 1.859375 1.5 C 1.796875 1.46875 1.796875 1.453125 1.75 1.453125 C 1.671875 1.453125 1.65625 1.53125 1.65625 1.5625 C 1.65625 1.6875 2.1875 2.046875 2.734375 2.046875 C 3.359375 2.046875 3.78125 1.46875 3.78125 0.984375 C 3.78125 0.5 3.40625 0.3125 3.296875 0.265625 C 3.15625 0.21875 2.828125 0.09375 2.6875 0.046875 C 2.5 -0.046875 2.296875 -0.125 2.078125 -0.1875 L 1.484375 -0.421875 C 1.03125 -0.609375 0.734375 -0.890625 0.734375 -1.3125 C 0.734375 -1.71875 1.125 -2.59375 1.96875 -3.015625 C 2.328125 -2.875 2.625 -2.875 2.84375 -2.875 C 3.140625 -2.875 3.765625 -2.875 3.765625 -3.1875 C 3.765625 -3.4375 3.34375 -3.453125 2.953125 -3.453125 C 2.765625 -3.453125 2.484375 -3.453125 2.109375 -3.34375 C 1.859375 -3.59375 1.8125 -3.921875 1.8125 -4.109375 C 1.8125 -4.671875 2.171875 -5.4375 2.921875 -5.8125 C 3.09375 -5.59375 3.328125 -5.59375 3.5625 -5.59375 C 3.8125 -5.59375 4.453125 -5.59375 4.453125 -5.90625 C 4.453125 -6.15625 4 -6.171875 3.625 -6.171875 C 3.484375 -6.171875 3.25 -6.171875 2.984375 -6.125 C 2.953125 -6.203125 2.9375 -6.28125 2.9375 -6.453125 C 2.9375 -6.59375 2.984375 -6.796875 2.984375 -6.8125 C 2.984375 -6.890625 2.9375 -6.953125 2.875 -6.953125 C 2.6875 -6.953125 2.6875 -6.484375 2.6875 -6.453125 C 2.6875 -6.265625 2.75 -6.109375 2.765625 -6.078125 C 1.6875 -5.765625 1.015625 -4.96875 1.015625 -4.203125 C 1.015625 -3.84375 1.203125 -3.421875 1.671875 -3.15625 Z M 3.15625 -5.90625 C 3.3125 -5.953125 3.515625 -5.953125 3.625 -5.953125 C 3.96875 -5.953125 4 -5.9375 4.1875 -5.890625 C 4.109375 -5.859375 4 -5.8125 3.5625 -5.8125 C 3.375 -5.8125 3.265625 -5.8125 3.15625 -5.90625 Z M 2.375 -3.1875 C 2.609375 -3.234375 2.828125 -3.234375 2.9375 -3.234375 C 3.296875 -3.234375 3.328125 -3.234375 3.515625 -3.1875 C 3.421875 -3.140625 3.328125 -3.09375 2.875 -3.09375 C 2.640625 -3.09375 2.546875 -3.09375 2.375 -3.1875 Z M 2.375 -3.1875 "/>
</symbol>
<symbol overflow="visible" id="glyph1-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph1-1">
<path style="stroke:none;" d="M 2.328125 -4.4375 C 2.328125 -4.625 2.328125 -4.625 2.125 -4.625 C 1.671875 -4.1875 1.046875 -4.1875 0.765625 -4.1875 L 0.765625 -3.9375 C 0.921875 -3.9375 1.390625 -3.9375 1.765625 -4.125 L 1.765625 -0.578125 C 1.765625 -0.34375 1.765625 -0.25 1.078125 -0.25 L 0.8125 -0.25 L 0.8125 0 C 0.9375 0 1.796875 -0.03125 2.046875 -0.03125 C 2.265625 -0.03125 3.140625 0 3.296875 0 L 3.296875 -0.25 L 3.03125 -0.25 C 2.328125 -0.25 2.328125 -0.34375 2.328125 -0.578125 Z M 2.328125 -4.4375 "/>
</symbol>
<symbol overflow="visible" id="glyph1-2">
<path style="stroke:none;" d="M 3.515625 -1.265625 L 3.28125 -1.265625 C 3.265625 -1.109375 3.1875 -0.703125 3.09375 -0.640625 C 3.046875 -0.59375 2.515625 -0.59375 2.40625 -0.59375 L 1.125 -0.59375 C 1.859375 -1.234375 2.109375 -1.4375 2.515625 -1.765625 C 3.03125 -2.171875 3.515625 -2.609375 3.515625 -3.265625 C 3.515625 -4.109375 2.78125 -4.625 1.890625 -4.625 C 1.03125 -4.625 0.4375 -4.015625 0.4375 -3.375 C 0.4375 -3.03125 0.734375 -2.984375 0.8125 -2.984375 C 0.96875 -2.984375 1.171875 -3.109375 1.171875 -3.359375 C 1.171875 -3.484375 1.125 -3.734375 0.765625 -3.734375 C 0.984375 -4.21875 1.453125 -4.375 1.78125 -4.375 C 2.484375 -4.375 2.84375 -3.828125 2.84375 -3.265625 C 2.84375 -2.65625 2.40625 -2.1875 2.1875 -1.9375 L 0.515625 -0.265625 C 0.4375 -0.203125 0.4375 -0.1875 0.4375 0 L 3.3125 0 Z M 3.515625 -1.265625 "/>
</symbol>
<symbol overflow="visible" id="glyph1-3">
<path style="stroke:none;" d="M 1.90625 -2.328125 C 2.453125 -2.328125 2.84375 -1.953125 2.84375 -1.203125 C 2.84375 -0.34375 2.328125 -0.078125 1.9375 -0.078125 C 1.65625 -0.078125 1.03125 -0.15625 0.75 -0.578125 C 1.078125 -0.578125 1.15625 -0.8125 1.15625 -0.96875 C 1.15625 -1.1875 0.984375 -1.34375 0.765625 -1.34375 C 0.578125 -1.34375 0.375 -1.21875 0.375 -0.9375 C 0.375 -0.28125 1.09375 0.140625 1.9375 0.140625 C 2.90625 0.140625 3.578125 -0.515625 3.578125 -1.203125 C 3.578125 -1.75 3.140625 -2.296875 2.375 -2.453125 C 3.09375 -2.71875 3.359375 -3.234375 3.359375 -3.671875 C 3.359375 -4.21875 2.734375 -4.625 1.953125 -4.625 C 1.1875 -4.625 0.59375 -4.25 0.59375 -3.6875 C 0.59375 -3.453125 0.75 -3.328125 0.953125 -3.328125 C 1.171875 -3.328125 1.3125 -3.484375 1.3125 -3.671875 C 1.3125 -3.875 1.171875 -4.03125 0.953125 -4.046875 C 1.203125 -4.34375 1.671875 -4.421875 1.9375 -4.421875 C 2.25 -4.421875 2.6875 -4.265625 2.6875 -3.671875 C 2.6875 -3.375 2.59375 -3.046875 2.40625 -2.84375 C 2.1875 -2.578125 1.984375 -2.5625 1.640625 -2.53125 C 1.46875 -2.515625 1.453125 -2.515625 1.421875 -2.515625 C 1.40625 -2.515625 1.34375 -2.5 1.34375 -2.421875 C 1.34375 -2.328125 1.40625 -2.328125 1.53125 -2.328125 Z M 1.90625 -2.328125 "/>
</symbol>
<symbol overflow="visible" id="glyph2-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph2-1">
<path style="stroke:none;" d="M 2.71875 -5.734375 C 2.71875 -5.953125 2.71875 -5.96875 2.5 -5.96875 C 1.9375 -5.40625 1.109375 -5.40625 0.828125 -5.40625 L 0.828125 -5.125 C 1 -5.125 1.546875 -5.125 2.03125 -5.359375 L 2.03125 -0.71875 C 2.03125 -0.390625 2.015625 -0.28125 1.171875 -0.28125 L 0.890625 -0.28125 L 0.890625 0 C 1.203125 -0.03125 2.015625 -0.03125 2.375 -0.03125 C 2.75 -0.03125 3.546875 -0.03125 3.875 0 L 3.875 -0.28125 L 3.59375 -0.28125 C 2.75 -0.28125 2.71875 -0.390625 2.71875 -0.71875 Z M 2.71875 -5.734375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-2">
<path style="stroke:none;" d="M 4.140625 -1.59375 L 3.890625 -1.59375 C 3.875 -1.46875 3.796875 -0.9375 3.6875 -0.796875 C 3.625 -0.71875 3.015625 -0.71875 2.828125 -0.71875 L 1.234375 -0.71875 L 2.125 -1.5625 C 3.59375 -2.828125 4.140625 -3.3125 4.140625 -4.21875 C 4.140625 -5.25 3.296875 -5.96875 2.1875 -5.96875 C 1.15625 -5.96875 0.453125 -5.15625 0.453125 -4.34375 C 0.453125 -3.890625 0.84375 -3.84375 0.921875 -3.84375 C 1.125 -3.84375 1.390625 -3.984375 1.390625 -4.3125 C 1.390625 -4.578125 1.203125 -4.78125 0.921875 -4.78125 C 0.875 -4.78125 0.859375 -4.78125 0.8125 -4.765625 C 1.03125 -5.40625 1.609375 -5.6875 2.09375 -5.6875 C 3 -5.6875 3.3125 -4.84375 3.3125 -4.21875 C 3.3125 -3.3125 2.625 -2.5625 2.203125 -2.09375 L 0.5625 -0.328125 C 0.453125 -0.21875 0.453125 -0.203125 0.453125 0 L 3.890625 0 Z M 4.140625 -1.59375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-3">
<path style="stroke:none;" d="M 2.734375 -3.15625 C 3.5625 -3.46875 3.96875 -4.125 3.96875 -4.75 C 3.96875 -5.4375 3.203125 -5.96875 2.265625 -5.96875 C 1.34375 -5.96875 0.640625 -5.4375 0.640625 -4.765625 C 0.640625 -4.46875 0.828125 -4.296875 1.09375 -4.296875 C 1.359375 -4.296875 1.546875 -4.484375 1.546875 -4.75 C 1.546875 -5.0625 1.328125 -5.1875 1.015625 -5.1875 C 1.25 -5.5625 1.796875 -5.75 2.25 -5.75 C 2.984375 -5.75 3.125 -5.15625 3.125 -4.734375 C 3.125 -4.46875 3.078125 -4.03125 2.859375 -3.6875 C 2.578125 -3.296875 2.265625 -3.28125 2 -3.25 C 1.78125 -3.234375 1.765625 -3.234375 1.6875 -3.234375 C 1.609375 -3.234375 1.53125 -3.21875 1.53125 -3.125 C 1.53125 -3 1.609375 -3 1.765625 -3 L 2.171875 -3 C 2.953125 -3 3.296875 -2.375 3.296875 -1.53125 C 3.296875 -0.375 2.6875 -0.046875 2.234375 -0.046875 C 2.0625 -0.046875 1.1875 -0.09375 0.796875 -0.765625 C 1.109375 -0.71875 1.359375 -0.9375 1.359375 -1.25 C 1.359375 -1.546875 1.140625 -1.734375 0.875 -1.734375 C 0.65625 -1.734375 0.390625 -1.59375 0.390625 -1.21875 C 0.390625 -0.421875 1.21875 0.203125 2.265625 0.203125 C 3.375 0.203125 4.21875 -0.609375 4.21875 -1.53125 C 4.21875 -2.3125 3.59375 -2.96875 2.734375 -3.15625 Z M 2.734375 -3.15625 "/>
</symbol>
<symbol overflow="visible" id="glyph2-4">
<path style="stroke:none;" d="M 0.265625 -1.765625 L 0.265625 -1.484375 L 2.703125 -1.484375 L 2.703125 -0.703125 C 2.703125 -0.375 2.6875 -0.28125 2.015625 -0.28125 L 1.8125 -0.28125 L 1.8125 0 C 2.375 -0.03125 3 -0.03125 3.0625 -0.03125 C 3.109375 -0.03125 3.765625 -0.03125 4.328125 0 L 4.328125 -0.28125 L 4.125 -0.28125 C 3.453125 -0.28125 3.421875 -0.375 3.421875 -0.703125 L 3.421875 -1.484375 L 4.34375 -1.484375 L 4.34375 -1.765625 L 3.421875 -1.765625 L 3.421875 -5.828125 C 3.421875 -6.015625 3.421875 -6.078125 3.25 -6.078125 C 3.140625 -6.078125 3.140625 -6.0625 3.0625 -5.9375 Z M 0.546875 -1.765625 L 2.765625 -5.078125 L 2.765625 -1.765625 Z M 0.546875 -1.765625 "/>
</symbol>
</g>
<clipPath id="clip1">
<path d="M 12 181 L 84 181 L 84 212.914062 L 12 212.914062 Z M 12 181 "/>
</clipPath>
<clipPath id="clip2">
<path d="M 192 181 L 264 181 L 264 212.914062 L 192 212.914062 Z M 192 181 "/>
</clipPath>
</defs>
<g id="surface1">
<g clip-path="url(#clip1)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -60.132875 -25.412688 L -120.265688 -50.82675 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="13.283" y="207.26"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-1" x="17.642" y="208.754"/>
</g>
<g clip-path="url(#clip2)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 60.13275 -25.412688 L 120.265562 -50.82675 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="253.811" y="207.26"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-2" x="258.17" y="208.754"/>
</g>
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -0.0000625 77.071687 L -0.0000625 154.145906 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="141.481" y="10.239"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph1-3" x="145.84" y="11.733"/>
</g>
<path style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M -0.0000625 77.071687 L -60.132875 -25.412688 L 60.13275 -25.412688 Z M -0.0000625 77.071687 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:2.98883,2.98883;stroke-miterlimit:10;" d="M -0.0000625 0.001375 L -60.132875 -25.412688 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:2.98883,2.98883;stroke-miterlimit:10;" d="M -0.0000625 0.001375 L 60.13275 -25.412688 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:2.98883,2.98883;stroke-miterlimit:10;" d="M -0.0000625 0.001375 L -0.0000625 77.071687 " transform="matrix(1,0,0,-1,137.961,161.892)"/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-1" x="140.485" y="159.369"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-2" x="71.695" y="185.777"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-3" x="199.619" y="185.776"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph2-4" x="131.826" y="84.29"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,39 @@
sections = {
"mesh_prep": 1,
"matrix_assembly": 2,
"bc_calc": 3,
"timestep": 4,
}
window.MathJax = {
loader: {load: ['[tex]/tagformat', '[tex]/ams']},
tex: {
packages: {'[+]': ['tagformat', 'ams']},
macros: {
dd: "{\\, \\mathrm{d}}",
E: "{\\mathbf{E}}",
H: "{\\mathbf{H}}",
J: "{\\mathbf{J}}",
D: "{\\mathbf{D}}",
B: "{\\mathbf{B}}",
M: "{\\mathbf{M}}",
tbE: "{\\tilde{\\E}}",
tbH: "{\\tilde{\\H}}",
tE: "{\\tilde{E}}",
tH: "{\\tilde{H}}",
tphi: "{\\tilde{\\phi}}",
curl: ["{\\nabla \\times {#1}}", 1],
div: ["{\\nabla \\cdot {#1}}", 1],
tens: ["{\\bar{\\bar{{#1}}}}", 1],
},
tags: 'ams',
tagformat: {
number: (n) => sections[window.location.pathname.split("/").pop().split(".")[0]] + '.' + n,
},
ams: {
multilineWidth: '100%',
multilineIndent: '50em'
}
},
}

@ -0,0 +1,81 @@
=======
Classes
=======
There are a few classes used for storing mesh data. All of the classes are stored under
the namespace ``Geometry``, and hence is ommitted from now on.
.. note::
Most functions are also available in the Python module, however, the ``camelCase``
naming is replaced with ``snake_case``. For example, in C++, one would write
``mesh.exportFacesSTL(...)``, but in Python, ``mesh.export_faces_stl(...)`` would be
correct.
There are two main components:
#. :ref:`Mesh Related`
#. :ref:`IO Related`
Mesh Related
============
These classes relate primarily to the actual geometry mesh data itself.
ThreeVector<T>
--------------
.. doxygenclass:: Geometry::ThreeVector
:members:
:allow-dot-graphs:
.. doxygentypedef:: Geometry::Vector
.. doxygentypedef:: Geometry::Indices
Face
----
.. doxygenclass:: Geometry::Face
:members:
Element
-------
.. doxygenclass:: Geometry::Element
:members:
BoundaryCondition
-----------------
.. doxygenenum:: Geometry::BoundaryCondition
VolumeMeshInfo
--------------
.. doxygenstruct:: Geometry::VolumeMeshInfo
:members:
VolumeMesh
----------
.. doxygenclass:: Geometry::VolumeMesh
:members:
:allow-dot-graphs:
IO Related
==========
EXODUS
------
.. doxygenclass:: Geometry::IO::EXODUS
:members:
JSON
----
.. doxygenstruct:: Geometry::IO::JSON::ElementSet
:members:
.. doxygenstruct:: Geometry::IO::JSON::FaceSet
:members:
.. doxygenstruct:: Geometry::IO::JSON::HybridMesh
:members:
.. doxygenstruct:: Geometry::IO::JSON::Config
:members:

@ -0,0 +1,54 @@
# Configuration file for the Sphinx documentation builder.
# -- Project information
project = 'Geometry'
copyright = '2023'
author = 'Kenneth Jao'
release = '0.1'
version = '0.1.0'
# -- General configuration
html_static_path = ["_static"]
html_js_files = ["js/mathjax-config.js"]
extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.autosectionlabel',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.graphviz',
'sphinxcontrib.bibtex',
'breathe',
]
breathe_projects = {}
breathe_projects[project] = "../build/xml"
breathe_default_project = project
bibtex_bibfiles = ['refs.bib']
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']
templates_path = ['_templates']
# -- Options for HTML output
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'collapse_navigation': False,
}
# -- Options for EPUB output
epub_show_urls = 'footnote'

@ -0,0 +1,21 @@
========
Geometry
========
This is the documentation for Geometry, a module which processes volumetric mesh data,
available both as a C++ library or as a Python module. To get started, please head over to the
:doc:`usage` section. If you're a developer and working this project, please
refer to the :doc:`classes` for detailed code documentation.
.. note::
If you would like to contribute, please visit the `git page <https://git.acem.ece.illinois.edu/kjao/Geometry>`__.
Contents
========
.. toctree::
:maxdepth: 2
usage
classes

@ -0,0 +1,85 @@
@Book{
jin_2014,
place={Hoboken},
title={The finite element method in electromagnetics},
publisher={Wiley},
author={Jin, Jian-Ming},
year={2014}
}
@book{alvarez_2014,
title={A discontinuous Galerkin finite element method for the time-domain solution of Maxwell equations},
author={{\'A}lvarez Gonz{\'a}lez, Jes{\'u}s and others},
year={2014},
publisher={Universidad de Granada}
}
@article{rognes_2010,
author = {Rognes, Marie E. and Kirby, Robert C. and Logg, Anders},
title = {Efficient Assembly of H(div) and H(curl) Conforming Finite Elements},
journal = {SIAM Journal on Scientific Computing},
volume = {31},
number = {6},
pages = {4130-4151},
year = {2010},
doi = {https://doi.org/10.1137/08073901X},
}
@article{sevilla_2014,
title = {The use of hybrid meshes to improve the efficiency of a discontinuous Galerkin method for the solution of Maxwell’s equations},
journal = {Computers & Structures},
volume = {137},
pages = {2-13},
year = {2014},
note = {Special Issue Title: UK Association for Computational Mechanics in Engineering},
issn = {0045-7949},
doi = {https://doi.org/10.1016/j.compstruc.2013.01.014},
url = {https://www.sciencedirect.com/science/article/pii/S0045794913000357},
author = {Ruben Sevilla and Oubay Hassan and Kenneth Morgan},
}
@article{tian_2017,
author={Tian, Cheng-Yi and Shi, Yan and Liang, Chang-Hong},
journal={IEEE Microwave and Wireless Components Letters},
title={A Low-Storage Discontinuous Galerkin Time-Domain Method},
year={2017},
volume={27},
number={1},
pages={1-3},
doi={10.1109/LMWC.2016.2629959}
}
@article{webb_1999,
author={Webb, J.P.},
journal={IEEE Transactions on Antennas and Propagation},
title={Hierarchal vector basis functions of arbitrary order for triangular and tetrahedral finite elements},
year={1999},
volume={47},
number={8},
pages={1244-1253},
doi={10.1109/8.791939}
}
@article{dunavant_1985,
Author = {Dunavant, D.A.},
ISSN = {10970207},
Journal = {International Journal for Numerical Methods in Engineering},
Number = {6},
Pages = {1129-1148 - 1148},
Title = {High degree efficient symmetrical Gaussian quadrature rules for the triangle.},
Volume = {21},
URL = {https://proxy2.library.illinois.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&db=edselc&AN=edselc.2-52.0-0022076980&site=eds-live&scope=site},
Year = {1985},
}
@article{fezoui_2005,
author = {{Fezoui, Loula} and {Lanteri, St\'ephane} and {Lohrengel, St\'ephanie} and {Piperno, Serge}},
title = {Convergence and stability of a discontinuous Galerkin time-domain method for the 3D heterogeneous Maxwell equations on unstructured meshes},
DOI= "10.1051/m2an:2005049",
url= "https://doi.org/10.1051/m2an:2005049",
journal = {ESAIM: M2AN},
year = 2005,
volume = 39,
number = 6,
pages = "1149-1176",
}

@ -0,0 +1,132 @@
==================
Usage and Examples
==================
This module is very basic, mainly involving the :ref:`VolumeMesh` class.
The usage of this libary will be illustrated through examples, and further details
can be found in the other sections. The full examples are given in the `samples <https://git.acem.ece.illinois.edu/kjao/Geometry/src/branch/main/samples>`__ folder.
We show the examples in Python, but as the module is built from C++, it should be a direct
translation if needed. Refer to :doc:`classes` for more information.
Mesh Structure
==============
The mesh is composed of three main parts: vertices, elements, and marked faces.
We group elements and marked faces with element and face sets, respectively. We may want to
assign attributes or conditions onto these element or face sets. This is accomplished by
creating a JSON file. For example,
.. code-block:: json
{
"Element Sets": [
{
"index": 0,
"attribute": "air"
}
],
"Face Sets": [
{
"index": 0,
"boundary": "PEC"
},
{
"index": 1,
"boundary": "ABC"
}
],
"Hybrid Mesh": {
"enable": true,
"holes": [
[0, 0, 0], [7, -7, 0]
]
}
}
These three main sections *must* be present in the JSON file for it to be read properly.
Currently, the supported boundary conditions are
* [0] PEC (Perfect Electric Conductor)
* [1] PMC (Perfect Magnetic Conductor)
* [2] ABC (Absorbing Boundary Condition)
* [3] PML (Perfectly Matched Layer)
* [4] None
* [5] None
* [6] None
* [7] NCB (Perfect Magnetic Conductor)
Loading
=======
This example shows how to load a EXODUS (.g) mesh file and access its information.
.. code-block:: python
import Geometry as geo
mesh_path = "../mesh/Cylinder.g"
json_path = "../mesh/Cylinder.json"
mesh = geo.VolumeMesh.from_exodus(mesh_path)
mesh.apply_config(json_path)
print(mesh.info)
print()
print("Vertex Array:")
print(mesh.vertices)
print()
print("Vertex Indices of Element Set 0:")
print(mesh.elem_set(0))
print()
print("Face Indices of Face Set 0:")
print(mesh.face_set(0))
print()
print("Element Operations:")
elem = mesh.element(0)
print("Volume:", elem.volume())
for face_num in range(4):
print(f"Face {face_num}:")
print(elem.face(face_num))
print("Area:", elem.face(face_num).normal().norm() / 2)
print()
print("Element Set 0 Attribute:", mesh.get_elem_set_attribute(0))
print("Face Set 0 Boundary Condition:", mesh.get_face_set_bc(0))
print()
Exporting STLs
==============
Following from there, we can also export mesh data. We can export all the elements
as faces, or specific face sets.
.. code-block:: python
BC = geo.BoundaryCondition # Shorthand
mesh.save_exodus("CylinderVolume") # Export EXODUS (.g) file.
mesh.extract_surfaces().save_stl("CylinderBoundary") # Export STL file.
# Only export the ABC Boundary.
mesh.extract_surfaces(mesh.face_sets_with_bc(BC.ABC)).save_stl("CylinderABC")
Hybrid Mesh Generation
======================
To utilize the hybrid mesh generation functionality, we need only
call a few functions.
.. code-block:: python
mesh = geo.VolumeMesh.from_exodus(mesh_path)
config = mesh.apply_config(json_path) # Get the config data.
BC = geo.BoundaryCondition # Shorthand
# Generate the grid mesh with each cube's side being 1.4.
# Ignore ABC face sets when generating the regular mesh.
hybrid = mesh.create_hybrid_mesh(1.4, mesh.face_sets_with_bc(BC.ABC))
hybrid.export_exodus("HybridCylinder")
hybrid_surfs = hybrid.extractSurfaces()
hybrid_surfs.save_stl("InnerCylinderPEC", inner.face_sets_with_bc(BC.PEC))
hybrid_surfs.save_stl("InnerCylinderNCB", inner.face_sets_with_bc(BC.NCB))

@ -0,0 +1,845 @@
#ifndef CUDATOOLS_ARRAY_H
#define CUDATOOLS_ARRAY_H
#include "Core.h"
#include "Macros.h"
#include "Types.h"
#include <cmath>
#include <complex>
#include <cstdlib>
#include <iomanip>
#include <random>
#include <type_traits>
#ifdef CUDATOOLS_USE_EIGEN
#include <Eigen/Dense>
#endif
#ifdef CUDATOOLS_USE_PYTHON
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
namespace py = pybind11;
#endif
#ifdef DEVICE
#define POINTER pDevice
#else
#define POINTER pHost
#endif
using namespace CudaTools::Types;
namespace CudaTools {
#ifdef CUDATOOLS_USE_EIGEN
template <typename T>
using EigenMat = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>;
template <typename T> using EigenMapMat = Eigen::Map<EigenMat<T>>;
template <typename T> using ConstEigenMapMat = Eigen::Map<const EigenMat<T>>;
template <typename T> struct EigenAdaptConst_S { typedef EigenMapMat<T> type; };
template <typename T> struct EigenAdaptConst_S<const T> { typedef ConstEigenMapMat<T> type; };
template <typename T> using EigenAdaptConst = typename EigenAdaptConst_S<T>::type;
#endif
template <typename T> class Array;
struct Slice {
uint32_t first;
uint32_t second;
HD Slice(const std::initializer_list<uint32_t> i)
: first(*i.begin()), second(*(i.begin() + 1)) {}
};
template <typename T> class ArrayIterator {
private:
template <typename U>
friend std::ostream& operator<<(std::ostream& out, const ArrayIterator<U>& it);
T* pData;
Shape mShape;
uint32_t mIndices[CUDATOOLS_ARRAY_MAX_AXES] = {0};
public:
HD ArrayIterator(T* p, const Shape& shape) : pData(p), mShape(shape){};
/**
* Moves the iterator to the next value.
*/
HD void next() {
bool carry = false;
uint32_t offset = 0;
for (uint32_t iAxis = mShape.axes() - 1; iAxis < mShape.axes(); --iAxis) {
if (mIndices[iAxis] == mShape.dim(iAxis) - 1) {
mIndices[iAxis] = 0;
offset += mShape.stride(iAxis) * (mShape.dim(iAxis) - 1);
carry = true;
} else {
pData += mShape.stride(iAxis);
mIndices[iAxis] += 1;
carry = false;
}
if (not carry) {
pData -= offset;
return;
}
}
pData += 1; // "Overflow" occured, so we reached end of array.
}
/**
* Moves the iterator to the previous value.
*/
HD void prev() {
bool carry = false;
uint32_t offset = 0;
for (uint32_t iAxis = mShape.axes() - 1; iAxis < mShape.axes(); --iAxis) {
if (mIndices[iAxis] == 0) {
mIndices[iAxis] = mShape.dim(iAxis) - 1;
offset += mShape.stride(iAxis) * (mShape.dim(iAxis) - 1);
carry = true;
} else {
pData -= mShape.stride(iAxis);
mIndices[iAxis] += 1;
carry = false;
}
if (not carry) {
pData += offset;
return;
}
}
pData -= 1;
}
/**
* Moves the iterator a specified value away.
* \param amount the amount to advance by
*/
HD void advance(const int32_t amount) {
if (amount < 0) {
for (uint32_t i = 0; i < std::abs(amount); ++i) {
prev();
}
} else {
for (uint32_t i = 0; i < std::abs(amount); ++i) {
next();
}
}
}
HD void operator++() { next(); }; /**< Prefix increment operator. */
HD void operator--() { prev(); }; /**< Prefix decrement operator. */
/**< Addition operator. */
HD ArrayIterator<T> operator+(const int32_t v) const {
ArrayIterator<T> it = *this;
it.advance(v);
return it;
};
/** Subtraction operator.*/
HD ArrayIterator<T> operator-(const int32_t v) const {
ArrayIterator<T> it = *this;
it.advance(-v);
return it;
};
HD void operator+=(const int32_t v) { advance(v); };
HD void operator-=(const int32_t v) { advance(-v); };
HD T& operator*() { return *pData; }; /**< Dereference operator. */
HD const T& operator*() const { return *pData; }; /**< Const dereference operator. */
/**
* Equals operator.
*/
HD bool operator==(const ArrayIterator<T>& it) { return pData == it.pData; }
/**
* Not equals operator.
*/
HD bool operator!=(const ArrayIterator<T>& it) { return pData != it.pData; }
};
template <typename T> std::ostream& operator<<(std::ostream& out, const ArrayIterator<T>& it) {
return out << it.pData;
}
template <typename T> class ArrayLoader {
private:
ArrayIterator<T> mIterator;
ArrayIterator<T> mIteratorEnd;
public:
HD ArrayLoader(const ArrayIterator<T>& it, const ArrayIterator<T>& it_end)
: mIterator(it), mIteratorEnd(it_end){};
HD ArrayLoader &operator,(const T value) {
CT_ERROR_IF(mIterator, ==, mIteratorEnd, "Cannot assign more values than Array size");
*mIterator = value;
++mIterator;
return *this;
}
};
/**
* A container that holds a N-dimensional array, stored column major. To set the
* maximum N, there is a compiler macro CUDATOOLS_ARRAY_MAX_DIM whose default value is 4.
* It adapts to operations between host and device to ease memory management.
*/
template <typename T> class Array {
private:
template <typename U> friend std::ostream& operator<<(std::ostream&, const Array<U>&);
Shape mShape;
T* pHost = nullptr;
T* pDevice = nullptr;
bool mIsView = false;
bool mIsSlice = false;
uint32_t mEndOffset = 0;
HD void freeArrays() {
#ifndef DEVICE
if (not mIsView) {
if (pDevice != nullptr) CudaTools::free(pDevice);
if (pHost != nullptr) delete[] pHost;
}
#endif
};
HD void calcEnd() {
uint32_t offset = 0;
for (uint32_t i = 0; i < shape().axes(); ++i) {
offset += (shape().dim(i) - 1) * shape().stride(i);
}
mEndOffset = offset + 1;
};
public:
HD Array() = default;
/**
* Constructor for an Array that creates an allocates an array with
* the specified Shape. Construction in this format is disabled on the device.
* \brief Host only
* \param shape the shape of the array
* \param noDevice whether to initialize the array on the device
*/
Array(const Shape& shape, const bool noDevice = false) : mShape(shape), mIsView(false) {
pHost = new T[shape.items()];
calcEnd();
if (noDevice) return;
pDevice = reinterpret_cast<T*>(CudaTools::malloc(shape.items() * sizeof(T)));
};
/**
* Constructor for an Array from an existing (preallocated) pointer.
* \param pointer the pointer to use
* \param shape the shape of the array
* \param noDevice whether to initialize the array on the device
*/
HD Array(T* const pointer, const Shape& shape, const bool noDevice = false)
: mShape(shape), mIsView(true), mIsSlice(false) {
POINTER = pointer;
calcEnd();
#ifndef DEVICE
if (noDevice) return;
pDevice = reinterpret_cast<T*>(CudaTools::malloc(shape.items() * sizeof(T)));
#endif
};
/**
* Constructor for making a Array view from another Array,
* given an offset and shape.
* \param arr the original Array
* \param shape the shape of the new array
* \param offset the index where to start the a view of the array
*/
HD Array(const Array& arr, const Shape& shape, const uint32_t offset = 0)
: mShape(shape), pHost(arr.pHost), pDevice(arr.pDevice), mIsView(true),
mIsSlice(arr.mIsSlice) {
calcEnd();
if (pHost != nullptr) pHost += offset;
if (pDevice != nullptr) pDevice += offset;
};
/**
* The copy-constructor for a Array. If this is not a view, a deep copy
* of the data will be performed on both host and device. On the device, it is always
* treated like a view.
*/
HD Array(const Array& arr) : mShape(arr.mShape), mIsView(arr.mIsView), mIsSlice(arr.mIsSlice) {
calcEnd();
if (mIsView) { // If the other array was a view (and now this one), just assign.
pHost = arr.pHost;
pDevice = arr.pDevice;
return;
}
// Otherwise, we assume this is needs to own data.
pHost = new T[mShape.items()];
auto arr_it = arr.begin();
for (auto it = begin(); it != end(); ++it) {
*it = *arr_it;
++arr_it;
}
#ifndef DEVICE
if (arr.pDevice != nullptr) {
pDevice = (T*)CudaTools::malloc(mShape.items() * sizeof(T));
}
#endif
};
/**
* The move-constructor for a Array.
*/
HD Array(Array&& arr)
: mShape(arr.mShape), pHost(arr.pHost), pDevice(arr.pDevice), mIsView(arr.mIsView),
mIsSlice(arr.mIsSlice) {
calcEnd();
// Make other object empty.
arr.pHost = nullptr;
arr.pDevice = nullptr;
arr.mIsView = true;
};
HD ~Array() { freeArrays(); };
/**
* The copy-assignment operator for a Array. If this is not a view,
* then the currently owned data will be freed, and a deep copy of the data will
* be performed on both host and device. On the device, it is always treated like a view.
*/
HD Array& operator=(const Array& arr) {
if (this == &arr) return *this;
if (mIsView) { // If this array is a view, we assign data from the right-hand side.
auto arr_it = arr.begin();
for (auto it = begin(); it != end() and arr_it != arr.end(); ++it) {
*it = *arr_it;
++arr_it;
}
return *this;
}
// Otherwise, it is implied to be object reassignment.
mShape = arr.mShape;
mIsView = arr.mIsView;
mIsSlice = arr.mIsSlice;
calcEnd();
// Regardless if the right-hand side is a view, we create a new copy.
// In case that the right-hand side is a view of this array, we
// allocate memory to copy first. Keep in mind that the right-hand side
// array will then become undefined.
// We can only do this on the host.
#ifndef DEVICE
T* new_pDevice = nullptr;
if (pDevice != nullptr) {
new_pDevice = (T*)CudaTools::malloc(mShape.items() * sizeof(T));
}
T* new_pHost = new T[mShape.items()];
memcpy(new_pHost, arr.pHost, mShape.items() * sizeof(T));
freeArrays();
pHost = new_pHost;
pDevice = new_pDevice;
#else
pHost = arr.pHost;
pDevice = arr.pDevice;
#endif
return *this;
};
/**
* The move-assignment operator for a Array.
*/
HD Array& operator=(Array&& arr) {
if (this == &arr) return *this;
if (mIsView) { // If this array is a view, we assign data from the right-hand side.
auto arr_it = arr.begin();
for (auto it = begin(); it != end() and arr_it != arr.end(); ++it) {
*it = *arr_it;
++arr_it;
}
return *this;
}
CT_ERROR(arr.mIsView,
"Cannot move-assign view to a non-view (owner). This would lead to undefined "
"behavior.");
// Otherwise, it is implied to be object reassignment.
freeArrays();
mShape = arr.mShape;
pHost = arr.pHost;
pDevice = arr.pDevice;
mIsView = arr.mIsView;
mIsSlice = arr.mIsSlice;
calcEnd();
// Make other array empty.
arr.pHost = nullptr;
arr.pDevice = nullptr;
arr.mIsView = true;
return *this;
};
/**
* Used for indexing the Array.
* \param index index of the first dimension
*/
HD Array operator[](const uint32_t index) const {
CT_ERROR_IF(index, >=, shape().dim(0), "Index exceeds axis size");
return Array(*this, shape().subshape(1), index * shape().stride(0));
};
/**
* Used for indexing the Array.
* \param indices a list of indices to index the Array
*/
HD Array operator[](const std::initializer_list<uint32_t> indices) const {
CT_ERROR_IF(indices.size(), >, shape().axes(),
"Number of indices cannot exceed number of axes");
auto it = indices.begin();
uint offset = 0;
for (uint32_t i = 0; i < indices.size(); ++i) {
uint32_t index = *it;
CT_ERROR_IF(index, >=, shape().dim(i), "Index exceeds axis size");
offset += index * shape().stride(i);
++it;
}
return Array(*this, shape().subshape(indices.size()), offset);
};
HD ArrayLoader<T> operator<<(const T value) {
auto it = begin();
*it = value;
++it;
return ArrayLoader<T>(it, end());
};
HD T operator=(const T& value) { return POINTER[0] = value; };
HD operator T&() { return POINTER[0]; };
HD operator const T&() const { return POINTER[0]; };
/**
* Used to create slices of the Array.
* \param slices a list of slices to slice the Array
*/
HD Array slice(const std::initializer_list<Slice> slices) const {
CT_ERROR_IF(slices.size(), >, shape().axes(),
"Number of slices cannot exceed number of axes");
uint offset = 0;
Shape new_shape = mShape;
auto it = slices.begin();
for (uint32_t i = 0; i < slices.size(); ++i) {
uint32_t from_index = it->first;
uint32_t to_index = it->second;
CT_ERROR_IF(from_index, >, to_index,
"Slice start cannot be greater than than slice end");
CT_ERROR_IF(from_index, >=, shape().dim(i), "Slice start exceeds axis size");
CT_ERROR_IF(to_index - 1, >=, shape().dim(i), "Slice end exceeds axis size");
offset += from_index * shape().stride(i);
new_shape.mAxisDim[i] = to_index - from_index;
++it;
}
new_shape.mItems = 1;
for (uint32_t i = 0; i < shape().axes(); ++i) {
new_shape.mItems *= new_shape.dim(i);
}
Array<T> arr(*this, new_shape, offset);
arr.mIsSlice = true;
return arr;
};
/**
* Returns this Array with a different Shape. Its self assigning version is reshape.
* If this Array is a slice of another, then it will perform a deep copy, and return
* a new non-view array.
*/
HD Array reshaped(const Shape& new_shape) const {
CT_ERROR_IF(shape().items(), !=, new_shape.items(),
"New shape cannot have a different number of terms");
CT_ERROR(mIsSlice, "Cannot reshape slice, a new array must be made. (Try copy first)")
Array<T> arr = view();
arr.mShape = new_shape;
return arr;
};
HD void reshape(const Shape& new_shape) {
CT_ERROR_IF(shape().items(), !=, new_shape.items(),
"New shape cannot have a different number of terms");
CT_ERROR(mIsSlice, "Cannot reshape slice, a new array must be made. (Try copy first)")
mShape = new_shape;
};
/**
* Gets a view that is has at least two dimensions. Useful for promoting
* single vectors to their 2D counterparts.
*/
HD Array atLeast2D() const {
return (shape().axes() == 1) ? reshaped({shape().length(), 1}) : view();
};
/**
* Reshapes this array, making it at least 2D. Useful for promoting
* single vectors to their 2D counterparts.
*/
HD void asAtLeast2D() {
if (shape().axes() == 1) reshape({shape().length(), 1});
};
/**
* Returns a view of this Array that has been flattened into one dimension.
*/
HD Array flattened() const { return reshaped({mShape.mItems}); };
/**
* Flattens this Array into one dimension.
*/
HD void flatten() { reshape({mShape.mItems}); };
#ifdef CUDATOOLS_USE_EIGEN
/**
* Returns the Eigen::Map of this Array.
*/
EigenAdaptConst<ComplexConversion<T>> eigenMap() const {
uint32_t total_dim = mShape.mAxes;
CT_ERROR(mIsSlice, "Mapping to an Eigen array cannot occur on slices")
CT_ERROR_IF(total_dim, !=, 2,
"Mapping to an Eigen array can only occur on two-dimensional arrays");
return EigenAdaptConst<ComplexConversion<T>>((ComplexConversion<T>*)POINTER, mShape.rows(),
mShape.cols());
};
#endif
/**
* Gets the Shape of the Array.
*/
HD Shape shape() const { return mShape; };
/**
* Gets the pointer to this array, depending on host or device.
*/
HD ComplexConversion<T>* data() const { return (ComplexConversion<T>*)POINTER; };
/**
* Returns the device pointer regardless of host or device.
*/
HD T* dataDevice() const { return pDevice; };
HD bool isView() const { return mIsView; }; /**< Gets whether this Array is a view. */
HD bool isSlice() const { return mIsSlice; }; /**< Gets whether this Array is a slice. */
/**
* Gets a view of this Array.
*/
HD Array view() const { return Array(*this, mShape); }
/**
* Copies this Array and returns a new Array with the same memory.
*/
Array copy() const {
Array<T> arr(mShape, (pDevice == nullptr));
auto arr_it = arr.begin();
for (auto it = begin(); it != end(); ++it) {
*arr_it = *it;
++arr_it;
}
#ifndef DEVICE
if (pDevice != nullptr) {
CudaTools::copy(pDevice, arr.dataDevice(), mShape.items() * sizeof(T)).wait();
}
#endif
return arr;
};
/**
* Gets the iterator to the beginning of this Array.
*/
HD ArrayIterator<T> begin() const { return ArrayIterator<T>(POINTER, mShape); };
/**
* Gets the iterator to the end of this Array.
*/
HD ArrayIterator<T> end() const { return ArrayIterator<T>(POINTER + mEndOffset, mShape); };
/**
* Sets the values of the entire Array to a constant. This is restricted to numerical types.
*/
HD void setConstant(const T value) const {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
for (auto it = begin(); it != end(); ++it) {
*it = value;
}
};
/**
* Sets the Array values with uniform random values in a specified range. This is restricted to
* numerical types.
* \brief Host only
*/
void setRandom(const T min, const T max) const {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
if constexpr (is_complex<T>) {
CT_ERROR_IF(max.real(), <, min.real(),
"Upper bound of range cannot be larger than lower bound");
CT_ERROR_IF(max.imag(), <, min.imag(),
"Upper bound of range cannot be larger than lower bound");
} else {
CT_ERROR_IF(max, <, min, "Upper bound of range cannot be larger than lower bound");
}
std::random_device rd;
std::mt19937 mt(rd());
if constexpr (is_int<T>) {
std::uniform_int_distribution<T> dist(min, max);
for (auto it = begin(); it != end(); ++it) {
*it = dist(mt);
}
} else if constexpr (is_float<T>) {
std::uniform_real_distribution<T> dist(min, max);
for (auto it = begin(); it != end(); ++it) {
*it = dist(mt);
}
} else if constexpr (is_complex<T>) {
std::uniform_real_distribution<ComplexUnderlying<T>> distr(min.real(), max.real());
std::uniform_real_distribution<ComplexUnderlying<T>> disti(min.imag(), max.imag());
for (auto it = begin(); it != end(); ++it) {
*it = T(distr(mt), disti(mt));
}
}
};
/**
* Sets the Array values to start from a value and increment by a specified step. This is
* restricted to numerical types.
*/
HD void setRange(T min, const T step = 1) const {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
for (auto it = begin(); it != end(); ++it) {
*it = min;
min += step;
}
}
/**
* Sets the Array values to be evenly spaced numbers over a given interval. This is restricted
* to floating point types.
*/
HD void setLinspace(const T min, const T max) const {
static_assert(is_float<T>, "Function only available on numeric floating types.");
CT_ERROR_IF(max, <, min, "Upper bound of range cannot be larger than lower bound");
T i = 0;
T d = max - min;
T items = (T)(shape().items() - 1);
for (auto it = begin(); it != end(); ++it) {
*it = min + d * (i / items);
i += 1;
}
};
/**
* Returns array of given shape with constant values. This is restricted to numerical types.
* \brief Host only
*/
static Array constant(const Shape& shape, const T value) {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
Array<T> arr(shape);
arr.setConstant(value);
return arr;
};
/**
* Returns array of given shape with random values in given interval. This is restricted to
* numerical types.
* \brief Host only
*/
static Array random(const Shape& shape, const T min, const T max) {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
Array<T> arr(shape);
arr.setRandom(min, max);
return arr;
};
/**
* Returns evenly spaced values within a given interval. This is restricted to numerical types.
* \brief Host only
*/
static Array range(const T min, const T max, const T step = 1) {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
CT_ERROR_IF(max, <, min, "Upper bound of range cannot be larger than lower bound");
Array<T> arr({(uint32_t)((max - min) / step)});
arr.setRange(min, step);
return arr;
}
/**
* Returns evenly spaced values within a given interval. This is restricted to floating point
* types.
* \brief Host only
*/
static Array linspace(const T min, const T max, const uint32_t size) {
static_assert(is_float<T>, "Function only available on numeric floating types.");
Array<T> arr({size});
arr.setLinspace(min, max);
return arr;
}
/**
* Transposes the internal data and returns the corresponding new Array.
* Its self assigning version is transpose. This is restricted to numerical types.
* \brief Host only
*/
#ifdef CUDATOOLS_USE_EIGEN
Array transposed() const {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
CT_ERROR_IF(shape().axes(), !=, 2, "Tranpose can only occur on two-dimensional arrays");
Array<T> new_arr({mShape.rows(), mShape.cols()});
new_arr.eigenMap() = this->eigenMap().transpose().eval();
return new_arr;
};
/**
* Transposes the intenal data. Its self assigning version is transpose.
* This is restricted to numerical types.
* \brief Host only
*/
void transpose() {
static_assert(is_host_num<T>, "Function only available on host-compatible numeric types.");
CT_ERROR_IF(shape().axes(), !=, 2, "Tranpose can only occur on two-dimensional arrays");
Array<T> new_arr(*this, {mShape.cols(), mShape.rows()});
new_arr.eigenMap() = this->eigenMap().transpose().eval();
mShape = Shape({mShape.cols(), mShape.rows()});
};
void inverse() const {
static_assert(is_float<T>, "Function only available on floating numeric types.");
CT_ERROR_IF(shape().axes(), !=, 2, "Inverse can only occur on two-dimensional arrays");
CT_ERROR_IF(shape().rows(), !=, shape().cols(),
"Inverse can only occur on square matrices");
Array<T> inv(shape());
inv.eigenMap() = this->eigenMap().inverse();
};
#endif
/**
* Pins the memory (page locks) for faster memory transfer in concurrent
* transfers.
* \brief Host only
*/
void pinMemory() const { CudaTools::pin(pHost, mShape.items() * sizeof(T)); };
/**
* Updates the host copy by copying the device data back to the host.
* \brief Host only
*/
StreamID updateHost(const StreamID& stream = DEF_MEM_STREAM) const {
CT_ERROR(mIsSlice, "Cannot update host copy on a slice");
return CudaTools::copy(pDevice, pHost, mShape.items() * sizeof(T), stream);
};
/**
* Updates the device copy by copying the host data to the device.
* \brief Host only
*/
StreamID updateDevice(const StreamID& stream = DEF_MEM_STREAM) const {
CT_ERROR(mIsSlice, "Cannot update device copy on a slice");
return CudaTools::copy(pHost, pDevice, mShape.items() * sizeof(T), stream);
};
#ifdef CUDATOOLS_USE_PYTHON
/**
* Returns a py::array for making an Array available as a Python numpy array.
*/
py::array pyArray() const {
std::vector<py::ssize_t> dims, strides;
for (uint iAxis = 0; iAxis < mShape.axes(); ++iAxis) {
dims.push_back(static_cast<py::ssize_t>(mShape.dim(iAxis)));
strides.push_back(sizeof(T) * static_cast<py::ssize_t>(mShape.stride(iAxis)));
}
return py::array_t<T, py::array::f_style>(
py::buffer_info((void*)pHost, sizeof(T), py::format_descriptor<T>::format(),
static_cast<py::ssize_t>(mShape.axes()), dims, strides));
};
#endif
};
template <typename T>
void printAxis(std::ostream& out, const Array<T>& arr, const uint32_t axis, size_t width) {
std::string space = std::string(2 * axis, ' ');
if (arr.shape().axes() == 1) {
out << "[";
for (uint32_t i = 0; i < arr.shape().items(); ++i) {
if constexpr (std::is_floating_point<T>::value) {
out << std::scientific << std::setprecision(6);
}
if (width == 0) {
out << ((i == 0) ? "" : " ");
} else {
out << std::setw((i == 0) ? width - 1 : width);
}
out << static_cast<T>(arr[i]) << ((i == arr.shape().items() - 1) ? "]" : ",");
}
} else if (arr.shape().axes() == 2) {
for (uint32_t i = 0; i < arr.shape().dim(0); ++i) {
out << space << ((i == 0) ? "[" : " ");
printAxis(out, arr[i], axis + 1, width);
out << ((i == arr.shape().dim(0) - 1) ? "]" : ",\n");
}
} else {
out << space << "[\n";
for (uint32_t i = 0; i < arr.shape().dim(0); ++i) {
printAxis(out, arr[i], axis + 1, width);
out << ((i == arr.shape().dim(0) - 1) ? "\n" : ",\n\n");
}
out << space << "]";
}
}
template <typename T> std::ostream& operator<<(std::ostream& out, const Array<T>& arr) {
size_t width = 0;
if constexpr (is_int<T>) {
T max_val = 0;
bool negative = false;
for (auto it = arr.begin(); it != arr.end(); ++it) {
T val = *it;
if constexpr (not std::is_unsigned<T>::value) {
if (*it < 0) {
negative = true;
val *= -1;
}
}
max_val = (val > max_val) ? val : max_val;
}
width = std::to_string(max_val).size() + 1;
width += (negative) ? 1 : 0;
} else if constexpr (is_float<T>) {
T max_val = 0;
bool negative = false;
for (auto it = arr.begin(); it != arr.end(); ++it) {
if (*it < 0) negative = true;
int exp = 0;
frexp(*it, &exp);
max_val = (exp > max_val) ? exp : max_val;
}
width = std::to_string(max_val).size() + 5;
width += (negative) ? 1 : 0;
}
printAxis<T>(out, arr, 0, (arr.shape().axes() == 1) ? 0 : width);
return out;
}
}; // namespace CudaTools
#endif // ARRAY_H

@ -0,0 +1,627 @@
#ifndef CUDATOOLS_BLAS_H
#define CUDATOOLS_BLAS_H
#ifndef CUDATOOLS_USE_EIGEN
#error "Cannot use CudaTools BLAS.h header without Eigen."
#endif
#include "Array.h"
#include "Core.h"
#include "Macros.h"
#include "Types.h"
using namespace CudaTools::Types;
namespace CudaTools {
namespace BLAS {
struct BatchInfo {
uint32_t strideA, strideB, strideC;
uint32_t size;
};
struct Check {
template <typename T>
static void isAtLeast2D(const Array<T>& arr, const std::string& name = "Array") {
CT_ERROR_IF(arr.shape().axes(), <, 2, (name + " needs to be at least 2D").c_str());
};
template <typename T>
static void isSquare(const Array<T>& arr, const std::string& name = "Array") {
isAtLeast2D(arr, name);
CT_ERROR_IF(arr.shape().rows(), !=, arr.shape().cols(), (name + " is not square").c_str())
};
template <typename T, typename U, typename V>
static void isValidMatmul(const Array<T>& A, const Array<U>& B, const Array<V>& C,
const std::string& nameA = "A", const std::string& nameB = "B",
const std::string nameC = "C") {
isAtLeast2D(A, nameA);
isAtLeast2D(B, nameB);
isAtLeast2D(C, nameB);
CT_ERROR_IF(A.shape().cols(), !=, B.shape().rows(),
(nameA + nameB + " is not a valid matrix multiplication").c_str());
Shape ABshape({A.shape().rows(), B.shape().cols()});
Shape Cshape({C.shape().rows(), C.shape().cols()});
CT_ERROR_IF(
ABshape, !=, Cshape,
("The shape of " + nameA + nameB + " does not match the shape of " + nameC).c_str());
};
template <typename T> static uint32_t getUpperItems(const Array<T>& arr) {
uint32_t upperItems = 1;
for (uint32_t iAxis = 0; iAxis < arr.shape().axes() - 2; ++iAxis) {
upperItems *= arr.shape().dim(iAxis);
}
return upperItems;
};
template <typename T, typename U>
static void matchUpperShape(const Array<T>& A, const Array<U>& B,
const std::string& nameA = "A", const std::string& nameB = "B") {
CT_ERROR_IF(A.shape().axes(), !=, B.shape().axes(),
(nameA + " and " + nameB + " shapes do not match for broadcasting").c_str());
for (uint32_t iAxis = 0; iAxis < A.shape().axes() - 2; ++iAxis) {
uint32_t Adim = A.shape().dim(iAxis);
uint32_t Bdim = B.shape().dim(iAxis);
CT_ERROR_IF(
Adim, !=, Bdim,
(nameA + " and " + nameB + " shapes do not match for broadcasting").c_str());
}
};
template <typename T, typename U, typename V>
static BatchInfo isBroadcastable(const Array<T>& A, const Array<U>& B, const Array<V>& C,
const std::string& nameA = "A", const std::string& nameB = "B",
const std::string nameC = "C") {
isValidMatmul(A, B, C, nameA, nameB, nameC);
uint32_t itemsA = getUpperItems(A);
uint32_t itemsB = getUpperItems(B);
uint32_t itemsC = getUpperItems(C);
uint32_t Asize = A.shape().rows() * A.shape().cols();
uint32_t Bsize = B.shape().rows() * B.shape().cols();
uint32_t Csize = C.shape().rows() * C.shape().cols();
if (itemsA == itemsB) {
CT_ERROR_IF(itemsA, !=, itemsC,
("Incorrect dimensions to broadcast to output " + nameC).c_str());
matchUpperShape(A, B, nameA, nameB);
matchUpperShape(A, C, nameA, nameC);
return BatchInfo{Asize, Bsize, Csize, itemsC};
} else if (itemsA > itemsB) {
CT_ERROR_IF(
itemsB, !=, 1,
("Cannot broadcast operation to " + nameB + " with non-matching " + nameA).c_str());
CT_ERROR_IF(itemsA, !=, itemsC,
("Incorrect dimensions to broadcast to output " + nameC).c_str());
matchUpperShape(A, C, nameA, nameC);
return BatchInfo{Asize, 0, Csize, itemsC};
} else {
CT_ERROR_IF(
itemsA, !=, 1,
("Cannot broadcast operation to " + nameA + " with non-matching " + nameB).c_str());
CT_ERROR_IF(itemsA, !=, itemsC,
("Incorrect dimensions to broadcast to output " + nameC).c_str());
matchUpperShape(B, C, nameB, nameC);
return BatchInfo{0, Bsize, Csize, itemsC};
}
};
};
/**
* Represents a Batch of Arrays with the same shape. Mainly used for cuBLAS functions.
*/
template <typename T> class Batch {
protected:
Array<T*> mBatch;
Shape mShape;
uint32_t mCount = 0;
uint32_t mBatchSize;
public:
Batch() = delete;
/**
* Constructs a batch from a given size.
*/
Batch(const uint32_t size) : mBatchSize(size){};
/**
* Constructs a batch from a non-view Array.
*/
Batch(const Array<T>& arr) {
CT_ERROR(arr.isView(), "Array cannot be a view");
mShape = Shape({arr.shape().rows(), arr.shape().cols()});
mBatchSize = mCount = Check::getUpperItems(arr);
mBatch = Array<T*>({mBatchSize});
Array<T> batch = arr.reshaped({mBatchSize, mShape.rows(), mShape.cols()});
for (uint32_t i = 0; i < mBatchSize; ++i) {
#ifdef CUDACC
mBatch[i] = batch[i].dataDevice();
#else
mBatch[i] = batch[i].data();
#endif
}
mBatch.updateDevice().wait();
};
/**
* Adds a matrix to the batch. Array must be a view.
*/
void add(const Array<T>& arr) {
CT_ERROR(not arr.isView(), "Cannot add non-view Arrays");
CT_ERROR_IF(mCount, ==, mBatchSize, "Batch is full, cannot add more arrays");
#ifdef CUDACC
mBatch[mCount] = arr.dataDevice();
#else
mBatch[mCount] = arr.data();
#endif
if (mCount == 0) {
mShape = arr.shape();
mBatchSize = mCount = Check::getUpperItems(arr);
} else {
CT_ERROR_IF(arr.shape(), !=, mShape, "Cannot add matrix of different shape to batch");
}
++mCount;
if (mCount == mBatchSize) {
mBatch.updateDevice().wait();
}
};
/**
* Indexing operator which returns a view of the Array in the Batch at the given index.
*/
Array<T> operator[](const uint32_t index) const {
CT_ERROR_IF(index, >=, mBatchSize, "Index exceeds batch size");
return Array<T>(mBatch[index], {mShape.rows(), mShape.cols()});
};
/**
* Returns the batch Array of pointers.
*/
Array<T*> batch() const { return mBatch.view(); };
Shape shape() const { return mShape; } /**< Gets the shape of the matrices in the batch. */
uint32_t size() const { return mBatchSize; } /**< Gets the batch size.*/
bool full() const { return mBatchSize == mCount; }; /**< Gets if the batch is full. */
};
////////////////
// cuBLAS API //
////////////////
template <typename T> struct CudaComplexConversion_S { typedef T type; };
#ifdef CUDACC
template <> struct CudaComplexConversion_S<complex64> { typedef cuComplex type; };
template <> struct CudaComplexConversion_S<complex128> { typedef cuDoubleComplex type; };
#else
#endif
template <typename T> using CudaComplexConversion = typename CudaComplexConversion_S<T>::type;
template <typename T> struct CublasTypeLetter_S { char letter; };
template <> struct CublasTypeLetter_S<real32> { char letter = 'S'; };
template <> struct CublasTypeLetter_S<real64> { char letter = 'D'; };
template <> struct CublasTypeLetter_S<complex64> { char letter = 'C'; };
template <> struct CublasTypeLetter_S<complex128> { char letter = 'Z'; };
#ifdef CUDACC
template <> struct CublasTypeLetter_S<real16> { char letter = 'H'; };
#endif
template <typename T> char CublasTypeLetter = CublasTypeLetter_S<T>::letter;
// Shorthands to reduce clutter.
#define CAST(var) reinterpret_cast<CudaComplexConversion<T>*>(var)
#define DCAST(var) reinterpret_cast<CudaComplexConversion<T>**>(var)
#define cublas(T, func) cublas##CublasTypeLetter<T>##func
template <typename T, typename F1, typename F2, typename F3, typename F4, typename... Args>
constexpr void invoke(F1 f1, F2 f2, F3 f3, F4 f4, Args&&... args) {
if constexpr (std::is_same<T, real32>::value) {
CUBLAS_CHECK(f1(args...));
} else if constexpr (std::is_same<T, real64>::value) {
CUBLAS_CHECK(f2(args...));
} else if constexpr (std::is_same<T, complex64>::value) {
CUBLAS_CHECK(f3(args...));
} else if constexpr (std::is_same<T, complex128>::value) {
CUBLAS_CHECK(f4(args...));
} else {
CT_ERROR(true, "This BLAS function is not callable with that type");
}
}
// If someone can think of a better solution, please tell me.
template <typename T, typename F1, typename F2, typename F3, typename F4, typename F5,
typename... Args>
constexpr void invoke5(F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, Args&&... args) {
if constexpr (std::is_same<T, real32>::value) {
CUBLAS_CHECK(f1(args...));
} else if constexpr (std::is_same<T, real64>::value) {
CUBLAS_CHECK(f2(args...));
} else if constexpr (std::is_same<T, complex64>::value) {
CUBLAS_CHECK(f3(args...));
} else if constexpr (std::is_same<T, complex128>::value) {
CUBLAS_CHECK(f4(args...));
} else if constexpr (std::is_same<T, real16>::value) {
CUBLAS_CHECK(f5(args...));
} else {
CT_ERROR(true, "This BLAS function is not callable with that type");
}
}
/**
* Computes the matrix-vector product: \f$ y = \alpha Ax + \beta y \f$. It will automatically
* broadcast the operation if applicable.
*/
template <typename T>
StreamID GEMV(const T alpha, const Array<T>& A, const Array<T>& x, const T beta, const Array<T>& y,
const StreamID& stream = DEF_CUBLAS_STREAM) {
BatchInfo bi = Check::isBroadcastable(A, x, y, "A", "x", "y");
CT_ERROR_IF(x.shape().cols(), !=, 1, "x must be a column vector");
CT_ERROR_IF(y.shape().cols(), !=, 1, "x must be a column vector");
uint32_t rows = A.shape().rows();
uint32_t cols = A.shape().cols();
T a = alpha, b = beta;
#ifdef CUDACC
CUBLAS_CHECK(cublasSetStream(Manager::get()->cublasHandle(), Manager::get()->stream(stream)));
if (bi.size == 1) {
invoke<T>(cublasSgemv, cublasDgemv, cublasCgemv, cublasZgemv,
Manager::get()->cublasHandle(), CUBLAS_OP_N, rows, cols, CAST(&a),
CAST(A.dataDevice()), rows, CAST(x.dataDevice()), 1, CAST(&b),
CAST(y.dataDevice()), 1);
} else { // Greater than 2, so broadcast.
invoke<T>(cublasSgemvStridedBatched, cublasDgemvStridedBatched, cublasCgemvStridedBatched,
cublasZgemvStridedBatched, Manager::get()->cublasHandle(), CUBLAS_OP_N, rows,
cols, CAST(&a), CAST(A.dataDevice()), rows, bi.strideA, CAST(x.dataDevice()), 1,
bi.strideB, CAST(&b), CAST(y.dataDevice()), 1, bi.strideC, bi.size);
}
#else
if (bi.size == 1) {
y.eigenMap() = a * (A.eigenMap() * x.eigenMap()) + b * y.eigenMap();
} else { // Greater than 2, so broadcast.
#pragma omp parallel for
for (uint32_t i = 0; i < bi.size; ++i) {
auto Ai = Array<T>(A, {rows, cols}, i * bi.strideA).eigenMap();
auto xi = Array<T>(x, {cols, 1}, i * bi.strideB).eigenMap();
auto yi = Array<T>(y, {rows, 1}, i * bi.strideC).eigenMap();
yi = a * (Ai * xi) + b * yi;
}
}
#endif
return StreamID{stream};
}
/**
* Computes the matrix-matrix product: \f$ C = \alpha AB + \beta C \f$. It will automatically
* broadcast the operation if applicable.
*/
template <typename T>
StreamID GEMM(const T alpha, const Array<T>& A, const Array<T>& B, const T beta, const Array<T>& C,
const StreamID& stream = DEF_CUBLAS_STREAM) {
BatchInfo bi = Check::isBroadcastable(A, B, C, "A", "B", "C");
// A is m x k, B is k x n.
uint32_t m = A.shape().rows();
uint32_t k = A.shape().cols();
uint32_t n = B.shape().cols();
T a = alpha, b = beta;
#ifdef CUDACC
CUBLAS_CHECK(cublasSetStream(Manager::get()->cublasHandle(), Manager::get()->stream(stream)));
if (bi.size == 1) {
invoke5<T>(cublasSgemm, cublasDgemm, cublasCgemm, cublasZgemm, cublasHgemm,
Manager::get()->cublasHandle(), CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, CAST(&a),
CAST(A.dataDevice()), m, CAST(B.dataDevice()), k, CAST(&b), CAST(C.dataDevice()),
m);
} else { // Greater than 2, so broadcast.
invoke5<T>(cublasSgemmStridedBatched, cublasDgemmStridedBatched, cublasCgemmStridedBatched,
cublasZgemmStridedBatched, cublasHgemmStridedBatched,
Manager::get()->cublasHandle(), CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, CAST(&a),
CAST(A.dataDevice()), m, bi.strideA, CAST(B.dataDevice()), k, bi.strideB,
CAST(&b), CAST(C.dataDevice()), m, bi.strideC, bi.size);
}
#else
if (bi.size == 1) {
C.eigenMap() = a * (A.eigenMap() * B.eigenMap()) + b * C.eigenMap();
} else { // Greater than 2, so broadcast.
#pragma omp parallel for
for (uint32_t i = 0; i < bi.size; ++i) {
auto Ai = Array<T>(A, {m, k}, i * bi.strideA).eigenMap();
auto Bi = Array<T>(B, {k, n}, i * bi.strideB).eigenMap();
auto Ci = Array<T>(C, {m, n}, i * bi.strideC).eigenMap();
Ci = a * (Ai * Bi) + b * Ci;
}
}
#endif
return StreamID{stream};
}
/**
* Computes the diagonal matrix multiplication: \f$ C = A\mathrm{diag}(X) \f$, or \f$ C =
* \mathrm{diag}(X)A \f$ if left = true.
*/
template <typename T>
StreamID DGMM(const Array<T>& A, const Array<T>& X, const Array<T>& C, const bool left = false,
const StreamID& stream = DEF_CUBLAS_STREAM) {
CT_ERROR_IF(X.shape().cols(), !=, 1, "'x' must be a column vector.");
if (left) {
CT_ERROR_IF(A.shape().rows(), !=, X.shape().rows(),
"Rows of 'A' and length of 'x' need to match.");
} else {
CT_ERROR_IF(A.shape().cols(), !=, X.shape().rows(),
"Columns of 'A' and length of 'x' need to match.");
}
CT_ERROR_IF(A.shape().rows(), !=, C.shape().rows(),
"Rows of 'A' and rows() of 'C' need to match.");
CT_ERROR_IF(A.shape().cols(), !=, C.shape().cols(),
"Rows of 'A' and columns of 'C' need to match.");
#ifdef CUDACC
uint32_t m = C.shape().rows();
uint32_t n = C.shape().cols();
auto mode = (left) ? CUBLAS_SIDE_LEFT : CUBLAS_SIDE_RIGHT;
CUBLAS_CHECK(cublasSetStream(Manager::get()->cublasHandle(), Manager::get()->stream(stream)));
invoke<T>(cublasSdgmm, cublasDdgmm, cublasCdgmm, cublasZdgmm, Manager::get()->cublasHandle(), m,
n, CAST(A.dataDevice()), A.shape().rows(), CAST(X.dataDevice()), 1,
CAST(C.dataDevice()), m);
#else
if (left) {
C.eigenMap() = X.eigenMap().asDiagonal() * A.eigenMap();
} else {
C.eigenMap() = A.eigenMap() * X.eigenMap().asDiagonal();
}
#endif
return StreamID{stream};
}
//////////////////////////////
// PLUArray Related Objects //
//////////////////////////////
///////////////////////////
// PartialPivLU Wrapper //
///////////////////////////
// This class is just a workaround to use Eigen's internals directly.
template <typename T> class PartialPivLU;
namespace internal {
template <typename T> static Array<T> empty({1, 1});
template <typename T> static EigenMapMat<T> empty_map = empty<T>.eigenMap();
}; // namespace internal
template <typename T, std::enable_if_t<is_float<T> or is_complex<T>, bool> = true> class PLUArray;
// This is a wrapper class for Eigen's class so we have more controlled access to
// the underlying data.
template <typename T> class PartialPivLU : public Eigen::PartialPivLU<Eigen::Ref<EigenMat<T>>> {
private:
using Base = Eigen::PartialPivLU<Eigen::Ref<EigenMat<T>>>;
template <typename U, std::enable_if_t<is_float<U> or is_complex<U>, bool>>
friend class PLUArray;
EigenMapMat<T> mMapLU;
EigenMapMat<int32_t> mMapPivots;
public:
PartialPivLU()
: Base(internal::empty_map<T>), mMapLU(internal::empty_map<T>),
mMapPivots(internal::empty_map<int32_t>){};
void make(const Array<T>& lu, const Array<int32_t>& pivots) {
new (&mMapLU) EigenMapMat<T>(lu.eigenMap());
new (&mMapPivots) EigenMapMat<int32_t>(pivots.atLeast2D().eigenMap());
new (&this->m_lu) decltype(Base::m_lu)(mMapLU.derived());
new (&this->m_p) decltype(Base::m_p)(mMapPivots.derived());
// new (&this->m_rowsTranspositions) decltype(Base::m_rowsTranspositions)(
// mMapPivots.derived());
this->m_l1_norm = 0;
this->m_det_p = 0;
this->m_isInitialized = true;
};
};
namespace internal {
// We only create one and copy-construct to avoid the re-initialization.
template <typename T> static PartialPivLU<T> BlankPPLU = PartialPivLU<T>();
}; // namespace internal
/**
* Class for storing the PLU decomposition an Array. This is restricted to floating point types.
*/
template <typename T, std::enable_if_t<is_float<T> or is_complex<T>, bool>> class PLUArray {
private:
Array<T> mLU;
Array<int32_t> mPivots;
PartialPivLU<T> mPPLU = internal::BlankPPLU<T>;
public:
PLUArray() = delete;
/**
* Constructor for a PLUArray given the matrix dimension.
*/
PLUArray(const uint32_t n) : mLU({n, n}), mPivots({n}) { mPPLU.make(mLU, mPivots); };
/**
* Constructor for a PLUArray given an existing array.
*/
PLUArray(const Array<T>& arr)
: mLU((arr.isView()) ? arr.view() : arr), mPivots({arr.shape().rows()}) {
CT_ERROR_IF(mLU.shape().axes(), !=, 2, "Array must be a 2D matrix");
CT_ERROR_IF(mLU.shape().rows(), !=, mLU.shape().cols(), "Matrix must be square");
mPPLU.make(mLU, mPivots);
};
/**
* Constructor for a PLUArray given an existing location in memory for both the matrix and
* the pivots.
*/
PLUArray(const Array<T>& arr, const Array<int32_t> pivots)
: mLU(arr.view()), mPivots(pivots.view()) {
CT_ERROR_IF(mLU.shape().axes(), !=, 2, "Array must be a 2D matrix");
CT_ERROR_IF(mLU.shape().rows(), !=, mLU.shape().cols(), "Matrix must be square");
mPPLU.make(mLU, mPivots);
};
uint32_t rank() { return mLU.shape().rows(); }; /**< Gets the rank of the LU matrix. */
Array<T> LU() const { return mLU.view(); }; /**< Gets the LU matrix. */
Array<int32_t> pivots() const { return mPivots.view(); }; /**< Gets the LU matrix. */
/**
* Comptues the inplace LU factorization for this array on CPU.
*/
void computeLU() {
mPPLU.compute();
mPPLU.mMapPivots = mPPLU.permutationP().indices();
};
/**
* Solves the system \f$ LUx = b \f$ and returns \f$x\f$.
*/
Array<T> solve(const Array<T>& b) {
Array<T> x(b.shape());
x.eigenMap() = mPPLU.solve(b.eigenMap());
return x;
};
};
/**
* This is a batch version of PLUArray, to enable usage of the cuBLAS API. This is restricted to
* floating point types.
*/
template <typename T, std::enable_if_t<is_float<T> or is_complex<T>, bool> = true>
class PLUBatch : public Batch<T> {
private:
Array<int32_t> mPivotsBatch;
Array<int32_t> mInfoLU;
int32_t mInfoSolve;
bool mInitialized = false;
public:
/**
* Constructor of a PLUBatch from a given batch size.
*/
PLUBatch(const uint32_t size) : Batch<T>(size), mInfoLU({size}){};
/**
* Constructor of a PLUBatch from a multi-dimensional array, batched across upper dimensions.
*/
PLUBatch(const Array<T>& arr) : Batch<T>(arr) {
Check::isSquare(arr, "LU Array");
mPivotsBatch = Array<int32_t>({this->mBatchSize * this->mShape.rows()});
mInfoLU = Array<int32_t>({this->mBatchSize});
};
/**
* Indexing operator which returns the PLUArray in the PLUBatch at the given index.
*/
PLUArray<T> operator[](const uint32_t index) const {
CT_ERROR_IF(index, >=, this->mBatchSize, "Index exceeds batch size");
Array<T> lu(this->mBatch[index], {this->mShape.rows(), this->mShape.cols()});
Array<int32_t> pivots(mPivotsBatch.data() + index * this->mShape.rows(),
{this->mShape.rows()});
return PLUArray<T>(lu, pivots);
};
/**
* Computes the inplace PLU decomposition of batch of arrays.
*/
StreamID computeLU(const StreamID& stream = DEF_CUBLAS_STREAM) {
#ifdef CUDACC
uint32_t n = this->mShape.rows();
CUBLAS_CHECK(
cublasSetStream(Manager::get()->cublasHandle(), Manager::get()->stream(stream)));
invoke<T>(cublasSgetrfBatched, cublasDgetrfBatched, cublasCgetrfBatched,
cublasZgetrfBatched, Manager::get()->cublasHandle(), n,
DCAST(this->mBatch.dataDevice()), n, mPivotsBatch.dataDevice(),
mInfoLU.dataDevice(), this->mBatchSize);
#else
#pragma omp parallel for
for (uint32_t i = 0; i < this->mBatchSize; ++i) {
(*this)[i].computeLU();
}
#endif
mInitialized = true;
return stream;
};
/**
* Solves the batched system \f$LUx = b\f$ inplace. The solution \f$x\f$ is written back into
* \f$b\f$.
*/
StreamID solve(const Batch<T>& b, const StreamID& stream = DEF_CUBLAS_STREAM) {
CT_ERROR(not mInitialized,
"Cannot solve system if PLUBatch has not yet computed its LU decomposition");
CT_ERROR_IF(b.size(), !=, this->mBatchSize,
"Upper dimensions of b do not match batch size");
CT_ERROR_IF(b.shape().rows(), !=, this->mShape.rows(),
"The length of each column of b must match the matrix rank");
#ifdef CUDACC
uint32_t n = b.shape().rows();
uint32_t nrhs = b.shape().cols();
CUBLAS_CHECK(
cublasSetStream(Manager::get()->cublasHandle(), Manager::get()->stream(stream)));
invoke<T>(cublasSgetrsBatched, cublasDgetrsBatched, cublasCgetrsBatched,
cublasZgetrsBatched, Manager::get()->cublasHandle(), CUBLAS_OP_N, n, nrhs,
DCAST(this->mBatch.dataDevice()), n, mPivotsBatch.dataDevice(),
DCAST(b.batch().dataDevice()), n, &mInfoSolve, this->mBatchSize);
#else
#pragma omp parallel for
for (uint32_t i = 0; i < this->mBatchSize; ++i) {
b[i] = (*this)[i].solve(b[i]);
}
#endif
return stream;
};
/**
* Gets the pivots data from the device to the host. Does nothing for CPU.
*/
StreamID getPivots(const StreamID& stream = DEF_MEM_STREAM) const {
mPivotsBatch.updateHost(stream);
return stream;
};
/**
* Gets the info array for the LU decomposition for the device to the host. Does not
* return useful information for CPU.
*/
Array<int32_t> getLUInfo() const {
mInfoLU.updateHost().wait();
return mInfoLU;
};
/**
* Checks validity of the solve operation. Does not return useful information for CPU.
*/
int32_t validSolve() const { return mInfoSolve == 0; }
};
}; // namespace BLAS
}; // namespace CudaTools
#endif

@ -0,0 +1,683 @@
#ifndef CUDATOOLS_H
#define CUDATOOLS_H
#include "Macros.h"
#include <functional>
#include <iostream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
namespace CudaTools {
struct Event;
/**
* Simple wrapper for the name of a stream. Its purposes is to allow for
* 'streams' to be passed on host code, and allowing for simple syntax
* for waiting.
*/
struct StreamID {
public:
std::string mId;
StreamID() : mId(""){};
/**
* The constructor for a StreamID.
*/
StreamID(const std::string& id_) : mId(id_){};
StreamID(const char* id_) : mId(id_){};
void wait() const; /**< Makes host wait for this stream. */
/**
* Makes this stream wait for this event. Does not block the host.
*/
void wait(const Event& event) const;
};
static const StreamID DEF_MEM_STREAM = StreamID{"defaultMemory"};
static const StreamID DEF_CUBLAS_STREAM = StreamID{"defaultCublas"};
static const StreamID DEF_KERNEL_STREAM = StreamID{"defaultKernel"};
/**
* Allocates memory on the device.
*/
void* malloc(const size_t size);
/**
* Frees memory on the device.
*/
void free(void* const pDevice);
/**
* Copies memory from the source pointer to the dest pointer.
*/
StreamID copy(void* const source, void* const dest, const size_t size,
const StreamID& stream = DEF_MEM_STREAM);
/**
* Initializes or sets device memory to a value.
*/
StreamID memset(void* const pDevice, int value, const size_t size,
const StreamID& stream = DEF_MEM_STREAM);
/**
* Pins memory on the host.
*/
void pin(void* const pHost, const size_t size);
#ifdef CUDACC
cudaDeviceProp getDeviceProp();
static cudaDeviceProp DeviceProperties = getDeviceProp();
const char* cublasGetErrorString(cublasStatus_t status);
#endif
/**
* A class that manages various CUDA Runtime components, such as
* streams, events, and handles.
*/
class Manager {
private:
static Manager mManagerInstance;
Manager(const std::vector<std::string>& names);
~Manager();
#ifdef CUDACC
std::unordered_map<std::string, cudaStream_t> mStreams;
cublasHandle_t mCublas;
// cusparseHandle_t mCusparse;
#endif
public:
/**
* Used to get the global CudaTools::Manager instance.
*/
static Manager* get() { return &mManagerInstance; };
void waitFor(const StreamID& stream) const; /**< Waits for the stream provided. */
void sync() const; /**< Waits until all device code has finished. */
void addStream(const std::string& name); /**< Creates a stream with the given name. */
#ifdef CUDACC
cudaStream_t stream(const StreamID& stream) const;
cublasHandle_t cublasHandle() const;
// cusparseHandle_t cusparseHandle() const;
#endif
};
namespace Kernel {
/**
* A struct that contains the kernel launch parameters.
*/
struct Settings {
public:
#ifdef CUDACC
dim3 blockGrid;
dim3 threadBlock;
size_t sharedMemoryBytes = 0;
#else
size_t threads;
#endif
StreamID stream;
Settings() = default;
void setGridDim(const size_t x); /**< Sets the Grid dimensions. */
void setGridDim(const size_t x, const size_t y); /**< Sets the Grid dimensions. */
void setGridDim(const size_t x, const size_t y,
const size_t z); /**< Sets the Grid dimensions. */
void setBlockDim(const size_t x); /**< Sets the Thread Block dimensions. */
void setBlockDim(const size_t x, const size_t y); /**< Sets the Thread Block dimensions. */
void setBlockDim(const size_t x, const size_t y,
const size_t z); /**< Sets the Thread Block dimensions. */
void setSharedMemSize(const size_t bytes); /**< Sets the static shared memory size. */
void setStream(const StreamID& stream); /**< Sets the stream. */
};
/**
* Returns a kernel launch parameters based on the number of threads, and optionally
* a stream. Should only be used for 'embarassingly parallel' situations, or where
* each thread corresponds some sort of index.
*/
Settings basic(const size_t threads, const StreamID& stream = DEF_KERNEL_STREAM);
/**
* Launches a kernel with the provided function, settings and its arguments.
*/
template <typename F, typename... Args>
StreamID launch(F func, const Kernel::Settings& sett, Args... args) {
#ifdef CUDACC
func<<<sett.blockGrid, sett.threadBlock, sett.sharedMemoryBytes,
Manager::get()->stream(sett.stream.mId)>>>(args...);
#else
func(args...);
#endif
return sett.stream;
}
}; // namespace Kernel
template <typename T> class Array;
/**
* A class that holds information about an Array.
*/
class Shape {
private:
template <typename T> friend class Array;
uint32_t mAxes;
uint32_t mItems;
uint32_t mAxisDim[CUDATOOLS_ARRAY_MAX_AXES] = {0};
uint32_t mStride[CUDATOOLS_ARRAY_MAX_AXES] = {0};
public:
HD Shape() : mAxes(0), mItems(1){};
/**
* The constructor for a Shape.
* \param dims an initializer list of the dimensions.
*/
HD Shape(const std::initializer_list<uint32_t> dims);
HD uint32_t axes() const; /**< Gets the number of axes. */
HD uint32_t items() const; /**< Gets the total number of items. */
HD uint32_t length() const; /**< For 1D shapes, gets the length. In general, gets the
dimension of the last axis. */
HD uint32_t rows() const; /**< For 2D shapes, gets the number of rows. In general, gets the
dimension of the second to last axis. */
HD uint32_t cols() const; /**< For 2D shapes, gets the number of columns. In general, gets
the dimension of the second to last axis. */
HD uint32_t
dim(const uint32_t axis) const; /**< Gets the dimension size of the specified axis. */
HD uint32_t stride(const uint32_t axis) const; /**< Gets the stride of the specified axis. */
/**
* Gets the shape at a specific axis of this shape.
* \param axis the axis of where the new shape starts.
*/
HD Shape subshape(const uint32_t axis) const;
HD bool operator==(const Shape& s) const; /**< Equals operator. */
HD bool operator!=(const Shape& s) const; /**< Not equals operator. */
};
std::ostream& operator<<(std::ostream& out, const Shape& s);
/**
* A simple class that manages a CUDA Event.
*/
struct Event {
#ifdef CUDACC
cudaEvent_t mEvent;
#endif
Event();
~Event();
void record(const StreamID& stream); /**< Records a event from a stream. */
};
template <typename F, typename... Args> struct FuncHolder {
F mFunc;
std::tuple<Args...> mArgs;
FuncHolder() = delete;
FuncHolder(F func, Args... args) : mFunc(func), mArgs(std::make_tuple(args...)){};
static void run(void* data) {
FuncHolder<F, Args...>* fh = (FuncHolder<F, Args...>*)(data);
std::apply([fh](auto&&... args) { fh->mFunc(args...); }, fh->mArgs);
};
};
/**
* A class that manages CUDA Graphs.
*/
template <typename F, typename... Args> class Graph {
private:
#ifdef CUDACC
cudaGraph_t mGraph;
cudaGraphExec_t mInstance;
#endif
FuncHolder<F, Args...> mFuncHolder;
StreamID mStream;
public:
Graph() = delete;
/**
* The constructor for a Graph, which captures the function.
* \param func the function to capture.
* \param stream the origin stream to use.
* \param args the arguments of the function.
*/
Graph(const StreamID& stream, F func, Args... args)
: mFuncHolder(func, args...), mStream(stream) {
#ifdef CUDACC
CUDA_CHECK(
cudaStreamBeginCapture(Manager::get()->stream(mStream), cudaStreamCaptureModeGlobal));
mFuncHolder.run((void*)&mFuncHolder);
CUDA_CHECK(cudaStreamEndCapture(Manager::get()->stream(mStream), &mGraph));
CUDA_CHECK(cudaGraphInstantiate(&mInstance, mGraph, NULL, NULL, 0));
#endif
};
~Graph() {
#ifdef CUDACC
cudaGraphDestroy(mGraph);
cudaGraphExecDestroy(mInstance);
#endif
};
/**
* Executes the instantiated graph, or simply runs the function with provided
* arguments if compiling for CPU.
*/
StreamID execute() const {
#ifdef CUDACC
cudaGraphLaunch(mInstance, Manager::get()->stream(mStream));
#else
mFuncHolder.run((void*)&mFuncHolder);
#endif
return mStream;
}
};
/**
* A struct to facilitate other CUDA Graphs functionality like creating branches and host callbacks.
*/
struct GraphManager {
std::vector<void*> mHostData;
std::vector<Event*> mEvents;
~GraphManager();
/**
* Within a function that is being stream captured, launch a host function that can
* be captured into the graph.
*/
template <typename F, typename... Args>
void launchHostFunction(const StreamID& stream, F func, Args&&... args) {
#ifdef CUDACC
FuncHolder<F, Args...>* fh = new FuncHolder<F, Args...>(func, args...);
mHostData.push_back((void*)fh);
cudaHostFn_t run_func = fh->run;
CUDA_CHECK(cudaLaunchHostFunc(Manager::get()->stream(stream), run_func, fh));
#else
func(args...);
#endif
}
/**
* Makes a new branch in the graph to be run in parallel by a new stream.
* \param orig_stream the original stream to branch from.
* \param branch_stream the stream of the new branch.
*/
void makeBranch(const StreamID& orig_stream, const StreamID& branch_stream);
/**
* Joins a existing branch in the graph to collapse a parallel block.
* \param orig_stream the original stream to join the branch to.
* \param branch_stream the stream of the branch to join.
*/
void joinBranch(const StreamID& orig_stream, const StreamID& branch_stream);
};
}; // namespace CudaTools
#endif // CUDATOOLS_H
#ifdef CUDATOOLS_IMPLEMENTATION
#ifndef __CUDATOOLS_IMPLEMENTED__
#define __CUDATOOLS_IMPLEMENTED__
namespace CudaTools {
//////////////////////
// StreamID Methods //
//////////////////////
void StreamID::wait() const { Manager::get()->waitFor(mId); }
void StreamID::wait(const Event& event) const {
#ifdef CUDACC
CUDA_CHECK(cudaStreamWaitEvent(Manager::get()->stream(mId), event.mEvent, 0));
#endif
}
////////////////////
// Memory Methods //
////////////////////
void* malloc(const size_t size) {
#ifdef CUDACC
void* pDevice;
CUDA_CHECK(cudaMalloc(&pDevice, size));
return pDevice;
#else
return nullptr;
#endif
}
void free(void* const pDevice) {
#ifdef CUDACC
if (pDevice != nullptr) CUDA_CHECK(cudaFree(pDevice));
#endif
}
StreamID copy(void* const source, void* const dest, const size_t size, const StreamID& stream) {
#ifdef CUDACC
CUDA_CHECK(
cudaMemcpyAsync(dest, source, size, cudaMemcpyDefault, Manager::get()->stream(stream)));
#endif
return stream;
}
StreamID memset(void* const pDevice, const int value, const size_t size, const StreamID& stream) {
#ifdef CUDACC
CUDA_CHECK(cudaMemsetAsync(pDevice, value, size, Manager::get()->stream(stream)));
#endif
return stream;
}
void pin(void* const pHost, const size_t size) {
#ifdef CUDACC
CUDA_CHECK(cudaHostRegister(pHost, size, cudaHostRegisterDefault));
#endif
}
#ifdef CUDACC
cudaDeviceProp getDeviceProp() {
cudaSetDevice(0);
cudaDeviceProp deviceProp;
cudaGetDeviceProperties(&deviceProp, 0);
return deviceProp;
}
#endif
/////////////////////
// Manager Methods //
/////////////////////
Manager::Manager(const std::vector<std::string>& names) {
#ifdef CUDACC
for (auto name : names) {
addStream(name);
}
CUBLAS_CHECK(cublasCreate(&mCublas));
// CUSPARSE_CHECK(cusparseCreate(&mCusparse));
#endif
}
Manager::~Manager() {
#ifdef CUDACC
for (auto& it : mStreams) {
cudaStreamDestroy(it.second);
}
cublasDestroy(mCublas);
// CUSPARSE_CHECK(cusparseDestroy(mCusparse));
#endif
}
void Manager::waitFor(const StreamID& stream) const {
#ifdef CUDACC
auto it = mStreams.find(stream.mId);
if (it != mStreams.end()) {
CUDA_CHECK(cudaStreamSynchronize(it->second));
} else {
CT_ERROR(true, ("Invalid stream " + stream.mId).c_str());
}
#endif
}
void Manager::sync() const {
#ifdef CUDACC
CUDA_CHECK(cudaDeviceSynchronize());
#endif
}
void Manager::addStream(const std::string& name) {
#ifdef CUDACC
cudaStream_t s;
CUDA_CHECK(cudaStreamCreate(&s));
mStreams[name] = s;
#endif
}
#ifdef CUDACC
cudaStream_t Manager::stream(const StreamID& stream) const {
auto it = mStreams.find(stream.mId);
if (it != mStreams.end()) {
return it->second;
} else {
CT_ERROR(true, ("Invalid stream " + stream.mId).c_str());
}
}
cublasHandle_t Manager::cublasHandle() const { return mCublas; };
// cusparseHandle_t Manager::cusparseHandle() const { return mCusparse; };
Manager Manager::mManagerInstance = Manager({"defaultMemory", "defaultCublas", "defaultKernel"});
#else
Manager Manager::mManagerInstance = Manager({""});
#endif
////////////////////
// Kernel Methods //
////////////////////
namespace Kernel {
void Settings::setGridDim(const size_t x) {
#ifdef CUDACC
CT_ERROR_IF(x, >, DeviceProperties.maxGridSize[0], "Total grid size too large")
blockGrid.x = x;
blockGrid.y = 1;
blockGrid.z = 1;
#endif
}
void Settings::setGridDim(const size_t x, const size_t y) {
#ifdef CUDACC
CT_ERROR_IF(x * y, >, DeviceProperties.maxGridSize[0], "Total grid size too large.");
CT_ERROR_IF(x, >, DeviceProperties.maxGridSize[0], "Grid dimension 'x' too large.");
CT_ERROR_IF(y, >, DeviceProperties.maxGridSize[1], "Grid dimension 'y' too large.");
blockGrid.x = x;
blockGrid.y = y;
blockGrid.z = 1;
#endif
}
void Settings::setGridDim(const size_t x, const size_t y, const size_t z) {
#ifdef CUDACC
CT_ERROR_IF(x * y * z, >, DeviceProperties.maxGridSize[0], "Total grid size too large.");
CT_ERROR_IF(x, >, DeviceProperties.maxGridSize[0], "Grid dimension 'x' too large.");
CT_ERROR_IF(y, >, DeviceProperties.maxGridSize[1], "Grid dimension 'y' too large.");
CT_ERROR_IF(z, >, DeviceProperties.maxGridSize[2], "Grid dimension 'z' too large.");
blockGrid.x = x;
blockGrid.y = y;
blockGrid.z = z;
#endif
}
void Settings::setBlockDim(const size_t x) {
#ifdef CUDACC
CT_ERROR_IF(x, >, DeviceProperties.maxThreadsDim[0], "Total block size too large.");
threadBlock.x = x;
threadBlock.y = 1;
threadBlock.z = 1;
#endif
}
void Settings::setBlockDim(const size_t x, const size_t y) {
#ifdef CUDACC
CT_ERROR_IF(x * y, >, DeviceProperties.maxThreadsDim[0], "Total block size too large.");
CT_ERROR_IF(x, >, DeviceProperties.maxThreadsDim[0], "Block dimension 'x' too large.");
CT_ERROR_IF(y, >, DeviceProperties.maxThreadsDim[1], "Block dimension 'y' too large.");
threadBlock.x = x;
threadBlock.y = y;
threadBlock.z = 1;
#endif
}
void Settings::setBlockDim(const size_t x, const size_t y, const size_t z) {
#ifdef CUDACC
CT_ERROR_IF(x * y * z, >, DeviceProperties.maxThreadsDim[0], "Total block size too large.");
CT_ERROR_IF(x, >, DeviceProperties.maxThreadsDim[0], "Block dimension 'x' too large.");
CT_ERROR_IF(y, >, DeviceProperties.maxThreadsDim[1], "Block dimension 'y' too large.");
CT_ERROR_IF(z, >, DeviceProperties.maxThreadsDim[2], "Block dimension 'z' too large.");
threadBlock.x = x;
threadBlock.y = y;
threadBlock.z = z;
#endif
}
void Settings::setSharedMemSize(const size_t bytes) {
#ifdef CUDACC
sharedMemoryBytes = bytes;
#endif
}
void Settings::setStream(const StreamID& stream_) {
#ifdef CUDACC
stream = stream_;
#endif
}
Settings basic(const size_t threads, const StreamID& stream) {
Settings sett;
#ifdef CUDACC
auto max_threads = DeviceProperties.maxThreadsPerBlock;
size_t grid_blocks = (threads + max_threads - 1) / max_threads; // ceil(threads / max_threads)
size_t block_threads = (threads + grid_blocks - 1) / grid_blocks; // ceil(threads / grid_blocks)
sett.setGridDim(grid_blocks);
sett.setBlockDim(block_threads);
sett.setStream(stream);
#else
sett.threads = threads;
#endif
return sett;
}
}; // namespace Kernel
/////////////////////
// Shape Functions //
/////////////////////
HD Shape::Shape(const std::initializer_list<uint32_t> dims) : mAxes(dims.size()), mItems(1) {
CT_ERROR_IF(dims.size(), >, CUDATOOLS_ARRAY_MAX_AXES, "Number of axes exceeds max axes");
mAxes = dims.size();
if (mAxes == 0) return;
auto it = dims.end() - 1;
mItems = 1;
for (uint32_t iAxis = mAxes - 1; iAxis < mAxes; --iAxis) {
uint32_t dim = *it;
CT_ERROR_IF(dim, ==, 0, "Axis dimension cannot be 0");
mAxisDim[iAxis] = dim;
mStride[iAxis] = mItems;
mItems *= dim;
--it;
}
if (mAxes == 1) return;
// Swap last two, for column major storage.
mStride[mAxes - 2] = 1;
mStride[mAxes - 1] = mAxisDim[mAxes - 2];
}
HD uint32_t Shape::axes() const { return mAxes; };
HD uint32_t Shape::items() const { return mItems; };
HD uint32_t Shape::length() const { return mAxisDim[mAxes - 1]; }
HD uint32_t Shape::rows() const { return mAxisDim[mAxes - 2]; }
HD uint32_t Shape::cols() const { return mAxisDim[mAxes - 1]; }
HD uint32_t Shape::dim(const uint32_t axis) const { return mAxisDim[axis]; }
HD uint32_t Shape::stride(const uint32_t axis) const { return mStride[axis]; }
HD bool Shape::operator==(const Shape& s) const {
if (mAxes != s.mAxes) {
return false;
}
for (uint32_t iAxis = 0; iAxis < mAxes; ++iAxis) {
if (mAxisDim[iAxis] != s.mAxisDim[iAxis]) {
return false;
}
}
return true;
}
HD bool Shape::operator!=(const Shape& s) const { return not(*this == s); }
HD Shape Shape::subshape(const uint32_t axis) const {
CT_ERROR_IF(axis, >, mAxes, "Axis number exceeds number of axes.");
if (axis == mAxes) return Shape({1});
Shape new_shape({});
new_shape.mAxes = mAxes - axis;
new_shape.mItems = mItems;
for (uint32_t iAxis = 0; iAxis < axis; iAxis++) {
new_shape.mItems /= mAxisDim[iAxis];
}
for (uint32_t iAxis = axis; iAxis < mAxes; iAxis++) {
new_shape.mAxisDim[iAxis - axis] = mAxisDim[iAxis];
new_shape.mStride[iAxis - axis] = mStride[iAxis];
}
return new_shape;
}
std::ostream& operator<<(std::ostream& out, const Shape& s) {
out << "(";
if (s.axes() == 0) return out << ")";
for (uint32_t iAxis = 0; iAxis < s.axes() - 1; ++iAxis) {
out << s.dim(iAxis) << ", ";
}
return out << s.dim(s.axes() - 1) << ")";
}
///////////////////
// Event Methods //
///////////////////
Event::Event() {
#ifdef CUDACC
CUDA_CHECK(cudaEventCreate(&mEvent));
#endif
}
Event::~Event() {
#ifdef CUDACC
cudaEventDestroy(mEvent);
#endif
}
void Event::record(const StreamID& stream) {
#ifdef CUDACC
CUDA_CHECK(cudaEventRecord(mEvent, Manager::get()->stream(stream)));
#endif
}
//////////////////////////
// GraphManager Methods //
//////////////////////////
GraphManager::~GraphManager() {
#ifdef CUDACC
for (Event* event : mEvents) {
delete event;
}
#endif
}
void GraphManager::makeBranch(const StreamID& orig_stream, const StreamID& branch_stream) {
Event* event = new Event();
event->record(orig_stream);
mEvents.push_back(event);
branch_stream.wait(*event);
}
void GraphManager::joinBranch(const StreamID& orig_stream, const StreamID& branch_stream) {
Event* event = new Event();
event->record(branch_stream);
mEvents.push_back(event);
orig_stream.wait(*event);
}
}; // namespace CudaTools
#endif
#endif // CUDATOOLS_IMPLEMENTATION

@ -0,0 +1,311 @@
#ifndef MACROS_H
#define MACROS_H
#include <exception>
#include <sstream>
#include <stdarg.h>
#if defined(CUDA) && defined(__CUDACC__)
#define CUDACC
#endif
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ > 0)
#define DEVICE
#endif
#ifdef CUDATOOLS_DOXYGEN
/**
* \def CUDACC
* This macro is defined when this code is being compiled by nvcc and the CUDA compilation
* flag is set. This should be used to enclose code where CUDA specific libraries and syntax are
* being used.
*/
#define CUDACC
/**
* \def DEVICE
* This macro is defined when this code is being compiled for the device. The difference between
* this and CUDACC is that this should exclusively be used to dcide if code is being compiled
* to execute on the device. CUDACC is only determines what compiler is being used.
*/
#define DEVICE
/**
* \def HD
* Mark a function in front with this if it needs to be callable on both the
* CPU and CUDA device.
*/
#define HD
/**
* \def DEVICE_FUNC
* Mark a function in front with this if it is only callable on the CUDA device.
*/
#define DEVICE_FUNC
/**
* \def SHARED
* Mark a variable as static shared memory.
*/
#define SHARED
/**
* \def CUDATOOLS_USE_EIGEN
* Compile the CudaTools library with Eigen support.
*/
#define CUDATOOLS_USE_EIGEN
/**
* \def CUDATOOLS_USE_PYTHON
* Compile the CudaTools library with Python support.
*/
#define CUDATOOLS_USE_PYTHON
/**
* \def KERNEL(call, settings, ...)
* Used to call a CUDA kernel.
* \param call the name of the kernel
* \param settings the associated CudaTools::Kernel::Settings to initialize the kernel with
* \param ... the arguments of the kernel
*/
#define KERNEL(call, settings, ...)
/**
* \def BASIC_LOOP(N)
* Can be used in conjunction with CudaTools::Kernel::Basic, which is mainly used for embarassingly
* parallel situations. Exposes the loop/thread number as iThread.
* \param N number of iterations
*/
#define BASIC_LOOP(N)
/**
* \def DEVICE_COPY(name)
* Can be used inside a class declaration (header) which generates boilerplate code to allow this
* class to be used on the device.
*
* This macro creates a few functions:\n
* name* that(): returns the pointer to this instance on the device.
*
* void allocateDevice(): allocates the memory on the device for this class instance.
*
* void freeDevice(): frees the memory on the device for this class instance.
*
* CudaTools::StreamID updateHost(const CudaTools::StreamID& stream): updates the host instance
* of the class.
*
* CudaTools::StreamID updateDevice(const CudaTools::StreamID& stream): updates
* the device instance of the class.
* \param name the name of the class
*/
#define DEVICE_COPY(name)
/**
* \def CT_ERROR_IF(a, op, b, msg)
* Used for throwing runtime errors given a condition with an operator.
*/
#define CT_ERROR_IF(a, op, b, msg)
/**
* \def CT_ERROR(a, msg)
* Used for throwing runtime errors given a bool.
*/
#define CT_ERROR(a, msg)
/**
* \def CUDA_CHECK(call)
* Gets the error generated by a CUDA function call if there is one.
* \param call CUDA function to check if there are errors when running.
*/
#define CUDA_CHECK(call)
/**
* \def CUBLAS_CHECK(call)
* Gets the error generated by a cuBLAS function call if there is one.
* \param call cuBLAS function to check if there are errors when running.
*/
#define CUBLAS_CHECK(call)
/**
* \def CUDA_MEM(call)
* Gets the GPU memory used from function call if there is one.
* \param call function to measure memory usage.
* \param name an identifier to use as a variable and when printing. Must satisfy variable naming.
*/
#define CUDA_MEM(call, name)
#endif
///////////////////
// KERNEL MACROS //
///////////////////
#ifdef CUDACC
#include <cublas_v2.h>
#include <cuda_bf16.h>
#include <cuda_fp16.h>
#include <cuda_runtime.h>
//#include <cusparse.h>
#define DEVICE_FUNC __device__
#define HD __host__ __device__
#define SHARED __shared__
#define KERNEL(call, ...) __global__ void call(__VA_ARGS__)
#else
#define DEVICE_FUNC
#define HD
#define SHARED
#define KERNEL(call, ...) void call(__VA_ARGS__)
#endif // CUDACC
///////////////////
// DEVICE MACROS //
///////////////////
#ifdef DEVICE
#define BASIC_LOOP(N) \
uint32_t iThread = blockIdx.x * blockDim.x + threadIdx.x; \
if (iThread < N)
#else
#define BASIC_LOOP(N) _Pragma("omp parallel for") for (uint32_t iThread = 0; iThread < N; ++iThread)
#endif
//////////////////
// CLASS MACROS //
//////////////////
#define UPDATE_FUNC(name) \
inline CudaTools::StreamID updateHost(const CudaTools::StreamID& stream = \
CudaTools::DEF_MEM_STREAM) { \
return CudaTools::copy(that(), this, sizeof(name)); \
}; \
inline CudaTools::StreamID updateDevice(const CudaTools::StreamID& stream = \
CudaTools::DEF_MEM_STREAM) { \
return CudaTools::copy(this, that(), sizeof(name)); \
}
#ifdef CUDACC
#define DEVICE_COPY(name) \
private: \
name* __deviceInstance__ = nullptr; \
\
public: \
inline name* that() { return __deviceInstance__; }; \
inline void allocateDevice() { __deviceInstance__ = (name*)CudaTools::malloc(sizeof(name)); }; \
inline void freeDevice() { CudaTools::free(__deviceInstance__); }; \
UPDATE_FUNC(name)
#else
#define DEVICE_COPY(name) \
public: \
inline name* that() { return this; }; \
inline void allocateDevice(){}; \
inline void freeDevice(){}; \
UPDATE_FUNC(name)
#endif
#ifndef CUDATOOLS_ARRAY_MAX_AXES
/**
* \def CUDATOOLS_ARRAY_MAX_AXES
* The maximum number of axes/dimensions an
* CudaTools::Array can have. The default is set
* to 4, but can be manully set fit the program
* needs.
*/
#define CUDATOOLS_ARRAY_MAX_AXES 4
#endif
////////////////////
// Error Checking //
////////////////////
#ifndef NO_DIMENSION_CHECK
#ifdef DEVICE
#define CT_ERROR_IF(a, op, b, msg) \
if (a op b) { \
printf("\033[1;31m[CudaTools]\033[0m %s:%d\n | %s: (" #a ") " #op " (" #b ").\n", \
__FILE__, __LINE__, msg); \
}
#define CT_ERROR(a, msg) \
if (a) { \
printf("\033[1;31m[CudaTools]\033[0m %s:%d\n | %s: " #a ".\n", __FILE__, __LINE__, msg); \
}
#else
#define CT_ERROR_IF(a, op, b, msg) \
if (a op b) { \
std::ostringstream os_a; \
std::ostringstream os_b; \
os_a << a; \
os_b << b; \
printf("\033[1;31m[CudaTools]\033[0m %s:%d\n | %s: (" #a ")%s " #op " (" #b ")%s.\n", \
__FILE__, __LINE__, msg, os_a.str().c_str(), os_b.str().c_str()); \
throw std::exception(); \
}
#define CT_ERROR(a, msg) \
if (a) { \
printf("\033[1;31m[CudaTools]\033[0m %s:%d\n | %s: " #a ".\n", __FILE__, __LINE__, msg); \
throw std::exception(); \
}
#endif
#endif // NO_DIMENSION_CHECK
#if defined(CUDACC) && !defined(NO_CUDA_CHECK)
#define CUDA_CHECK(call) \
do { \
cudaError_t err = (call); \
if (err != cudaSuccess) { \
printf("\033[1;31m[CUDA]\033[0m %s:%d\n | %s\n", __FILE__, __LINE__, \
cudaGetErrorString(err)); \
throw std::exception(); \
} \
} while (0)
#define CUBLAS_CHECK(call) \
do { \
cublasStatus_t err = (call); \
if (err != CUBLAS_STATUS_SUCCESS) { \
printf("\033[1;31m[cuBLAS]\033[0m %s:%d\n | %s\n", __FILE__, __LINE__, \
cublasGetStatusName(err)); \
throw std::exception(); \
} \
} while (0)
/*
#define CUSPARSE_CHECK(call) \
do { \
cusparseStatus_t err = (call); \
if (err != CUSPARSE_STATUS_SUCCESS) { \
printf("[cuSPARSE] %s:%d\n | %s\n", __FILE__, __LINE__, cusparseGetErrorName(err)); \
throw std::exception(); \
} \
} while (0)
*/
#define CUDA_MEM(call, name) \
size_t free_bef_##name, free_aft_##name; \
cudaMemGetInfo(&free_bef_##name, NULL); \
call; \
CudaTools::Manager::get()->sync(); \
cudaMemGetInfo(&free_aft_##name, NULL); \
printf("[%s] GPU Memory Usage: %iMiB\n", #name, \
(free_bef_##name - free_aft_##name) / (1024 * 1024));
#else
#define CUDA_CHECK(call) (call)
#define CUBLAS_CHECK(call) (call)
#define CUDA_MEM(call, name) (call)
#endif
#endif // MACROS_H

@ -0,0 +1,166 @@
#ifndef CUDATOOLS_COMPLEX_H
#define CUDATOOLS_COMPLEX_H
#include "Macros.h"
#include <cmath>
#include <complex>
/**
* This is directly adapated from cuComplex.h, except placed into a C++ friendly format.
*/
namespace CudaTools {
namespace Types {
using real32 = float; /**< Type alias for 32-bit floating point datatype. */
using real64 = double; /**< Type alias for 64-bit floating point datatype. */
#ifdef CUDACC
using real16 = __half; /**< Type alias for 16-bit floating point datatype, when using GPU.
Otherwise, defaults to float. */
using realb16 = __nv_bfloat16; /**< Type alias for the 16-bit bfloat datatype, when using GPU.
Otherwise, defaults to float. */
#else
using real16 = float;
using realb16 = float;
#endif // CUDACC
template <typename T> class complex {
private:
T r = 0;
T i = 0;
public:
HD complex() = default;
HD complex(T real, T imag) : r(real), i(imag){};
HD complex(T x) : r(x), i(0){};
HD complex<T> operator+(const complex<T> z) const { return complex(r + z.r, i + z.i); };
HD complex<T> operator-(const complex<T> z) const { return complex(r - z.r, i - z.i); };
HD complex<T> operator*(const T y) const { return complex(r * y, i * y); };
HD complex<T> operator/(const T y) const { return complex(r / y, i / y); };
HD complex<T> operator*(const complex<T> z) const {
return complex(r * z.r - i * z.i, r * z.i + i * z.r);
};
HD complex<T> operator/(const complex<T> z) const {
T s = std::abs(z.r) + std::abs(z.i);
T oos = 1.0f / s;
T ars = r * oos, ais = i * oos, brs = z.r * oos, bis = z.i * oos;
s = (brs * brs) + (bis * bis);
oos = 1.0f / s;
return complex(ars * brs + ais * bis, ais * brs - ars * bis) * oos;
};
HD void operator+=(const complex<T> z) {
r += z.r;
i += z.i;
};
HD void operator-=(const complex<T> z) {
r -= z.r;
i -= z.i;
};
HD void operator*=(const T y) {
r *= y;
i *= y;
};
HD void operator/=(const T y) {
r /= y;
i /= y;
};
HD void operator*=(const complex<T> z) {
T a = r * z.r - i * z.i, b = r * z.i + i * z.r;
r = a;
i = b;
}
HD void operator/=(const complex<T> z) {
T s = std::abs(z.r) + std::abs(z.i);
T oos = 1.0f / s;
T ars = r * oos, ais = i * oos, brs = z.r * oos, bis = z.i * oos;
s = (brs * brs) + (bis * bis);
oos = 1.0f / s;
r = (ars * brs + ais * bis) * oos;
i = (ais * brs - ars * bis) * oos;
};
HD T abs() const {
T a = std::abs(r), b = std::abs(i);
T v, w;
if (a > b) {
v = a;
w = b;
} else {
v = b;
w = a;
}
T t = w / v;
t = 1.0f + t * t;
t = v * std::sqrt(t);
if ((v == 0.0f) || (v > 3.402823466e38f) || (w > 3.402823466e38f)) {
t = v + w;
}
return t;
}
HD complex<T> conj() const { return complex(r, -1 * i); }
HD T real() const { return r; };
HD T imag() const { return i; };
};
template class complex<real32>;
template class complex<real64>;
template <class T> complex<T> operator*(const T y, const complex<T> z) { return z * y; };
template <class T> complex<T> operator/(const T y, const complex<T> z) { return z / y; };
template complex<real32> operator*<real32>(const real32, const complex<real32>);
template complex<real64> operator*<real64>(const real64, const complex<real64>);
template complex<real32> operator/<real32>(const real32, const complex<real32>);
template complex<real64> operator/<real64>(const real64, const complex<real64>);
#ifdef CUDACC
using complex64 = complex<real32>; /**< Type alias for 64-bit complex floating point datatype.
* This adapts depending on the CUDA compilation flag, and
* will automatically switch std::complex<real32>. */
using complex128 = complex<real64>; /**< Type alias for 128-bit complex floating point datatype.
* This adapts depending on the CUDA compilation flag, and will
* automatically switch std::complex<real64>. */
#else
using complex64 = std::complex<real32>;
using complex128 = std::complex<real64>;
#endif
/** Type alises and lots of metaprogramming definitions, primarily dealing with
* the different numeric types and overrides. */
template <typename T> struct ComplexUnderlying_S { typedef T type; };
template <> struct ComplexUnderlying_S<complex64> { typedef float type; };
template <> struct ComplexUnderlying_S<complex128> { typedef double type; };
template <typename T> using ComplexUnderlying = typename ComplexUnderlying_S<T>::type;
template <typename T> struct ComplexConversion_S { typedef T type; };
template <> struct ComplexConversion_S<complex64> { typedef std::complex<float> type; };
template <> struct ComplexConversion_S<complex128> { typedef std::complex<double> type; };
template <typename T> using ComplexConversion = typename ComplexConversion_S<T>::type;
template <typename T> inline constexpr bool is_int = std::is_integral<T>::value;
template <typename T> inline constexpr bool is_float = std::is_floating_point<T>::value;
template <typename T>
inline constexpr bool is_complex =
std::is_same<T, complex64>::value or std::is_same<T, complex128>::value;
template <typename T> inline constexpr bool is_host_num = is_int<T> or is_float<T> or is_complex<T>;
}; // namespace Types
}; // namespace CudaTools
#endif

@ -0,0 +1,66 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER
get_filename_component(_Seacas_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_Seacas_PREFIX "${_Seacas_DIR}" PATH)
set(Seacas_DIR "${_Seacas_PREFIX}/lib/cmake/Seacas")
message(WARNING "SeacasConfig.cmake has moved. "
"It now exists at a location under the installation prefix where the "
"find_package command looks by default (<prefix>/lib/cmake/Seacas). "
"This compatibility file exists at the old location (<prefix>/include) "
"to present this message and load the file from its new location."
"\n"
"The find_package() call that loaded this file did so because its "
"cached result variable, Seacas_DIR, is set to\n"
" ${_Seacas_DIR}\n"
"I'm locally setting Seacas_DIR to\n"
" ${Seacas_DIR}\n"
"and loading SeacasConfig.cmake from its new location. "
"One may suppress this warning by setting the above value in the cache. "
"However, the application needs modification permanently fix the issue. "
"The find_package() call that loaded this file may have the form\n"
" find_package(Seacas REQUIRED PATHS \${Seacas_PATH}/include)\n"
"Change it to the form\n"
" set(CMAKE_PREFIX_PATH \${Seacas_PATH} \${CMAKE_PREFIX_PATH})\n"
" find_package(Seacas REQUIRED)\n"
"to find SeacasConfig.cmake in its new location in future builds "
"while still honoring the Seacas_PATH option for this application."
)
include(${Seacas_DIR}/SeacasConfig.cmake)

@ -0,0 +1,36 @@
/* SEACAS_VERSION_DATE
*
* This macro gives the version date of the Seacas git repository at
* the time it was configured. It gives the date YYYY-MM-DD and the 2-digit
* (24) hour hh of the commit as a 10-digit integer:
*
* YYYYYMMDDhh
*
* As long as the branch for the git repo is not hard reset, the first-parent
* history should give a monotonically increasing 10-digit integer. This
* 10-digit date/time integer YYYYMMDDhh will fit in a signed 32-bit integer
* with a maximum value of 2^32 / 2 - 1 = 2147483647. Therefore, the maximum
* date that can be handled is the year 2147 with the max date/time of 2147 12
* 31 23 = 2147123123. Modern C/C++ compilers (and other implementations of
* the C preprocessor) should be able to handle 32-bit integers.
*
* This header file is meant to be included by downstream codes to determine
* the version of Seacas being used and allows
* SEACAS_VERSION_DATE to be used in C/C++ ifdefs like:
*
* #if defined(SEACAS_VERSION_DATE) && SEACAS_VERSION_DATE >= 2019032704
* // The version is newer than 2019-03-27 04:00:00 UTC
* ...
* #else
* // The version is older than 2019-03-27 04:00:00 UTC
* ...
* #endif
*
* This allows downstream codes to know the fine-grained version of
* Seacas at configure and build time to adjust for the addition of
* new features, deprecation of code, or breaks in backward compatibility
* (which occur in specific commits with unique commit dates).
*
*/
#undef SEACAS_VERSION_DATE

File diff suppressed because it is too large Load Diff

@ -0,0 +1,892 @@
/*
* Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
* NTESS, the U.S. Government retains certain rights in this software.
*
* See packages/seacas/LICENSE for details
*/
/*****************************************************************************
*
* exodusII_int.h - ExodusII header file for internal Exodus call use only
*
*/
#pragma once
#include <stdbool.h>
#include "exodus_config.h"
#if defined(EXODUS_THREADSAFE)
#include <pthread.h>
#endif
#include "netcdf.h"
#if defined(NC_HAVE_META_H)
#include "netcdf_meta.h"
#endif
#if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1900
#define PRId64 "I64d"
#else
#include <inttypes.h>
#endif
#include <assert.h>
#include <ctype.h>
#include <string.h>
#ifndef __APPLE__
#if defined __STDC__ || defined __cplusplus
#include <stdlib.h>
#endif
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4127)
#pragma warning(disable : 4706)
#pragma warning(disable : 4701)
#endif
#if defined(__BORLANDC__)
#pragma warn - 8004 /* "assigned a value that is never used" */
#endif
#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER < 1900
#define __func__ __FUNCTION__
#define snprintf _snprintf
#endif
#define snprintf_nowarn(...) (snprintf(__VA_ARGS__) < 0 ? abort() : (void)0)
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup Internal Internal Functions and Defines
* \internal
*
* Variables and functions used internally in the library
*@{
*/
#define MAX_VAR_NAME_LENGTH 32 /**< Internal use only */
/* Default "filesize" for newly created files.
* Set to 0 for normal filesize setting.
* Set to 1 for EXODUS_LARGE_MODEL setting to be the default
*/
#define EXODUS_DEFAULT_SIZE 1
/* Used to map between root (file id) and group ids when using groups */
#define EX_FILE_ID_MASK (0xffff0000) /**< Must match FILE_ID_MASK in NetCDF nc4internal.h */
#define EX_GRP_ID_MASK (0x0000ffff) /**< Must match GRP_ID_MASK in NetCDF nc4internal.h */
void ex__reset_error_status(void);
#if defined(EXODUS_THREADSAFE)
#if !defined(exerrval)
/* In both exodusII.h and exodusII_int.h */
typedef struct EX_errval
{
int errval;
char last_pname[MAX_ERR_LENGTH];
char last_errmsg[MAX_ERR_LENGTH];
int last_err_num;
} EX_errval_t;
EXODUS_EXPORT EX_errval_t *ex_errval;
#define exerrval ex_errval->errval
#endif
extern pthread_once_t EX_first_init_g;
typedef struct EX_mutex_struct
{
pthread_mutex_t atomic_lock; /**< lock for atomicity of new mechanism */
pthread_mutexattr_t attribute;
} EX_mutex_t;
extern EX_mutex_t EX_g;
extern int ex__mutex_lock(EX_mutex_t *mutex);
extern int ex__mutex_unlock(EX_mutex_t *mutex, const char *func, int line);
extern void ex__pthread_first_thread_init(void);
extern EX_errval_t *exerrval_get();
#define EX_FUNC_ENTER() \
do { \
/* Initialize the thread-safe code */ \
pthread_once(&EX_first_init_g, ex__pthread_first_thread_init); \
\
/* Grab the mutex for the library */ \
ex__mutex_lock(&EX_g); \
ex_errval = exerrval_get(); \
exerrval = 0; \
ex_errval->last_err_num = 0; \
} while (0)
#define EX_FUNC_ENTER_INT() \
do { \
/* Initialize the thread-safe code */ \
pthread_once(&EX_first_init_g, ex__pthread_first_thread_init); \
\
/* Grab the mutex for the library */ \
ex__mutex_lock(&EX_g); \
ex_errval = exerrval_get(); \
} while (0)
#define EX_FUNC_LEAVE(error) \
do { \
ex__mutex_unlock(&EX_g, __func__, __LINE__); \
return error; \
} while (0)
#define EX_FUNC_VOID() \
do { \
ex__mutex_unlock(&EX_g, __func__, __LINE__); \
return; \
} while (0)
#define EX_FUNC_UNLOCK() \
do { \
ex__mutex_unlock(&EX_g, __func__, __LINE__); \
} while (0)
#else
/* Enable this to output tracing information from the API functions */
#if 0
EXODUS_EXPORT int indent;
#define EX_FUNC_ENTER() \
do { \
ex__reset_error_status(); \
fprintf(stderr, "%d Enter: %s\n", indent, __func__); \
indent++; \
} while (0)
#define EX_FUNC_ENTER_INT() \
do { \
fprintf(stderr, "%d Enter: %s\n", indent, __func__); \
indent++; \
} while (0)
#define EX_FUNC_LEAVE(error) \
do { \
indent--; \
fprintf(stderr, "%d Leave: %s\n", indent, __func__); \
return error; \
} while (0)
#define EX_FUNC_VOID() \
do { \
indent--; \
fprintf(stderr, "%d Leave: %s\n", indent, __func__); \
return; \
} while (0)
#define EX_FUNC_UNLOCK() \
do { \
indent--; \
fprintf(stderr, "%d Unlock: %s\n", indent, __func__); \
} while (0)
#else
#define EX_FUNC_ENTER() \
do { \
ex__reset_error_status(); \
} while (0)
#define EX_FUNC_ENTER_INT()
#define EX_FUNC_LEAVE(error) return error
#define EX_FUNC_VOID() return
#define EX_FUNC_UNLOCK()
#endif
#endif
#define EX_UNUSED(A) \
do { \
(void)(A); \
} while (0)
/*
* This file contains defined constants that are used internally in the
* EXODUS API.
*
* The first group of constants refer to NetCDF variables, attributes, or
* dimensions in which the EXODUS data are stored. Using the defined
* constants will allow the names of the NetCDF entities to be changed easily
* in the future if needed. The first three letters of the constant identify
* the NetCDF entity as a variable (VAR), dimension (DIM), or attribute (ATT).
*
* NOTE: The entity name should not have any blanks in it. Blanks are
* technically legal but some NetCDF utilities (ncgen in particular)
* fail when they encounter a blank in a name.
*
*/
#define ATT_TITLE "title" /**< the database title */
#define ATT_API_VERSION "api_version" /**< the EXODUS api vers number */
/*! the EXODUS api vers # used for db version 2.01 and earlier */
#define ATT_API_VERSION_BLANK "api version"
#define ATT_VERSION "version" /**< the EXODUS file vers number */
#define ATT_FILESIZE "file_size" /**< 1=large, 0=normal */
/*! word size of floating point numbers in file */
#define ATT_FLT_WORDSIZE "floating_point_word_size"
/*! word size of floating point numbers in file used for db version
2.01 and earlier */
#define ATT_FLT_WORDSIZE_BLANK "floating point word size"
#define ATT_MAX_NAME_LENGTH "maximum_name_length"
#define ATT_INT64_STATUS "int64_status"
#define ATT_NEM_API_VERSION "nemesis_api_version"
#define ATT_NEM_FILE_VERSION "nemesis_file_version"
#define ATT_PROCESSOR_INFO "processor_info"
#define ATT_LAST_WRITTEN_TIME "last_written_time"
#define DIM_NUM_ASSEMBLY "num_assembly" /**< number of assemblies */
#define DIM_NUM_BLOB "num_blob" /**< number of blobs */
#define DIM_NUM_NODES "num_nodes" /**< number of nodes */
#define DIM_NUM_DIM "num_dim" /**< number of dimensions; 2- or 3-d*/
#define DIM_NUM_EDGE "num_edge" /**< number of edges (over all blks)*/
#define DIM_NUM_FACE "num_face" /**< number of faces (over all blks)*/
#define DIM_NUM_ELEM "num_elem" /**< number of elements */
#define DIM_NUM_EL_BLK "num_el_blk" /**< number of element blocks */
#define DIM_NUM_ED_BLK "num_ed_blk" /**< number of edge blocks */
#define DIM_NUM_FA_BLK "num_fa_blk" /**< number of face blocks */
#define VAR_COORD "coord" /**< nodal coordinates */
#define VAR_COORD_X "coordx" /**< X-dimension coordinate */
#define VAR_COORD_Y "coordy" /**< Y-dimension coordinate */
#define VAR_COORD_Z "coordz" /**< Z-dimension coordinate */
#define VAR_NAME_COOR "coor_names" /**< names of coordinates */
#define VAR_NAME_EL_BLK "eb_names" /**< names of element blocks */
#define VAR_NAME_NS "ns_names" /**< names of node sets */
#define VAR_NAME_SS "ss_names" /**< names of side sets */
#define VAR_NAME_EM "emap_names" /**< names of element maps */
#define VAR_NAME_EDM "edmap_names" /**< names of edge maps */
#define VAR_NAME_FAM "famap_names" /**< names of face maps */
#define VAR_NAME_NM "nmap_names" /**< names of node maps */
#define VAR_NAME_ED_BLK "ed_names" /**< names of edge blocks */
#define VAR_NAME_FA_BLK "fa_names" /**< names of face blocks */
#define VAR_NAME_ES "es_names" /**< names of edge sets */
#define VAR_NAME_FS "fs_names" /**< names of face sets */
#define VAR_NAME_ELS "els_names" /**< names of element sets */
#define VAR_STAT_EL_BLK "eb_status" /**< element block status */
#define VAR_STAT_ECONN "econn_status" /**< element block edge status */
#define VAR_STAT_FCONN "fconn_status" /**< element block face status */
#define VAR_STAT_ED_BLK "ed_status" /**< edge block status */
#define VAR_STAT_FA_BLK "fa_status" /**< face block status */
#define VAR_ID_EL_BLK "eb_prop1" /**< element block ids props */
#define VAR_ID_ED_BLK "ed_prop1" /**< edge block ids props */
#define VAR_ID_FA_BLK "fa_prop1" /**< face block ids props */
#define DIM_NUM_ENTITY_ASSEMBLY(num) ex__catstr("num_entity_assembly", num)
#define VAR_ENTITY_ASSEMBLY(num) ex__catstr("assembly_entity", num)
#define DIM_NUM_VALUES_BLOB(num) ex__catstr("num_values_blob", num)
#define VAR_ENTITY_BLOB(num) ex__catstr("blob_entity", num)
#define EX_ATTRIBUTE_TYPE "_type"
#define EX_ATTRIBUTE_TYPENAME "_typename"
#define EX_ATTRIBUTE_NAME "_name"
#define EX_ATTRIBUTE_ID "_id"
/*! element type names for each element block */
#define ATT_NAME_ELB "elem_type"
/*! number of elements in element block num */
#define DIM_NUM_EL_IN_BLK(num) ex__catstr("num_el_in_blk", num)
/*! number of nodes per element in element block num */
#define DIM_NUM_NOD_PER_EL(num) ex__catstr("num_nod_per_el", num)
/*! number of attributes in element block num */
#define DIM_NUM_ATT_IN_BLK(num) ex__catstr("num_att_in_blk", num)
/*! number of edges in edge block num */
#define DIM_NUM_ED_IN_EBLK(num) ex__catstr("num_ed_in_blk", num)
/*! number of nodes per edge in edge block num */
#define DIM_NUM_NOD_PER_ED(num) ex__catstr("num_nod_per_ed", num)
/*! number of edges per element in element block num */
#define DIM_NUM_EDG_PER_EL(num) ex__catstr("num_edg_per_el", num)
/*! number of attributes in edge block num */
#define DIM_NUM_ATT_IN_EBLK(num) ex__catstr("num_att_in_eblk", num)
/*! number of faces in face block num */
#define DIM_NUM_FA_IN_FBLK(num) ex__catstr("num_fa_in_blk", num)
/*! number of nodes per face in face block num */
#define DIM_NUM_NOD_PER_FA(num) ex__catstr("num_nod_per_fa", num)
/*! number of faces per element in element block num */
#define DIM_NUM_FAC_PER_EL(num) ex__catstr("num_fac_per_el", num)
/*! number of attributes in face block num */
#define DIM_NUM_ATT_IN_FBLK(num) ex__catstr("num_att_in_fblk", num)
/*! element connectivity for element block num */
#define VAR_CONN(num) ex__catstr("connect", num)
/*! array containing number of entity per */
/* entity for n-sided face/element blocks */
#define VAR_EBEPEC(num) ex__catstr("ebepecnt", num)
/*! list of attributes for element block num */
#define VAR_ATTRIB(num) ex__catstr("attrib", num)
/*! list of attribute names for element block num */
#define VAR_NAME_ATTRIB(num) ex__catstr("attrib_name", num)
/*! list of the numth property for all element blocks */
#define VAR_EB_PROP(num) ex__catstr("eb_prop", num)
/*! edge connectivity for element block num */
#define VAR_ECONN(num) ex__catstr("edgconn", num)
/*! edge connectivity for edge block num */
#define VAR_EBCONN(num) ex__catstr("ebconn", num)
/*! list of attributes for edge block num */
#define VAR_EATTRIB(num) ex__catstr("eattrb", num)
/*! list of attribute names for edge block num */
#define VAR_NAME_EATTRIB(num) ex__catstr("eattrib_name", num)
#define VAR_NATTRIB "nattrb"
#define VAR_NAME_NATTRIB "nattrib_name"
#define DIM_NUM_ATT_IN_NBLK "num_att_in_nblk"
#define VAR_NSATTRIB(num) ex__catstr("nsattrb", num)
#define VAR_NAME_NSATTRIB(num) ex__catstr("nsattrib_name", num)
#define DIM_NUM_ATT_IN_NS(num) ex__catstr("num_att_in_ns", num)
#define VAR_SSATTRIB(num) ex__catstr("ssattrb", num)
#define VAR_NAME_SSATTRIB(num) ex__catstr("ssattrib_name", num)
#define DIM_NUM_ATT_IN_SS(num) ex__catstr("num_att_in_ss", num)
#define VAR_ESATTRIB(num) ex__catstr("esattrb", num)
#define VAR_NAME_ESATTRIB(num) ex__catstr("esattrib_name", num)
#define DIM_NUM_ATT_IN_ES(num) ex__catstr("num_att_in_es", num)
#define VAR_FSATTRIB(num) ex__catstr("fsattrb", num)
#define VAR_NAME_FSATTRIB(num) ex__catstr("fsattrib_name", num)
#define DIM_NUM_ATT_IN_FS(num) ex__catstr("num_att_in_fs", num)
#define VAR_ELSATTRIB(num) ex__catstr("elsattrb", num)
#define VAR_NAME_ELSATTRIB(num) ex__catstr("elsattrib_name", num)
#define DIM_NUM_ATT_IN_ELS(num) ex__catstr("num_att_in_els", num)
/*! list of the numth property for all edge blocks */
#define VAR_ED_PROP(num) ex__catstr("ed_prop", num)
/*! face connectivity for element block num */
#define VAR_FCONN(num) ex__catstr("facconn", num)
/*! face connectivity for face block num */
#define VAR_FBCONN(num) ex__catstr("fbconn", num)
/*! array containing number of entity per entity for n-sided face/element blocks */
#define VAR_FBEPEC(num) ex__catstr("fbepecnt", num)
/*! list of attributes for face block num */
#define VAR_FATTRIB(num) ex__catstr("fattrb", num)
/*! list of attribute names for face block num */
#define VAR_NAME_FATTRIB(num) ex__catstr("fattrib_name", num)
/*! list of the numth property for all face blocks */
#define VAR_FA_PROP(num) ex__catstr("fa_prop", num)
/*! name attached to element block, node set, side set, element map,
or map properties */
#define ATT_PROP_NAME "name"
#define VAR_MAP "elem_map" /**< element order map */
#define DIM_NUM_SS "num_side_sets" /**< number of side sets */
#define VAR_SS_STAT "ss_status" /**< side set status */
#define VAR_SS_IDS "ss_prop1" /**< side set id properties */
/*! number of sides in side set num*/
#define DIM_NUM_SIDE_SS(num) ex__catstr("num_side_ss", num)
/*! number of distribution factors in side set num */
#define DIM_NUM_DF_SS(num) ex__catstr("num_df_ss", num)
/*! the distribution factors for each node in side set num */
#define VAR_FACT_SS(num) ex__catstr("dist_fact_ss", num)
/*! list of elements in side set num */
#define VAR_ELEM_SS(num) ex__catstr("elem_ss", num)
/*! list of sides in side set */
#define VAR_SIDE_SS(num) ex__catstr("side_ss", num)
/*! list of the numth property for all side sets */
#define VAR_SS_PROP(num) ex__catstr("ss_prop", num)
#define DIM_NUM_ES "num_edge_sets" /**< number of edge sets */
#define VAR_ES_STAT "es_status" /**< edge set status */
#define VAR_ES_IDS "es_prop1" /**< edge set id properties */
/*! number of edges in edge set num*/
#define DIM_NUM_EDGE_ES(num) ex__catstr("num_edge_es", num)
/*! number of distribution factors in edge set num */
#define DIM_NUM_DF_ES(num) ex__catstr("num_df_es", num)
/*! the distribution factors for each node in edge set num */
#define VAR_FACT_ES(num) ex__catstr("dist_fact_es", num)
/*! list of edges in edge set num */
#define VAR_EDGE_ES(num) ex__catstr("edge_es", num)
/*! list of orientations in the edge set. */
#define VAR_ORNT_ES(num) ex__catstr("ornt_es", num)
/*! list of the numth property for all edge sets */
#define VAR_ES_PROP(num) ex__catstr("es_prop", num)
#define DIM_NUM_FS "num_face_sets" /**< number of face sets */
#define VAR_FS_STAT "fs_status" /**< face set status */
#define VAR_FS_IDS "fs_prop1" /**< face set id properties */
/*! number of faces in side set num*/
#define DIM_NUM_FACE_FS(num) ex__catstr("num_face_fs", num)
/*! number of distribution factors in face set num */
#define DIM_NUM_DF_FS(num) ex__catstr("num_df_fs", num)
/*! the distribution factors for each node in face set num */
#define VAR_FACT_FS(num) ex__catstr("dist_fact_fs", num)
/*! list of elements in face set num */
#define VAR_FACE_FS(num) ex__catstr("face_fs", num)
/*! list of sides in side set */
#define VAR_ORNT_FS(num) ex__catstr("ornt_fs", num)
/*! list of the numth property for all face sets */
#define VAR_FS_PROP(num) ex__catstr("fs_prop", num)
#define DIM_NUM_ELS "num_elem_sets" /**< number of elem sets */
/*! number of elements in elem set num */
#define DIM_NUM_ELE_ELS(num) ex__catstr("num_ele_els", num)
/*! number of distribution factors in element set num */
#define DIM_NUM_DF_ELS(num) ex__catstr("num_df_els", num)
#define VAR_ELS_STAT "els_status" /**< elem set status */
#define VAR_ELS_IDS "els_prop1" /**< elem set id properties */
/*! list of elements in elem set num */
#define VAR_ELEM_ELS(num) ex__catstr("elem_els", num)
/*! list of distribution factors in elem set num */
#define VAR_FACT_ELS(num) ex__catstr("dist_fact_els", num)
/*! list of the numth property for all elem sets */
#define VAR_ELS_PROP(num) ex__catstr("els_prop", num)
#define DIM_NUM_NS "num_node_sets" /**< number of node sets */
/*! number of nodes in node set num */
#define DIM_NUM_NOD_NS(num) ex__catstr("num_nod_ns", num)
/*! number of distribution factors in node set num */
#define DIM_NUM_DF_NS(num) ex__catstr("num_df_ns", num)
#define VAR_NS_STAT "ns_status" /**< node set status */
#define VAR_NS_IDS "ns_prop1" /**< node set id properties */
/*! list of nodes in node set num */
#define VAR_NODE_NS(num) ex__catstr("node_ns", num)
/*! list of distribution factors in node set num */
#define VAR_FACT_NS(num) ex__catstr("dist_fact_ns", num)
/*! list of the numth property for all node sets */
#define VAR_NS_PROP(num) ex__catstr("ns_prop", num)
#define DIM_NUM_QA "num_qa_rec" /**< number of QA records */
#define VAR_QA_TITLE "qa_records" /**< QA records */
#define DIM_NUM_INFO "num_info" /**< number of information records */
#define VAR_INFO "info_records" /**< information records */
#define VAR_WHOLE_TIME "time_whole" /**< simulation times for whole time steps */
#define VAR_ASSEMBLY_TAB "assembly_var_tab" /**< assembly variable truth table */
#define VAR_BLOB_TAB "blob_var_tab" /**< blob variable truth table */
#define VAR_ELEM_TAB "elem_var_tab" /**< element variable truth table */
#define VAR_EBLK_TAB "edge_var_tab" /**< edge variable truth table */
#define VAR_FBLK_TAB "face_var_tab" /**< face variable truth table */
#define VAR_ELSET_TAB "elset_var_tab" /**< elemset variable truth table */
#define VAR_SSET_TAB "sset_var_tab" /**< sideset variable truth table */
#define VAR_FSET_TAB "fset_var_tab" /**< faceset variable truth table */
#define VAR_ESET_TAB "eset_var_tab" /**< edgeset variable truth table */
#define VAR_NSET_TAB "nset_var_tab" /**< nodeset variable truth table */
#define DIM_NUM_GLO_VAR "num_glo_var" /**< number of global variables */
#define VAR_NAME_GLO_VAR "name_glo_var" /**< names of global variables */
#define VAR_GLO_VAR "vals_glo_var" /**< values of global variables*/
#define DIM_NUM_NOD_VAR "num_nod_var" /**< number of nodal variables */
#define VAR_NAME_NOD_VAR "name_nod_var" /**< names of nodal variables */
#define VAR_NOD_VAR "vals_nod_var" /**< values of nodal variables \deprecated */
/*! values of nodal variables */
#define VAR_NOD_VAR_NEW(num) ex__catstr("vals_nod_var", num)
#define DIM_NUM_ASSEMBLY_VAR "num_assembly_var" /**< number of assembly variables */
#define VAR_NAME_ASSEMBLY_VAR "name_assembly_var" /**< names of assembly variables*/
#define VAR_ASSEMBLY_VAR(num1, num2) ex__catstr2("vals_assembly_var", num1, "assembly", num2)
#define DIM_NUM_BLOB_VAR "num_blob_var" /**< number of blob variables */
#define VAR_NAME_BLOB_VAR "name_blob_var" /**< names of blob variables*/
#define VAR_BLOB_VAR(num1, num2) ex__catstr2("vals_blob_var", num1, "blob", num2)
#define DIM_NUM_ELE_VAR "num_elem_var" /**< number of element variables */
#define VAR_NAME_ELE_VAR "name_elem_var" /**< names of element variables*/
/*! values of element variable num1 in element block num2 */
#define VAR_ELEM_VAR(num1, num2) ex__catstr2("vals_elem_var", num1, "eb", num2)
#define DIM_NUM_EDG_VAR "num_edge_var" /**< number of edge variables */
#define VAR_NAME_EDG_VAR "name_edge_var" /**< names of edge variables */
/*! values of edge variable num1 in edge block num2 */
#define VAR_EDGE_VAR(num1, num2) ex__catstr2("vals_edge_var", num1, "eb", num2)
#define DIM_NUM_FAC_VAR "num_face_var" /**< number of face variables */
#define VAR_NAME_FAC_VAR "name_face_var" /**< names of face variables */
/*! values of face variable num1 in face block num2 */
#define VAR_FACE_VAR(num1, num2) ex__catstr2("vals_face_var", num1, "fb", num2)
#define DIM_NUM_NSET_VAR "num_nset_var" /**< number of nodeset variables */
#define VAR_NAME_NSET_VAR "name_nset_var" /**< names of nodeset variables*/
/*! values of nodeset variable num1 in nodeset num2 */
#define VAR_NS_VAR(num1, num2) ex__catstr2("vals_nset_var", num1, "ns", num2)
#define DIM_NUM_ESET_VAR "num_eset_var" /**< number of edgeset variables */
/*! values of edgeset variable num1 in edgeset num2 */
#define VAR_NAME_ESET_VAR "name_eset_var" /**< names of edgeset variables*/
#define VAR_ES_VAR(num1, num2) ex__catstr2("vals_eset_var", num1, "es", num2)
#define DIM_NUM_FSET_VAR "num_fset_var" /**< number of faceset variables */
#define VAR_NAME_FSET_VAR "name_fset_var" /**< names of faceset variables*/
/*! values of faceset variable num1 in faceset num2 */
#define VAR_FS_VAR(num1, num2) ex__catstr2("vals_fset_var", num1, "fs", num2)
#define DIM_NUM_SSET_VAR "num_sset_var" /**< number of sideset variables */
#define VAR_NAME_SSET_VAR "name_sset_var" /**< names of sideset variables*/
/*! values of sideset variable num1 in sideset num2 */
#define VAR_SS_VAR(num1, num2) ex__catstr2("vals_sset_var", num1, "ss", num2)
#define DIM_NUM_ELSET_VAR "num_elset_var" /**< number of element set variables*/
#define VAR_NAME_ELSET_VAR "name_elset_var" /**< names of elemset variables*/
/*! values of elemset variable num1 in elemset num2 */
#define VAR_ELS_VAR(num1, num2) ex__catstr2("vals_elset_var", num1, "es", num2)
/**
* \defgroup ReductionVariables Variables controlling storage of reduction variables
*@{
*/
#define DIM_NUM_ASSEMBLY_RED_VAR "num_assembly_red_var" /**< number of assembly variables */
#define VAR_NAME_ASSEMBLY_RED_VAR "name_assembly_red_var" /**< names of assembly variables*/
#define VAR_ASSEMBLY_RED_VAR(num) ex__catstr("vals_red_var_assembly", num)
#define DIM_NUM_BLOB_RED_VAR "num_blob_red_var" /**< number of blob variables */
#define VAR_NAME_BLOB_RED_VAR "name_blob_red_var" /**< names of blob variables*/
#define VAR_BLOB_RED_VAR(num) ex__catstr("vals_red_var_blob", num)
#define DIM_NUM_ELE_RED_VAR "num_elem_red_var" /**< number of element variables */
#define VAR_NAME_ELE_RED_VAR "name_elem_red_var" /**< names of element variables*/
/*! values of element variable num in element block num */
#define VAR_ELEM_RED_VAR(num) ex__catstr("vals_red_var_eb", num)
#define DIM_NUM_EDG_RED_VAR "num_edge_red_var" /**< number of edge variables */
#define VAR_NAME_EDG_RED_VAR "name_edge_red_var" /**< names of edge variables */
/*! values of edge variable num in edge block num */
#define VAR_EDGE_RED_VAR(num) ex__catstr("vals_red_var_edb", num)
#define DIM_NUM_FAC_RED_VAR "num_face_red_var" /**< number of face variables */
#define VAR_NAME_FAC_RED_VAR "name_face_red_var" /**< names of face variables */
/*! values of face variable num in face block num */
#define VAR_FACE_RED_VAR(num) ex__catstr("vals_red_var_fb", num)
#define DIM_NUM_NSET_RED_VAR "num_nset_red_var" /**< number of nodeset variables */
#define VAR_NAME_NSET_RED_VAR "name_nset_red_var" /**< names of nodeset variables*/
/*! values of nodeset variable num in nodeset num */
#define VAR_NS_RED_VAR(num) ex__catstr("vals_red_var_nset", num)
#define DIM_NUM_ESET_RED_VAR "num_eset_red_var" /**< number of edgeset variables */
/*! values of edgeset variable num in edgeset num */
#define VAR_NAME_ESET_RED_VAR "name_eset_red_var" /**< names of edgeset variables*/
#define VAR_ES_RED_VAR(num) ex__catstr("vals_red_var_eset", num)
#define DIM_NUM_FSET_RED_VAR "num_fset_red_var" /**< number of faceset variables */
#define VAR_NAME_FSET_RED_VAR "name_fset_red_var" /**< names of faceset variables*/
/*! values of faceset variable num in faceset num */
#define VAR_FS_RED_VAR(num) ex__catstr("vals_red_var_fset", num)
#define DIM_NUM_SSET_RED_VAR "num_sset_red_var" /**< number of sideset variables */
#define VAR_NAME_SSET_RED_VAR "name_sset_red_var" /**< names of sideset variables*/
/*! values of sideset variable num in sideset num */
#define VAR_SS_RED_VAR(num) ex__catstr("vals_red_var_sset", num)
#define DIM_NUM_ELSET_RED_VAR "num_elset_red_var" /**< number of element set variables*/
#define VAR_NAME_ELSET_RED_VAR "name_elset_red_var" /**< names of elemset variables*/
/*! values of elemset variable num in elemset num */
#define VAR_ELS_RED_VAR(num) ex__catstr("vals_red_var_elset", num)
/** @}*/
/*! general dimension of length MAX_STR_LENGTH used for some string lengths */
#define DIM_STR "len_string"
/*! general dimension of length MAX_NAME_LENGTH used for name lengths */
#define DIM_STR_NAME "len_name"
/*! general dimension of length MAX_LINE_LENGTH used for long strings */
#define DIM_LIN "len_line"
#define DIM_N4 "four"
#define DIM_N1 "blob_entity"
/*! unlimited (expandable) dimension for time steps*/
#define DIM_TIME "time_step"
#define VAR_ELEM_NUM_MAP "elem_num_map" /**< element numbering map */
#define VAR_FACE_NUM_MAP "face_num_map" /**< face numbering map */
#define VAR_EDGE_NUM_MAP "edge_num_map" /**< edge numbering map */
#define VAR_NODE_NUM_MAP "node_num_map" /**< node numbering map */
#define DIM_NUM_EM "num_elem_maps" /**< number of element maps */
/*! the numth element map */
#define VAR_ELEM_MAP(num) ex__catstr("elem_map", num)
/*! list of the numth property for all element maps */
#define VAR_EM_PROP(num) ex__catstr("em_prop", num)
#define DIM_NUM_EDM "num_edge_maps" /**< number of edge maps */
/*! the numth edge map */
#define VAR_EDGE_MAP(num) ex__catstr("edge_map", num)
/* list of the numth property for all edge maps */
#define VAR_EDM_PROP(num) ex__catstr("edm_prop", num)
#define DIM_NUM_FAM "num_face_maps" /**< number of face maps */
/*! the numth face map */
#define VAR_FACE_MAP(num) ex__catstr("face_map", num)
/*! list of the numth property for all face maps */
#define VAR_FAM_PROP(num) ex__catstr("fam_prop", num)
#define DIM_NUM_NM "num_node_maps" /**< number of node maps */
/*! the numth node map */
#define VAR_NODE_MAP(num) ex__catstr("node_map", num)
/*! list of the numth property for all node maps */
#define VAR_NM_PROP(num) ex__catstr("nm_prop", num)
/*! list of the numth property for all assemblies */
#define VAR_ASSEMBLY_PROP(num) ex__catstr("assembly_prop", num)
#define VAR_BLOB_PROP(num) ex__catstr("blob_prop", num)
#define DIM_NUM_CFRAMES "num_cframes"
#define DIM_NUM_CFRAME9 "num_cframes_9"
#define VAR_FRAME_COORDS "frame_coordinates"
#define VAR_FRAME_IDS "frame_ids"
#define VAR_FRAME_TAGS "frame_tags"
#define VAR_ELBLK_IDS_GLOBAL "el_blk_ids_global"
#define VAR_ELBLK_CNT_GLOBAL "el_blk_cnt_global"
#define VAR_NS_IDS_GLOBAL "ns_ids_global"
#define VAR_NS_NODE_CNT_GLOBAL "ns_node_cnt_global"
#define VAR_NS_DF_CNT_GLOBAL "ns_df_cnt_global"
#define VAR_SS_IDS_GLOBAL "ss_ids_global"
#define VAR_SS_SIDE_CNT_GLOBAL "ss_side_cnt_global"
#define VAR_SS_DF_CNT_GLOBAL "ss_df_cnt_global"
#define VAR_FILE_TYPE "nem_ftype"
#define VAR_COMM_MAP "comm_map"
#define VAR_NODE_MAP_INT "node_mapi"
#define VAR_NODE_MAP_INT_IDX "node_mapi_idx"
#define VAR_NODE_MAP_BOR "node_mapb"
#define VAR_NODE_MAP_BOR_IDX "node_mapb_idx"
#define VAR_NODE_MAP_EXT "node_mape"
#define VAR_NODE_MAP_EXT_IDX "node_mape_idx"
#define VAR_ELEM_MAP_INT "elem_mapi"
#define VAR_ELEM_MAP_INT_IDX "elem_mapi_idx"
#define VAR_ELEM_MAP_BOR "elem_mapb"
#define VAR_ELEM_MAP_BOR_IDX "elem_mapb_idx"
#define VAR_INT_N_STAT "int_n_stat"
#define VAR_BOR_N_STAT "bor_n_stat"
#define VAR_EXT_N_STAT "ext_n_stat"
#define VAR_INT_E_STAT "int_e_stat"
#define VAR_BOR_E_STAT "bor_e_stat"
#define VAR_N_COMM_IDS "n_comm_ids"
#define VAR_N_COMM_STAT "n_comm_stat"
#define VAR_N_COMM_INFO_IDX "n_comm_info_idx"
#define VAR_E_COMM_IDS "e_comm_ids"
#define VAR_E_COMM_STAT "e_comm_stat"
#define VAR_E_COMM_INFO_IDX "e_comm_info_idx"
#define VAR_N_COMM_NIDS "n_comm_nids"
#define VAR_N_COMM_PROC "n_comm_proc"
#define VAR_N_COMM_DATA_IDX "n_comm_data_idx"
#define VAR_E_COMM_EIDS "e_comm_eids"
#define VAR_E_COMM_SIDS "e_comm_sids"
#define VAR_E_COMM_PROC "e_comm_proc"
#define VAR_E_COMM_DATA_IDX "e_comm_data_idx"
#define DIM_NUM_INT_NODES "num_int_node"
#define DIM_NUM_BOR_NODES "num_bor_node"
#define DIM_NUM_EXT_NODES "num_ext_node"
#define DIM_NUM_INT_ELEMS "num_int_elem"
#define DIM_NUM_BOR_ELEMS "num_bor_elem"
#define DIM_NUM_PROCS "num_processors"
#define DIM_NUM_PROCS_F "num_procs_file"
#define DIM_NUM_NODES_GLOBAL "num_nodes_global"
#define DIM_NUM_ELEMS_GLOBAL "num_elems_global"
#define DIM_NUM_NS_GLOBAL "num_ns_global"
#define DIM_NUM_SS_GLOBAL "num_ss_global"
#define DIM_NUM_ELBLK_GLOBAL "num_el_blk_global"
#define DIM_NUM_N_CMAPS "num_n_cmaps"
#define DIM_NUM_E_CMAPS "num_e_cmaps"
#define DIM_NCNT_CMAP "ncnt_cmap"
#define DIM_ECNT_CMAP "ecnt_cmap"
enum ex__element_type {
EX_EL_UNK = -1, /**< unknown entity */
EX_EL_NULL_ELEMENT = 0,
EX_EL_TRIANGLE = 1, /**< Triangle entity */
EX_EL_QUAD = 2, /**< Quad entity */
EX_EL_HEX = 3, /**< Hex entity */
EX_EL_WEDGE = 4, /**< Wedge entity */
EX_EL_TETRA = 5, /**< Tetra entity */
EX_EL_TRUSS = 6, /**< Truss entity */
EX_EL_BEAM = 7, /**< Beam entity */
EX_EL_SHELL = 8, /**< Shell entity */
EX_EL_SPHERE = 9, /**< Sphere entity */
EX_EL_CIRCLE = 10, /**< Circle entity */
EX_EL_TRISHELL = 11, /**< Triangular Shell entity */
EX_EL_PYRAMID = 12 /**< Pyramid entity */
};
typedef enum ex__element_type ex__element_type;
/* Internal structure declarations */
struct ex__file_item
{
int file_id;
nc_type netcdf_type_code;
int int64_status;
int maximum_name_length;
int time_varid; /* Store to avoid lookup each timestep */
unsigned int assembly_count;
unsigned int blob_count;
unsigned int
compression_algorithm : 2; /**< GZIP/ZLIB, SZIP, more may be supported by NetCDF soon */
unsigned int compression_level : 6; /**< 0 (disabled) to 9 (maximum) compression level for
gzip, 4..32 and even for szip; NetCDF-4 only */
unsigned int user_compute_wordsize : 1; /**< 0 for 4 byte or 1 for 8 byte reals */
unsigned int shuffle : 1; /**< 1 true, 0 false */
unsigned int
file_type : 2; /**< 0 - classic, 1 -- 64 bit classic, 2 --NetCDF4, 3 --NetCDF4 classic */
unsigned int is_write : 1; /**< for output or append */
unsigned int is_parallel : 1; /**< 1 true, 0 false */
unsigned int is_hdf5 : 1; /**< 1 true, 0 false */
unsigned int is_pnetcdf : 1; /**< 1 true, 0 false */
unsigned int has_nodes : 1; /**< for input only at this time */
unsigned int has_edges : 1; /**< for input only at this time */
unsigned int has_faces : 1; /**< for input only at this time */
unsigned int has_elems : 1; /**< for input only at this time */
struct ex__file_item *next;
};
struct ex__elem_blk_parm
{
char elem_type[33];
int64_t elem_blk_id;
int64_t num_elem_in_blk;
int num_nodes_per_elem;
int num_sides;
int num_nodes_per_side[6];
int num_attr;
int64_t elem_ctr;
ex__element_type elem_type_val;
};
/* Used in exo_jack.c for fortran interface */
enum ex__coordinate_frame_type {
EX_CF_RECTANGULAR = 1,
EX_CF_CYLINDRICAL = 2,
EX_CF_SPHERICAL = 3
};
typedef enum ex__coordinate_frame_type ex__coordinate_frame_type;
struct ex__list_item
{ /* for use with ex_get_file_item */
int exo_id;
int value;
struct ex__list_item *next;
};
struct ex__obj_stats
{
int64_t *id_vals;
int *stat_vals;
size_t num;
int exoid;
char valid_ids;
char valid_stat;
char sequential;
struct ex__obj_stats *next;
};
#ifndef EXODUS_EXPORT
#define EXODUS_EXPORT extern
#endif /* EXODUS_EXPORT */
EXODUS_EXPORT void ex__iqsort(int v[], int iv[], size_t N);
EXODUS_EXPORT void ex__iqsort64(int64_t v[], int64_t iv[], int64_t N);
EXODUS_EXPORT char *ex__catstr(const char * /*string*/, int /*num*/);
EXODUS_EXPORT char *ex__catstr2(const char * /*string1*/, int /*num1*/, const char * /*string2*/,
int /*num2*/);
EXODUS_EXPORT char *ex__dim_num_entries_in_object(ex_entity_type /*obj_type*/, int /*idx*/);
EXODUS_EXPORT char *ex__dim_num_objects(ex_entity_type obj_type);
EXODUS_EXPORT char *ex__name_var_of_object(ex_entity_type /*obj_type*/, int /*i*/, int /*j*/);
EXODUS_EXPORT char *ex__name_red_var_of_object(ex_entity_type /*obj_type*/, int /*indx*/);
EXODUS_EXPORT char *ex__name_of_map(ex_entity_type /*map_type*/, int /*map_index*/);
EXODUS_EXPORT int ex__conv_init(int exoid, int *comp_wordsize, int *io_wordsize, int file_wordsize,
int int64_status, bool is_parallel, bool is_hdf5, bool is_pnetcdf,
bool is_write);
EXODUS_EXPORT void ex__conv_exit(int exoid);
EXODUS_EXPORT nc_type nc_flt_code(int exoid);
EXODUS_EXPORT int ex__comp_ws(int exoid);
EXODUS_EXPORT int ex__get_cpu_ws(void);
EXODUS_EXPORT int ex__is_parallel(int exoid);
EXODUS_EXPORT struct ex__list_item **ex__get_counter_list(ex_entity_type obj_type);
EXODUS_EXPORT int ex__get_file_item(int /*exoid*/, struct ex__list_item **/*list_ptr*/);
EXODUS_EXPORT int ex__inc_file_item(int /*exoid*/, struct ex__list_item **/*list_ptr*/);
EXODUS_EXPORT void ex__rm_file_item(int /*exoid*/, struct ex__list_item ** /*list_ptr*/);
extern struct ex__obj_stats *exoII_eb;
extern struct ex__obj_stats *exoII_ed;
extern struct ex__obj_stats *exoII_fa;
extern struct ex__obj_stats *exoII_ns;
extern struct ex__obj_stats *exoII_es;
extern struct ex__obj_stats *exoII_fs;
extern struct ex__obj_stats *exoII_ss;
extern struct ex__obj_stats *exoII_els;
extern struct ex__obj_stats *exoII_em;
extern struct ex__obj_stats *exoII_edm;
extern struct ex__obj_stats *exoII_fam;
extern struct ex__obj_stats *exoII_nm;
struct ex__file_item *ex__find_file_item(int exoid);
struct ex__file_item *ex__add_file_item(int exoid);
struct ex__obj_stats *ex__get_stat_ptr(int exoid, struct ex__obj_stats **obj_ptr);
EXODUS_EXPORT void ex__rm_stat_ptr(int exoid, struct ex__obj_stats **obj_ptr);
EXODUS_EXPORT void ex__set_compact_storage(int exoid, int varid);
EXODUS_EXPORT void ex__compress_variable(int exoid, int varid, int type);
EXODUS_EXPORT int ex__id_lkup(int exoid, ex_entity_type id_type, ex_entity_id num);
EXODUS_EXPORT int ex__check_valid_file_id(
int exoid, const char *func); /** Return fatal error if exoid does not refer to valid file */
EXODUS_EXPORT int ex__check_multiple_open(const char *path, int mode, const char *func);
EXODUS_EXPORT int ex__check_file_type(const char *path, int *type);
EXODUS_EXPORT char *ex__canonicalize_filename(const char *path);
EXODUS_EXPORT int ex__get_dimension(int exoid, const char *DIMENSION, const char *label,
size_t *count, int *dimid, const char *routine);
EXODUS_EXPORT int ex__get_nodal_var(int exoid, int time_step, int nodal_var_index,
int64_t num_nodes, void *nodal_var_vals);
EXODUS_EXPORT int ex__put_nodal_var(int exoid, int time_step, int nodal_var_index,
int64_t num_nodes, const void *nodal_var_vals);
EXODUS_EXPORT int ex__get_nodal_var_time(int exoid, int nodal_var_index, int64_t node_number,
int beg_time_step, int end_time_step,
void *nodal_var_vals);
EXODUS_EXPORT int ex__get_partial_nodal_var(int exoid, int time_step, int nodal_var_index,
int64_t start_node, int64_t num_nodes, void *var_vals);
EXODUS_EXPORT int ex__put_partial_nodal_var(int exoid, int time_step, int nodal_var_index,
int64_t start_node, int64_t num_nodes,
const void *nodal_var_vals);
EXODUS_EXPORT int ex__get_glob_vars(int exoid, int time_step, int num_glob_vars,
void *glob_var_vals);
EXODUS_EXPORT int ex__get_glob_var_time(int exoid, int glob_var_index, int beg_time_step,
int end_time_step, void *glob_var_vals);
EXODUS_EXPORT int ex__get_name(int exoid, int varid, size_t index, char *name, int name_size,
ex_entity_type obj_type, const char *routine);
EXODUS_EXPORT int ex__get_names(int exoid, int varid, size_t num_entity, char **names,
ex_entity_type obj_type, const char *routine);
EXODUS_EXPORT int ex__put_name(int exoid, int varid, size_t index, const char *name,
ex_entity_type obj_type, const char *subtype, const char *routine);
EXODUS_EXPORT int ex__put_names(int exoid, int varid, size_t num_entity, char *const *names,
ex_entity_type obj_type, const char *subtype, const char *routine);
EXODUS_EXPORT void ex__trim(char *name);
EXODUS_EXPORT void ex__update_max_name_length(int exoid, int length);
EXODUS_EXPORT int ex__leavedef(int exoid, /* NemesisI file ID */
const char *call_rout /* Name of calling function */
);
EXODUS_EXPORT int ex__check_version(int run_version);
EXODUS_EXPORT int ex__handle_mode(unsigned int my_mode, int is_parallel, int run_version);
EXODUS_EXPORT int ex__populate_header(int exoid, const char *path, int my_mode, int is_parallel,
int *comp_ws, int *io_ws);
EXODUS_EXPORT int ex__get_block_param(int exoid, ex_entity_id id, int ndim,
struct ex__elem_blk_parm *elem_blk_parm);
EXODUS_EXPORT int ex__get_file_type(int exoid, char *ftype);
EXODUS_EXPORT int ex__put_nemesis_version(int exoid);
EXODUS_EXPORT int ex__put_homogenous_block_params(int exoid, size_t block_count,
const struct ex_block *blocks);
EXODUS_EXPORT int ne__check_file_version(int exoid);
EXODUS_EXPORT int ne__id_lkup(int exoid, /* NetCDF/Exodus file ID */
const char *ne_var_name, /* Nemesis variable name */
int64_t *idx, /* index variable for variable, length 2 */
ex_entity_id ne_var_id /* NetCDF variable ID */
);
/**
* For output databases, the maximum length of any entity, variable,
* property, attribute, or coordinate name to be written (not
* including the NULL terminator). If a name is longer than this
* value, a warning message will be output to stderr and the name
* will be truncated. Must be set (via call to
* ex_set_max_name_length()(exoid, int len) prior to calling ex_create().
*
* For input databases, the size of the name arrays that the client
* code will be passing to API routines that retrieve names (not
* including the NULL terminator). This defaults to 32 for
* compatibility with older clients. The value used at the time of
* creation of the database can be queried by ex_inquire with the
* #EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH argument. The current value for this
* variable can be queried with #EX_INQ_MAX_READ_NAME_LENGTH argument.
*
* Note that this is a global setting for all databases. If you are
* accessing multiple databases, they will all use the same value.
*/
EXODUS_EXPORT int ex__default_max_name_length;
/*! @} */
#ifdef __cplusplus
}
#endif

@ -0,0 +1,18 @@
/*
* Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
* NTESS, the U.S. Government retains certain rights in this software.
*
* See packages/seacas/LICENSE for details
*/
/*
* NOTE: Contents of this include file have been moved to exodusII.h
* Retained here just for backward compatibility
*/
#pragma once
#include "exodusII.h"
#if !defined(PARALLEL_AWARE_EXODUS)
#error "Parallel-aware exodusII_par.h included in non-parallel context"
#endif

@ -0,0 +1,22 @@
#pragma once
/* #undef EXODUS_THREADSAFE */
#ifndef SEACAS_DEPRECATED
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
# define SEACAS_DEPRECATED __attribute__((__deprecated__))
# else
# define SEACAS_DEPRECATED
# endif
#endif
#ifndef SEACAS_DEPRECATED_MSG
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
# define SEACAS_DEPRECATED_MSG(MSG) __attribute__((__deprecated__ (#MSG) ))
# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
# define SEACAS_DEPRECATED_MSG(MSG) __attribute__((__deprecated__))
# else
# define SEACAS_DEPRECATED_MSG(MSG)
# endif
#endif

@ -0,0 +1,222 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER
##############################################################################
#
# CMake variable for use by Seacas/SEACAS clients.
#
# Do not edit: This file was generated automatically by CMake.
#
##############################################################################
if(CMAKE_VERSION VERSION_LESS 3.3)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"SEACAS requires CMake 3.3 or later for 'if (... IN_LIST ...)'"
)
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
cmake_minimum_required(VERSION 3.3...3.22.0)
## ---------------------------------------------------------------------------
## Compilers used by Seacas/SEACAS build
## ---------------------------------------------------------------------------
set(SEACAS_CXX_COMPILER "/usr/lib/ccache/g++")
set(SEACAS_C_COMPILER "/usr/lib/ccache/gcc")
set(SEACAS_Fortran_COMPILER "gfortran")
# Deprecated!
set(SEACAS_FORTRAN_COMPILER "gfortran")
## ---------------------------------------------------------------------------
## Compiler flags used by Seacas/SEACAS build
## ---------------------------------------------------------------------------
## Give the build type
set(SEACAS_CMAKE_BUILD_TYPE "RELEASE")
## Set compiler flags, including those determined by build type
set(SEACAS_CXX_FLAGS [[ -O3 -DNDEBUG]])
set(SEACAS_C_FLAGS [[ -Wall -Wunused -pedantic -std=c11 -fPIC -O3 -DNDEBUG]])
set(SEACAS_Fortran_FLAGS [[ ]])
# Deprecated
set(SEACAS_FORTRAN_FLAGS [[ ]])
## Extra link flags (e.g., specification of fortran libraries)
set(SEACAS_EXTRA_LD_FLAGS [[]])
## This is the command-line entry used for setting rpaths. In a build
## with static libraries it will be empty.
set(SEACAS_SHARED_LIB_RPATH_COMMAND "-Wl,-rpath,/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS/lib")
set(SEACAS_BUILD_SHARED_LIBS "YES")
set(SEACAS_LINKER /usr/bin/ld)
set(SEACAS_AR /usr/bin/ar)
## ---------------------------------------------------------------------------
## Set library specifications and paths
## ---------------------------------------------------------------------------
## Base install location (if not in the build tree)
set(SEACAS_INSTALL_DIR "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS")
## List of package libraries
set(SEACAS_LIBRARIES SEACAS::all_libs)
## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
## and includes on systems that do not use the mpi wrappers for compiling
## ---------------------------------------------------------------------------
set(SEACAS_MPI_LIBRARIES "")
set(SEACAS_MPI_LIBRARY_DIRS "")
set(SEACAS_MPI_INCLUDE_DIRS "")
set(SEACAS_MPI_EXEC "")
set(SEACAS_MPI_EXEC_MAX_NUMPROCS "")
set(SEACAS_MPI_EXEC_NUMPROCS_FLAG "")
## ---------------------------------------------------------------------------
## Set useful general variables
## ---------------------------------------------------------------------------
# Enables/Disables for upstream package dependencies
set(SEACAS_ENABLE_SEACASExodus ON)
set(SEACAS_ENABLE_SEACASIoss OFF)
set(SEACAS_ENABLE_SEACASExodus_for OFF)
set(SEACAS_ENABLE_SEACASExoIIv2for32 OFF)
set(SEACAS_ENABLE_SEACASNemesis OFF)
set(SEACAS_ENABLE_SEACASChaco OFF)
set(SEACAS_ENABLE_SEACASAprepro_lib OFF)
set(SEACAS_ENABLE_SEACASSupes OFF)
set(SEACAS_ENABLE_SEACASSuplib OFF)
set(SEACAS_ENABLE_SEACASSuplibC OFF)
set(SEACAS_ENABLE_SEACASSuplibCpp OFF)
set(SEACAS_ENABLE_SEACASSVDI OFF)
set(SEACAS_ENABLE_SEACASPLT OFF)
set(SEACAS_ENABLE_SEACASAlgebra OFF)
set(SEACAS_ENABLE_SEACASAprepro OFF)
set(SEACAS_ENABLE_SEACASBlot OFF)
set(SEACAS_ENABLE_SEACASConjoin OFF)
set(SEACAS_ENABLE_SEACASEjoin OFF)
set(SEACAS_ENABLE_SEACASEpu OFF)
set(SEACAS_ENABLE_SEACASCpup OFF)
set(SEACAS_ENABLE_SEACASExo2mat OFF)
set(SEACAS_ENABLE_SEACASExodiff OFF)
set(SEACAS_ENABLE_SEACASExomatlab OFF)
set(SEACAS_ENABLE_SEACASExotxt OFF)
set(SEACAS_ENABLE_SEACASExo_format OFF)
set(SEACAS_ENABLE_SEACASEx1ex2v2 OFF)
set(SEACAS_ENABLE_SEACASExotec2 OFF)
set(SEACAS_ENABLE_SEACASFastq OFF)
set(SEACAS_ENABLE_SEACASGjoin OFF)
set(SEACAS_ENABLE_SEACASGen3D OFF)
set(SEACAS_ENABLE_SEACASGenshell OFF)
set(SEACAS_ENABLE_SEACASGrepos OFF)
set(SEACAS_ENABLE_SEACASExplore OFF)
set(SEACAS_ENABLE_SEACASMapvarlib OFF)
set(SEACAS_ENABLE_SEACASMapvar OFF)
set(SEACAS_ENABLE_SEACASMapvar-kd OFF)
set(SEACAS_ENABLE_SEACASMat2exo OFF)
set(SEACAS_ENABLE_SEACASNas2exo OFF)
set(SEACAS_ENABLE_SEACASZellij OFF)
set(SEACAS_ENABLE_SEACASNemslice OFF)
set(SEACAS_ENABLE_SEACASNemspread OFF)
set(SEACAS_ENABLE_SEACASNumbers OFF)
set(SEACAS_ENABLE_SEACASSlice OFF)
set(SEACAS_ENABLE_SEACASTxtexo OFF)
set(SEACAS_ENABLE_SEACASEx2ex1v2 OFF)
set(SEACAS_ENABLE_MPI OFF)
# Exported cache variables
set(SEACAS_ENABLE_DEBUG "OFF")
set(HAVE_SEACAS_DEBUG "OFF")
set(SEACASExodus_ENABLE_THREADSAFE "NO")
set(EXODUS_THREADSAFE "OFF")
set(SEACASExodus_ENABLE_STATIC "YES")
set(EXODUS_STATIC "ON")
set(SEACASExodus_ENABLE_SHARED "OFF")
set(EXODUS_SHARED "OFF")
set(SEACASIoss_ENABLE_THREADSAFE "OFF")
set(IOSS_THREADSAFE "OFF")
# Include configuration of dependent packages
if (NOT TARGET SEACASExodus::all_libs)
include("${CMAKE_CURRENT_LIST_DIR}/../SEACASExodus/SEACASExodusConfig.cmake")
endif()
# Import SEACAS targets
include("${CMAKE_CURRENT_LIST_DIR}/SEACASTargets.cmake")
# Standard TriBITS-compliant external package variables
set(SEACAS_IS_TRIBITS_COMPLIANT TRUE)
set(SEACAS_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")
set(SEACAS_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}")
## ----------------------------------------------------------------------------
## Create deprecated non-namespaced library targets for backwards compatibility
## ----------------------------------------------------------------------------
set(SEACAS_EXPORTED_PACKAGE_LIBS_NAMES "exodus")
foreach(libname IN LISTS SEACAS_EXPORTED_PACKAGE_LIBS_NAMES)
if (NOT TARGET ${libname})
add_library(${libname} INTERFACE IMPORTED)
target_link_libraries(${libname}
INTERFACE SEACAS::${libname})
set(deprecationMessage
"WARNING: The non-namespaced target '${libname}' is deprecated!"
" If always using newer versions of the project 'Seacas', then use the"
" new namespaced target 'SEACAS::${libname}', or better yet,"
" 'SEACAS::all_libs' to be less sensitive to changes in the definition"
" of targets in the package 'SEACAS'. Or, to maintain compatibility with"
" older or newer versions the project 'Seacas', instead link against the"
" libraries specified by the variable 'SEACAS_LIBRARIES'."
)
string(REPLACE ";" "" deprecationMessage "${deprecationMessage}")
set_target_properties(${libname}
PROPERTIES DEPRECATION "${deprecationMessage}" )
endif()
endforeach()

@ -0,0 +1,123 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.22)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SEACAS::all_libs)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SEACAS::all_libs
add_library(SEACAS::all_libs INTERFACE IMPORTED)
set_target_properties(SEACAS::all_libs PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "SEACASExodus::exodus"
)
if(CMAKE_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
endif()
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SEACASTargets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# Make sure the targets which have been exported in some other
# export set exist.
unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
foreach(_target "SEACASExodus::exodus" )
if(NOT TARGET "${_target}" )
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}")
endif()
endforeach()
if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
if(CMAKE_FIND_PACKAGE_NAME)
set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}")
else()
message(FATAL_ERROR "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}")
endif()
endif()
unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

@ -0,0 +1,181 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER
##############################################################################
#
# CMake variable for use by Seacas/SEACASExodus clients.
#
# Do not edit: This file was generated automatically by CMake.
#
##############################################################################
if(CMAKE_VERSION VERSION_LESS 3.3)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"SEACASExodus requires CMake 3.3 or later for 'if (... IN_LIST ...)'"
)
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
cmake_minimum_required(VERSION 3.3...3.22.0)
## ---------------------------------------------------------------------------
## Compilers used by Seacas/SEACASExodus build
## ---------------------------------------------------------------------------
set(SEACASExodus_CXX_COMPILER "/usr/lib/ccache/g++")
set(SEACASExodus_C_COMPILER "/usr/lib/ccache/gcc")
set(SEACASExodus_Fortran_COMPILER "gfortran")
# Deprecated!
set(SEACASExodus_FORTRAN_COMPILER "gfortran")
## ---------------------------------------------------------------------------
## Compiler flags used by Seacas/SEACASExodus build
## ---------------------------------------------------------------------------
## Give the build type
set(SEACASExodus_CMAKE_BUILD_TYPE "RELEASE")
## Set compiler flags, including those determined by build type
set(SEACASExodus_CXX_FLAGS [[ -O3 -DNDEBUG]])
set(SEACASExodus_C_FLAGS [[ -Wall -Wunused -pedantic -std=c11 -fPIC -O3 -DNDEBUG]])
set(SEACASExodus_Fortran_FLAGS [[ ]])
# Deprecated
set(SEACASExodus_FORTRAN_FLAGS [[ ]])
## Extra link flags (e.g., specification of fortran libraries)
set(SEACASExodus_EXTRA_LD_FLAGS [[]])
## This is the command-line entry used for setting rpaths. In a build
## with static libraries it will be empty.
set(SEACASExodus_SHARED_LIB_RPATH_COMMAND "-Wl,-rpath,/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS/lib")
set(SEACASExodus_BUILD_SHARED_LIBS "YES")
set(SEACASExodus_LINKER /usr/bin/ld)
set(SEACASExodus_AR /usr/bin/ar)
## ---------------------------------------------------------------------------
## Set library specifications and paths
## ---------------------------------------------------------------------------
## Base install location (if not in the build tree)
set(SEACASExodus_INSTALL_DIR "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS")
## List of package libraries
set(SEACASExodus_LIBRARIES SEACASExodus::all_libs)
## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
## and includes on systems that do not use the mpi wrappers for compiling
## ---------------------------------------------------------------------------
set(SEACASExodus_MPI_LIBRARIES "")
set(SEACASExodus_MPI_LIBRARY_DIRS "")
set(SEACASExodus_MPI_INCLUDE_DIRS "")
set(SEACASExodus_MPI_EXEC "")
set(SEACASExodus_MPI_EXEC_MAX_NUMPROCS "")
set(SEACASExodus_MPI_EXEC_NUMPROCS_FLAG "")
## ---------------------------------------------------------------------------
## Set useful general variables
## ---------------------------------------------------------------------------
# Enables/Disables for upstream package dependencies
set(SEACASExodus_ENABLE_Netcdf ON)
set(SEACASExodus_ENABLE_Pthread OFF)
set(SEACASExodus_ENABLE_HDF5 OFF)
set(SEACASExodus_ENABLE_Pnetcdf OFF)
set(SEACASExodus_ENABLE_MPI OFF)
# Exported cache variables
set(SEACAS_ENABLE_DEBUG "OFF")
set(HAVE_SEACAS_DEBUG "OFF")
set(SEACASExodus_ENABLE_THREADSAFE "NO")
set(EXODUS_THREADSAFE "OFF")
set(SEACASExodus_ENABLE_STATIC "YES")
set(EXODUS_STATIC "ON")
set(SEACASExodus_ENABLE_SHARED "OFF")
set(EXODUS_SHARED "OFF")
set(SEACASIoss_ENABLE_THREADSAFE "OFF")
set(IOSS_THREADSAFE "OFF")
# Include configuration of dependent packages
if (NOT TARGET Netcdf::all_libs)
include("${CMAKE_CURRENT_LIST_DIR}/../../external_packages/Netcdf/NetcdfConfig.cmake")
endif()
# Import SEACASExodus targets
include("${CMAKE_CURRENT_LIST_DIR}/SEACASExodusTargets.cmake")
# Standard TriBITS-compliant external package variables
set(SEACASExodus_IS_TRIBITS_COMPLIANT TRUE)
set(SEACASExodus_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")
set(SEACASExodus_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}")
## ----------------------------------------------------------------------------
## Create deprecated non-namespaced library targets for backwards compatibility
## ----------------------------------------------------------------------------
set(SEACASExodus_EXPORTED_PACKAGE_LIBS_NAMES "exodus")
foreach(libname IN LISTS SEACASExodus_EXPORTED_PACKAGE_LIBS_NAMES)
if (NOT TARGET ${libname})
add_library(${libname} INTERFACE IMPORTED)
target_link_libraries(${libname}
INTERFACE SEACASExodus::${libname})
set(deprecationMessage
"WARNING: The non-namespaced target '${libname}' is deprecated!"
" If always using newer versions of the project 'Seacas', then use the"
" new namespaced target 'SEACASExodus::${libname}', or better yet,"
" 'SEACASExodus::all_libs' to be less sensitive to changes in the definition"
" of targets in the package 'SEACASExodus'. Or, to maintain compatibility with"
" older or newer versions the project 'Seacas', instead link against the"
" libraries specified by the variable 'SEACASExodus_LIBRARIES'."
)
string(REPLACE ";" "" deprecationMessage "${deprecationMessage}")
set_target_properties(${libname}
PROPERTIES DEPRECATION "${deprecationMessage}" )
endif()
endforeach()

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "RELEASE".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "SEACASExodus::exodus" for configuration "RELEASE"
set_property(TARGET SEACASExodus::exodus APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(SEACASExodus::exodus PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libexodus.so.2.0"
IMPORTED_SONAME_RELEASE "libexodus.so.2"
)
list(APPEND _cmake_import_check_targets SEACASExodus::exodus )
list(APPEND _cmake_import_check_files_for_SEACASExodus::exodus "${_IMPORT_PREFIX}/lib/libexodus.so.2.0" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

@ -0,0 +1,116 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.22)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SEACASExodus::exodus SEACASExodus::all_libs)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SEACASExodus::exodus
add_library(SEACASExodus::exodus SHARED IMPORTED)
set_target_properties(SEACASExodus::exodus PROPERTIES
INTERFACE_COMPILE_FEATURES "cxx_std_11"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "Netcdf::all_libs"
)
# Create imported target SEACASExodus::all_libs
add_library(SEACASExodus::all_libs INTERFACE IMPORTED)
set_target_properties(SEACASExodus::all_libs PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "SEACASExodus::exodus"
)
if(CMAKE_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
endif()
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SEACASExodusTargets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

@ -0,0 +1,202 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER
##############################################################################
#
# CMake variable for use by Seacas clients.
#
# Do not edit: This file was generated automatically by CMake.
#
##############################################################################
if(CMAKE_VERSION VERSION_LESS 3.3)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"Seacas requires CMake 3.3 or later for 'if (... IN_LIST ...)'"
)
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif()
cmake_minimum_required(VERSION 3.3...3.22.0)
## ---------------------------------------------------------------------------
## Compilers used by Seacas build
## ---------------------------------------------------------------------------
set(Seacas_CXX_COMPILER "/usr/lib/ccache/g++")
set(Seacas_C_COMPILER "/usr/lib/ccache/gcc")
set(Seacas_Fortran_COMPILER "gfortran")
## ---------------------------------------------------------------------------
## Compiler flags used by Seacas build
## ---------------------------------------------------------------------------
set(Seacas_CMAKE_BUILD_TYPE "RELEASE")
set(Seacas_CXX_COMPILER_FLAGS [[ -Wall -Wunused -pedantic -fPIC -O3 -DNDEBUG]])
set(Seacas_C_COMPILER_FLAGS [[ -Wall -Wunused -pedantic -std=c11 -fPIC -O3 -DNDEBUG]])
set(Seacas_Fortran_COMPILER_FLAGS [[ ]])
## Extra link flags (e.g., specification of fortran libraries)
set(Seacas_EXTRA_LD_FLAGS [[]])
## This is the command-line entry used for setting rpaths. In a build
## with static libraries it will be empty.
set(Seacas_SHARED_LIB_RPATH_COMMAND "-Wl,-rpath,/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS/lib")
set(Seacas_BUILD_SHARED_LIBS "YES")
set(Seacas_LINKER /usr/bin/ld)
set(Seacas_AR /usr/bin/ar)
## ---------------------------------------------------------------------------
## Set library specifications and paths
## ---------------------------------------------------------------------------
## The project version number
set(Seacas_VERSION "2.0")
# For best practices in handling of components, see
# <http://www.cmake.org/cmake/help/v3.2/manual/cmake-developer.7.html#find-modules>.
#
# If components were requested, include only those. If not, include all of
# Trilinos.
if (Seacas_FIND_COMPONENTS)
set(COMPONENTS_LIST ${Seacas_FIND_COMPONENTS})
else()
set(COMPONENTS_LIST SEACAS;SEACASExodus)
endif()
# Initialize Seacas_FOUND with true, and set it to FALSE if any of
# the required components wasn't found.
set(Seacas_FOUND TRUE)
set(Seacas_NOT_FOUND_MESSAGE "")
set(selectedComponentsFound "")
foreach (comp IN ITEMS ${COMPONENTS_LIST})
set(compPkgConfigFile
${CMAKE_CURRENT_LIST_DIR}/../${comp}/${comp}Config.cmake
)
if (EXISTS ${compPkgConfigFile})
# Set Seacas_<component>_FOUND.
set(Seacas_${comp}_FOUND TRUE)
# Include the package file.
include(${compPkgConfigFile})
# Add variables to lists.
list(APPEND Seacas_LIBRARIES ${${comp}_LIBRARIES})
list(APPEND selectedComponentsFound ${comp})
else()
set(Seacas_${comp}_FOUND FALSE)
if(Seacas_FIND_REQUIRED_${comp})
string(APPEND Seacas_NOT_FOUND_MESSAGE
"ERROR: Could not find component '${comp}'!\n")
set(Seacas_FOUND FALSE)
endif()
endif()
endforeach()
# Deprecated (see #299)!
set(Seacas_INCLUDE_DIRS "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS/include")
# Remove duplicates in Seacas_LIBRARIES
list(REMOVE_DUPLICATES Seacas_LIBRARIES)
## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
## and includes on systems that do not use the mpi wrappers for compiling
## ---------------------------------------------------------------------------
set(Seacas_INSTALL_DIR "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS")
set(Seacas_MPI_LIBRARIES "")
set(Seacas_MPI_LIBRARY_DIRS "")
set(Seacas_MPI_INCLUDE_DIRS "")
set(Seacas_MPI_EXEC "")
set(Seacas_MPI_EXEC_PRE_NUMPROCS_FLAGS "")
set(Seacas_MPI_EXEC_MAX_NUMPROCS "")
set(Seacas_MPI_EXEC_POST_NUMPROCS_FLAGS "")
set(Seacas_MPI_EXEC_NUMPROCS_FLAG "")
## ---------------------------------------------------------------------------
## Compiler vendor identifications
## ---------------------------------------------------------------------------
set(Seacas_SYSTEM_NAME "Linux")
set(Seacas_CXX_COMPILER_ID "GNU")
set(Seacas_C_COMPILER_ID "GNU")
set(Seacas_Fortran_COMPILER_ID "")
set(Seacas_Fortran_IMPLICIT_LINK_LIBRARIES "")
## ---------------------------------------------------------------------------
## Set useful general variables
## ---------------------------------------------------------------------------
## The packages enabled for this project
set(Seacas_PACKAGE_LIST "SEACAS;SEACASExodus")
## The selected packages for this project
set(Seacas_SELECTED_PACKAGE_LIST "${selectedComponentsFound}")
## ---------------------------------------------------------------------------
## Modern CMake (IMPORTED) targets
## ---------------------------------------------------------------------------
# Seacas::all_libs (Does *not* depend on COMPONENTS)
if (NOT TARGET Seacas::all_libs)
set(Seacas_ALL_PACKAGES_TARGETS)
foreach (pkg IN ITEMS SEACAS;SEACASExodus)
list(APPEND Seacas_ALL_PACKAGES_TARGETS ${pkg}::all_libs)
endforeach()
add_library(Seacas::all_libs IMPORTED INTERFACE GLOBAL)
target_link_libraries(Seacas::all_libs
INTERFACE ${Seacas_ALL_PACKAGES_TARGETS} )
endif()
# Seacas::all_selected_libs (Depend on COMPONENTS)
if (NOT TARGET Seacas::all_selected_libs)
set(Seacas_ALL_SELECTED_PACKAGES_TARGETS)
foreach (pkg IN ITEMS ${selectedComponentsFound})
list(APPEND Seacas_ALL_SELECTED_PACKAGES_TARGETS ${pkg}::all_libs)
endforeach()
add_library(Seacas::all_selected_libs IMPORTED INTERFACE GLOBAL)
target_link_libraries(Seacas::all_selected_libs
INTERFACE ${Seacas_ALL_SELECTED_PACKAGES_TARGETS} )
endif()

@ -0,0 +1,70 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
# but only if the requested major version is the same as the current one.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "2.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if("2.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
else()
set(CVF_VERSION_MAJOR "2.0")
endif()
if(PACKAGE_FIND_VERSION_RANGE)
# both endpoints of the range must have the expected major version
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
else()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,23 @@
# Package config file for external package/TPL 'DLlib'
#
# Generated by CMake, do not edit!
# Guard against multiple inclusion
if (TARGET DLlib::all_libs)
return()
endif()
add_library(tribits::DLlib::dl IMPORTED UNKNOWN)
set_target_properties(tribits::DLlib::dl PROPERTIES
IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libdl.so")
add_library(DLlib::all_libs INTERFACE IMPORTED)
target_link_libraries(DLlib::all_libs
INTERFACE tribits::DLlib::dl
)
# Standard TriBITS-compliant external package variables
set(DLlib_IS_TRIBITS_COMPLIANT TRUE)
set(DLlib_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")
set(DLlib_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}")

@ -0,0 +1,14 @@
# Package config file for external package/TPL 'DLlib'
#
# Generated by CMake, do not edit!
if (TRIBITS_FINDING_RAW_DLlib_PACKAGE_FIRST)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
set(PACKAGE_VERSION_UNSUITABLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
# Currently there is no version information
set(PACKAGE_VERSION UNKNOWN)
set(PACKAGE_VERSION_EXACT FALSE)

@ -0,0 +1,62 @@
# Package config file for external package/TPL 'Netcdf'
#
# Generated by CMake, do not edit!
# Guard against multiple inclusion
if (TARGET Netcdf::all_libs)
return()
endif()
add_library(tribits::Netcdf::m IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::m PROPERTIES
IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libm.so")
add_library(tribits::Netcdf::dl IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::dl PROPERTIES
IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libdl.so")
target_link_libraries(tribits::Netcdf::dl
INTERFACE tribits::Netcdf::m)
add_library(tribits::Netcdf::z IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::z PROPERTIES
IMPORTED_LOCATION "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/zlib-1.2.13/lib/libz.so")
target_link_libraries(tribits::Netcdf::z
INTERFACE tribits::Netcdf::dl)
add_library(tribits::Netcdf::hdf5 IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::hdf5 PROPERTIES
IMPORTED_LOCATION "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/HDF5-1.14.1/lib/libhdf5.so")
target_link_libraries(tribits::Netcdf::hdf5
INTERFACE tribits::Netcdf::z)
add_library(tribits::Netcdf::hdf5_hl IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::hdf5_hl PROPERTIES
IMPORTED_LOCATION "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/HDF5-1.14.1/lib/libhdf5_hl.so")
target_link_libraries(tribits::Netcdf::hdf5_hl
INTERFACE tribits::Netcdf::hdf5)
add_library(tribits::Netcdf::netcdf IMPORTED UNKNOWN)
set_target_properties(tribits::Netcdf::netcdf PROPERTIES
IMPORTED_LOCATION "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/NetCDF-C-4.9.2/lib/libnetcdf.so")
target_link_libraries(tribits::Netcdf::netcdf
INTERFACE tribits::Netcdf::hdf5_hl)
add_library(Netcdf::all_libs INTERFACE IMPORTED)
target_link_libraries(Netcdf::all_libs
INTERFACE tribits::Netcdf::m
INTERFACE tribits::Netcdf::dl
INTERFACE tribits::Netcdf::z
INTERFACE tribits::Netcdf::hdf5
INTERFACE tribits::Netcdf::hdf5_hl
INTERFACE tribits::Netcdf::netcdf
)
target_include_directories(Netcdf::all_libs SYSTEM
INTERFACE "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/NetCDF-C-4.9.2/include"
INTERFACE "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/HDF5-1.14.1/include"
)
# Standard TriBITS-compliant external package variables
set(Netcdf_IS_TRIBITS_COMPLIANT TRUE)
set(Netcdf_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")
set(Netcdf_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}")

@ -0,0 +1,14 @@
# Package config file for external package/TPL 'Netcdf'
#
# Generated by CMake, do not edit!
if (TRIBITS_FINDING_RAW_Netcdf_PACKAGE_FIRST)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
set(PACKAGE_VERSION_UNSUITABLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
# Currently there is no version information
set(PACKAGE_VERSION UNKNOWN)
set(PACKAGE_VERSION_EXACT FALSE)

@ -0,0 +1,379 @@
#!/usr/bin/env python
"""
Copyright(C) 1999-2022 National Technology & Engineering Solutions
of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
NTESS, the U.S. Government retains certain rights in this software.
See packages/seacas/LICENSE for details
"""
import unittest
import sys
import os
import tempfile
import ctypes
from contextlib import contextmanager
ACCESS = os.getenv("ACCESS", "/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/EXODUS")
sys.path.append(os.path.join(ACCESS, "lib"))
import exodus as exo
class TestExodus(unittest.TestCase):
def setUp(self):
input_dir = os.path.dirname(__file__)
self.tempdir = tempfile.TemporaryDirectory()
self.temp_exo_path = os.path.join(self.tempdir.name, "temp-test-assembly.exo")
with exo.exodus(
os.path.join(input_dir, "test-assembly.exo"), mode="r"
) as exofile:
self.exofile = exofile
with self.exofile.copy(self.temp_exo_path, True) as temp_exofile:
self.temp_exofile = temp_exofile
def tearDown(self):
self.tempdir.cleanup()
def test_ex_obj_to_inq(self):
self.assertEqual("EX_INQ_ASSEMBLY", exo.ex_obj_to_inq("EX_ASSEMBLY"))
def test_ex_obj_to_inq_wrong_obj_type(self):
self.assertEqual(-1, exo.ex_obj_to_inq("fake_obj"))
def test_ex_entity_type_to_objType(self):
self.assertEqual(
"assembly",
exo.ex_entity_type_to_objType(exo.get_entity_type("EX_ASSEMBLY")),
)
def test_ex_entity_type_to_objType_wrong_entity_type(self):
self.assertEqual("EX_INVALID", exo.ex_entity_type_to_objType("fake_entity"))
def test_exodus_context_manager_reraises_exceptions(self):
with self.assertRaises(AssertionError):
with exo.exodus(self.temp_exo_path, mode="r"):
self.assertFalse(True)
def test_copy_opened_in_append_mode(self):
new = exo.assembly(
name="Unit_test", type=exo.ex_entity_type.EX_ASSEMBLY, id=444
)
new.entity_list = [100, 222]
temp_exo_path2 = f"{self.temp_exo_path}2"
with exo.exodus(self.temp_exo_path, mode="r") as temp_exofile:
expected = list(temp_exofile.get_ids("EX_ASSEMBLY"))
with temp_exofile.copy(temp_exo_path2, True, mode="a") as temp_exofile2:
temp_exofile2.put_assembly(new)
copied_output = list(temp_exofile2.get_ids("EX_ASSEMBLY"))
self.assertNotEqual(temp_exofile.modeChar, temp_exofile2.modeChar)
self.assertNotEqual(expected, copied_output)
def test_copy_opened_in_read_mode(self):
temp_exo_path2 = f"{self.temp_exo_path}2"
with exo.exodus(self.temp_exo_path, mode="r") as temp_exofile:
with temp_exofile.copy(temp_exo_path2, True, mode="r") as temp_exofile2:
expected = list(temp_exofile.get_ids("EX_ASSEMBLY"))
copied_output = list(temp_exofile2.get_ids("EX_ASSEMBLY"))
self.assertEqual(temp_exofile.modeChar, temp_exofile2.modeChar)
self.assertEqual(expected, copied_output)
def test_setup_ex_assembly(self):
assem = exo.assembly(name="Unit_test", type="EX_ASSEMBLY", id=444)
assem.entity_list = [100, 222]
ctype_assem = exo.setup_ex_assembly(assem)
self.assertIsInstance(ctype_assem, exo.ex_assembly)
self.assertIsInstance(
ctype_assem.entity_list, ctypes.POINTER(ctypes.c_longlong)
)
def test_get_name_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
names = [
temp_exofile.get_name("EX_ASSEMBLY", assembly)
for assembly in assembly_ids
]
self.assertEqual(
["Root", "Child2", "Child3", "Child4", "NewAssembly", "FromPython"], names
)
def test_inquire_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assem_count = temp_exofile.inquire("EX_INQ_ASSEMBLY")
self.assertEqual(6, assem_count)
def test_get_block_id_map(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
elem_ids = temp_exofile.get_ids("EX_ELEM_BLOCK")
expected = [1, 2, 3, 4, 5, 6, 7]
outputs = []
for val in elem_ids:
outputs.extend(temp_exofile.get_block_id_map("EX_ELEM_BLOCK", val))
self.assertListEqual(expected, outputs)
def test_get_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
root = exo.assembly(name="Root", type="EX_ASSEMBLY", id=100)
root.entity_list = [200, 300, 400]
self.assertEqual(str(root), str(assemblies[0]))
def test_get_entity_count(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
elem_ids = temp_exofile.get_ids("EX_ELEM_BLOCK")
elems = [temp_exofile.get_entity_count("EX_ELEM_BLOCK", elem) for elem in elem_ids]
self.assertListEqual([1, 1, 1, 1, 1, 1, 1], elems)
def test_get_elem_attr_values(self):
names = ["Scale", "Units"]
temp_copy = os.path.join(self.tempdir.name, "temp_copy.exo")
with exo.copy_mesh(self.temp_exo_path, temp_copy, additionalElementAttributes=names) as temp_exofile:
for elem_id in temp_exofile.get_ids("EX_ELEM_BLOCK"):
attrs = [[3.14159], [1]]
for name, values in zip(names, attrs):
temp_exofile.put_elem_attr_values(elem_id, name, values)
self.assertEqual(3.14159, temp_exofile.get_elem_attr_values(elem_id, "Scale")[0])
self.assertEqual(1.0, temp_exofile.get_elem_attr_values(elem_id, "Units")[0])
def test_get_assemblies(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = temp_exofile.get_assemblies(assembly_ids)
expected = [
exo.assembly(name="Root", type="EX_ASSEMBLY", id=100),
exo.assembly(name="Child2", type="EX_ELEM_BLOCK", id=200),
exo.assembly(name="Child3", type="EX_ELEM_BLOCK", id=300),
exo.assembly(name="Child4", type="EX_ELEM_BLOCK", id=400),
exo.assembly(name="NewAssembly", type="EX_ASSEMBLY", id=222),
exo.assembly(name="FromPython", type="EX_ASSEMBLY", id=333),
]
entity_lists = [
[200, 300, 400],
[10, 11, 12, 13],
[14, 15, 16],
[10, 16],
[100, 200, 300, 400],
[100, 222],
]
for i, x in enumerate(expected):
x.entity_list = entity_lists[i]
self.maxDiff = None
self.assertEqual(str(expected), str(assemblies))
def test_get_attributes_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
count = temp_exofile.get_attribute_count("EX_ASSEMBLY", 100)
self.assertEqual(count, 2)
attributes = temp_exofile.get_attributes("EX_ASSEMBLY", 100)
expected = [
exo.attribute("Scale", "EX_ASSEMBLY", 100),
exo.attribute("Units", "EX_ASSEMBLY", 100),
]
expected[0].values = [1.5]
expected[1].values = [1, 0, 0, -1]
self.maxDiff = None
self.assertEqual(str(expected[0]), str(attributes["Scale"]))
self.assertEqual(str(expected[1]), str(attributes["Units"]))
def test_put_attributes_assembly(self):
with exo.exodus(self.temp_exo_path, mode="a") as temp_exofile:
new = [
exo.attribute("Scale", "EX_ASSEMBLY", 222),
exo.attribute("Units", "EX_ASSEMBLY", 333),
]
new[0].values = [3.14159]
new[1].values = [0, 1, -1, 0]
temp_exofile.put_attribute(new[0])
temp_exofile.put_attribute(new[1])
att1 = temp_exofile.get_attributes("EX_ASSEMBLY", 222)
att2 = temp_exofile.get_attributes("EX_ASSEMBLY", 333)
self.maxDiff = None
self.assertEqual(str(att1["Scale"]), str(new[0]))
self.assertEqual(str(att2["Units"]), str(new[1]))
def test_put_qa(self):
new = [("name", "1.2.3-4", "20220801", "12:34:56")]
with exo.exodus(self.temp_exo_path, mode="a") as temp_exofile:
temp_exofile.put_qa_records(new)
with exo.exodus(self.temp_exo_path) as temp_exofile:
self.assertEqual(new, temp_exofile.get_qa_records())
def test_copy_file(self):
new = [("name", "1.2.3-4", "20220801", "12:34:56")]
new_path = os.path.join(self.tempdir.name, "temp-test-assembly_new.exo")
with exo.exodus(self.temp_exo_path) as exofile:
qa_recs = exofile.get_qa_records()
with exo.exodus(new_path, mode="w+") as exofile:
exofile.put_qa_records(qa_recs + new)
with exo.exodus(self.temp_exo_path) as orig:
orig.copy_file(exofile.fileId, include_transient=True)
self.assertIn(new[0], exofile.get_qa_records())
def test_put_assembly(self):
new = exo.assembly(
name="Unit_test", type=exo.ex_entity_type.EX_ASSEMBLY, id=444
)
new.entity_list = [100, 222]
with exo.exodus(self.temp_exo_path, mode="a") as temp_exofile:
temp_exofile.put_assembly(new)
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
self.assertEqual(new.name, assemblies[6].name)
self.assertEqual(16, assemblies[6].type)
self.assertEqual(new.id, assemblies[6].id)
self.assertEqual(new.entity_list, assemblies[6].entity_list)
def test_get_reduction_variables_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
red_var = temp_exofile.get_reduction_variable_number("EX_ASSEMBLY")
names = temp_exofile.get_reduction_variable_names("EX_ASSEMBLY")
self.assertEqual(4, red_var)
self.assertIn("Momentum_X", names)
self.assertIn("Momentum_Y", names)
self.assertIn("Momentum_Z", names)
self.assertIn("Kinetic_Energy", names)
def test_get_reduction_variables_assembly_enum(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
red_var = temp_exofile.get_reduction_variable_number(
exo.ex_entity_type.EX_ASSEMBLY
)
names = temp_exofile.get_reduction_variable_names(
exo.ex_entity_type.EX_ASSEMBLY
)
self.assertEqual(4, red_var)
self.assertIn("Momentum_X", names)
self.assertIn("Momentum_Y", names)
self.assertIn("Momentum_Z", names)
self.assertIn("Kinetic_Energy", names)
def test_get_reduction_variable_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
red_var = temp_exofile.get_reduction_variable_number("EX_ASSEMBLY")
name = temp_exofile.get_reduction_variable_name("EX_ASSEMBLY", 1)
self.assertEqual(4, red_var)
self.assertIn("Momentum_X", name)
def test_get_reduction_variable_assembly_enum(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
red_var = temp_exofile.get_reduction_variable_number(
exo.ex_entity_type.EX_ASSEMBLY
)
name = temp_exofile.get_reduction_variable_name(
exo.ex_entity_type.EX_ASSEMBLY, 1
)
self.assertEqual(4, red_var)
self.assertIn("Momentum_X", name)
def test_get_reduction_variable_values_assembly(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
values = temp_exofile.get_reduction_variable_values(
"EX_ASSEMBLY", assemblies[0].id, 1
)
self.assertListEqual([0.02, 0.03, 0.04, 0.05], list(values))
def test_get_reduction_variable_values_assembly_no_values(self):
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
values = temp_exofile.get_reduction_variable_values(
"EX_ASSEMBLY", assemblies[5].id, 1
)
self.assertListEqual([0.00, 0.00, 0.00, 0.00], list(values))
def test_put_assemblies(self):
new = exo.assembly(name="Unit_test", type="EX_ASSEMBLY", id=444)
new.entity_list = [100, 222]
with exo.exodus(self.temp_exo_path, mode="a") as temp_exofile:
temp_exofile.put_assemblies([new])
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
self.assertEqual(new.name, assemblies[6].name)
self.assertEqual(16, assemblies[6].type)
self.assertEqual(new.id, assemblies[6].id)
self.assertEqual(new.entity_list, assemblies[6].entity_list)
def test_put_assemblies_multiple_assemblies(self):
new = exo.assembly(name="Unit_test1", type="EX_ASSEMBLY", id=444)
new.entity_list = [100, 222]
new2 = exo.assembly(name="Unit_test2", type="EX_ASSEMBLY", id=448)
new2.entity_list = [102, 224]
with exo.exodus(self.temp_exo_path, mode="a") as temp_exofile:
temp_exofile.put_assemblies([new, new2])
with exo.exodus(self.temp_exo_path) as temp_exofile:
assembly_ids = temp_exofile.get_ids("EX_ASSEMBLY")
assemblies = [
temp_exofile.get_assembly(assembly) for assembly in assembly_ids
]
self.assertEqual(new.name, assemblies[6].name)
self.assertEqual(16, assemblies[6].type)
self.assertEqual(new.id, assemblies[6].id)
self.assertEqual(new.entity_list, assemblies[6].entity_list)
self.assertEqual(new2.name, assemblies[7].name)
self.assertEqual(16, assemblies[7].type)
self.assertEqual(new2.id, assemblies[7].id)
self.assertEqual(new2.entity_list, assemblies[7].entity_list)
class TestExodusUtilities(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.TemporaryDirectory()
def tearDown(self):
self.tempdir.cleanup()
def test_basename(self):
self.assertEqual("test", exo.basename("test.e"))
self.assertEqual("fake/path/to/test", exo.basename("fake/path/to/test.e"))
def test_getExodusVersion(self):
include_path = os.path.join(self.tempdir.name, "include")
os.makedirs(include_path)
with open(os.path.join(include_path, "exodusII.h"), "w") as fptr:
fptr.write("#define EXODUS_VERSION_MAJOR 1\n")
fptr.write("#define EXODUS_VERSION_MINOR 22\n")
with swap_ACCESS_value(self.tempdir.name):
self.assertEqual(122, exo.getExodusVersion())
def test_getExodusVersion_not_found(self):
include_path = os.path.join(self.tempdir.name, "include")
os.makedirs(include_path)
with open(os.path.join(include_path, "exodusII.h"), "w") as fptr:
fptr.write("#define NOT_EXODUS_VERSION 1\n")
fptr.write("#define ALSO_NOT_EXODUS_VERSION 22\n")
with swap_ACCESS_value(self.tempdir.name):
self.assertEqual(0, exo.getExodusVersion())
@contextmanager
def swap_ACCESS_value(new_access_value):
old_value = exo.ACCESS
exo.ACCESS = new_access_value
yield
exo.ACCESS = old_value
if __name__ == "__main__":
unittest.main()

@ -0,0 +1,391 @@
#! /bin/sh
##
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##
# This tool is adapted from the mpicc command of the MPICH Software.
############################################################################
## ##
## Things You May Have to Modify: ##
## ##
## If the following paths don't point to the place were HDF5 is installed ##
## on your system (i.e., you received a binary distribution or moved the ##
## files from the originally installed directory to another directory) ##
## then modify them accordingly to represent the new paths. ##
## ##
############################################################################
prefix="/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/HDF5-1.14.1"
exec_prefix="${prefix}"
libdir="${exec_prefix}/lib"
includedir="${prefix}/include"
HL="hl"
############################################################################
## ##
## Things You Can Modify to Override HDF5 Library Build Components: ##
## ##
## (Advanced usage - know what you're doing - you're on your own here.) ##
## The four variables below can be used to insert paths and flags in ##
## CPPFLAGS, CFLAGS, LDFLAGS, or LIBS in the h5cc compile line: ##
## $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS ##
## $LIBS $clibpath $link_objs $link_args $shared_link ##
## ##
## These settings can be overridden by setting HDF5_CFLAGS, ##
## HDF5_CPPFLAGS, HDF5_LDFLAGS, or HDF5_LIBS in the environment. ##
## ##
############################################################################
CFLAGSBASE=""
CPPFLAGSBASE=""
LDFLAGSBASE=""
LIBSBASE=""
############################################################################
## ##
## You shouldn't have to modify anything below this line. ##
## ##
############################################################################
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
host_os="linux-gnu"
prog_name="`basename $0`"
allargs=""
compile_args=""
libraries=""
link_args=""
link_objs=""
clibpath=""
do_link="yes"
do_compile="no"
dash_o="no"
dash_c="no"
get_output_file="no"
SHOW="eval"
CCBASE="gcc"
CLINKERBASE="gcc"
# CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
H5BLD_CFLAGS=" -fPIC"
H5BLD_CPPFLAGS=" -I/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/zlib-1.2.13/include "
H5BLD_LDFLAGS=" -L/media/digitalstorm/edf2449b-a566-40a2-8d0f-393bbe8ea1c0/maxwell_td_hybrid_mesher/HybridMesher/libraries/zlib-1.2.13/lib "
H5BLD_LIBS="-lz -ldl -lm "
CC="${HDF5_CC:-$CCBASE}"
CLINKER="${HDF5_CLINKER:-$CLINKERBASE}"
CFLAGS="${HDF5_CFLAGS:-$CFLAGSBASE}"
CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}"
LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
LIBS="${HDF5_LIBS:-$LIBSBASE}"
# If a static library is available, the default will be to use it. If the only
# available library is shared, it will be used by default. The user can
# override either default, although choosing an unavailable library will result
# in link errors.
STATIC_AVAILABLE="yes"
if test "${STATIC_AVAILABLE}" = "yes"; then
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
else
USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}"
fi
usage() {
# A wonderfully informative "usage" message.
echo "usage: $prog_name [OPTIONS] <compile line>"
echo " OPTIONS:"
echo " -help This help message."
echo " -echo Show all the shell commands executed"
echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/"
echo " subdirectories [default: $prefix]"
echo " -show Show the commands without executing them"
echo " -showconfig Show the HDF5 library configuration summary"
echo " -shlib Compile with shared HDF5 libraries [default for hdf5 built"
echo " without static libraries]"
echo " -noshlib Compile with static HDF5 libraries [default for hdf5 built"
echo " with static libraries]"
echo " "
echo " <compile line> - the normal compile line options for your compiler."
echo " $prog_name uses the same compiler you used to compile"
echo " HDF5. Check with your compiler's man pages for more"
echo " information on which options are needed."
echo " "
echo " You can override the compiler, linker, and whether or not to use static"
echo " or shared libraries to compile your program by setting the following"
echo " environment variables accordingly:"
echo " "
echo " HDF5_CC - use a different C compiler"
echo " HDF5_CLINKER - use a different linker"
echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library"
echo " [default: no except when built with only"
echo " shared libraries]"
echo " "
echo " You can also add or change paths and flags to the compile line using"
echo " the following environment variables or by assigning them to their counterparts"
echo " in the 'Things You Can Modify to Override...'" section of $prog_name
echo " "
echo " Variable Current value to be replaced"
echo " HDF5_CPPFLAGS \"$CPPFLAGSBASE\""
echo " HDF5_CFLAGS \"$CFLAGSBASE\""
echo " HDF5_LDFLAGS \"$LDFLAGSBASE\""
echo " HDF5_LIBS \"$LIBSBASE\""
echo " "
echo " Note that adding library paths to HDF5_LDFLAGS where another hdf5 version"
echo " is located may link your program with that other hdf5 library version."
echo " "
exit $EXIT_FAILURE
}
# Show the configuration summary of the library recorded in the
# libhdf5.settings file reside in the lib directory.
showconfigure()
{
cat ${libdir}/libhdf5.settings
status=$?
}
# Main
status=$EXIT_SUCCESS
if test "$#" = "0"; then
# No parameters specified, issue usage statement and exit.
usage
fi
case "$CC" in
gcc)
kind="gcc"
;;
mpicc|mpcc|mpicc_r)
# Is this gcc masquarading as an MPI compiler?
if test "`${CC} -v 2>&1 | sed -n 2p | cut -c1-3`" = "gcc"; then
kind="gcc"
else
# Nope
kind="$host_os"
fi
;;
*)
kind="$host_os"
;;
esac
for arg in $@ ; do
if test "x$get_output_file" = "xyes"; then
link_args="$link_args $arg"
output_file="$arg"
get_output_file="no"
continue
fi
case "$arg" in
-c)
allargs="$allargs $arg"
compile_args="$compile_args $arg"
if test "x$do_link" = "xyes" -a -n "$output_file"; then
compile_args="$compile_args -o $output_file"
fi
do_link="no"
dash_c="yes"
;;
-o)
allargs="$allargs $arg"
dash_o="yes"
if test "x$dash_c" = "xyes"; then
compile_args="$compile_args $arg"
else
link_args="$link_args $arg"
do_link="yes"
get_output_file="yes"
fi
;;
-E|-M|-MT)
allargs="$allargs $arg"
compile_args="$compile_args $arg"
dash_c="yes"
do_link="no"
;;
-l*)
libraries=" $libraries $arg "
allargs="$allargs $arg"
;;
-prefix=*)
prefix="`expr "$arg" : '-prefix=\(.*\)'`"
;;
-echo)
set -x
;;
-show)
SHOW="echo"
;;
-showconfig)
showconfigure
exit $status
;;
-shlib)
USE_SHARED_LIB="yes"
;;
-noshlib)
USE_SHARED_LIB="no"
;;
-help)
usage
;;
*\"*)
qarg="'"$arg"'"
allargs="$allargs $qarg"
;;
*\'*)
qarg='\"'"$arg"'\"'
allargs="$allargs $qarg"
;;
*)
allargs="$allargs $qarg"
if test -s "$arg"; then
ext=`expr "$arg" : '.*\(\..*\)'`
if test "x$ext" = "x.c"; then
do_compile="yes"
compile_args="$compile_args $arg"
fname=`basename $arg .c`
link_objs="$link_objs $fname.o"
elif test "x$ext" = "x.o"; then
if test "x$dash_c" = "xyes"; then
compile_args="$compile_args $arg"
else
do_link="yes"
link_objs="$link_objs $arg"
fi
elif test "x$ext" = "x.a"; then
# This is an archive that we're linking in
libraries=" $libraries $arg "
else
compile_args="$compile_args $arg"
link_args="$link_args $arg"
fi
else
compile_args="$compile_args $arg"
link_args="$link_args $arg"
fi
;;
esac
done
if test "$dash_c" = "yes" -a "$do_compile" = no -a "$do_link" = no ; then
# -c was specified. Force do_compile on.
do_compile=yes
fi
if test "x$do_compile" = "xyes"; then
if test "x$dash_c" != "xyes"; then
compile_args="-c $compile_args"
fi
$SHOW $CC -I$includedir $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $compile_args
status=$?
if test "$status" != "0"; then
exit $status
fi
fi
if test "x$do_link" = "xyes"; then
shared_link=""
# conditionally link with the hl library
if test "X$HL" = "Xhl"; then
libraries=" $libraries -lhdf5_hl -lhdf5 "
else
libraries=" $libraries -lhdf5 "
fi
link_args="$link_args -L${libdir}"
case "$kind" in
gcc|linux*)
# MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
# It appears to want none of them specified.
case "$host_os" in
darwin*) flag="" ;;
*) flag="-Wl,-rpath -Wl," ;;
esac
;;
hpux*) flag="-Wl,+b -Wl," ;;
freebsd*|solaris*) flag="-R" ;;
rs6000*|aix*) flag="-L" ;;
sgi) flag="-rpath " ;;
*) flag="" ;;
esac
if test -n "$flag"; then
shared_link="${flag}${libdir}"
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
# The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static
# compile though, so change it to the static version (.a) of the library.
new_libraries=""
for lib in $libraries; do
case "$lib" in
-lhdf5)
new_libraries="$new_libraries ${libdir}/libhdf5.a"
;;
-lhdf5_hl)
new_libraries="$new_libraries ${libdir}/libhdf5_hl.a"
;;
*)
new_libraries="$new_libraries $lib"
;;
esac
done
libraries="$new_libraries"
fi
for lib in $libraries; do
if echo $link_args | grep " $lib " > /dev/null ||
echo $link_args | grep " $lib$" > /dev/null; then
:
else
link_args="$link_args $lib "
fi
done
# The LIBS are just a bunch of -l* libraries necessary for the HDF5
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
$SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link
status=$?
fi
exit $status

@ -0,0 +1,215 @@
#! /bin/sh
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
## Update HDF5 compiler tools after the HDF5 software has been installed ##
## in a new location. ##
## For help page, use "h5redeploy -help" ##
## ##
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Function definitions
# show help page
usage() {
# A wonderfully informative "usage" message.
echo "usage: $prog_name [OPTIONS]"
echo " OPTIONS:"
echo " -help|help This help message"
echo " -echo Show all the shell commands executed"
echo " -force No prompt, just do it"
echo " -prefix=DIR New directory to find HDF5 lib/ and include/"
echo " subdirectories [default: current directory]"
echo " -exec-prefix=DIR New directory to find HDF5 lib/"
echo " subdirectory [default: <prefix>]"
echo " -libdir=DIR New directory for the HDF5 lib directory"
echo " [default: <exec-prefix>/lib]"
echo " -includedir=DIR New directory for the HDF5 header files"
echo " [default: <prefix>/include]"
echo " -tool=TOOL Tool to update. TOOL must be in the current"
echo " directory and writable. [default: $h5tools]"
echo " -show Show the commands without executing them"
echo " "
exit $EXIT_FAILURE
}
# display variable values
dump_vars(){
echo "====Showing all variable values====="
echo prefix=$prefix
echo h5tools=$h5tools
echo "====End Showing====="
}
# show actions to be taken
show_action()
{
echo "Update the following tools because they are now installed at a new directory"
for t in $foundtools; do
echo "${t}:"
echo " current setting=`sed -e '/^prefix=/s/prefix=//p' -e d $t`"
echo " new setting="\""$prefix"\"
done
}
# Report Error message
ERROR()
{
echo "***ERROR***"
echo "$1"
}
# Main
#
############################################################################
## Installation directories: ##
## prefix architecture-independent files. ##
## exec_prefix architecture-dependent files, default is <prefix>. ##
## libdir libraries, default is <exec_prefix>/lib. ##
## includedir header files, default is <prefix/include>. ##
## Not used here: ##
## bindir executables, <exec_prefix/bin>. ##
############################################################################
# Initialization
h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools
foundtools= # tools found and will be modified
fmode= # force mode, default is off
prefix=
exec_prefix=
libdir=
includedir=
# Parse options
for arg in $@ ; do
case "$arg" in
-prefix=*)
prefix="`echo $arg | cut -f2 -d=`"
;;
-exec-prefix=*)
exec_prefix="`echo $arg | cut -f2 -d=`"
;;
-libdir=*)
libdir="`echo $arg | cut -f2 -d=`"
;;
-includedir=*)
includedir="`echo $arg | cut -f2 -d=`"
;;
-echo)
set -x
;;
-show)
SHOW="echo"
;;
-tool=*)
h5tools="`echo $arg | cut -f2 -d=`"
;;
-help|help)
usage
;;
-force)
fmode=yes
;;
*)
ERROR "Unknown Option($arg)"
usage
exit $EXIT_FAILURE
;;
esac
done
# Set to default value, one above where i am, if not given by user
if [ -z "$prefix" ]; then
prefix=`(cd ..;pwd)`
fi
if [ -z "$exec_prefix" ]; then
exec_prefix='${prefix}' # use single quotes to prevent expansion of $
fi
if [ -z "$libdir" ]; then
libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $
fi
if [ -z "$includedir" ]; then
includedir='${prefix}'/include # use single quotes to prevent expansion of $
fi
for x in $h5tools; do
if [ -f $x ]; then
foundtools="$foundtools $x"
if [ ! -w $x ]; then
ERROR "h5tool($x) is not writable"
exit $EXIT_FAILURE
fi
fi
done
if [ -z "$foundtools" ]; then
ERROR "found no tools to modify"
exit $EXIT_FAILURE
fi
# Show actions to be taken and get consent
show_action
# Ask confirmation unless fmode is on
if [ x-$fmode = x- ]; then
echo "Continue? (yes/no)"
read ansx
ans=`echo $ansx | tr "[A-Z]" "[a-z]"`
if [ x-$ans != x-yes ]; then
echo ABORT. No tools changed.
exit $EXIT_FAILURE
fi
fi
# Create the update commands
CMDFILE=/tmp/h5redeploy.$$
touch $CMDFILE
chmod 0600 $CMDFILE
echo "/^prefix=/c" >> $CMDFILE
echo prefix=\""$prefix"\" >> $CMDFILE
echo . >> $CMDFILE
echo "/^exec_prefix=/c" >> $CMDFILE
echo exec_prefix=\""$exec_prefix"\" >> $CMDFILE
echo . >> $CMDFILE
echo "/^libdir=/c" >> $CMDFILE
echo libdir=\""$libdir"\" >> $CMDFILE
echo . >> $CMDFILE
echo "/^includedir=/c" >> $CMDFILE
echo includedir=\""$includedir"\" >> $CMDFILE
echo . >> $CMDFILE
(echo w; echo q) >> $CMDFILE
# Update them
if [ "$SHOW" = "echo" ]; then
echo "===Update commands are:===="
cat $CMDFILE
echo "===End Update commands====="
fi
for t in $foundtools; do
echo Update $t ...
COMMAND="ed - $t"
if [ "$SHOW" = "echo" ]; then
echo $COMMAND
else
$COMMAND < $CMDFILE
fi
done
# Cleanup
rm -f $CMDFILE
exit $EXIT_SUCCESS

@ -0,0 +1,781 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5ACpublic.h
* Jul 10 1997
* Robb Matzke
*
* Purpose: Public include file for cache functions.
*
*-------------------------------------------------------------------------
*/
#ifndef H5ACpublic_H
#define H5ACpublic_H
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Cpublic.h"
/****************************************************************************
*
* structure H5AC_cache_config_t
*
* H5AC_cache_config_t is a public structure intended for use in public APIs.
* At least in its initial incarnation, it is basically a copy of struct
* H5C_auto_size_ctl_t, minus the report_fcn field, and plus the
* dirty_bytes_threshold field.
*
* The report_fcn field is omitted, as including it would require us to
* make H5C_t structure public.
*
* The dirty_bytes_threshold field does not appear in H5C_auto_size_ctl_t,
* as synchronization between caches on different processes is handled at
* the H5AC level, not at the level of H5C. Note however that there is
* considerable interaction between this value and the other fields in this
* structure.
*
* Similarly, the open_trace_file, close_trace_file, and trace_file_name
* fields do not appear in H5C_auto_size_ctl_t, as most trace file
* issues are handled at the H5AC level. The one exception is storage of
* the pointer to the trace file, which is handled by H5C.
*
* The structure is in H5ACpublic.h as we may wish to allow different
* configuration options for metadata and raw data caches.
*
* The fields of the structure are discussed individually below:
*
* version: Integer field containing the version number of this version
* of the H5AC_cache_config_t structure. Any instance of
* H5AC_cache_config_t passed to the cache must have a known
* version number, or an error will be flagged.
*
* rpt_fcn_enabled: Boolean field used to enable and disable the default
* reporting function. This function is invoked every time the
* automatic cache resize code is run, and reports on its activities.
*
* This is a debugging function, and should normally be turned off.
*
* open_trace_file: Boolean field indicating whether the trace_file_name
* field should be used to open a trace file for the cache.
*
* *** DEPRECATED *** Use H5Fstart/stop logging functions instead
*
* The trace file is a debugging feature that allow the capture of
* top level metadata cache requests for purposes of debugging and/or
* optimization. This field should normally be set to FALSE, as
* trace file collection imposes considerable overhead.
*
* This field should only be set to TRUE when the trace_file_name
* contains the full path of the desired trace file, and either
* there is no open trace file on the cache, or the close_trace_file
* field is also TRUE.
*
* close_trace_file: Boolean field indicating whether the current trace
* file (if any) should be closed.
*
* *** DEPRECATED *** Use H5Fstart/stop logging functions instead
*
* See the above comments on the open_trace_file field. This field
* should be set to FALSE unless there is an open trace file on the
* cache that you wish to close.
*
* trace_file_name: Full path of the trace file to be opened if the
* open_trace_file field is TRUE.
*
* *** DEPRECATED *** Use H5Fstart/stop logging functions instead
*
* In the parallel case, an ascii representation of the mpi rank of
* the process will be appended to the file name to yield a unique
* trace file name for each process.
*
* The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN
* characters.
*
* evictions_enabled: Boolean field used to either report the current
* evictions enabled status of the cache, or to set the cache's
* evictions enabled status.
*
* In general, the metadata cache should always be allowed to
* evict entries. However, in some cases it is advantageous to
* disable evictions briefly, and thereby postpone metadata
* writes. However, this must be done with care, as the cache
* can grow quickly. If you do this, re-enable evictions as
* soon as possible and monitor cache size.
*
* At present, evictions can only be disabled if automatic
* cache resizing is also disabled (that is, ( incr_mode ==
* H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There
* is no logical reason why this should be so, but it simplifies
* implementation and testing, and I can't think of any reason
* why it would be desirable. If you can think of one, I'll
* revisit the issue.
*
* set_initial_size: Boolean flag indicating whether the size of the
* initial size of the cache is to be set to the value given in
* the initial_size field. If set_initial_size is FALSE, the
* initial_size field is ignored.
*
* initial_size: If enabled, this field contain the size the cache is
* to be set to upon receipt of this structure. Needless to say,
* initial_size must lie in the closed interval [min_size, max_size].
*
* min_clean_fraction: double in the range 0 to 1 indicating the fraction
* of the cache that is to be kept clean. This field is only used
* in parallel mode. Typical values are 0.1 to 0.5.
*
* max_size: Maximum size to which the cache can be adjusted. The
* supplied value must fall in the closed interval
* [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must
* be greater than or equal to min_size.
*
* min_size: Minimum size to which the cache can be adjusted. The
* supplied value must fall in the closed interval
* [H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]. Also, min_size
* must be less than or equal to max_size.
*
* epoch_length: Number of accesses on the cache over which to collect
* hit rate stats before running the automatic cache resize code,
* if it is enabled.
*
* At the end of an epoch, we discard prior hit rate data and start
* collecting afresh. The epoch_length must lie in the closed
* interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH].
*
*
* Cache size increase control fields:
*
* incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
* value indicates how we determine whether the cache size should be
* increased. At present there are two possible values:
*
* H5C_incr__off: Don't attempt to increase the size of the cache
* automatically.
*
* When this increment mode is selected, the remaining fields
* in the cache size increase section ar ignored.
*
* H5C_incr__threshold: Attempt to increase the size of the cache
* whenever the average hit rate over the last epoch drops
* below the value supplied in the lower_hr_threshold
* field.
*
* Note that this attempt will fail if the cache is already
* at its maximum size, or if the cache is not already using
* all available space.
*
* Note that you must set decr_mode to H5C_incr__off if you
* disable metadata cache entry evictions.
*
* lower_hr_threshold: Lower hit rate threshold. If the increment mode
* (incr_mode) is H5C_incr__threshold and the hit rate drops below the
* value supplied in this field in an epoch, increment the cache size by
* size_increment. Note that cache size may not be incremented above
* max_size, and that the increment may be further restricted by the
* max_increment field if it is enabled.
*
* When enabled, this field must contain a value in the range [0.0, 1.0].
* Depending on the incr_mode selected, it may also have to be less than
* upper_hr_threshold.
*
* increment: Double containing the multiplier used to derive the new
* cache size from the old if a cache size increment is triggered.
* The increment must be greater than 1.0, and should not exceed 2.0.
*
* The new cache size is obtained my multiplying the current max cache
* size by the increment, and then clamping to max_size and to stay
* within the max_increment as necessary.
*
* apply_max_increment: Boolean flag indicating whether the max_increment
* field should be used to limit the maximum cache size increment.
*
* max_increment: If enabled by the apply_max_increment field described
* above, this field contains the maximum number of bytes by which the
* cache size can be increased in a single re-size.
*
* flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
* type whose value indicates whether and by which algorithm we should
* make flash increases in the size of the cache to accommodate insertion
* of large entries and large increases in the size of a single entry.
*
* The addition of the flash increment mode was occasioned by performance
* problems that appear when a local heap is increased to a size in excess
* of the current cache size. While the existing re-size code dealt with
* this eventually, performance was very bad for the remainder of the
* epoch.
*
* At present, there are two possible values for the flash_incr_mode:
*
* H5C_flash_incr__off: Don't perform flash increases in the size of
* the cache.
*
* H5C_flash_incr__add_space: Let x be either the size of a newly
* newly inserted entry, or the number of bytes by which the
* size of an existing entry has been increased.
*
* If
* x > flash_threshold * current max cache size,
*
* increase the current maximum cache size by x * flash_multiple
* less any free space in the cache, and star a new epoch. For
* now at least, pay no attention to the maximum increment.
*
* In both of the above cases, the flash increment pays no attention to
* the maximum increment (at least in this first incarnation), but DOES
* stay within max_size.
*
* With a little thought, it should be obvious that the above flash
* cache size increase algorithm is not sufficient for all circumstances
* -- for example, suppose the user round robins through
* (1/flash_threshold) +1 groups, adding one data set to each on each
* pass. Then all will increase in size at about the same time, requiring
* the max cache size to at least double to maintain acceptable
* performance, however the above flash increment algorithm will not be
* triggered.
*
* Hopefully, the add space algorithms detailed above will be sufficient
* for the performance problems encountered to date. However, we should
* expect to revisit the issue.
*
* flash_multiple: Double containing the multiple described above in the
* H5C_flash_incr__add_space section of the discussion of the
* flash_incr_mode section. This field is ignored unless flash_incr_mode
* is H5C_flash_incr__add_space.
*
* flash_threshold: Double containing the factor by which current max cache
* size is multiplied to obtain the size threshold for the add_space flash
* increment algorithm. The field is ignored unless flash_incr_mode is
* H5C_flash_incr__add_space.
*
*
* Cache size decrease control fields:
*
* decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
* value indicates how we determine whether the cache size should be
* decreased. At present there are four possibilities.
*
* H5C_decr__off: Don't attempt to decrease the size of the cache
* automatically.
*
* When this increment mode is selected, the remaining fields
* in the cache size decrease section are ignored.
*
* H5C_decr__threshold: Attempt to decrease the size of the cache
* whenever the average hit rate over the last epoch rises
* above the value supplied in the upper_hr_threshold
* field.
*
* H5C_decr__age_out: At the end of each epoch, search the cache for
* entries that have not been accessed for at least the number
* of epochs specified in the epochs_before_eviction field, and
* evict these entries. Conceptually, the maximum cache size
* is then decreased to match the new actual cache size. However,
* this reduction may be modified by the min_size, the
* max_decrement, and/or the empty_reserve.
*
* H5C_decr__age_out_with_threshold: Same as age_out, but we only
* attempt to reduce the cache size when the hit rate observed
* over the last epoch exceeds the value provided in the
* upper_hr_threshold field.
*
* Note that you must set decr_mode to H5C_decr__off if you
* disable metadata cache entry evictions.
*
* upper_hr_threshold: Upper hit rate threshold. The use of this field
* varies according to the current decr_mode:
*
* H5C_decr__off or H5C_decr__age_out: The value of this field is
* ignored.
*
* H5C_decr__threshold: If the hit rate exceeds this threshold in any
* epoch, attempt to decrement the cache size by size_decrement.
*
* Note that cache size may not be decremented below min_size.
*
* Note also that if the upper_threshold is 1.0, the cache size
* will never be reduced.
*
* H5C_decr__age_out_with_threshold: If the hit rate exceeds this
* threshold in any epoch, attempt to reduce the cache size
* by evicting entries that have not been accessed for more
* than the specified number of epochs.
*
* decrement: This field is only used when the decr_mode is
* H5C_decr__threshold.
*
* The field is a double containing the multiplier used to derive the
* new cache size from the old if a cache size decrement is triggered.
* The decrement must be in the range 0.0 (in which case the cache will
* try to contract to its minimum size) to 1.0 (in which case the
* cache will never shrink).
*
* apply_max_decrement: Boolean flag used to determine whether decrements
* in cache size are to be limited by the max_decrement field.
*
* max_decrement: Maximum number of bytes by which the cache size can be
* decreased in a single re-size. Note that decrements may also be
* restricted by the min_size of the cache, and (in age out modes) by
* the empty_reserve field.
*
* epochs_before_eviction: Integer field used in H5C_decr__age_out and
* H5C_decr__age_out_with_threshold decrement modes.
*
* This field contains the number of epochs an entry must remain
* unaccessed before it is evicted in an attempt to reduce the
* cache size. If applicable, this field must lie in the range
* [1, H5C__MAX_EPOCH_MARKERS].
*
* apply_empty_reserve: Boolean field controlling whether the empty_reserve
* field is to be used in computing the new cache size when the
* decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
*
* empty_reserve: To avoid a constant racheting down of cache size by small
* amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
* modes, this field allows one to require that any cache size
* reductions leave the specified fraction of unused space in the cache.
*
* The value of this field must be in the range [0.0, 1.0]. I would
* expect typical values to be in the range of 0.01 to 0.1.
*
*
* Parallel Configuration Fields:
*
* In PHDF5, all operations that modify metadata must be executed collectively.
*
* We used to think that this was enough to ensure consistency across the
* metadata caches, but since we allow processes to read metadata individually,
* the order of dirty entries in the LRU list can vary across processes,
* which can result in inconsistencies between the caches.
*
* PHDF5 uses several strategies to prevent such inconsistencies in metadata,
* all of which use the fact that the same stream of dirty metadata is seen
* by all processes for purposes of synchronization. This is done by
* having each process count the number of bytes of dirty metadata generated,
* and then running a "sync point" whenever this count exceeds a user
* specified threshold (see dirty_bytes_threshold below).
*
* The current metadata write strategy is indicated by the
* metadata_write_strategy field. The possible values of this field, along
* with the associated metadata write strategies are discussed below.
*
* dirty_bytes_threshold: Threshold of dirty byte creation used to
* synchronize updates between caches. (See above for outline and
* motivation.)
*
* This value MUST be consistent across all processes accessing the
* file. This field is ignored unless HDF5 has been compiled for
* parallel.
*
* metadata_write_strategy: Integer field containing a code indicating the
* desired metadata write strategy. The valid values of this field
* are enumerated and discussed below:
*
*
* H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
*
* When metadata_write_strategy is set to this value, only process
* zero is allowed to write dirty metadata to disk. All other
* processes must retain dirty metadata until they are informed at
* a sync point that the dirty metadata in question has been written
* to disk.
*
* When the sync point is reached (or when there is a user generated
* flush), process zero flushes sufficient entries to bring it into
* compliance with its min clean size (or flushes all dirty entries in
* the case of a user generated flush), broad casts the list of
* entries just cleaned to all the other processes, and then exits
* the sync point.
*
* Upon receipt of the broadcast, the other processes mark the indicated
* entries as clean, and leave the sync point as well.
*
*
* H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
*
* In the distributed metadata write strategy, process zero still makes
* the decisions as to what entries should be flushed, but the actual
* flushes are distributed across the processes in the computation to
* the extent possible.
*
* In this strategy, when a sync point is triggered (either by dirty
* metadata creation or manual flush), all processes enter a barrier.
*
* On the other side of the barrier, process 0 constructs an ordered
* list of the entries to be flushed, and then broadcasts this list
* to the caches in all the processes.
*
* All processes then scan the list of entries to be flushed, flushing
* some, and marking the rest as clean. The algorithm for this purpose
* ensures that each entry in the list is flushed exactly once, and
* all are marked clean in each cache.
*
* Note that in the case of a flush of the cache, no message passing
* is necessary, as all processes have the same list of dirty entries,
* and all of these entries must be flushed. Thus in this case it is
* sufficient for each process to sort its list of dirty entries after
* leaving the initial barrier, and use this list as if it had been
* received from process zero.
*
* To avoid possible messages from the past/future, all caches must
* wait until all caches are done before leaving the sync point.
*
****************************************************************************/
#define H5AC__CURR_CACHE_CONFIG_VERSION 1
#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024
#define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0
#define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1
/**
* H5AC_cache_config_t is a public structure intended for use in public APIs.
* At least in its initial incarnation, it is basically a copy of \c struct
* \c H5C_auto_size_ctl_t, minus the \c report_fcn field, and plus the
* \c dirty_bytes_threshold field.
*
* The \c report_fcn field is omitted, as including it would require us to make
* \c H5C_t structure public.
*
* The \c dirty_bytes_threshold field does not appear in \c H5C_auto_size_ctl_t,
* as synchronization between caches on different processes is handled at the \c
* H5AC level, not at the level of \c H5C. Note however that there is
* considerable interaction between this value and the other fields in this
* structure.
*
* Similarly, the \c open_trace_file, \c close_trace_file, and \c
* trace_file_name fields do not appear in \c H5C_auto_size_ctl_t, as most trace
* file issues are handled at the \c H5AC level. The one exception is storage
* of the pointer to the trace file, which is handled by \c H5C.
*
* The structure is in H5ACpublic.h as we may wish to allow different
* configuration options for metadata and raw data caches.
*/
//! <!-- [H5AC_cache_config_t_snip] -->
typedef struct H5AC_cache_config_t {
/* general configuration fields: */
//! <!-- [H5AC_cache_config_t_general_snip] -->
int version;
/**< Integer field indicating the version of the H5AC_cache_config_t
* in use. This field should be set to #H5AC__CURR_CACHE_CONFIG_VERSION
* (defined in H5ACpublic.h). */
hbool_t rpt_fcn_enabled;
/**< Boolean flag indicating whether the adaptive cache resize report
* function is enabled. This field should almost always be set to disabled
* (0). Since resize algorithm activity is reported via stdout, it MUST be
* set to disabled (0) on Windows machines.\n
* The report function is not supported code, and can be expected to change
* between versions of the library. Use it at your own risk. */
hbool_t open_trace_file;
/**< Boolean field indicating whether the
* \ref H5AC_cache_config_t.trace_file_name "trace_file_name"
* field should be used to open a trace file for the cache.\n
* The trace file is a debugging feature that allows the capture
* of top level metadata cache requests for purposes of debugging
* and/or optimization. This field should normally be set to 0, as
* trace file collection imposes considerable overhead.\n
* This field should only be set to 1 when the
* \ref H5AC_cache_config_t.trace_file_name "trace_file_name"
* contains the full path of the desired trace file, and either
* there is no open trace file on the cache, or the
* \ref H5AC_cache_config_t.close_trace_file "close_trace_file"
* field is also 1.\n
* The trace file feature is unsupported unless used at the
* direction of The HDF Group. It is intended to allow The HDF
* Group to collect a trace of cache activity in cases of occult
* failures and/or poor performance seen in the field, so as to aid
* in reproduction in the lab. If you use it absent the direction
* of The HDF Group, you are on your own. */
hbool_t close_trace_file;
/**< Boolean field indicating whether the current trace file
*(if any) should be closed.\n
* See the above comments on the \ref H5AC_cache_config_t.open_trace_file
* "open_trace_file" field. This field should be set to 0 unless there is
* an open trace file on the cache that you wish to close.\n
* The trace file feature is unsupported unless used at the direction of
* The HDF Group. It is intended to allow The HDF Group to collect a trace
* of cache activity in cases of occult failures and/or poor performance
* seen in the field, so as to aid in reproduction in the lab. If you use
* it absent the direction of The HDF Group, you are on your own. */
char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1];
/**< Full path of the trace file to be opened if the
* \ref H5AC_cache_config_t.open_trace_file "open_trace_file" field is set
* to 1.\n
* In the parallel case, an ascii representation of the MPI rank of the
* process will be appended to the file name to yield a unique trace file
* name for each process.\n
* The length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN
* characters.\n
* The trace file feature is unsupported unless used at the direction of
* The HDF Group. It is intended to allow The HDF Group to collect a trace
* of cache activity in cases of occult failures and/or poor performance
* seen in the field, so as to aid in reproduction in the lab. If you use
* it absent the direction of The HDF Group, you are on your own. */
hbool_t evictions_enabled;
/**< A boolean flag indicating whether evictions from the metadata cache
* are enabled. This flag is initially set to enabled (1).\n
* In rare circumstances, the raw data throughput quirements may be so high
* that the user wishes to postpone metadata writes so as to reserve I/O
* throughput for raw data. The \p evictions_enabled field exists to allow
* this. However, this is an extreme step, and you have no business doing
* it unless you have read the User Guide section on metadata caching, and
* have considered all other options carefully.\n
* The \p evictions_enabled field may not be set to disabled (0)
* unless all adaptive cache resizing code is disabled via the
* \ref H5AC_cache_config_t.incr_mode "incr_mode",
* \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode",
* \ref H5AC_cache_config_t.decr_mode "decr_mode" fields.\n
* When this flag is set to disabled (\c 0), the metadata cache will not
* attempt to evict entries to make space for new entries, and thus will
* grow without bound.\n
* Evictions will be re-enabled when this field is set back to \c 1.
* This should be done as soon as possible. */
hbool_t set_initial_size;
/**< Boolean flag indicating whether the cache should be created
* with a user specified initial size. */
size_t initial_size;
/**< If \ref H5AC_cache_config_t.set_initial_size "set_initial_size"
* is set to 1, \p initial_size must contain he desired initial size in
* bytes. This value must lie in the closed interval
* [ \p min_size, \p max_size ]. (see below) */
double min_clean_fraction;
/**< This field specifies the minimum fraction of the cache
* that must be kept either clean or empty.\n
* The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to
* start in the serial case. In the parallel case, a larger value is needed
* -- see the overview of the metadata cache in the
* Metadata Caching in HDF5 section of the -- <em>\ref UG</em>
* for details. */
size_t max_size;
/**< Upper bound (in bytes) on the range of values that the
* adaptive cache resize code can select as the maximum cache size. */
size_t min_size;
/**< Lower bound (in bytes) on the range of values that the
* adaptive cache resize code can select as the minimum cache * size. */
long int epoch_length;
/**< Number of cache accesses between runs of the adaptive cache resize
* code. 50,000 is a good starting number. */
//! <!-- [H5AC_cache_config_t_general_snip] -->
/* size increase control fields: */
//! <!-- [H5AC_cache_config_t_incr_snip] -->
enum H5C_cache_incr_mode incr_mode;
/**< Enumerated value indicating the operational mode of the automatic
* cache size increase code. At present, only two values listed in
* #H5C_cache_incr_mode are legal. */
double lower_hr_threshold;
/**< Hit rate threshold used by the hit rate threshold cache size
* increment algorithm.\n
* When the hit rate over an epoch is below this threshold and the cache
* is full, the maximum size of the cache is multiplied by increment
* (below), and then clipped as necessary to stay within \p max_size, and
* possibly \p max_increment.\n
* This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good
* place to start. */
double increment;
/**< Factor by which the hit rate threshold cache size increment
* algorithm multiplies the current cache max size to obtain a tentative
* new cache size.\n
* The actual cache size increase will be clipped to satisfy the \p max_size
* specified in the general configuration, and possibly max_increment
* below.\n
* The parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable
* value.\n
* If you set it to 1.0, you will effectively disable cache size increases.
*/
hbool_t apply_max_increment;
/**< Boolean flag indicating whether an upper limit should be applied to
* the size of cache size increases. */
size_t max_increment;
/**< Maximum number of bytes by which cache size can be increased in a
* single step -- if applicable. */
enum H5C_cache_flash_incr_mode flash_incr_mode;
/**< Enumerated value indicating the operational mode of the flash cache
* size increase code. At present, only two listed values in
* #H5C_cache_flash_incr_mode are legal.*/
double flash_multiple;
/**< The factor by which the size of the triggering entry / entry size
* increase is multiplied to obtain the initial cache size increment. This
* increment may be reduced to reflect existing free space in the cache and
* the \p max_size field above.\n
* The parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good
* place to start.\n
* At present, this field must lie in the range [0.1, 10.0]. */
double flash_threshold;
/**< The factor by which the current maximum cache size is multiplied to
* obtain the minimum size entry / entry size increase which may trigger a
* flash cache size increase. \n
* At present, this value must lie in the range [0.1, 1.0]. */
//! <!-- [H5AC_cache_config_t_incr_snip] -->
/* size decrease control fields: */
//! <!-- [H5AC_cache_config_t_decr_snip] -->
enum H5C_cache_decr_mode decr_mode;
/**< Enumerated value indicating the operational mode of the tomatic
* cache size decrease code. At present, the values listed in
* #H5C_cache_decr_mode are legal.*/
double upper_hr_threshold;
/**< Hit rate threshold for the hit rate threshold and ageout with hit
* rate threshold cache size decrement algorithms.\n
* When \p decr_mode is #H5C_decr__threshold, and the hit rate over a given
* epoch exceeds the supplied threshold, the current maximum cache
* size is multiplied by decrement to obtain a tentative new (and smaller)
* maximum cache size.\n
* When \p decr_mode is #H5C_decr__age_out_with_threshold, there is
* no attempt to find and evict aged out entries unless the hit rate in
* the previous epoch exceeded the supplied threshold.\n
* This field must lie in the interval [0.0, 1.0].\n
* For #H5C_incr__threshold, .9995 or .99995 is a good place to start.\n
* For #H5C_decr__age_out_with_threshold, .999 might be more useful.*/
double decrement;
/**< In the hit rate threshold cache size decrease algorithm, this
* parameter contains the factor by which the current max cache size is
* multiplied to produce a tentative new cache size.\n
* The actual cache size decrease will be clipped to satisfy the
* \ref H5AC_cache_config_t.min_size "min_size" specified in the general
* configuration, and possibly \ref H5AC_cache_config_t.max_decrement
* "max_decrement".\n
* The parameter must be be in the interval [0.0, 1.0].\n
* If you set it to 1.0, you will effectively
* disable cache size decreases. 0.9 is a reasonable starting point. */
hbool_t apply_max_decrement;
/**< Boolean flag indicating ether an upper limit should be applied to
* the size of cache size decreases. */
size_t max_decrement;
/**< Maximum number of bytes by which the maximum cache size can be
* decreased in any single step -- if applicable.*/
int epochs_before_eviction;
/**< In the ageout based cache size reduction algorithms, this field
* contains the minimum number of epochs an entry must remain unaccessed in
* cache before the cache size reduction algorithm tries to evict it. 3 is a
* reasonable value. */
hbool_t apply_empty_reserve;
/**< Boolean flag indicating whether the ageout based decrement
* algorithms will maintain a empty reserve when decreasing cache size. */
double empty_reserve;
/**< Empty reserve as a fraction maximum cache size if applicable.\n When
* so directed, the ageout based algorithms will not decrease the maximum
* cache size unless the empty reserve can be met.\n The parameter must lie
* in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to start. */
//! <!-- [H5AC_cache_config_t_decr_snip] -->
/* parallel configuration fields: */
//! <!-- [H5AC_cache_config_t_parallel_snip] -->
size_t dirty_bytes_threshold;
/**< Threshold number of bytes of dirty metadata generation for
* triggering synchronizations of the metadata caches serving the target
* file in the parallel case.\n Synchronization occurs whenever the number
* of bytes of dirty metadata created since the last synchronization exceeds
* this limit.\n This field only applies to the parallel case. While it is
* ignored elsewhere, it can still draw a value out of bounds error.\n It
* must be consistent across all caches on any given file.\n By default,
* this field is set to 256 KB. It shouldn't be more than half the current
* max cache size times the min clean fraction. */
int metadata_write_strategy;
/**< Desired metadata write strategy. The valid values for this field
* are:\n #H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: Specifies the only
* process zero is allowed to write dirty metadata to disk.\n
* #H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: Specifies that process zero
* still makes the decisions as to what entries should be flushed, but the
* actual flushes are distributed across the processes in the computation to
* the extent possible.\n The src/H5ACpublic.h include file in the HDF5
* library has detailed information on each strategy. */
//! <!-- [H5AC_cache_config_t_parallel_snip] -->
} H5AC_cache_config_t;
//! <!-- [H5AC_cache_config_t_snip] -->
#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100
//! <!-- [H5AC_cache_image_config_t_snip] -->
/**
* H5AC_cache_image_config_t is a public structure intended for use in public
* APIs. At least in its initial incarnation, it is a copy of \c struct \c
* H5C_cache_image_ctl_t.
*/
typedef struct H5AC_cache_image_config_t {
int version;
/**< Integer field containing the version number of this version of the \c
* H5C_image_ctl_t structure. Any instance of \c H5C_image_ctl_t passed
* to the cache must have a known version number, or an error will be
* flagged.
*/
hbool_t generate_image;
/**< Boolean flag indicating whether a cache image should be created on file
* close.
*/
hbool_t save_resize_status;
/**< Boolean flag indicating whether the cache image should include the
* adaptive cache resize configuration and status. Note that this field
* is ignored at present.
*/
int entry_ageout;
/**< Integer field indicating the maximum number of times a
* prefetched entry can appear in subsequent cache images. This field
* exists to allow the user to avoid the buildup of infrequently used
* entries in long sequences of cache images.
*
* The value of this field must lie in the range \ref
* H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to \ref
* H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100).
*
* \ref H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit is
* imposed on number of times a prefetched entry can appear in subsequent
* cache images.
*
* A value of 0 prevents prefetched entries from being included in cache
* images.
*
* Positive integers restrict prefetched entries to the specified number
* of appearances.
*
* Note that the number of subsequent cache images that a prefetched entry
* has appeared in is tracked in an 8 bit field. Thus, while \ref
* H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its current
* value, any value in excess of 255 will be the functional equivalent of
* \ref H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE.
*/
} H5AC_cache_image_config_t;
//! <!-- [H5AC_cache_image_config_t_snip] -->
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,59 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5Cpublic.h
* June 4, 2005
* John Mainzer
*
* Purpose: Public include file for cache functions.
*
*-------------------------------------------------------------------------
*/
#ifndef H5Cpublic_H
#define H5Cpublic_H
/* Public headers needed by this file */
#include "H5public.h"
enum H5C_cache_incr_mode {
H5C_incr__off,
/**<Automatic cache size increase is disabled, and the remaining increment fields are ignored.*/
H5C_incr__threshold
/**<Automatic cache size increase is enabled using the hit rate threshold algorithm.*/
};
enum H5C_cache_flash_incr_mode {
H5C_flash_incr__off,
/**<Flash cache size increase is disabled.*/
H5C_flash_incr__add_space
/**<Flash cache size increase is enabled using the add space algorithm.*/
};
enum H5C_cache_decr_mode {
H5C_decr__off,
/**<Automatic cache size decrease is disabled.*/
H5C_decr__threshold,
/**<Automatic cache size decrease is enabled using the hit rate threshold algorithm.*/
H5C_decr__age_out,
/**<Automatic cache size decrease is enabled using the ageout algorithm. */
H5C_decr__age_out_with_threshold
/**<Automatic cache size decrease is enabled using the ageout with hit rate threshold algorithm.*/
};
#endif

@ -0,0 +1,250 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef H5DOpublic_H
#define H5DOpublic_H
#ifdef __cplusplus
extern "C" {
#endif
/** \page H5DO_UG The HDF5 High Level Optimizations
* @todo Under Construction
*/
/**\defgroup H5DO HDF5 Optimizations APIs (H5DO)
*
* <em>Bypassing default HDF5 behavior in order to optimize for specific
* use cases (H5DO)</em>
*
* HDF5 functions described is this section are implemented in the HDF5 High-level
* library as optimized functions. These functions generally require careful setup
* and testing as they enable an application to bypass portions of the HDF5
* librarys I/O pipeline for performance purposes.
*
* These functions are distributed in the standard HDF5 distribution and are
* available any time the HDF5 High-level library is available.
*
* - \ref H5DOappend
* \n Appends data to a dataset along a specified dimension.
* - \ref H5DOread_chunk
* \n Reads a raw data chunk directly from a dataset in a file into a buffer (DEPRECATED)
* - \ref H5DOwrite_chunk
* \n Writes a raw data chunk from a buffer directly to a dataset in a file (DEPRECATED)
*
*/
/*-------------------------------------------------------------------------
*
* "Optimized dataset" routines.
*
*-------------------------------------------------------------------------
*/
/**
* --------------------------------------------------------------------------
* \ingroup H5DO
*
* \brief Appends data to a dataset along a specified dimension.
*
* \param[in] dset_id Dataset identifier
* \param[in] dxpl_id Dataset transfer property list identifier
* \param[in] axis Dataset Dimension (0-based) for the append
* \param[in] extension Number of elements to append for the
* axis-th dimension
* \param[in] memtype The memory datatype identifier
* \param[in] buf Buffer with data for the append
*
* \return \herr_t
*
* \details The H5DOappend() routine extends a dataset by \p extension
* number of elements along a dimension specified by a
* dimension \p axis and writes \p buf of elements to the
* dataset. Dimension \p axis is 0-based. Elements type
* is described by \p memtype.
*
* This routine combines calling H5Dset_extent(),
* H5Sselect_hyperslab(), and H5Dwrite() into a single routine
* that simplifies application development for the common case
* of appending elements to an existing dataset.
*
* For a multi-dimensional dataset, appending to one dimension
* will write a contiguous hyperslab over the other dimensions.
* For example, if a 3-D dataset has dimension sizes (3, 5, 8),
* extending the 0th dimension (currently of size 3) by 3 will
* append 3*5*8 = 120 elements (which must be pointed to by the
* \p buffer parameter) to the dataset, making its final
* dimension sizes (6, 5, 8).
*
* If a dataset has more than one unlimited dimension, any of
* those dimensions may be appended to, although only along
* one dimension per call to H5DOappend().
*
* \since 1.10.0
*
*/
H5_HLDLL herr_t H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t memtype,
const void *buf);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Compatibility wrappers for functionality moved to H5D */
/**
* --------------------------------------------------------------------------
* \ingroup H5DO
*
* \brief Writes a raw data chunk from a buffer directly to a dataset in a file.
*
* \param[in] dset_id Identifier for the dataset to write to
* \param[in] dxpl_id Transfer property list identifier for
* this I/O operation
* \param[in] filters Mask for identifying the filters in use
* \param[in] offset Logical position of the chunks first element
* in the dataspace
* \param[in] data_size Size of the actual data to be written in bytes
* \param[in] buf Buffer containing data to be written to the chunk
*
* \return \herr_t
*
* \deprecated This function was deprecated in favor of the function
* H5Dwrite_chunk() of HDF5-1.10.3.
* The functionality of H5DOwrite_chunk() was moved
* to H5Dwrite_chunk().
* \deprecated For compatibility, this API call has been left as a stub which
* simply calls H5Dwrite_chunk(). New code should use H5Dwrite_chunk().
*
* \details The H5DOwrite_chunk() writes a raw data chunk as specified by its
* logical \p offset in a chunked dataset \p dset_id from the application
* memory buffer \p buf to the dataset in the file. Typically, the data
* in \p buf is preprocessed in memory by a custom transformation, such as
* compression. The chunk will bypass the librarys internal data
* transfer pipeline, including filters, and will be written directly to the file.
*
* \p dxpl_id is a data transfer property list identifier.
*
* \p filters is a mask providing a record of which filters are used
* with the chunk. The default value of the mask is zero (\c 0),
* indicating that all enabled filters are applied. A filter is skipped
* if the bit corresponding to the filters position in the pipeline
* (<tt>0 position < 32</tt>) is turned on. This mask is saved
* with the chunk in the file.
*
* \p offset is an array specifying the logical position of the first
* element of the chunk in the datasets dataspace. The length of the
* offset array must equal the number of dimensions, or rank, of the
* dataspace. The values in \p offset must not exceed the dimension limits
* and must specify a point that falls on a dataset chunk boundary.
*
* \p data_size is the size in bytes of the chunk, representing the number of
* bytes to be read from the buffer \p buf. If the data chunk has been
* precompressed, \p data_size should be the size of the compressed data.
*
* \p buf is the memory buffer containing data to be written to the chunk in the file.
*
* \attention Exercise caution when using H5DOread_chunk() and H5DOwrite_chunk(),
* as they read and write data chunks directly in a file.
* H5DOwrite_chunk() bypasses hyperslab selection, the conversion of data
* from one datatype to another, and the filter pipeline to write the chunk.
* Developers should have experience with these processes before
* using this function. Please see
* <a href="https://portal.hdfgroup.org/display/HDF5/Using+the+Direct+Chunk+Write+Function">
* Using the Direct Chunk Write Function</a>
* for more information.
*
* \note H5DOread_chunk() and H5DOwrite_chunk() are not
* supported under parallel and do not support variable length types.
*
* \par Example
* The following code illustrates the use of H5DOwrite_chunk to write
* an entire dataset, chunk by chunk:
* \snippet H5DO_examples.c H5DOwrite
*
* \version 1.10.3 Function deprecated in favor of H5Dwrite_chunk.
*
* \since 1.8.11
*/
H5_HLDLL herr_t H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset,
size_t data_size, const void *buf);
/**
* --------------------------------------------------------------------------
* \ingroup H5DO
*
* \brief Reads a raw data chunk directly from a dataset in a file into a buffer.
*
* \param[in] dset_id Identifier for the dataset to be read
* \param[in] dxpl_id Transfer property list identifier for
* this I/O operation
* \param[in] offset Logical position of the chunks first
element in the dataspace
* \param[in,out] filters Mask for identifying the filters used
* with the chunk
* \param[in] buf Buffer containing the chunk read from
* the dataset
*
* \return \herr_t
*
* \deprecated This function was deprecated in favor of the function
* H5Dread_chunk() as of HDF5-1.10.3.
* In HDF5 1.10.3, the functionality of H5DOread_chunk()
* was moved to H5Dread_chunk().
* \deprecated For compatibility, this API call has been left as a stub which
* simply calls H5Dread_chunk(). New code should use H5Dread_chunk().
*
* \details The H5DOread_chunk() reads a raw data chunk as specified
* by its logical \p offset in a chunked dataset \p dset_id
* from the dataset in the file into the application memory
* buffer \p buf. The data in \p buf is read directly from the file
* bypassing the librarys internal data transfer pipeline,
* including filters.
*
* \p dxpl_id is a data transfer property list identifier.
*
* The mask \p filters indicates which filters are used with the
* chunk when written. A zero value indicates that all enabled filters
* are applied on the chunk. A filter is skipped if the bit corresponding
* to the filters position in the pipeline
* (<tt>0 position < 32</tt>) is turned on.
*
* \p offset is an array specifying the logical position of the first
* element of the chunk in the datasets dataspace. The length of the
* offset array must equal the number of dimensions, or rank, of the
* dataspace. The values in \p offset must not exceed the dimension
* limits and must specify a point that falls on a dataset chunk boundary.
*
* \p buf is the memory buffer containing the chunk read from the dataset
* in the file.
*
* \par Example
* The following code illustrates the use of H5DOread_chunk()
* to read a chunk from a dataset:
* \snippet H5DO_examples.c H5DOread
*
* \version 1.10.3 Function deprecated in favor of H5Dread_chunk.
*
* \since 1.10.2, 1.8.19
*/
H5_HLDLL herr_t H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters /*out*/,
void *buf /*out*/);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,413 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef H5DSpublic_H
#define H5DSpublic_H
#define DIMENSION_SCALE_CLASS "DIMENSION_SCALE"
#define DIMENSION_LIST "DIMENSION_LIST"
#define REFERENCE_LIST "REFERENCE_LIST"
#define DIMENSION_LABELS "DIMENSION_LABELS"
/**
* \brief Prototype for H5DSiterate_scales() operator
*
*/
//! <!-- [H5DS_iterate_t_snip] -->
typedef herr_t (*H5DS_iterate_t)(hid_t dset, unsigned dim, hid_t scale, void *visitor_data);
//! <!-- [H5DS_iterate_t_snip] -->
#ifdef __cplusplus
extern "C" {
#endif
/** \page H5DS_UG The HDF5 High Level Dimension Scales
* @todo Under Construction
*/
/**\defgroup H5DS HDF5 Dimension Scales APIs (H5DS)
*
* <em>Creating and manipulating HDF5 datasets that are associated with
* the dimension of another HDF5 dataset (H5DS)</em>
*
* \note \Bold{Programming hints:}
* \note To use any of these functions or subroutines,
* you must first include the relevant include file (C) or
* module (Fortran) in your application.
* \note The following line includes the HDF5 Dimension Scale package,
* H5DS, in C applications:
* \code #include "hdf5_hl.h" \endcode
* \note This line includes the H5DS module in Fortran applications:
* \code use h5ds \endcode
*
* - \ref H5DSwith_new_ref
* \n Determines if new references are used with dimension scales.
* - \ref H5DSattach_scale
* \n Attach dimension scale dsid to dimension idx of dataset did.
* - \ref H5DSdetach_scale
* \n Detach dimension scale dsid from the dimension idx of Dataset did.
* - \ref H5DSget_label
* \n Read the label for dimension idx of did into buffer label.
* - \ref H5DSget_num_scales
* \n Determines how many Dimension Scales are attached
* to dimension idx of did.
* - \ref H5DSget_scale_name
* \n Retrieves name of scale did into buffer name.
* - \ref H5DSis_attached
* \n Report if dimension scale dsid is currently attached
* to dimension idx of dataset did.
* - \ref H5DSis_scale
* \n Determines whether dset is a Dimension Scale.
* - \ref H5DSiterate_scales
* \n Iterates the operation visitor through the scales
* attached to dimension dim.
* - \ref H5DSset_label
* \n Set label for the dimension idx of did to the value label.
* - \ref H5DSset_scale
* \n Convert dataset dsid to a dimension scale,
* with optional name, dimname.
*
*/
/* THIS IS A NEW ROUTINE NOT ON OLD PORTAL */
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Determines if new references are used with dimension scales.
*
* \param[in] obj_id Object identifier
* \param[out] with_new_ref New references are used or not
*
* \return \herr_t
*
* \details H5DSwith_new_ref() takes any object identifier and checks
* if new references are used for dimension scales. Currently,
* new references are used when non-native VOL connector is
* used or when H5_DIMENSION_SCALES_WITH_NEW_REF is set up
* via configure option.
*
*/
H5_HLDLL herr_t H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Attach dimension scale \p dsid to dimension \p idx of
* dataset did.
*
* \param[in] did The dataset
* \param[in] dsid The scale to be attached
* \param[in] idx The dimension of \p did that \p dsid is associated with
*
* \return \herr_t
*
* \details Define Dimension Scale \p dsid to be associated with
* dimension \p idx of dataset \p did.
*
* Entries are created in the #DIMENSION_LIST and
* #REFERENCE_LIST attributes, as defined in section 4.2 of
* <a href="https://support.hdfgroup.org/HDF5/doc/HL/H5DS_Spec.pdf">
* HDF5 Dimension Scale Specification</a>.
*
* Fails if:
* - Bad arguments
* - If \p dsid is not a Dimension Scale
* - If \p did is a Dimension Scale
* (A Dimension Scale cannot have scales.)
*
* \note The Dimension Scale \p dsid can be attached to the
* same dimension more than once, which has no effect.
*/
H5_HLDLL herr_t H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Detach dimension scale \p dsid from the dimension \p idx of dataset \p did.
*
* \param[in] did The dataset
* \param[in] dsid The scale to be detached
* \param[in] idx The dimension of \p did to detach
*
* \return \herr_t
*
* \details If possible, deletes association of Dimension Scale \p dsid with
* dimension \p idx of dataset \p did. This deletes the entries in the
* #DIMENSION_LIST and #REFERENCE_LIST attributes,
* as defined in section 4.2 of
* <a href="https://support.hdfgroup.org/HDF5/doc/HL/H5DS_Spec.pdf">
* HDF5 Dimension Scale Specification</a>.
*
* Fails if:
* - Bad arguments
* - The dataset \p did or \p dsid do not exist
* - The \p dsid is not a Dimension Scale
* - \p dsid is not attached to \p did
*
* \note A scale may be associated with more than dimension of the
* same dataset. If so, the detach operation only deletes one
* of the associations, for \p did.
*
*/
H5_HLDLL herr_t H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Convert dataset \p dsid to a dimension scale,
* with optional name, \p dimname.
*
* \param[in] dsid The dataset to be made a Dimemsion Scale
* \param[in] dimname The dimension name (optional), NULL if the
* dimension has no name.
*
* \return \herr_t
*
* \details The dataset \p dsid is converted to a Dimension Scale dataset,
* as defined above. Creates the CLASS attribute, set to the value
* "DIMENSION_SCALE" and an empty #REFERENCE_LIST attribute,
* as described in
* <a href="https://support.hdfgroup.org/HDF5/doc/HL/H5DS_Spec.pdf">
* HDF5 Dimension Scale Specification</a>.
* (PDF, see section 4.2).
*
* If \p dimname is specified, then an attribute called NAME
* is created, with the value \p dimname.
*
* Fails if:
* - Bad arguments
* - If \p dsid is already a scale
* - If \p dsid is a dataset which already has dimension scales
*
* If the dataset was created with the Table, Image, or Palette interface [9],
* it is not recommended to convert to a Dimension Scale.
* (These Datasets will have a CLASS Table, Image, or Palette.)
*
* \todo what is [9] after Palette interface?
*/
H5_HLDLL herr_t H5DSset_scale(hid_t dsid, const char *dimname);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Determines how many Dimension Scales are attached
* to dimension \p idx of \p did.
*
* \param[in] did The dataset to query
* \param[in] idx The dimension of \p did to query
*
* \return Returns the number of Dimension Scales associated
* with \p did, if successful, otherwise returns a
* negative value.
*
* \details H5DSget_num_scales() determines how many Dimension
* Scales are attached to dimension \p idx of
* dataset \p did.
*
*/
H5_HLDLL int H5DSget_num_scales(hid_t did, unsigned int idx);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Set label for the dimension \p idx of \p did
* to the value \p label.
*
* \param[in] did The dataset
* \param[in] idx The dimension
* \param[in] label The label
*
* \return \herr_t
*
* \details Sets the #DIMENSION_LABELS for dimension \p idx of
* dataset \p did. If the dimension had a label,
* the new value replaces the old.
*
* Fails if:
* - Bad arguments
*
*/
H5_HLDLL herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Read the label for dimension \p idx of \p did into buffer \p label.
*
* \param[in] did The dataset
* \param[in] idx The dimension
* \param[out] label The label
* \param[in] size The length of the label buffer
*
* \return Upon success, size of label or zero if no label found.
* Negative if fail.
*
* \details Returns the value of the #DIMENSION_LABELS for
* dimension \p idx of dataset \p did, if set.
* Up to \p size characters of the name are copied into
* the buffer \p label. If the label is longer than
* \p size, it will be truncated to fit. The parameter
* \p size is set to the size of the returned \p label.
*
* If \p did has no label, the return value of
* \p label is NULL.
*
* Fails if:
* - Bad arguments
*
*/
H5_HLDLL ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Retrieves name of scale \p did into buffer \p name.
*
* \param[in] did Dimension scale identifier
* \param[out] name Buffer to contain the returned name
* \param[in] size Size in bytes, of the \p name buffer
*
* \return Upon success, the length of the scale name or zero if no name found.
* Negative if fail.
*
* \details H5DSget_scale_name() retrieves the name attribute
* for scale \p did.
*
* Up to \p size characters of the scale name are returned
* in \p name; additional characters, if any, are not returned
* to the user application.
*
* If the length of the name, which determines the required value of
* \p size, is unknown, a preliminary H5DSget_scale_name() call can
* be made by setting \p name to NULL. The return value of this call
* will be the size of the scale name; that value plus one (1) can then
* be assigned to \p size for a second H5DSget_scale_name() call,
* which will retrieve the actual name. (The value passed in with the
* parameter \p size must be one greater than size in bytes of the actual
* name in order to accommodate the null terminator;
* if \p size is set to the exact size of the name, the last byte
* passed back will contain the null terminator and the last character
* will be missing from the name passed back to the calling application.)
*/
H5_HLDLL ssize_t H5DSget_scale_name(hid_t did, char *name, size_t size);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Determines whether \p did is a Dimension Scale.
*
* \param[in] did The dataset to query
*
* \return \htri_t
*
* \details H5DSis_scale() determines if \p did is a Dimension Scale,
* i.e., has class="DIMENSION_SCALE").
*
*/
H5_HLDLL htri_t H5DSis_scale(hid_t did);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Iterates the operation visitor through the scales
* attached to dimension \p dim.
*
* \param[in] did The dataset
* \param[in] dim The dimension of dataset \p did
* \param[in,out] idx Input the index to start iterating,
* output the next index to visit.
* If NULL, start at the first position.
* \param[in] visitor The visitor function
* \param[in] visitor_data Arbitrary data to pass to the
* visitor function
*
* \return Returns the return value of the last operator if it was
* non-zero, or zero if all scales were processed.
*
* \details H5DSiterate_scales() iterates over the scales attached to
* dimension \p dim of dataset \p did. For each scale in the
* list, the \p visitor_data and some additional information,
* specified below, are passed to the \p visitor function.
* The iteration begins with the \p idx object in the
* group and the next element to be processed by the operator
* is returned in \p idx. If \p idx is NULL, then the
* iterator starts at the first group member; since no
* stopping point is returned in this case,
* the iterator cannot be restarted if one of the calls
* to its operator returns non-zero.
*
* The prototype for \ref H5DS_iterate_t is:
* \snippet this H5DS_iterate_t_snip
*
* The operation receives the Dimension Scale dataset
* identifier, \p scale, and the pointer to the operator
* data passed in to H5DSiterate_scales(), \p visitor_data.
*
* The return values from an operator are:
*
* - Zero causes the iterator to continue, returning zero
* when all group members have been processed.
* - Positive causes the iterator to immediately return that
* positive value, indicating short-circuit success.
* The iterator can be restarted at the next group member.
* - Negative causes the iterator to immediately return
* that value, indicating failure. The iterator can be
* restarted at the next group member.
*
* H5DSiterate_scales() assumes that the scales of the
* dimension identified by \p dim remain unchanged through
* the iteration. If the membership changes during the iteration,
* the function's behavior is undefined.
*/
H5_HLDLL herr_t H5DSiterate_scales(hid_t did, unsigned int dim, int *idx, H5DS_iterate_t visitor,
void *visitor_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5DS
*
* \brief Report if dimension scale \p dsid is currently attached to
* dimension \p idx of dataset \p did.
*
* \param[in] did The dataset
* \param[in] dsid The scale to be attached
* \param[in] idx The dimension of \p did that \p dsid is associated with
*
* \return \htri_t
*
* \details Report if dimension scale \p dsid is currently attached to
* dimension \p idx of dataset \p did.
*
* Fails if:
* - Bad arguments
* - If \p dsid is not a Dimension Scale
* - The \p dsid is not a Dimension Scale
* - If \p did is a Dimension Scale (A Dimension Scale cannot have scales.)
*
*/
H5_HLDLL htri_t H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,52 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains public declarations for the H5ES (event set) developer
* support routines.
*/
#ifndef H5ESdevelop_H
#define H5ESdevelop_H
/* Include package's public header */
#include "H5ESpublic.h"
/*****************/
/* Public Macros */
/*****************/
/*******************/
/* Public Typedefs */
/*******************/
/********************/
/* Public Variables */
/********************/
/*********************/
/* Public Prototypes */
/*********************/
#ifdef __cplusplus
extern "C" {
#endif
H5_DLL herr_t H5ESinsert_request(hid_t es_id, hid_t connector_id, void *request);
H5_DLL herr_t H5ESget_requests(hid_t es_id, H5_iter_order_t order, hid_t *connector_ids, void **requests,
size_t array_len, size_t *count);
#ifdef __cplusplus
}
#endif
#endif /* H5ESdevelop_H */

@ -0,0 +1,384 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains public declarations for the H5ES (event set) module.
*/
#ifndef H5ESpublic_H
#define H5ESpublic_H
/* Public headers needed by this file */
#include "H5public.h" /* Generic Functions */
/*****************/
/* Public Macros */
/*****************/
/* Default value for "no event set" / synchronous execution */
#define H5ES_NONE 0 /* (hid_t) */
/* Special "wait" timeout values */
#define H5ES_WAIT_FOREVER (UINT64_MAX) /* Wait until all operations complete */
#define H5ES_WAIT_NONE \
(0) /* Don't wait for operations to complete, \
* just check their status. \
* (this allows H5ESwait to behave \
* like a 'test' operation) \
*/
/*******************/
/* Public Typedefs */
/*******************/
/**
* Asynchronous operation status
*/
typedef enum H5ES_status_t {
H5ES_STATUS_IN_PROGRESS, /**< Operation(s) have not yet completed */
H5ES_STATUS_SUCCEED, /**< Operation(s) have completed, successfully */
H5ES_STATUS_CANCELED, /**< Operation(s) has been canceled */
H5ES_STATUS_FAIL /**< An operation has completed, but failed */
} H5ES_status_t;
/**
* Information about operations in an event set
*/
typedef struct H5ES_op_info_t {
/* API call info */
const char *api_name; /**< Name of HDF5 API routine called */
char *api_args; /**< "Argument string" for arguments to HDF5 API routine called */
/* Application info */
const char *app_file_name; /**< Name of source file where the HDF5 API routine was called */
const char *app_func_name; /**< Name of function where the HDF5 API routine was called */
unsigned app_line_num; /**< Line # of source file where the HDF5 API routine was called */
/* Operation info */
uint64_t op_ins_count; /**< Counter of operation's insertion into event set */
uint64_t op_ins_ts; /**< Timestamp for when the operation was inserted into the event set */
uint64_t op_exec_ts; /**< Timestamp for when the operation began execution */
uint64_t op_exec_time; /**< Execution time for operation (in ns) */
} H5ES_op_info_t;
//! <!-- [H5ES_err_info_t_snip] -->
/**
* Information about failed operations in event set
*/
typedef struct H5ES_err_info_t {
/* API call info */
char *api_name; /**< Name of HDF5 API routine called */
char *api_args; /**< "Argument string" for arguments to HDF5 API routine called */
/* Application info */
char *app_file_name; /**< Name of source file where the HDF5 API routine was called */
char *app_func_name; /**< Name of function where the HDF5 API routine was called */
unsigned app_line_num; /**< Line # of source file where the HDF5 API routine was called */
/* Operation info */
uint64_t op_ins_count; /**< Counter of operation's insertion into event set */
uint64_t op_ins_ts; /**< Timestamp for when the operation was inserted into the event set */
uint64_t op_exec_ts; /**< Timestamp for when the operation began execution */
uint64_t op_exec_time; /**< Execution time for operation (in ns) */
/* Error info */
hid_t err_stack_id; /**< ID for error stack from failed operation */
} H5ES_err_info_t;
//! <!-- [H5ES_err_info_t_snip] -->
/*
More Possible Info for H5ES_op_info_t:
Parent Operation's request token (*) -> "parent event count"? -- Could be
used to "prune" child operations from reported errors, with flag
to H5ESget_err_info?
Possible debugging routines: (Should also be configured from Env Var)
H5ESdebug_signal(hid_t es_id, signal_t sig, uint64_t <event count>);
H5ESdebug_err_trace_log(hid_t es_id, const char *filename);
H5ESdebug_err_trace_fh(hid_t es_id, FILE *fh);
H5ESdebug_err_signal(hid_t es_id, signal_t sig);
[Possibly option to allow operations to be inserted into event set with error?]
Example usage:
es_id = H5EScreate();
H5ESdebug...(es_id, ...);
...
H5Dwrite_async(..., es_id);
How to Trace Async Operations?
<Example of stacking Logging VOL Connector w/Async VOL Connector>
*/
/**
* Callback for H5ESregister_insert_func()
*/
typedef int (*H5ES_event_insert_func_t)(const H5ES_op_info_t *op_info, void *ctx);
/**
* Callback for H5ESregister_complete_func()
*/
typedef int (*H5ES_event_complete_func_t)(const H5ES_op_info_t *op_info, H5ES_status_t status,
hid_t err_stack, void *ctx);
/********************/
/* Public Variables */
/********************/
/*********************/
/* Public Prototypes */
/*********************/
#ifdef __cplusplus
extern "C" {
#endif
/**
* \ingroup H5ES
*
* \brief Creates an event set
*
* \returns \hid_t{event set}
*
* \details H5EScreate() creates a new event set and returns a corresponding
* event set identifier.
*
* \since 1.14.0
*
*/
H5_DLL hid_t H5EScreate(void);
/**
* \ingroup H5ES
*
* \brief Waits for operations in event set to complete
*
* \es_id
* \param[in] timeout Total time in nanoseconds to wait for all operations in
* the event set to complete
* \param[out] num_in_progress The number of operations still in progress
* \param[out] err_occurred Flag if an operation in the event set failed
* \returns \herr_t
*
* \details H5ESwait() waits for operations in an event set \p es_id to wait
* with \p timeout.
*
* Timeout value is in nanoseconds, and is for the H5ESwait() call and
* not for each individual operation in the event set. For example, if
* "10" is passed as a timeout value and the event set waited 4
* nanoseconds for the first operation to complete, the remaining
* operations would be allowed to wait for at most 6 nanoseconds more,
* i.e., the timeout value used across all operations in the event set
* until it reaches 0, then any remaining operations are only checked
* for completion, not waited on.
*
* This call will stop waiting on operations and will return
* immediately if an operation fails. If a failure occurs, the value
* returned for the number of operations in progress may be inaccurate.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESwait(hid_t es_id, uint64_t timeout, size_t *num_in_progress, hbool_t *err_occurred);
/**
* \ingroup H5ES
*
* \brief Attempt to cancel operations in an event set
*
* \es_id
* \param[out] num_not_canceled The number of events not canceled
* \param[out] err_occurred Status indicating if error is present in the event set
* \returns \herr_t
*
* \details H5EScancel() attempts to cancel operations in an event set specified
* by \p es_id. H5ES_NONE is a valid value for \p es_id, but functions as a no-op.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5EScancel(hid_t es_id, size_t *num_not_canceled, hbool_t *err_occurred);
/**
* \ingroup H5ES
*
* \brief Retrieves number of events in an event set
*
* \es_id
* \param[out] count The number of events in the event set
* \returns \herr_t
*
* \details H5ESget_count() retrieves number of events in an event set specified
* by \p es_id.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESget_count(hid_t es_id, size_t *count);
/**
* \ingroup H5ES
*
* \brief Retrieves the accumulative operation counter for an event set
*
* \es_id
* \param[out] counter The accumulative counter value for an event set
* \returns \herr_t
*
* \details H5ESget_op_counter() retrieves the current accumulative count of
* event set operations since the event set creation of \p es_id.
*
* \note This is designed for wrapper libraries mainly, to use as a mechanism
* for matching operations inserted into the event set with possible
* errors that occur.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESget_op_counter(hid_t es_id, uint64_t *counter);
/**
* \ingroup H5ES
*
* \brief Checks for failed operations
*
* \es_id
* \param[out] err_occurred Status indicating if error is present in the event
* set
* \returns \herr_t
*
* \details H5ESget_err_status() checks if event set specified by es_id has
* failed operations.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESget_err_status(hid_t es_id, hbool_t *err_occurred);
/**
* \ingroup H5ES
*
* \brief Retrieves the number of failed operations
*
* \es_id
* \param[out] num_errs Number of errors
* \returns \herr_t
*
* \details H5ESget_err_count() retrieves the number of failed operations in an
* event set specified by \p es_id.
*
* The function does not wait for active operations to complete, so
* count may not include all failures.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESget_err_count(hid_t es_id, size_t *num_errs);
/**
* \ingroup H5ES
*
* \brief Retrieves information about failed operations
*
* \es_id
* \param[in] num_err_info The number of elements in \p err_info array
* \param[out] err_info Array of structures
* \param[out] err_cleared Number of cleared errors
* \returns \herr_t
*
* \details H5ESget_err_info() retrieves information about failed operations in
* an event set specified by \p es_id. The strings retrieved for each
* error info must be released by calling H5free_memory().
*
* Below is the description of the \ref H5ES_err_info_t structure:
* \snippet this H5ES_err_info_t_snip
* \click4more
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESget_err_info(hid_t es_id, size_t num_err_info, H5ES_err_info_t err_info[],
size_t *err_cleared);
/**
* \ingroup H5ES
*
* \brief Convenience routine to free an array of H5ES_err_info_t structs
*
* \param[in] num_err_info The number of elements in \p err_info array
* \param[in] err_info Array of structures
* \returns \herr_t
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESfree_err_info(size_t num_err_info, H5ES_err_info_t err_info[]);
/**
* \ingroup H5ES
*
* \brief Registers a callback to invoke when a new operation is inserted into
* an event set
*
* \es_id
* \param[in] func The insert function to register
* \param[in] ctx User-specified information (context) to pass to \p func
* \returns \herr_t
*
* \details Only one insert callback can be registered for each event set.
* Registering a new callback will replace the existing one.
* H5ES_NONE is a valid value for 'es_id', but functions as a no-op
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESregister_insert_func(hid_t es_id, H5ES_event_insert_func_t func, void *ctx);
/**
* \ingroup H5ES
*
* \brief Registers a callback to invoke when an operation completes within an
* event set
*
* \es_id
* \param[in] func The completion function to register
* \param[in] ctx User-specified information (context) to pass to \p func
* \returns \herr_t
*
* \details Only one complete callback can be registered for each event set.
* Registering a new callback will replace the existing one.
* H5ES_NONE is a valid value for 'es_id', but functions as a no-op
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESregister_complete_func(hid_t es_id, H5ES_event_complete_func_t func, void *ctx);
/**
* \ingroup H5ES
*
* \brief Terminates access to an event set
*
* \es_id
* \returns \herr_t
*
* \details H5ESclose() terminates access to an event set specified by \p es_id.
*
* \since 1.14.0
*
*/
H5_DLL herr_t H5ESclose(hid_t es_id);
#ifdef __cplusplus
}
#endif
#endif /* H5ESpublic_H */

@ -0,0 +1,441 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Generated automatically by bin/make_err -- do not edit */
/* Add new errors to H5err.txt file */
#ifndef H5Epubgen_H
#define H5Epubgen_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************/
/* Major error codes */
/*********************/
#define H5E_FUNC (H5OPEN H5E_FUNC_g)
#define H5E_FILE (H5OPEN H5E_FILE_g)
#define H5E_VOL (H5OPEN H5E_VOL_g)
#define H5E_SOHM (H5OPEN H5E_SOHM_g)
#define H5E_SYM (H5OPEN H5E_SYM_g)
#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g)
#define H5E_VFL (H5OPEN H5E_VFL_g)
#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g)
#define H5E_BTREE (H5OPEN H5E_BTREE_g)
#define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g)
#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g)
#define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g)
#define H5E_EVENTSET (H5OPEN H5E_EVENTSET_g)
#define H5E_ID (H5OPEN H5E_ID_g)
#define H5E_RS (H5OPEN H5E_RS_g)
#define H5E_FARRAY (H5OPEN H5E_FARRAY_g)
#define H5E_HEAP (H5OPEN H5E_HEAP_g)
#define H5E_MAP (H5OPEN H5E_MAP_g)
#define H5E_ATTR (H5OPEN H5E_ATTR_g)
#define H5E_IO (H5OPEN H5E_IO_g)
#define H5E_EFL (H5OPEN H5E_EFL_g)
#define H5E_TST (H5OPEN H5E_TST_g)
#define H5E_LIB (H5OPEN H5E_LIB_g)
#define H5E_PAGEBUF (H5OPEN H5E_PAGEBUF_g)
#define H5E_FSPACE (H5OPEN H5E_FSPACE_g)
#define H5E_DATASET (H5OPEN H5E_DATASET_g)
#define H5E_STORAGE (H5OPEN H5E_STORAGE_g)
#define H5E_LINK (H5OPEN H5E_LINK_g)
#define H5E_PLIST (H5OPEN H5E_PLIST_g)
#define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g)
#define H5E_OHDR (H5OPEN H5E_OHDR_g)
#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g)
#define H5E_SLIST (H5OPEN H5E_SLIST_g)
#define H5E_ARGS (H5OPEN H5E_ARGS_g)
#define H5E_CONTEXT (H5OPEN H5E_CONTEXT_g)
#define H5E_EARRAY (H5OPEN H5E_EARRAY_g)
#define H5E_PLINE (H5OPEN H5E_PLINE_g)
#define H5E_ERROR (H5OPEN H5E_ERROR_g)
#define H5E_CACHE (H5OPEN H5E_CACHE_g)
H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */
H5_DLLVAR hid_t H5E_FILE_g; /* File accessibility */
H5_DLLVAR hid_t H5E_VOL_g; /* Virtual Object Layer */
H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */
H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */
H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */
H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */
H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */
H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */
H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */
H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */
H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */
H5_DLLVAR hid_t H5E_EVENTSET_g; /* Event Set */
H5_DLLVAR hid_t H5E_ID_g; /* Object ID */
H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */
H5_DLLVAR hid_t H5E_FARRAY_g; /* Fixed Array */
H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */
H5_DLLVAR hid_t H5E_MAP_g; /* Map */
H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */
H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */
H5_DLLVAR hid_t H5E_EFL_g; /* External file list */
H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */
H5_DLLVAR hid_t H5E_LIB_g; /* General library infrastructure */
H5_DLLVAR hid_t H5E_PAGEBUF_g; /* Page Buffering */
H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */
H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */
H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */
H5_DLLVAR hid_t H5E_LINK_g; /* Links */
H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */
H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */
H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */
H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */
H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */
H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */
H5_DLLVAR hid_t H5E_CONTEXT_g; /* API Context */
H5_DLLVAR hid_t H5E_EARRAY_g; /* Extensible Array */
H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */
H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */
H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */
/*********************/
/* Minor error codes */
/*********************/
/* Object ID related errors */
#define H5E_BADID (H5OPEN H5E_BADID_g)
#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g)
#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g)
#define H5E_CANTINC (H5OPEN H5E_CANTINC_g)
#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g)
#define H5E_NOIDS (H5OPEN H5E_NOIDS_g)
H5_DLLVAR hid_t H5E_BADID_g; /* Unable to find ID information (already closed?) */
H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */
H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new ID */
H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */
H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */
H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */
/* Generic low-level file I/O errors */
#define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g)
#define H5E_READERROR (H5OPEN H5E_READERROR_g)
#define H5E_WRITEERROR (H5OPEN H5E_WRITEERROR_g)
#define H5E_CLOSEERROR (H5OPEN H5E_CLOSEERROR_g)
#define H5E_OVERFLOW (H5OPEN H5E_OVERFLOW_g)
#define H5E_FCNTL (H5OPEN H5E_FCNTL_g)
H5_DLLVAR hid_t H5E_SEEKERROR_g; /* Seek failed */
H5_DLLVAR hid_t H5E_READERROR_g; /* Read failed */
H5_DLLVAR hid_t H5E_WRITEERROR_g; /* Write failed */
H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */
H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */
H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */
/* Resource errors */
#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g)
#define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g)
#define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g)
#define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g)
#define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g)
#define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g)
#define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g)
#define H5E_CANTGC (H5OPEN H5E_CANTGC_g)
#define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g)
#define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g)
H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */
H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */
H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */
H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */
H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */
H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */
H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */
H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */
H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */
H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */
/* Heap errors */
#define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g)
#define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g)
#define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g)
#define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g)
#define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g)
#define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g)
H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */
H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */
H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */
H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */
H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */
H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */
/* Map related errors */
#define H5E_CANTPUT (H5OPEN H5E_CANTPUT_g)
H5_DLLVAR hid_t H5E_CANTPUT_g; /* Can't put value */
/* Function entry/exit interface errors */
#define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g)
#define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g)
#define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g)
H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */
H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */
H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */
/* Property list errors */
#define H5E_CANTGET (H5OPEN H5E_CANTGET_g)
#define H5E_CANTSET (H5OPEN H5E_CANTSET_g)
#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g)
#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g)
H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */
H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */
H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */
H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */
/* Asynchronous operation errors */
#define H5E_CANTWAIT (H5OPEN H5E_CANTWAIT_g)
#define H5E_CANTCANCEL (H5OPEN H5E_CANTCANCEL_g)
H5_DLLVAR hid_t H5E_CANTWAIT_g; /* Can't wait on operation */
H5_DLLVAR hid_t H5E_CANTCANCEL_g; /* Can't cancel operation */
/* Free space errors */
#define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g)
#define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g)
#define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g)
H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */
H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */
H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */
/* Object header related errors */
#define H5E_LINKCOUNT (H5OPEN H5E_LINKCOUNT_g)
#define H5E_VERSION (H5OPEN H5E_VERSION_g)
#define H5E_ALIGNMENT (H5OPEN H5E_ALIGNMENT_g)
#define H5E_BADMESG (H5OPEN H5E_BADMESG_g)
#define H5E_CANTDELETE (H5OPEN H5E_CANTDELETE_g)
#define H5E_BADITER (H5OPEN H5E_BADITER_g)
#define H5E_CANTPACK (H5OPEN H5E_CANTPACK_g)
#define H5E_CANTRESET (H5OPEN H5E_CANTRESET_g)
#define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g)
H5_DLLVAR hid_t H5E_LINKCOUNT_g; /* Bad object header link count */
H5_DLLVAR hid_t H5E_VERSION_g; /* Wrong version number */
H5_DLLVAR hid_t H5E_ALIGNMENT_g; /* Alignment error */
H5_DLLVAR hid_t H5E_BADMESG_g; /* Unrecognized message */
H5_DLLVAR hid_t H5E_CANTDELETE_g; /* Can't delete message */
H5_DLLVAR hid_t H5E_BADITER_g; /* Iteration failed */
H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */
H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */
H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */
/* System level errors */
#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g)
H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */
/* I/O pipeline errors */
#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g)
#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g)
#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g)
#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g)
#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g)
#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g)
H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */
H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */
H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */
H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */
H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */
H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */
/* Group related errors */
#define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g)
#define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g)
#define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g)
#define H5E_PATH (H5OPEN H5E_PATH_g)
H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */
H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */
H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */
H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */
/* No error */
#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g)
H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */
/* Plugin errors */
#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g)
H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */
/* File accessibility errors */
#define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g)
#define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g)
#define H5E_CANTCREATE (H5OPEN H5E_CANTCREATE_g)
#define H5E_CANTOPENFILE (H5OPEN H5E_CANTOPENFILE_g)
#define H5E_CANTCLOSEFILE (H5OPEN H5E_CANTCLOSEFILE_g)
#define H5E_NOTHDF5 (H5OPEN H5E_NOTHDF5_g)
#define H5E_BADFILE (H5OPEN H5E_BADFILE_g)
#define H5E_TRUNCATED (H5OPEN H5E_TRUNCATED_g)
#define H5E_MOUNT (H5OPEN H5E_MOUNT_g)
#define H5E_UNMOUNT (H5OPEN H5E_UNMOUNT_g)
#define H5E_CANTDELETEFILE (H5OPEN H5E_CANTDELETEFILE_g)
#define H5E_CANTLOCKFILE (H5OPEN H5E_CANTLOCKFILE_g)
#define H5E_CANTUNLOCKFILE (H5OPEN H5E_CANTUNLOCKFILE_g)
H5_DLLVAR hid_t H5E_FILEEXISTS_g; /* File already exists */
H5_DLLVAR hid_t H5E_FILEOPEN_g; /* File already open */
H5_DLLVAR hid_t H5E_CANTCREATE_g; /* Unable to create file */
H5_DLLVAR hid_t H5E_CANTOPENFILE_g; /* Unable to open file */
H5_DLLVAR hid_t H5E_CANTCLOSEFILE_g; /* Unable to close file */
H5_DLLVAR hid_t H5E_NOTHDF5_g; /* Not an HDF5 file */
H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */
H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */
H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */
H5_DLLVAR hid_t H5E_UNMOUNT_g; /* File unmount error */
H5_DLLVAR hid_t H5E_CANTDELETEFILE_g; /* Unable to delete file */
H5_DLLVAR hid_t H5E_CANTLOCKFILE_g; /* Unable to lock file */
H5_DLLVAR hid_t H5E_CANTUNLOCKFILE_g; /* Unable to unlock file */
/* Cache related errors */
#define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g)
#define H5E_CANTUNSERIALIZE (H5OPEN H5E_CANTUNSERIALIZE_g)
#define H5E_CANTSERIALIZE (H5OPEN H5E_CANTSERIALIZE_g)
#define H5E_CANTTAG (H5OPEN H5E_CANTTAG_g)
#define H5E_CANTLOAD (H5OPEN H5E_CANTLOAD_g)
#define H5E_PROTECT (H5OPEN H5E_PROTECT_g)
#define H5E_NOTCACHED (H5OPEN H5E_NOTCACHED_g)
#define H5E_SYSTEM (H5OPEN H5E_SYSTEM_g)
#define H5E_CANTINS (H5OPEN H5E_CANTINS_g)
#define H5E_CANTPROTECT (H5OPEN H5E_CANTPROTECT_g)
#define H5E_CANTUNPROTECT (H5OPEN H5E_CANTUNPROTECT_g)
#define H5E_CANTPIN (H5OPEN H5E_CANTPIN_g)
#define H5E_CANTUNPIN (H5OPEN H5E_CANTUNPIN_g)
#define H5E_CANTMARKDIRTY (H5OPEN H5E_CANTMARKDIRTY_g)
#define H5E_CANTMARKCLEAN (H5OPEN H5E_CANTMARKCLEAN_g)
#define H5E_CANTMARKUNSERIALIZED (H5OPEN H5E_CANTMARKUNSERIALIZED_g)
#define H5E_CANTMARKSERIALIZED (H5OPEN H5E_CANTMARKSERIALIZED_g)
#define H5E_CANTDIRTY (H5OPEN H5E_CANTDIRTY_g)
#define H5E_CANTCLEAN (H5OPEN H5E_CANTCLEAN_g)
#define H5E_CANTEXPUNGE (H5OPEN H5E_CANTEXPUNGE_g)
#define H5E_CANTRESIZE (H5OPEN H5E_CANTRESIZE_g)
#define H5E_CANTDEPEND (H5OPEN H5E_CANTDEPEND_g)
#define H5E_CANTUNDEPEND (H5OPEN H5E_CANTUNDEPEND_g)
#define H5E_CANTNOTIFY (H5OPEN H5E_CANTNOTIFY_g)
#define H5E_LOGGING (H5OPEN H5E_LOGGING_g)
#define H5E_CANTCORK (H5OPEN H5E_CANTCORK_g)
#define H5E_CANTUNCORK (H5OPEN H5E_CANTUNCORK_g)
H5_DLLVAR hid_t H5E_CANTFLUSH_g; /* Unable to flush data from cache */
H5_DLLVAR hid_t H5E_CANTUNSERIALIZE_g; /* Unable to mark metadata as unserialized */
H5_DLLVAR hid_t H5E_CANTSERIALIZE_g; /* Unable to serialize data from cache */
H5_DLLVAR hid_t H5E_CANTTAG_g; /* Unable to tag metadata in the cache */
H5_DLLVAR hid_t H5E_CANTLOAD_g; /* Unable to load metadata into cache */
H5_DLLVAR hid_t H5E_PROTECT_g; /* Protected metadata error */
H5_DLLVAR hid_t H5E_NOTCACHED_g; /* Metadata not currently cached */
H5_DLLVAR hid_t H5E_SYSTEM_g; /* Internal error detected */
H5_DLLVAR hid_t H5E_CANTINS_g; /* Unable to insert metadata into cache */
H5_DLLVAR hid_t H5E_CANTPROTECT_g; /* Unable to protect metadata */
H5_DLLVAR hid_t H5E_CANTUNPROTECT_g; /* Unable to unprotect metadata */
H5_DLLVAR hid_t H5E_CANTPIN_g; /* Unable to pin cache entry */
H5_DLLVAR hid_t H5E_CANTUNPIN_g; /* Unable to un-pin cache entry */
H5_DLLVAR hid_t H5E_CANTMARKDIRTY_g; /* Unable to mark a pinned entry as dirty */
H5_DLLVAR hid_t H5E_CANTMARKCLEAN_g; /* Unable to mark a pinned entry as clean */
H5_DLLVAR hid_t H5E_CANTMARKUNSERIALIZED_g; /* Unable to mark an entry as unserialized */
H5_DLLVAR hid_t H5E_CANTMARKSERIALIZED_g; /* Unable to mark an entry as serialized */
H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */
H5_DLLVAR hid_t H5E_CANTCLEAN_g; /* Unable to mark metadata as clean */
H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */
H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */
H5_DLLVAR hid_t H5E_CANTDEPEND_g; /* Unable to create a flush dependency */
H5_DLLVAR hid_t H5E_CANTUNDEPEND_g; /* Unable to destroy a flush dependency */
H5_DLLVAR hid_t H5E_CANTNOTIFY_g; /* Unable to notify object about action */
H5_DLLVAR hid_t H5E_LOGGING_g; /* Failure in the cache logging framework */
H5_DLLVAR hid_t H5E_CANTCORK_g; /* Unable to cork an object */
H5_DLLVAR hid_t H5E_CANTUNCORK_g; /* Unable to uncork an object */
/* Link related errors */
#define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g)
#define H5E_NLINKS (H5OPEN H5E_NLINKS_g)
#define H5E_NOTREGISTERED (H5OPEN H5E_NOTREGISTERED_g)
#define H5E_CANTMOVE (H5OPEN H5E_CANTMOVE_g)
#define H5E_CANTSORT (H5OPEN H5E_CANTSORT_g)
H5_DLLVAR hid_t H5E_TRAVERSE_g; /* Link traversal failure */
H5_DLLVAR hid_t H5E_NLINKS_g; /* Too many soft links in path */
H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */
H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */
H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */
/* Parallel MPI errors */
#define H5E_MPI (H5OPEN H5E_MPI_g)
#define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g)
#define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g)
#define H5E_CANTGATHER (H5OPEN H5E_CANTGATHER_g)
#define H5E_NO_INDEPENDENT (H5OPEN H5E_NO_INDEPENDENT_g)
H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */
H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */
H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */
H5_DLLVAR hid_t H5E_CANTGATHER_g; /* Can't gather data */
H5_DLLVAR hid_t H5E_NO_INDEPENDENT_g; /* Can't perform independent IO */
/* Dataspace errors */
#define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g)
#define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g)
#define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g)
#define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g)
#define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g)
#define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g)
#define H5E_INCONSISTENTSTATE (H5OPEN H5E_INCONSISTENTSTATE_g)
#define H5E_CANTAPPEND (H5OPEN H5E_CANTAPPEND_g)
H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */
H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */
H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */
H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */
H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */
H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */
H5_DLLVAR hid_t H5E_INCONSISTENTSTATE_g; /* Internal states are inconsistent */
H5_DLLVAR hid_t H5E_CANTAPPEND_g; /* Can't append object */
/* Argument errors */
#define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g)
#define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g)
#define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g)
#define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g)
#define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g)
H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */
H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */
H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */
H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */
H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */
/* B-tree related errors */
#define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g)
#define H5E_EXISTS (H5OPEN H5E_EXISTS_g)
#define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g)
#define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g)
#define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g)
#define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g)
#define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g)
#define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g)
#define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g)
#define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g)
#define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g)
#define H5E_CANTFIND (H5OPEN H5E_CANTFIND_g)
H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */
H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */
H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */
H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */
H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */
H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */
H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */
H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */
H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */
H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */
H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */
H5_DLLVAR hid_t H5E_CANTFIND_g; /* Unable to check for record */
/* Datatype conversion errors */
#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g)
#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g)
H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */
H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */
#ifdef __cplusplus
}
#endif
#endif /* H5Epubgen_H */

@ -0,0 +1,946 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This file contains public declarations for the H5E module.
*/
#ifndef H5Epublic_H
#define H5Epublic_H
#include <stdio.h> /*FILE arg of H5Eprint() */
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
/* Value for the default error stack */
#define H5E_DEFAULT 0 /* (hid_t) */
/**
* Different kinds of error information
*/
typedef enum H5E_type_t { H5E_MAJOR, H5E_MINOR } H5E_type_t;
/**
* Information about an error; element of error stack
*/
typedef struct H5E_error2_t {
hid_t cls_id;
/**< Class ID */
hid_t maj_num;
/**< Major error ID */
hid_t min_num;
/**< Minor error number */
unsigned line;
/**< Line in file where error occurs */
const char *func_name;
/**< Function in which error occurred */
const char *file_name;
/**< File in which error occurred */
const char *desc;
/**< Optional supplied description */
} H5E_error2_t;
/* When this header is included from a private header, don't make calls to H5open() */
#undef H5OPEN
#ifndef H5private_H
#define H5OPEN H5open(),
#else /* H5private_H */
#define H5OPEN
#endif /* H5private_H */
/* HDF5 error class */
/* Extern "C" block needed to compile C++ filter plugins with some compilers */
#ifdef __cplusplus
extern "C" {
#endif
#define H5E_ERR_CLS (H5OPEN H5E_ERR_CLS_g)
H5_DLLVAR hid_t H5E_ERR_CLS_g;
#ifdef __cplusplus
}
#endif
/* Include the automatically generated public header information */
/* (This includes the list of major and minor error codes for the library) */
#include "H5Epubgen.h"
/*
* One often needs to temporarily disable automatic error reporting when
* trying something that's likely or expected to fail. The code to try can
* be nested between calls to H5Eget_auto() and H5Eset_auto(), but it's
* easier just to use this macro like:
* H5E_BEGIN_TRY {
* ...stuff here that's likely to fail...
* } H5E_END_TRY;
*
* Warning: don't break, return, or longjmp() from the body of the loop or
* the error reporting won't be properly restored!
*
* These two macros still use the old API functions for backward compatibility
* purpose.
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
#define H5E_BEGIN_TRY \
{ \
unsigned H5E_saved_is_v2; \
union { \
H5E_auto1_t efunc1; \
H5E_auto2_t efunc2; \
} H5E_saved; \
void *H5E_saved_edata; \
\
(void)H5Eauto_is_v2(H5E_DEFAULT, &H5E_saved_is_v2); \
if (H5E_saved_is_v2) { \
(void)H5Eget_auto2(H5E_DEFAULT, &H5E_saved.efunc2, &H5E_saved_edata); \
(void)H5Eset_auto2(H5E_DEFAULT, NULL, NULL); \
} \
else { \
(void)H5Eget_auto1(&H5E_saved.efunc1, &H5E_saved_edata); \
(void)H5Eset_auto1(NULL, NULL); \
}
#define H5E_END_TRY \
if (H5E_saved_is_v2) \
(void)H5Eset_auto2(H5E_DEFAULT, H5E_saved.efunc2, H5E_saved_edata); \
else \
(void)H5Eset_auto1(H5E_saved.efunc1, H5E_saved_edata); \
}
#else /* H5_NO_DEPRECATED_SYMBOLS */
#define H5E_BEGIN_TRY \
{ \
H5E_auto2_t saved_efunc; \
void *H5E_saved_edata; \
\
(void)H5Eget_auto2(H5E_DEFAULT, &saved_efunc, &H5E_saved_edata); \
(void)H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
#define H5E_END_TRY \
(void)H5Eset_auto2(H5E_DEFAULT, saved_efunc, H5E_saved_edata); \
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/*
* Public API Convenience Macros for Error reporting - Documented
*/
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
#define H5Epush_sim(func, cls, maj, min, str) \
H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, cls, maj, min, str)
/*
* Public API Convenience Macros for Error reporting - Undocumented
*/
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
/* And return after pushing error onto stack */
#define H5Epush_ret(func, cls, maj, min, str, ret) \
do { \
H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, cls, maj, min, str); \
return (ret); \
} while (0)
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in
* And goto a label after pushing error onto stack.
*/
#define H5Epush_goto(func, cls, maj, min, str, label) \
{ \
H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, cls, maj, min, str); \
goto label; \
}
/**
* Error stack traversal direction
*/
typedef enum H5E_direction_t {
H5E_WALK_UPWARD = 0, /**< begin w/ most specific error, end at API function */
H5E_WALK_DOWNWARD = 1 /**< begin at API function, end w/ most specific error */
} H5E_direction_t;
#ifdef __cplusplus
extern "C" {
#endif
/* Error stack traversal callback function pointers */
//! <!-- [H5E_walk2_t_snip] -->
/**
* \brief Callback function for H5Ewalk2()
*
* \param[in] n Indexed error position in the stack
* \param[in] err_desc Pointer to a data structure describing the error
* \param[in] client_data Pointer to client data in the format expected by the
* user-defined function
* \return \herr_t
*/
typedef herr_t (*H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data);
//! <!-- [H5E_walk2_t_snip] -->
//! <!-- [H5E_auto2_t_snip] -->
/**
* \brief Callback function for H5Eset_auto2()
*
* \estack_id{estack}
* \param[in] client_data Pointer to client data in the format expected by the
* user-defined function
* \return \herr_t
*/
typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);
//! <!-- [H5E_auto2_t_snip] -->
/* Public API functions */
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Registers a client library or application program to the HDF5 error API
*
* \param[in] cls_name Name of the error class
* \param[in] lib_name Name of the client library or application to which the error class belongs
* \param[in] version Version of the client library or application to which the
error class belongs. It can be \c NULL.
* \return Returns a class identifier on success; otherwise returns H5I_INVALID_ID.
*
* \details H5Eregister_class() registers a client library or application
* program to the HDF5 error API so that the client library or
* application program can report errors together with the HDF5
* library. It receives an identifier for this error class for further
* error operations. The library name and version number will be
* printed out in the error message as a preamble.
*
* \since 1.8.0
*/
H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Removes an error class
*
* \param[in] class_id Error class identifier.
* \return \herr_t
*
* \details H5Eunregister_class() removes the error class specified by \p
* class_id. All the major and minor errors in this class will also be
* closed.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eunregister_class(hid_t class_id);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Closes an error message
*
* \param[in] err_id An error message identifier
* \return \herr_t
*
* \details H5Eclose_msg() closes an error message identifier, which can be
* either a major or minor message.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eclose_msg(hid_t err_id);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Adds a major error message to an error class
*
* \param[in] cls An error class identifier
* \param[in] msg_type The type of the error message
* \param[in] msg Major error message
* \return \herr_t
*
* \details H5Ecreate_msg() adds an error message to an error class defined by
* client library or application program. The error message can be
* either major or minor as indicated by the parameter \p msg_type.
*
* Use H5Eclose_msg() to close the message identifier returned by this
* function.
*
* \since 1.8.0
*/
H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Creates a new, empty error stack
*
* \return \hid_ti{error stack}
*
* \details H5Ecreate_stack() creates a new empty error stack and returns the
* new stacks identifier. Use H5Eclose_stack() to close the error stack
* identifier returned by this function.
*
* \since 1.8.0
*/
H5_DLL hid_t H5Ecreate_stack(void);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Returns a copy of the current error stack
*
* \return \hid_ti{error stack}
*
* \details H5Eget_current_stack() copies the current error stack and returns an
* error stack identifier for the new copy.
*
* \since 1.8.0
*/
H5_DLL hid_t H5Eget_current_stack(void);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Appends one error stack to another, optionally closing the source
* stack.
*
* \estack_id{dst_stack_id}
* \estack_id{src_stack_id}
* \param[in] close_source_stack Flag to indicate whether to close the source stack
* \return \herr_t
*
* \details H5Eappend_stack() appends the messages from error stack
* \p src_stack_id to the error stack \p dst_stack_id.
* If \p close_source_stack is \c TRUE, the source error stack
* will be closed.
*
* \since 1.14.0
*/
H5_DLL herr_t H5Eappend_stack(hid_t dst_stack_id, hid_t src_stack_id, hbool_t close_source_stack);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Closes an error stack handle
*
* \estack_id{stack_id}
*
* \return \herr_t
*
* \details H5Eclose_stack() closes the error stack handle \p stack_id
* and releases its resources. #H5E_DEFAULT cannot be closed.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Retrieves error class name
*
* \param[in] class_id Error class identifier
* \param[out] name Buffer for the error class name
* \param[in] size The maximum number of characters of the class name to be returned
* by this function in \p name.
* \return Returns non-negative value as on success; otherwise returns negative value.
*
* \details H5Eget_class_name() retrieves the name of the error class specified
* by the class identifier. If a non-NULL pointer is passed in for \p
* name and \p size is greater than zero, the class name of \p size
* long is returned. The length of the error class name is also
* returned. If NULL is passed in as \p name, only the length of class
* name is returned. If zero is returned, it means no name. The user is
* responsible for allocating sufficient buffer space for the name.
*
* \since 1.8.0
*/
H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Replaces the current error stack
*
* \estack_id{err_stack_id}
*
* \return \herr_t
*
* \details H5Eset_current_stack() replaces the content of the current error
* stack with a copy of the content of the error stack specified by
* \p err_stack_id, and it closes the error stack specified by
* \p err_stack_id.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Pushes a new error record onto an error stack
*
* \estack_id{err_stack}. If the identifier is #H5E_DEFAULT, the error record
* will be pushed to the current stack.
* \param[in] file Name of the file in which the error was detected
* \param[in] func Name of the function in which the error was detected
* \param[in] line Line number in the file where the error was detected
* \param[in] cls_id Error class identifier
* \param[in] maj_id Major error identifier
* \param[in] min_id Minor error identifier
* \param[in] msg Error description string
* \return \herr_t
*
* \details H5Epush2() pushes a new error record onto the error stack specified
* by \p err_stack.\n
* The error record contains the error class identifier \p cls_id, the
* major and minor message identifiers \p maj_id and \p min_id, the
* function name \p func where the error was detected, the file name \p
* file and line number \p line in the file where the error was
* detected, and an error description \p msg.\n
* The major and minor errors must be in the same error class.\n
* The function name, filename, and error description strings must be
* statically allocated.\n
* \p msg can be a format control string with additional
* arguments. This design of appending additional arguments is similar
* to the system and C functions printf() and fprintf().
*
* \since 1.8.0
*/
H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id,
hid_t maj_id, hid_t min_id, const char *msg, ...);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Deletes specified number of error messages from the error stack
*
* \estack_id{err_stack}
* \param[in] count The number of error messages to be deleted from the top
* of error stack
* \return \herr_t
*
* \details H5Epop() deletes the number of error records specified in \p count
* from the top of the error stack specified by \p err_stack (including
* major, minor messages and description). The number of error messages
* to be deleted is specified by \p count.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Prints the specified error stack in a default manner
*
* \estack_id{err_stack}
* \param[in] stream File pointer, or \c NULL for \c stderr
* \return \herr_t
*
* \details H5Eprint2() prints the error stack specified by \p err_stack on the
* specified stream, \p stream. Even if the error stack is empty, a
* one-line message of the following form will be printed:
* \code{.unparsed}
* HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.
* \endcode
*
* A similar line will appear before the error messages of each error
* class stating the library name, library version number, and thread
* identifier.
*
* If \p err_stack is #H5E_DEFAULT, the current error stack will be
* printed.
*
* H5Eprint2() is a convenience function for H5Ewalk2() with a function
* that prints error messages. Users are encouraged to write their own
* more specific error handlers.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Walks the specified error stack, calling the specified function
*
* \estack_id{err_stack}
* \param[in] direction Direction in which the error stack is to be walked
* \param[in] func Function to be called for each error encountered
* \param[in] client_data Data to be passed to \p func
* \return \herr_t
*
* \details H5Ewalk2() walks the error stack specified by err_stack for the
* current thread and calls the function specified in \p func for each
* error along the way.
*
* If the value of \p err_stack is #H5E_DEFAULT, then H5Ewalk2() walks
* the current error stack.
*
* \p direction specifies whether the stack is walked from the inside
* out or the outside in. A value of #H5E_WALK_UPWARD means to begin
* with the most specific error and end at the API; a value of
* #H5E_WALK_DOWNWARD means to start at the API and end at the
* innermost function where the error was first detected.
*
* \p func, a function conforming to the #H5E_walk2_t prototype, will
* be called for each error in the error stack. Its arguments will
* include an index number \c n (beginning at zero regardless of stack
* traversal direction), an error stack entry \c err_desc, and the \c
* client_data pointer passed to H5Eprint(). The #H5E_walk2_t prototype
* is as follows:
* \snippet this H5E_walk2_t_snip
*
* \since 1.8.0
*/
H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, void *client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Returns the settings for the automatic error stack traversal
* function and its data
*
* \estack_id
* \param[out] func The function currently set to be called upon an error condition
* \param[out] client_data Data currently set to be passed to the error function
* \return \herr_t
*
* \details H5Eget_auto2() returns the settings for the automatic error stack
* traversal function, \p func, and its data, \p client_data, that are
* associated with the error stack specified by \p estack_id.
*
* Either or both of the \p func and \p client_data arguments may be
* \c NULL, in which case the value is not returned.
*
* The library initializes its default error stack traversal functions
* to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
* H5Eprint2() or the user-defined function passed in through
* H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
* user-defined function passed in through H5Eset_auto1(). However, if
* the application passes in a user-defined function through
* H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
* function. If the application passes in a user-defined function
* through H5Eset_auto2(), it should call H5Eget_auto2() to query the
* traversal function.
*
* Mixing the new style and the old style functions will cause a
* failure. For example, if the application sets a user-defined
* old-style traversal function through H5Eset_auto1(), a call to
* H5Eget_auto2() will fail and will indicate that the application has
* mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
* H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
* the traversal functions are the librarys default H5Eprint1() or
* H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
* H5Eset_auto2() and H5Eget_auto1() does not fail.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Turns automatic error printing on or off
*
* \estack_id
* \param[in] func Function to be called upon an error condition
* \param[in] client_data Data passed to the error function
* \return \herr_t
*
* \details H5Eset_auto2() turns on or off automatic printing of errors for the
* error stack specified with \p estack_id. An \p estack_id value of
* #H5E_DEFAULT indicates the current stack.
*
* When automatic printing is turned on, by the use of a non-null \p func
* pointer, any API function which returns an error indication will
* first call \p func, passing it \p client_data as an argument.
*
* \p func, a function compliant with the #H5E_auto2_t prototype, is
* defined in the H5Epublic.h source code file as:
* \snippet this H5E_auto2_t_snip
*
* When the library is first initialized, the auto printing function is
* set to H5Eprint2() (cast appropriately) and \p client_data is the
* standard error stream pointer, \c stderr.
*
* Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
* direction.
*
* Automatic error printing is turned off with a H5Eset_auto2() call
* with a \c NULL \p func pointer.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Clears the specified error stack or the error stack for the current thread
*
* \estack_id{err_stack}
* \return \herr_t
*
* \details H5Eclear2() clears the error stack specified by \p err_stack, or, if
* \p err_stack is set to #H5E_DEFAULT, the error stack for the current
* thread.
*
* \p err_stack is an error stack identifier, such as that returned by
* H5Eget_current_stack().
*
* The current error stack is also cleared whenever an API function is
* called, with certain exceptions (for instance, H5Eprint1() or
* H5Eprint2()).
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eclear2(hid_t err_stack);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Determines the type of error stack
*
* \estack_id{err_stack}
* \param[out] is_stack A flag indicating which error stack \c typedef the
* specified error stack conforms to
*
* \return \herr_t
*
* \details H5Eauto_is_v2() determines whether the error auto reporting function
* for an error stack conforms to the #H5E_auto2_t \c typedef or the
* #H5E_auto1_t \c typedef.
*
* The \p is_stack parameter is set to 1 if the error stack conforms to
* #H5E_auto2_t and 0 if it conforms to #H5E_auto1_t.
*
* \since 1.8.0
*/
H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Retrieves an error message
*
* \param[in] msg_id Error message identifier
* \param[out] type The type of the error message Valid values are #H5E_MAJOR
* and #H5E_MINOR.
* \param[out] msg Error message buffer
* \param[in] size The length of error message to be returned by this function
* \return Returns the size of the error message in bytes on success; otherwise
* returns a negative value.
*
* \details H5Eget_msg() retrieves the error message including its length and
* type. The error message is specified by \p msg_id. The user is
* responsible for passing in sufficient buffer space for the
* message. If \p msg is not NULL and \p size is greater than zero, the
* error message of \p size long is returned. The length of the message
* is also returned. If NULL is passed in as \p msg, only the length
* and type of the message is returned. If the return value is zero, it
* means there is no message.
*
* \since 1.8.0
*/
H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Retrieves the number of error messages in an error stack
*
* \estack_id{error_stack_id}
* \return Returns a non-negative value on success; otherwise returns a negative value.
*
* \details H5Eget_num() retrieves the number of error records in the error
* stack specified by \p error_stack_id (including major, minor
* messages and description).
*
* \since 1.8.0
*/
H5_DLL ssize_t H5Eget_num(hid_t error_stack_id);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Typedefs */
/* Alias major & minor error types to hid_t's, for compatibility with new
* error API in v1.8
*/
typedef hid_t H5E_major_t;
typedef hid_t H5E_minor_t;
/**
* Information about an error element of error stack.
*/
typedef struct H5E_error1_t {
H5E_major_t maj_num; /**< major error number */
H5E_minor_t min_num; /**< minor error number */
const char *func_name; /**< function in which error occurred */
const char *file_name; /**< file in which error occurred */
unsigned line; /**< line in file where error occurs */
const char *desc; /**< optional supplied description */
} H5E_error1_t;
/* Error stack traversal callback function pointers */
//! <!-- [H5E_walk1_t_snip] -->
/**
* \brief Callback function for H5Ewalk1()
*
* \param[in] n Indexed error position in the stack
* \param[in] err_desc Pointer to a data structure describing the error
* \param[in] client_data Pointer to client data in the format expected by the
* user-defined function
* \return \herr_t
*/
typedef herr_t (*H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data);
//! <!-- [H5E_walk1_t_snip] -->
//! <!-- [H5E_auto1_t_snip] -->
/**
* \brief Callback function for H5Eset_auto1()
*
* \param[in] client_data Pointer to client data in the format expected by the
* user-defined function
* \return \herr_t
*/
typedef herr_t (*H5E_auto1_t)(void *client_data);
//! <!-- [H5E_auto1_t_snip] -->
/* Function prototypes */
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Clears the error stack for the current thread
*
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Eclear() renamed to H5Eclear1() and deprecated
* in this release.
*
* \details H5Eclear1() clears the error stack for the current thread.\n
* The stack is also cleared whenever an API function is called, with
* certain exceptions (for instance, H5Eprint1()).
*
*/
H5_DLL herr_t H5Eclear1(void);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Returns the current settings for the automatic error stack traversal
* function and its data
*
* \param[out] func Current setting for the function to be called upon an error
* condition
* \param[out] client_data Current setting for the data passed to the error
* function
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Eget_auto() renamed to H5Eget_auto1() and
* deprecated in this release.
*
* \details H5Eget_auto1() returns the current settings for the automatic error
* stack traversal function, \p func, and its data,
* \p client_data. Either or both arguments may be \c NULL, in which case the
* value is not returned.
*
* The library initializes its default error stack traversal functions
* to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
* H5Eprint2() or the user-defined function passed in through
* H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
* user-defined function passed in through H5Eset_auto1(). However, if
* the application passes in a user-defined function through
* H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
* function. If the application passes in a user-defined function
* through H5Eset_auto2(), it should call H5Eget_auto2() to query the
* traversal function.
*
* Mixing the new style and the old style functions will cause a
* failure. For example, if the application sets a user-defined
* old-style traversal function through H5Eset_auto1(), a call to
* H5Eget_auto2() will fail and will indicate that the application has
* mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
* H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
* the traversal functions are the librarys default H5Eprint1() or
* H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
* H5Eset_auto2() and H5Eget_auto1() does not fail.
*
*/
H5_DLL herr_t H5Eget_auto1(H5E_auto1_t *func, void **client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Pushes a new error record onto the error stack
*
* \param[in] file Name of the file in which the error was detected
* \param[in] func Name of the function in which the error was detected
* \param[in] line Line number in the file where the error was detected
* \param[in] maj Major error identifier
* \param[in] min Minor error identifier
* \param[in] str Error description string
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Epush() renamed to H5Epush1() and
* deprecated in this release.
*
* \details H5Epush1() pushes a new error record onto the error stack for the
* current thread.\n
* The error has major and minor numbers \p maj_num
* and \p min_num, the function \p func where the error was detected, the
* name of the file \p file where the error was detected, the line \p line
* within that file, and an error description string \p str.\n
* The function name, filename, and error description strings must be statically
* allocated.
*
* \since 1.4.0
*/
H5_DLL herr_t H5Epush1(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min,
const char *str);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Prints the current error stack in a default manner
*
* \param[in] stream File pointer, or \c NULL for \c stderr
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Eprint() renamed to H5Eprint1() and
* deprecated in this release.
*
* \details H5Eprint1() prints the error stack for the current thread
* on the specified stream, \p stream. Even if the error stack is empty, a
* one-line message of the following form will be printed:
* \code{.unparsed}
* HDF5-DIAG: Error detected in thread 0.
* \endcode
* H5Eprint1() is a convenience function for H5Ewalk1() with a function
* that prints error messages. Users are encouraged to write their own
* more specific error handlers.
*
*/
H5_DLL herr_t H5Eprint1(FILE *stream);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Turns automatic error printing on or off
*
* \param[in] func Function to be called upon an error condition
* \param[in] client_data Data passed to the error function
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Eset_auto() renamed to H5Eset_auto1() and
* deprecated in this release.
*
* \details H5Eset_auto1() turns on or off automatic printing of errors. When
* turned on (non-null \p func pointer), any API function which returns
* an error indication will first call \p func, passing it \p
* client_data as an argument.
*
* \p func, a function conforming to the #H5E_auto1_t prototype, is
* defined in the H5Epublic.h source code file as:
* \snippet this H5E_auto1_t_snip
*
* When the library is first initialized, the auto printing function is
* set to H5Eprint1() (cast appropriately) and \p client_data is the
* standard error stream pointer, \c stderr.
*
* Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
* direction.
*
*/
H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Walks the current error stack, calling the specified function
*
* \param[in] direction Direction in which the error stack is to be walked
* \param[in] func Function to be called for each error encountered
* \param[in] client_data Data to be passed to \p func
* \return \herr_t
*
* \deprecated 1.8.0 Function H5Ewalk() renamed to H5Ewalk1() and
* deprecated in this release.
*
* \details H5Ewalk1() walks the error stack for the current thread and calls
* the function specified in \p func for each error along the way.
*
* \p direction specifies whether the stack is walked from the inside
* out or the outside in. A value of #H5E_WALK_UPWARD means to begin
* with the most specific error and end at the API; a value of
* #H5E_WALK_DOWNWARD means to start at the API and end at the
* innermost function where the error was first detected.
*
* \p func, a function conforming to the #H5E_walk1_t prototype, will
* be called for each error in the error stack. Its arguments will
* include an index number \c n (beginning at zero regardless of stack
* traversal direction), an error stack entry \c err_desc, and the \c
* client_data pointer passed to H5Eprint(). The #H5E_walk1_t prototype
* is as follows:
* \snippet this H5E_walk1_t_snip
*
*/
H5_DLL herr_t H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client_data);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Returns a character string describing an error specified by a major
* error number
*
* \param[in] maj Major error number
* \return \herr_t
*
* \deprecated 1.8.0 Function deprecated in this release.
*
* \details H5Eget_major() returns a constant
* character string that describes the error, given a major error number.
*
* \attention This function returns a dynamically allocated string (\c char
* array). An application calling this function must free the memory
* associated with the return value to prevent a memory leak.
*
*/
H5_DLL char *H5Eget_major(H5E_major_t maj);
/**
* --------------------------------------------------------------------------
* \ingroup H5E
*
* \brief Returns a character string describing an error specified by a minor
* error number
*
* \param[in] min Minor error number
* \return \herr_t
*
* \deprecated 1.8.0 Function deprecated and return type changed in this release.
*
* \details H5Eget_minor() returns a constant
* character string that describes the error, given a minor error number.
*
* \attention In the Release 1.8.x series, H5Eget_minor() returns a string of
* dynamic allocated \c char array. An application calling this
* function from an HDF5 library of Release 1.8.0 or later must free
* the memory associated with the return value to prevent a memory
* leak. This is a change from the 1.6.x release series.
*
*/
H5_DLL char *H5Eget_minor(H5E_minor_t min);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
}
#endif
#endif /* end H5Epublic_H */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save