Skip to content

Commit

Permalink
Use threads local sums of C_h and I_h to reduce memory consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar committed Nov 27, 2024
1 parent 8ec4dc0 commit 857cc84
Show file tree
Hide file tree
Showing 16 changed files with 390 additions and 270 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/doccleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Delete preview and history
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
env:
PRNUM: ${{ github.event.number }}

- name: Push changes
run: |
git push --force origin gh-pages-new:gh-pages
12 changes: 8 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ jobs:
with:
version: '1.10'
- uses: julia-actions/cache@v1
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
- name: Install Dependencies
run: |
julia --project=./docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: Build and Deploy
run: julia -t 2 --project=./docs ./docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia -t 2 --project=docs/ docs/make.jl
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ version = "0.1.2"
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DynamicSampling = "2083aeaf-6258-5d07-89fc-32cf5060c837"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7"
Expand All @@ -20,8 +22,10 @@ StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
[compat]
Dates = "1"
Distributions = "0.25"
DynamicSampling = "0.4"
FileIO = "1.16"
JLD2 = "0.4"
LazyArrays = "2"
LinearAlgebra = "1"
MAT = "0.10"
MutableNamedTuples = "0.1.3"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ julia --proj test/runtests.jl
</a><br />
<p>Paris 1: Pantheon - Sorbonne</p>
</td>
<td align="center">
<a href="https://github.com/Tortar">
<img src="https://avatars.githubusercontent.com/Tortar" width="100px;" alt="Adriano Meligrana"/><br />
<sub><b>Adriano Meligrana</b></sub>
</a><br />
<p>University of Turin</p>
<p>Email: <a href="mailto:[email protected]:">[email protected]</a></p>
</td>
</tr>
</table>

Expand Down
15 changes: 12 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Literate.markdown(joinpath(indir, "scenario_analysis_via_overload.jl"), outdir;
Literate.markdown(joinpath(indir, "change_expectations.jl"), outdir; credit = false)


println("Documentation Build")

@info "Building Documentation"
makedocs(
sitename = "BeforeIT.jl",
format = Documenter.HTML(prettyurls = false),
Expand All @@ -47,4 +46,14 @@ makedocs(
],
)

deploydocs(;repo = "github.com/bancaditalia/BeforeIT.jl.git")
@info "Deploying Documentation"
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing
if CI
deploydocs(
repo = "github.com/JuliaDynamics/BeforeIT.jl.git",
target = "build",
push_preview = true,
devbranch = "main",
)
end
println("Finished building and deploying docs.")
5 changes: 4 additions & 1 deletion src/BeforeIT.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
module BeforeIT

import Base: length

using DynamicSampling
using LazyArrays
using LinearAlgebra
using Random
using StatsBase
import Base: length

# definition of agents
include("model_init/agents.jl")
Expand Down
Loading

0 comments on commit 857cc84

Please sign in to comment.