Skip to content

Commit

Permalink
Merge pull request #6 from houpc/houpc
Browse files Browse the repository at this point in the history
Add dSigma/dk for m*
  • Loading branch information
houpc authored Apr 3, 2024
2 parents 52bcac6 + 40d357a commit 6100f51
Show file tree
Hide file tree
Showing 20 changed files with 8,141 additions and 75 deletions.
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

0 comments on commit 6100f51

Please sign in to comment.