fullwave25 1.3.2.dev2__tar.gz → 1.3.2.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/.bumpversion.toml +1 -1
  2. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/PKG-INFO +1 -1
  3. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/__init__.py +1 -1
  4. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/solver.py +67 -38
  5. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/pyproject.toml +1 -1
  6. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/uv.lock +1 -1
  7. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/.gitignore +0 -0
  8. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/.pre-commit-config.yaml +0 -0
  9. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/.python-version +0 -0
  10. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/CITATION.cff +0 -0
  11. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/CONTRIBUTING.md +0 -0
  12. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/LICENSE +0 -0
  13. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/Makefile +0 -0
  14. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/README.md +0 -0
  15. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/attenuation.png +0 -0
  16. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/beamformer.m +0 -0
  17. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_2d_2_relax_multi_gpu_cuda124 +0 -0
  18. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_2d_exponential_attenuation_multi_gpu +0 -0
  19. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_2d_exponential_attenuation_multi_gpu_cuda124 +0 -0
  20. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_2d_exponential_attenuation_multi_gpu_cuda124_ +0 -0
  21. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_3d_exponential_attenuation_multi_gpu_cuda124 +0 -0
  22. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/debug_solver_bin/fullwave2_3d_exponential_attenuation_multi_gpu_cuda124_ +0 -0
  23. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/experiments/__init__.py +0 -0
  24. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/experiments/exp_scatterer_diameter.py +0 -0
  25. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/beamformer/__init__.py +0 -0
  26. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/beamformer/beamformer.py +0 -0
  27. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/constants/__init__.py +0 -0
  28. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/constants/material_properties.py +0 -0
  29. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/grid.py +0 -0
  30. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium.py +0 -0
  31. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/__init__.py +0 -0
  32. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/domain.py +0 -0
  33. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/medium_builder.py +0 -0
  34. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/__init__.py +0 -0
  35. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/data/.keep +0 -0
  36. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat +0 -0
  37. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/domain_abdominal_wall.py +0 -0
  38. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/domain_background.py +0 -0
  39. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/domain_scatterer.py +0 -0
  40. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/domain_simple.py +0 -0
  41. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/medium_builder/presets/domain_water_gel.py +0 -0
  42. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/sensor.py +0 -0
  43. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/__init__.py +0 -0
  44. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/binary_manager.py +0 -0
  45. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_cuda118 +0 -0
  46. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_cuda124 +0 -0
  47. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_cuda129 +0 -0
  48. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_cuda130 +0 -0
  49. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_cuda118 +0 -0
  50. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_cuda124 +0 -0
  51. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_cuda129 +0 -0
  52. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/_gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_cuda130 +0 -0
  53. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/database/relaxation_params_database_num_relax=3_20260828_1513.mat +0 -0
  54. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/database/relaxation_params_database_num_relax=3_20260828_1513_invalid_cells.json +0 -0
  55. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/database/relaxation_params_database_num_relax=4_20260828_1456.mat +0 -0
  56. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/bins/database/relaxation_params_database_num_relax=4_20260828_1456_invalid_cells.json +0 -0
  57. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/cuda_utils.py +0 -0
  58. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/input_file_writer.py +0 -0
  59. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/launcher.py +0 -0
  60. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/pml_builder.py +0 -0
  61. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/shipped_database.py +0 -0
  62. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/source_type.py +0 -0
  63. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/solver/utils.py +0 -0
  64. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/source.py +0 -0
  65. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/transducer.py +0 -0
  66. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/transmit.py +0 -0
  67. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/__init__.py +0 -0
  68. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/check_functions.py +0 -0
  69. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/coordinates.py +0 -0
  70. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/memory_tempfile.py +0 -0
  71. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/numerical.py +0 -0
  72. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/plot_utils.py +0 -0
  73. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/pulse.py +0 -0
  74. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/relaxation_parameters.py +0 -0
  75. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/scatterer.py +0 -0
  76. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/signal_filter.py +0 -0
  77. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/fullwave/utils/signal_process.py +0 -0
  78. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/ruff.toml +0 -0
  79. {fullwave25-1.3.2.dev2 → fullwave25-1.3.2.dev4}/signal_filter_example.png +0 -0
@@ -1,5 +1,5 @@
1
1
  [tool.bumpversion]
2
- current_version = "1.3.2-dev2"
2
+ current_version = "1.3.2-dev4"
3
3
  parse = """(?x)
4
4
  (?P<major>0|[1-9]\\d*)\\.
5
5
  (?P<minor>0|[1-9]\\d*)\\.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fullwave25
3
- Version: 1.3.2.dev2
3
+ Version: 1.3.2.dev4
4
4
  Summary: Fullwave 2.5: Ultrasound wave propagation simulation with heterogeneous power law attenuation modelling capabilities
5
5
  Author: Masashi Sode, Gianmarco Pinton
6
6
  Maintainer: Masashi Sode
@@ -66,7 +66,7 @@ try:
66
66
  __version__ = version("fullwave")
67
67
  except PackageNotFoundError:
68
68
  # Update via bump-my-version, not manually
69
- __version__ = "1.3.2-dev2"
69
+ __version__ = "1.3.2-dev4"
70
70
 
71
71
  VERSION = __version__ # for convenience
72
72
  logger.info("Fullwave version: %s", __version__)
@@ -42,6 +42,7 @@ COMPATIBLE_CUDA_ARCHITECTURES = [
42
42
  "sm_90", # Hopper: H100, H200
43
43
  "sm_100", # Blackwell: RTX 50 series
44
44
  "sm_101", # Blackwell: RTX 50 series
45
+ "sm_103", # Blackwell
45
46
  "sm_120", # Blackwell: RTX 50 series
46
47
  "sm_121", # Blackwell: RTX 50 series
47
48
  ]
@@ -56,18 +57,6 @@ VERIFIED_CUDA_ARCHITECTURES = [
56
57
  ]
57
58
 
58
59
 
59
- COMPATIBLE_CUDA_VERSIONS = [
60
- 11.8,
61
- 12.4,
62
- 12.9,
63
- 13.0,
64
- 13.1,
65
- ]
66
-
67
- COMPATIBLE_CUDA_RANGES = [
68
- (11.8, 13.1),
69
- ]
70
-
71
60
  VERIFIED_CUDA_VERSIONS = [
72
61
  12.4,
73
62
  12.9,
@@ -108,6 +97,7 @@ COMPATIBLE_CUDA_VERSIONS_ARCHITECTURES_set = {
108
97
  (12.9, "sm_90"),
109
98
  (12.9, "sm_100"),
110
99
  (12.9, "sm_101"),
100
+ (12.9, "sm_103"),
111
101
  (12.9, "sm_120"),
112
102
  (12.9, "sm_121"),
113
103
  # ---
@@ -149,7 +139,36 @@ def _make_cuda_arch_option(*, use_gpu: bool = True) -> str:
149
139
  return arch_option
150
140
 
151
141
 
152
- def _make_cuda_version_option(*, use_gpu: bool = True) -> tuple[str, float]:
142
+ def _make_cuda_version_option(*, cuda_arch: str, use_gpu: bool = True) -> tuple[str, float]:
143
+ """Return the CUDA tag of the binary to run on this driver and architecture.
144
+
145
+ The driver reports the newest CUDA version it supports, and it also runs a binary
146
+ built with an older CUDA version. The choice is therefore the newest CUDA version
147
+ with a build for the architecture that is not newer than the driver. Where no such
148
+ build exists, the choice is the oldest build of the driver's CUDA major version,
149
+ which runs through CUDA minor version compatibility. A Blackwell GPU on a CUDA 12.8
150
+ driver takes this path, because its first build is CUDA 12.9.
151
+
152
+ Parameters
153
+ ----------
154
+ cuda_arch : str
155
+ The architecture option of the first GPU, such as "sm_90".
156
+ use_gpu : bool, optional
157
+ Whether the simulation runs on the GPU. Without it, the driver version is
158
+ returned unchecked.
159
+
160
+ Returns
161
+ -------
162
+ tuple[str, float]
163
+ The tag the binary name ends with, such as "cuda129", and its CUDA version.
164
+
165
+ Raises
166
+ ------
167
+ ValueError
168
+ If the driver version cannot be read, or the architecture has no build as
169
+ old as the driver and none of the driver's CUDA major version.
170
+
171
+ """
153
172
  cuda_version: float = retrieve_cuda_version()
154
173
  if use_gpu and cuda_version == -1:
155
174
  error_msg = (
@@ -159,34 +178,38 @@ def _make_cuda_version_option(*, use_gpu: bool = True) -> tuple[str, float]:
159
178
  logger.error(error_msg)
160
179
  raise ValueError(error_msg)
161
180
 
162
- # range check
163
- if use_gpu and not any(start <= cuda_version <= end for start, end in COMPATIBLE_CUDA_RANGES):
164
- error_msg = (
165
- f"CUDA version {cuda_version} is not in the compatible ranges: "
166
- f"{COMPATIBLE_CUDA_RANGES}. Please install a compatible CUDA version."
181
+ if use_gpu:
182
+ built_versions = sorted(
183
+ version
184
+ for version, arch in COMPATIBLE_CUDA_VERSIONS_ARCHITECTURES_set
185
+ if arch == cuda_arch
167
186
  )
168
- logger.error(error_msg)
169
- raise ValueError(error_msg)
170
-
171
- # find the a compatible cuda version below the system cuda
172
- if use_gpu and cuda_version not in COMPATIBLE_CUDA_VERSIONS:
173
- compatible_versions_below = [v for v in COMPATIBLE_CUDA_VERSIONS if v < cuda_version]
174
- if compatible_versions_below:
175
- closest_version = max(compatible_versions_below)
176
- message = (
177
- f"Warning: CUDA version {cuda_version} is not in the compatible versions: "
178
- f"{COMPATIBLE_CUDA_VERSIONS}. "
179
- f"Using the closest compatible version {closest_version} instead."
180
- )
181
- logger.warning(message)
182
- cuda_version = closest_version
187
+ older_versions = [version for version in built_versions if version <= cuda_version]
188
+ same_major_versions = [
189
+ version for version in built_versions if int(version) == int(cuda_version)
190
+ ]
191
+ if older_versions:
192
+ closest_version = older_versions[-1]
193
+ elif same_major_versions:
194
+ closest_version = same_major_versions[0]
183
195
  else:
184
196
  error_msg = (
185
- f"No compatible CUDA versions found below {cuda_version}. "
186
- "Please install a compatible CUDA version."
197
+ f"No binary for architecture {cuda_arch} runs on a driver that supports "
198
+ f"CUDA {cuda_version}. The binaries for this architecture are built with "
199
+ f"CUDA {built_versions}. Please update the NVIDIA driver."
187
200
  )
188
201
  logger.error(error_msg)
189
202
  raise ValueError(error_msg)
203
+ if closest_version != cuda_version:
204
+ message = (
205
+ f"Warning: CUDA version {cuda_version} of the driver has no binary for "
206
+ f"architecture {cuda_arch}. "
207
+ f"Using the closest compatible version {closest_version} instead."
208
+ )
209
+ if closest_version > cuda_version:
210
+ message += " It runs through CUDA minor version compatibility."
211
+ logger.warning(message)
212
+ cuda_version = closest_version
190
213
 
191
214
  if use_gpu and cuda_version not in VERIFIED_CUDA_VERSIONS:
192
215
  warning_msg = (
@@ -240,7 +263,10 @@ def _retrieve_fullwave_simulation_path(
240
263
  use_isotropic_relaxation: bool = True,
241
264
  ) -> Path:
242
265
  arch_option = _make_cuda_arch_option(use_gpu=use_gpu)
243
- cuda_version_option, cuda_version = _make_cuda_version_option(use_gpu=use_gpu)
266
+ cuda_version_option, cuda_version = _make_cuda_version_option(
267
+ use_gpu=use_gpu,
268
+ cuda_arch=arch_option,
269
+ )
244
270
  if use_isotropic_relaxation is False:
245
271
  error_msg = (
246
272
  "Currently, only isotropic relaxation is supported. "
@@ -251,10 +277,13 @@ def _retrieve_fullwave_simulation_path(
251
277
  # isotropic_str = "_isotropic" if use_isotropic_relaxation else ""
252
278
  isotropic_str = ""
253
279
 
254
- _check_compatible_set(
280
+ if use_gpu and not _check_compatible_set(
255
281
  cuda_version=cuda_version,
256
282
  cuda_arch=arch_option,
257
- )
283
+ ):
284
+ error_msg = f"No binary is built with CUDA {cuda_version} for architecture {arch_option}."
285
+ logger.error(error_msg)
286
+ raise ValueError(error_msg)
258
287
  if use_exponential_attenuation:
259
288
  if is_3d and use_gpu:
260
289
  path_fullwave_simulation_bin = (
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fullwave25"
3
- version = "1.3.2-dev2" # Update via bump-my-version, not manually
3
+ version = "1.3.2-dev4" # Update via bump-my-version, not manually
4
4
  description = "Fullwave 2.5: Ultrasound wave propagation simulation with heterogeneous power law attenuation modelling capabilities"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -761,7 +761,7 @@ wheels = [
761
761
 
762
762
  [[package]]
763
763
  name = "fullwave25"
764
- version = "1.3.2.dev2"
764
+ version = "1.3.2.dev4"
765
765
  source = { editable = "." }
766
766
  dependencies = [
767
767
  { name = "cupy-cuda12x" },
File without changes