PyCLAW's fluid solver
PyCLAW has a number of pure python 1D fluid solvers, would be a good use case for stencils that are a bit more complicated than Laplace's equation.
https://github.com/clawpack/pyclaw/tree/master/apps/stegoton_1d
Hello @aterrel
Thank you for highlighting this use case. I'm interested in contributing to the development of more complex stencils for PyCLAW's 1D fluid solvers. After reviewing the Stegoton 1D application, I would like to take a shot at benchmarking the PyCLAW 1D fluid solvers mentioned in this issue. As a beginner, I see this as a very great opportunity for me to deepen my understanding of computational fluid dynamics and stencil operations beyond the standard Laplace equation.
After reviewing, I would like to propose the following contribution with the below plan:
-
Set up the stegoton1d example: I'll begin by cloning the PyCLAW repository and running the stegoton1d example provided in the link: https://github.com/clawpack/pyclaw/tree/master/apps/stegoton1d. This will give me a baseline understanding of the solvers' behavior.
-
Develop benchmarking scripts: I'll create Python scripts using the time module or a dedicated benchmarking tool like timelit to measure the execution time of the solvers for different problem sizes and configurations.
-
Implement various stencil operations: I'll explore different stencil implementations, potentially using NumPy or Numba for optimization, and compare their performance. This will help me to identify the most efficient methods for complex stencil operations.
-
Compare against a known implementation: If possible, I'll compare the performance against a known, optimized implementation of a similar fluid solver (e.g., in Fortran or C) to assess the efficiency of the pure Python approach.
-
Documentation and Reporting: I'll document my findings and provide the benchmarking code and results in a pull request for review. This will include detailed performance metrics and potential areas for further optimization.
References:
- PyCLAW Repository: https://github.com/clawpack/pyclaw (For cloning and running the example)
- Python time module: https://docs.python.org/3/library/timeit.html (For basic timing)
- pytest-benchmark: https://pytest-benchmark.readthedocs.io/en/stable/ (For more advanced benchmarking)
- NumPy: https://numpy.org/ (For efficient array operations)
- Numba: https://numba.pydata.org/ (For potential JIT compilation of stencil operations)
Let me know if you have any specific requirements or suggestions for this benchmarking effort. I am eager to receive your feedback and guidance to ensure my contribution aligns with the project's goals.
Best regards, [Shreyash Kumar]