Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Aug 1, 2023
1 parent ef44bea commit 9f82890
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/foldssum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function product(sum::FoldsSum{<:Any,<:DistributedEx}, v::ITensor)
end

function product(callback, sum::FoldsSum, v::ITensor)
return Folds.sum(terms(sum), executor(sum)) begin term
return Folds.sum(terms(sum), executor(sum)) do term
res = term(v)
callback()
return res
Expand All @@ -86,7 +86,7 @@ function position!(sum::FoldsSum{<:Any,<:DistributedEx}, v::MPS, pos::Int)
end

function position!(callback, sum::FoldsSum, v::MPS, pos::Int)
new_terms = Folds.map(term -> position!(term, v, pos), terms(sum), executor(sum)) begin term
new_terms = Folds.map(terms(sum), executor(sum)) do term
res = position!(term, v, pos)
callback()
return res
Expand All @@ -99,7 +99,7 @@ function noiseterm(sum::FoldsSum, v::ITensor, dir::String)
end

function noiseterm(callback, sum::FoldsSum, v::ITensor, dir::String)
return Folds.sum(terms(sum), executor(sum)) begin term
return Folds.sum(terms(sum), executor(sum)) do term
res = noiseterm(term, v, dir)
callback()
return res
Expand Down
2 changes: 1 addition & 1 deletion src/force_gc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end
# https://discourse.julialang.org/t/from-multithreading-to-distributed/101984/6
function force_gc(gb_threshold::Real=get_gc_gb_threshold())
if Sys.free_memory() < gb_threshold * 2^30
GC.gc()
GC.gc()
end
return nothing
end
2 changes: 1 addition & 1 deletion src/mpisumterm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set_term(sumterm::MPISumTerm, term) = (@set sumterm.term = term)
set_comm(sumterm::MPISumTerm, comm) = (@set sumterm.comm = comm)

MPISumTerm(mpo::MPO, comm::MPI.Comm) = MPISumTerm(ProjMPO(mpo), comm)
MPISumTerm(mpos::Vector{MPO},comm::MPI.Comm) = MPISumTerm(ProjMPOSum(mpos),comm)
MPISumTerm(mpos::Vector{MPO}, comm::MPI.Comm) = MPISumTerm(ProjMPOSum(mpos), comm)

nsite(sumterm::MPISumTerm) = nsite(term(sumterm))

Expand Down

0 comments on commit 9f82890

Please sign in to comment.