Skip to content

Instantly share code, notes, and snippets.

@deep75
deep75 / stokes3D-XPU.jl
Created May 1, 2022 03:11
ParallelStencil.jl/miniapps/stokes_multixpu/Stokes3D_multixpu.jl
const USE_GPU = true
using ParallelStencil
using ParallelStencil.FiniteDifferences3D
@static if USE_GPU
@init_parallel_stencil(CUDA, Float64, 3)
else
@init_parallel_stencil(Threads, Float64, 3)
end
using ImplicitGlobalGrid, Plots, Printf, Statistics, LinearAlgebra # ATTENTION: plotting fails inside plotting library if using flag '--math-mode=fast'.
import MPI
@deep75
deep75 / scalar_porowaves2D.jl
Last active April 30, 2022 23:25
ParallelStencil.jl/miniapps/scalar_porowaves2D.jl
const USE_GPU = false # Use GPU? If this is set false, then no GPU needs to be available
using ParallelStencil
using ParallelStencil.FiniteDifferences2D
@static if USE_GPU
@init_parallel_stencil(CUDA, Float64, 2)
else
@init_parallel_stencil(Threads, Float64, 2)
end
using Plots, Printf, Statistics
@deep75
deep75 / ThermalConvection2D.jl
Last active April 30, 2022 22:32
ParallelStencil.jl/miniapps/ThermalConvection2D.jl
using ParallelStencil
using ParallelStencil.FiniteDifferences2D
using Plots, Printf, Statistics, LinearAlgebra
@parallel function assign!(A::Data.Array, B::Data.Array)
@all(A) = @all(B)
return
end
@parallel function compute_error!(Err_A::Data.Array, A::Data.Array)
@deep75
deep75 / acoustic2D.jl
Created April 30, 2022 22:00
ParallelStencil.jl/miniapps/acoustic2D.jl
const USE_GPU = false # Use GPU? If this is set false, then no GPU needs to be available
using ParallelStencil
using ParallelStencil.FiniteDifferences2D
@static if USE_GPU
@init_parallel_stencil(CUDA, Float64, 2)
else
@init_parallel_stencil(Threads, Float64, 2)
end
using Plots, Printf, Statistics
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deep75
deep75 / branin-elasticmanager.jl
Last active March 29, 2022 22:08
The Branin Function is commonly used as a test function for metamodelling in computer experiments, especially in the context of optimization => https://github.com/SciML/Surrogates.jl/blob/master/docs/src/BraninFunction.md
### A Pluto.jl notebook ###
# v0.18.4
using Markdown
using InteractiveUtils
# ╔═╡ 17d3ca02-afa8-11ec-2f02-21d36cc79349
using Distributed, ClusterManagers
# ╔═╡ eda32dec-9254-4a77-bfe2-2bdb63128fd0
@deep75
deep75 / vm.yaml
Last active December 13, 2023 23:30
kubevirt vm example with ubuntu 20.04 qcow2 image
apiVersion: kubevirt.io/v1
kind: VirtualMachineInstance
metadata:
name: vm1
labels:
vmi : vm1
spec:
terminationGracePeriodSeconds: 30
domain:
resources:
@everywhere begin
using NeuralPDE, Flux, ModelingToolkit, GalacticOptim, Optim, DiffEqFlux
import ModelingToolkit: Interval, infimum, supremum
end
@everywhere begin
@parameters t, x
@variables u(..)
Dxx = Differential(x)^2
Dtt = Differential(t)^2
@everywhere begin
using NeuralPDE, Flux, ModelingToolkit, GalacticOptim, Optim, DiffEqFlux
import ModelingToolkit: Interval, infimum, supremum
end
# the example is taken from this article https://arxiv.org/abs/1910.10503
@everywhere begin
@parameters x
@variables p(..)
Dx = Differential(x)