Skip to content

Commit 2446b1d

Browse files
authored
Mention required tools in analysis/sims/ReadMe.md (#481)
* Mention required tools in analysis/sims/ReadMe.md Add dev shell to analysis/sims/flake.nix which includes those tools. * Add more tools to sims shell
1 parent bf7b346 commit 2446b1d

File tree

2 files changed

+47
-31
lines changed

2 files changed

+47
-31
lines changed

analysis/sims/ReadMe.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,37 @@ These instructions are valid for the folders `2025w25/` and onwards.
88
### Running the simulation
99

1010
1. Navigate to the folder for the study, for example `2025w31c/`.
11-
2. Copy or link the Rust simulator `sim-cli` executable to that folder.
11+
2. Make sure to have the following tools installed: `yaml2json`, `jq` and `pigz`
12+
- *Nix:* use the default dev shell of the `sims/` flake `nix develop ..`
13+
3. Copy or link the Rust simulator `sim-cli` executable to that folder.
1214
- If you want to reproduce the study, check out the git commit listed in the `sim-cli.hash` file.
13-
- Otherwise, run `cargo build --release` in the [sim-rs](../../sim-rs/) folder.
14-
3. Copy of link the Haskell `leios-trace-processor` executable to that folder.
15+
- Build with `cargo build --release` in the [sim-rs](../../sim-rs/) folder.
16+
- Link with `ln -s ../../../sim-rs/target/release/sim-cli` from the study folder.
17+
4. Copy of link the Haskell `leios-trace-processor` executable to that folder.
1518
- *Cabal:* compile using `cabal build all`.
16-
- *Nix:* compile using `nix build #leios-trace-processor`.
17-
4. You can execute individual scenarios by executing the `run.sh` script in the relevant folder.
19+
- *Nix:* compile using `nix build ../..#leios-trace-processor && ln -s result/bin/leios-trace-processor`.
20+
5. You can execute individual scenarios by executing the `run.sh` script in the relevant folder.
1821
- *Nix:* run `./run.sh`, which will automatically fetch the package dependencies.
1922
- *Without Nix:* run `bash run.sh`, but make sure you have the dependent tools already installled, which are listed in the first lines of `run.sh`.
20-
5. The results folder will contain results:
23+
6. The results folder will contain results:
2124
- `sim.log.gz`: the simulation log file, but with a few of the minor message types discarded.
2225
- `lifecycle.csv.gz`: transaction lifecycle results.
2326
- `resoruces.csv.gz`: resource usage results.
2427
- `receipts.csv.gz`: message diffusion results.
2528
- `cpus.csv.gz`: CPU usage results.
2629
- `sizes.csv.gz`: BLock size results.
27-
6. You can also run several simulations at once using the `parallel` command-line tool.
28-
30+
7. You can also run several simulations at once using the `parallel` command-line tool.
2931

3032
### Combining the results
3133

32-
7. Execute the `combine-results.sh` script to bundle the results from multiple runs into the `results/` folder.
34+
8. Execute the `combine-results.sh` script to bundle the results from multiple runs into the `results/` folder.
3335
- *Nix:* run `./combine-results.sh`.
3436
- *Without nix:* run `bash combine-results.sh` after installing the required dependencies.
35-
3637

3738
### Plot the results in Jupyter
3839

39-
8. Start a Jupter notebook server using the command `nix run #../sims/`.
40-
9. In the web browser, navigate to the relevant experiment folder and open any `.ipynb` files of interest.
40+
9. Start a Jupter notebook server using the command `nix run #../sims/`.
41+
10. In the web browser, navigate to the relevant experiment folder and open any `.ipynb` files of interest.
4142

4243

4344
## Data dictionary

analysis/sims/flake.nix

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description = "Your jupyenv project";
2+
description = "Flake for simulations and analysis";
33

44
nixConfig.extra-substituters = [
55
"https://tweag-jupyter.cachix.org"
@@ -14,30 +14,45 @@
1414
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
1515
inputs.jupyenv.url = "github:tweag/jupyenv";
1616

17-
outputs = {
18-
self,
19-
flake-compat,
20-
flake-utils,
21-
nixpkgs,
22-
jupyenv,
23-
...
24-
} @ inputs:
25-
flake-utils.lib.eachSystem
26-
[
17+
outputs =
18+
{ self
19+
, flake-compat
20+
, flake-utils
21+
, nixpkgs
22+
, jupyenv
23+
, ...
24+
} @ inputs:
25+
flake-utils.lib.eachSystem [
2726
flake-utils.lib.system.x86_64-linux
2827
]
29-
(
30-
system: let
28+
(system:
29+
let
3130
inherit (jupyenv.lib.${system}) mkJupyterlabNew;
32-
jupyterlab = mkJupyterlabNew ({...}: {
31+
jupyterlab = mkJupyterlabNew ({ ... }: {
3332
nixpkgs = inputs.nixpkgs;
34-
imports = [(import ./kernels.nix {pkgs = nixpkgs;})];
33+
imports = [ (import ./kernels.nix { pkgs = nixpkgs; }) ];
3534
});
36-
in rec {
37-
packages = {inherit jupyterlab;};
35+
pkgs = import nixpkgs { inherit system; };
36+
in
37+
rec {
38+
packages = { inherit jupyterlab; };
3839
packages.default = jupyterlab;
40+
3941
apps.default.program = "${jupyterlab}/bin/jupyter-lab";
4042
apps.default.type = "app";
41-
}
42-
);
43+
44+
devShells.sims = pkgs.mkShell {
45+
buildInputs = [
46+
pkgs.remarshal # yaml2json
47+
pkgs.jq
48+
pkgs.ansifilter
49+
pkgs.gnugrep
50+
pkgs.gnused
51+
pkgs.gzip
52+
pkgs.pigz
53+
pkgs.bc
54+
];
55+
};
56+
devShells.default = devShells.sims;
57+
});
4358
}

0 commit comments

Comments
 (0)