diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index e5c3a9f90..427012e56 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout VSL - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: vsl diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 61b9f5b2d..af64a2030 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -1,7 +1,13 @@ name: Markdown Lint on: - workflow_call: + push: + branches: + - main + + pull_request: + branches: + - main jobs: markdownlint: diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index d6879d82b..e3e3f9f4f 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -1,7 +1,13 @@ name: Shellcheck on: - workflow_call: + push: + branches: + - main + + pull_request: + branches: + - main jobs: shellcheck: diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index 6b027e89a..df93c68a8 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -1,7 +1,9 @@ name: Todo Checker on: - workflow_call: + push: + branches: + - main jobs: todo: diff --git a/.github/workflows/ci.yml b/.github/workflows/v-ci.yml similarity index 71% rename from .github/workflows/ci.yml rename to .github/workflows/v-ci.yml index 94309ba3d..9cbbb7ba4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/v-ci.yml @@ -8,9 +8,6 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - schedule: - - cron: "31 1,12 * * *" - push: branches: - main @@ -20,24 +17,11 @@ on: - main jobs: - shellcheck: - name: Shellcheck - uses: ./.github/workflows/shellcheck.yml - - markdownlint: - name: Markdown Lint - uses: ./.github/workflows/markdownlint.yml - - todo: - if: github.event_name == 'push' - name: TODO - uses: ./.github/workflows/todo.yml - validate-docs: runs-on: ubuntu-latest steps: - name: Checkout VSL - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: vsl @@ -79,7 +63,7 @@ jobs: steps: - name: Checkout VSL - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: vsl @@ -133,7 +117,7 @@ jobs: steps: - name: Checkout VSL - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: vsl @@ -178,3 +162,59 @@ jobs: - name: Execute Tests using Pure V Backend with Pure C Blas and Garbage Collection enabled run: ~/.vmodules/vsl/bin/test ${{ matrix.flags }} --use-cblas --use-gc boehm if: ${{ matrix.os != 'ubuntu-18.04' }} + + run-tests-on-macos: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: + - macos-latest + flags: + - "" + - "--prod" + + steps: + - name: Checkout VSL + uses: actions/checkout@v3 + with: + path: vsl + + - name: Setup V + uses: vlang/setup-v@v1.3 + with: + check-latest: true + + - name: V doctor + run: v doctor + + - name: Install dependencies + run: | + brew install coreutils + brew install gcc + brew install libomp + brew install hdf5 + brew install open-mpi + brew install openblas + brew install lapack + + - name: Move VSL source code to V Modules + run: mv ./vsl ~/.vmodules + + - name: Execute Tests using Pure V Backend + # TODO: Remove continue-on-error when CI is fixed for macOS + continue-on-error: true + run: ~/.vmodules/vsl/bin/test + + - name: Execute Tests using Pure V Backend with Pure C Blas + continue-on-error: true + run: ~/.vmodules/vsl/bin/test --use-cblas + + - name: Execute Tests using Pure V Backend and Garbage Collection enabled + continue-on-error: true + run: ~/.vmodules/vsl/bin/test --use-gc boehm + + - name: Execute Tests using Pure V Backend with Pure C Blas and Garbage Collection enabled + continue-on-error: true + run: ~/.vmodules/vsl/bin/test --use-cblas --use-gc boehm diff --git a/deriv/README.md b/deriv/README.md index 168283331..096613e8d 100644 --- a/deriv/README.md +++ b/deriv/README.md @@ -1,71 +1,71 @@ -# Numerical Differentiation +# 🚀 Numerical Differentiation -This module provides functions for computing numerical derivatives of -functions. +This module provides functions for computing numerical derivatives of functions. 🧮 -An adaptive algorithm is used to find the best -choice of finite difference and to estimate the error in the derivative. +An adaptive algorithm is used to find the best choice of finite difference and to +estimate the error in the derivative. 🎯 -The development of this module is inspired by the same present in [GSL](https://github.com/ampl/gsl) -looking to adapt it completely to the practices and tools present in VSL. +The development of this module is inspired by the same present in +[GSL](https://github.com/ampl/gsl) 📚, looking to adapt it completely +to the practices and tools present in VSL. 🛠️ ## Functions +### `central` + ```v ignore fn central (f func.Fn, x, h f64) (f64, f64) ``` -This function computes the numerical derivative of the function `f` -at the point `x` using an adaptive central difference algorithm with -a step-size of `h`. The derivative is returned in `result` and an -estimate of its absolute error is returned in `abserr`. - -The initial value of `h` is used to estimate an optimal step-size, -based on the scaling of the truncation error and round-off error in the -derivative calculation. The derivative is computed using a 5-point rule -for equally spaced abscissae at `x - h`, `x - h/2`, `x`, -`x + h/2`, `x+h`, with an error estimate taken from the difference -between the 5-point rule and the corresponding 3-point rule `x-h`, -`x`, `x+h`. Note that the value of the function at `x` -does not contribute to the derivative calculation, so only 4-points are -actually used. +This function computes the numerical derivative of the function `f` at the point `x` +using an adaptive central difference algorithm with a step-size of `h`. The derivative +is returned in `result` and an estimate of its absolute error is returned in `abserr`. + +The initial value of `h` is used to estimate an optimal step-size, based on the scaling +of the truncation error and round-off error in the derivative calculation. +The derivative is computed using a 5-point rule for equally spaced abscissae +at `x - h`, `x - h/2`, `x`, `x + h/2`, `x+h`, with an error estimate taken +from the difference between the 5-point rule and the corresponding 3-point +rule `x-h`, `x`, `x+h`. Note that the value of the function at `x` does not +contribute to the derivative calculation, so only 4-points are actually used. 🧐 + +### `forward` ```v ignore fn forward (f func.Fn, x, h f64) (f64, f64) ``` -This function computes the numerical derivative of the function `f` -at the point `x` using an adaptive forward difference algorithm with -a step-size of `h`. The function is evaluated only at points greater -than `x`, and never at `x` itself. The derivative is returned in -`result` and an estimate of its absolute error is returned in -`abserr`. This function should be used if `f(x)` has a -discontinuity at `x`, or is undefined for values less than `x`. - -The initial value of `h` is used to estimate an optimal step-size, -based on the scaling of the truncation error and round-off error in the -derivative calculation. The derivative at `x` is computed using an -"open" 4-point rule for equally spaced abscissae at `x+h/4`, -`x + h/2`, `x + 3h/4`, `x+h`, with an error estimate taken -from the difference between the 4-point rule and the corresponding -2-point rule `x+h/2`, `x+h`. +This function computes the numerical derivative of the function `f` at the point `x` +using an adaptive forward difference algorithm with a step-size of `h`. The function +is evaluated only at points greater than `x`, and never at `x` itself. The derivative +is returned in `result` and an estimate of its absolute error is returned in `abserr`. +This function should be used if `f(x)` has a discontinuity at `x`, or +is undefined for values less than `x`. 📈 + +The initial value of `h` is used to estimate an optimal step-size, based on the scaling +of the truncation error and round-off error in the derivative calculation. The derivative +at `x` is computed using an "open" 4-point rule for equally spaced abscissae at `x+h/4`, +`x + h/2`, `x + 3h/4`, `x+h`, with an error estimate taken from the difference between +the 4-point rule and the corresponding 2-point rule `x+h/2`, `x+h`. 🚀 + +### `backward` ```v ignore fn backward (f func.Fn, x, h f64) (f64, f64) ``` -This function computes the numerical derivative of the function `f` -at the point `x` using an adaptive backward difference algorithm -with a step-size of `h`. The function is evaluated only at points -less than `x`, and never at `x` itself. The derivative is -returned in `result` and an estimate of its absolute error is -returned in `abserr`. This function should be used if `f(x)` -has a discontinuity at `x`, or is undefined for values greater than -`x`. +This function computes the numerical derivative of the function `f` at the point `x` +using an adaptive backward difference algorithm with a step-size of `h`. The function +is evaluated only at points less than `x`, and never at `x` itself. The derivative is +returned in `result` and an estimate of its absolute error is returned in `abserr`. +This function should be used if `f(x)` has a discontinuity at `x`, or is undefined +for values greater than `x`. 📉 -This function is equivalent to calling `deriv.forward` with a -negative step-size. +This function is equivalent to calling `deriv.forward` with a negative step-size. ## References and Further Reading -This work is a spiritual descendent of the Differentiation module in [GSL](https://github.com/ampl/gsl). +This work is a spiritual descendent of the Differentiation module in [GSL](https://github.com/ampl/gsl). 📖 + +Feel free to explore and utilize these numerical differentiation functions in +your projects! 🤖📊🔬 diff --git a/diff/README.md b/diff/README.md index ffbdb41a1..5f3589d77 100644 --- a/diff/README.md +++ b/diff/README.md @@ -1,7 +1,10 @@ -# Numerical Differentiation +# 🧮 Numerical Differentiation -This module provides functions for computing numerical derivatives of -functions. +This module equips you with powerful functions for calculating numerical +derivatives of functions. Dive into the world of numerical differentiation with ease! 🚀 -An adaptive algorithm is used to find the best -choice of finite difference and to estimate the error in the derivative. +Utilizing an adaptive algorithm, we help you determine the optimal finite difference and +provide error estimates for your derivatives. Say goodbye to guesswork! 📊💡 + +Explore the possibilities and make your mathematical computations smoother with +Numerical Differentiation. 🌟 diff --git a/mpi/_cflags.c.v b/mpi/_cflags.c.v index 24ea44913..5f5a22569 100644 --- a/mpi/_cflags.c.v +++ b/mpi/_cflags.c.v @@ -2,12 +2,12 @@ module mpi #flag linux -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/x86_64-linux-gnu/mpi -pthread #flag linux -pthread -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi -#flag darwin -I/usr/local/Cellar/open-mpi/4.0.1_2/include -I/usr/local/include -#flag darwin -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.0.1_2/lib -L/usr/local/lib -lmpi -#flag freebsd -I/usr/local/Cellar/open-mpi/4.0.1_2/include -I/usr/local/include -#flag freebsd -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.0.1_2/lib -L/usr/local/lib -lmpi -#flag openbsd -I/usr/local/Cellar/open-mpi/4.0.1_2/include -I/usr/local/include -#flag openbsd -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.0.1_2/lib -L/usr/local/lib -lmpi +#flag darwin -I/usr/local/Cellar/open-mpi/4.1.5/include -I/usr/local/include +#flag darwin -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.1.5/lib -L/usr/local/lib -lmpi +#flag freebsd -I/usr/local/Cellar/open-mpi/4.1.5/include -I/usr/local/include +#flag freebsd -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.1.5/lib -L/usr/local/lib -lmpi +#flag openbsd -I/usr/local/Cellar/open-mpi/4.1.5/include -I/usr/local/include +#flag openbsd -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.1.5/lib -L/usr/local/lib -lmpi #flag -I@VMODROOT #include diff --git a/vlas/README.md b/vlas/README.md index f6d765015..20133d5de 100644 --- a/vlas/README.md +++ b/vlas/README.md @@ -52,7 +52,7 @@ brew install openblas ## LAPACKE Backend -Use the flag `-d lapacke` to use the LAPACKE backend. +Use the flag `-d lapacke` to use the LAPACKE backend (enabled by default for now). ### Install dependencies diff --git a/vlas/cflags_d_cblas.v b/vlas/cflags_d_cblas.v index ff59c5d8e..ae18e60f2 100644 --- a/vlas/cflags_d_cblas.v +++ b/vlas/cflags_d_cblas.v @@ -4,6 +4,6 @@ module vlas #flag linux -lopenblas -llapacke -L/usr/local/lib -L/usr/lib #flag windows -O2 #flag windows -lopenblas -lgfortran -#flag darwin -I/usr/local/opt/openblas/include -I/usr/local/include -#flag darwin -lopenblas -L/usr/local/opt/openblas/lib -L/usr/local/lib +#flag darwin -I/usr/local/opt/openblas/include +#flag darwin -llapacke -lopenblas -L/usr/local/opt/openblas/lib #flag -I@VMODROOT diff --git a/vlas/cflags_notd_cblas.v b/vlas/cflags_notd_cblas.v index 211a09268..8a66ee902 100644 --- a/vlas/cflags_notd_cblas.v +++ b/vlas/cflags_notd_cblas.v @@ -4,6 +4,6 @@ module vlas #flag linux -llapacke -L/usr/local/lib -L/usr/lib #flag windows -O2 #flag windows -lopenblas -lgfortran -#flag darwin -I/usr/local/opt/openblas/include -I/usr/local/include -#flag darwin -lopenblas -L/usr/local/opt/openblas/lib -L/usr/local/lib +#flag darwin -I/usr/local/opt/openblas/include +#flag darwin -llapacke -lopenblas -L/usr/local/opt/openblas/lib #flag -I@VMODROOT