From c1b477a1b2b796617c4e345a7296a8d429d7a067 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Sun, 26 Feb 2023 18:36:05 -0500 Subject: Update to v0.4 feature: compute the 2-point correlation function in easyeq. feature: compute the Fourier transform of the 2-point correlation function in anyeq and easyeq. feature: compute the local maximum of the 2-point correlation function and its Fourier transform. feature: compute the compressibility for anyeq. feature: allow for linear spacing of rho's. feature: print the scattering length. change: ux and uk now return real numbers. fix: error in the computation of the momentum distribution: wrong definition of delta functions. fix: various minor bugs. optimization: assign explicit types to variables. --- src/multithread.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/multithread.jl (limited to 'src/multithread.jl') diff --git a/src/multithread.jl b/src/multithread.jl new file mode 100644 index 0000000..f61cdd7 --- /dev/null +++ b/src/multithread.jl @@ -0,0 +1,16 @@ +# split up 1...n among workers +function spawn_workers(n::Int64) + # number of workers + nw=nworkers() + # split jobs among workers + work=Array{Array{Int64,1},1}(undef,nw) + # init empty arrays + for p in 1:nw + work[p]=Int64[] + end + for i in 1:n + append!(work[(i-1)%nw+1],[i]) + end + + return work +end -- cgit v1.2.3-70-g09d2