Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dSigma/dk for m* #6

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions example/compile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function GVcompileC_so(partition, datatype::DataType=Float64; c_source=joinpath(@__DIR__, "source_codeGV", "func_sigmaGV.c"),
lib_path=joinpath(@__DIR__, "source_codeGV"), lib_name="sigmaGV", compiler::String="gcc", isnative::Bool=false)
lib = joinpath(lib_path, "$lib_name.so")
### compile C source file to *.so library
if isnative
command = `$compiler -shared -fPIC -o $lib $c_source -O3 -march=native`
else
command = `$compiler -shared -fPIC -o $lib $c_source -O3`
end
run(command)

### generate the C wrapper Julia functions and save them in the same path of C library
GV_Cwrapper(partition, datatype, lib_path=lib_path, lib_name=lib_name)
end
8 changes: 6 additions & 2 deletions example/input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ diagGenerate = :GV # :GV or :Parquet, algorithm to generate diagrams
isLayered2D = false # whether to use layered 2D system or not

spin = 2 # 2 for unpolarized, 1 for polarized
spinPolarPara = 2 / spin - 1 # spin-polarization parameter (n_up - n_down) / (n_up + n_down) ∈ [0,1]
ispolarized = spinPolarPara != 0.0
# spin = 1 # 2 for unpolarized, 1 for polarized
# spinPolarPara = 2 / spin - 1 # spin-polarization parameter (n_up - n_down) / (n_up + n_down) ∈ [0,1]
ispolarized = spin < 2

println("rs = $rs, mass2 = $mass2, order = $order, neval = $neval")

Expand All @@ -25,6 +26,7 @@ basenames = [
"para_wn_1minus0",
"data$(dim)d_Z",
"data$(dim)d_K",
"data$(dim)d_dk",
"meff_$(dim)d",
"inverse_meff_$(dim)d",
"zfactor_$(dim)d",
Expand All @@ -48,6 +50,7 @@ end
para_basename,
sigma_z_basename,
sigma_k_basename,
sigmadk_basename,
meff_basename,
inverse_meff_basename,
zfactor_basename,
Expand All @@ -65,6 +68,7 @@ para_directory = "" # src directory
const parafilename = joinpath(para_directory, para_basename * ".csv")
const sigma_z_filename = joinpath(data_directory, sigma_z_basename * ".jld2")
const sigma_k_filename = joinpath(data_directory, sigma_k_basename * ".jld2")
const sigmadk_filename = joinpath(data_directory, sigmadk_basename * ".jld2")
const meff_filename = joinpath(res_directory, meff_basename * ".dat")
const inverse_meff_filename = joinpath(res_directory, inverse_meff_basename * ".dat")
const zfactor_filename = joinpath(res_directory, zfactor_basename * ".dat")
Expand Down
Loading
Loading