-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kinetic electron case to precompilation runs inputs
Also add a script to precompile specifically for kinetic electron runs.
- Loading branch information
1 parent
d8cfa26
commit 3d3b87a
Showing
3 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Pkg | ||
|
||
# Activate the moment_kinetics package | ||
Pkg.activate(".") | ||
|
||
using PackageCompiler | ||
|
||
# Create the sysimage 'moment_kinetics.so' in the base moment_kinetics source directory | ||
# with both moment_kinetics and the dependencies listed above precompiled. | ||
# Warning: editing the code will not affect what runs when using this .so, you | ||
# need to re-precompile if you change anything. | ||
create_sysimage(; sysimage_path="moment_kinetics.so", | ||
precompile_execution_file="util/precompile_run_kinetic-electrons.jl", | ||
include_transitive_dependencies=false, # This is needed to make MPI work, see https://github.com/JuliaParallel/MPI.jl/issues/518 | ||
sysimage_build_args=`-O3 --check-bounds=no`, # Assume if we are precompiling we want an optimized, production build | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# provide option of running from command line via 'julia moment_kinetics.jl' | ||
using Pkg | ||
Pkg.activate(".") | ||
|
||
using moment_kinetics | ||
|
||
# Create a temporary directory for test output | ||
test_output_directory = tempname() | ||
mkpath(test_output_directory) | ||
|
||
input = Dict("run_name" => "precompilation", | ||
"base_directory" => test_output_directory, | ||
"dt" => 0.0, | ||
"evolve_moments_density" => true, | ||
"evolve_moments_parallel_flow" => true, | ||
"evolve_moments_parallel_pressure" => true, | ||
"electron_physics" => "kinetic_electrons", | ||
"r_ngrid" => 1, | ||
"r_nelement" => 1, | ||
"r_bc" => "periodic", | ||
"r_discretization" => "chebyshev_pseudospectral", | ||
"z_ngrid" => 5, | ||
"z_nelement" => 4, | ||
"z_bc" => "wall", | ||
"z_discretization" => "chebyshev_pseudospectral", | ||
"vperp_ngrid" => 1, | ||
"vperp_nelement" => 1, | ||
"vperp_bc" => "zero", | ||
"vperp_L" => 4.0, | ||
"vperp_discretization" => "chebyshev_pseudospectral", | ||
"vpa_ngrid" => 7, | ||
"vpa_nelement" => 8, | ||
"vpa_bc" => "zero", | ||
"vpa_L" => 8.0, | ||
"vpa_discretization" => "chebyshev_pseudospectral", | ||
"vzeta_ngrid" => 1, | ||
"vzeta_nelement" => 1, | ||
"vzeta_bc" => "zero", | ||
"vzeta_L" => 4.0, | ||
"vzeta_discretization" => "chebyshev_pseudospectral", | ||
"vr_ngrid" => 1, | ||
"vr_nelement" => 1, | ||
"vr_bc" => "zero", | ||
"vr_L" => 4.0, | ||
"vr_discretization" => "chebyshev_pseudospectral", | ||
"vz_ngrid" => 7, | ||
"vz_nelement" => 8, | ||
"vz_bc" => "zero", | ||
"vz_L" => 8.0, | ||
"vz_discretization" => "chebyshev_pseudospectral", | ||
"timestepping" => Dict{String,Any}("nstep" => 1, | ||
"dt" => 2.0e-11), | ||
"electron_timestepping" => Dict{String,Any}("nstep" => 1, | ||
"dt" => 2.0e-11, | ||
"initialization_residual_value" => 1.0e10, | ||
"converged_residual_value" => 1.0e10, | ||
"rtol" => 1.0e10, | ||
"no_restart" => true)) | ||
|
||
|
||
run_moment_kinetics(input) |