diff --git a/Cargo.lock b/Cargo.lock index a01ed7a..c412e31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -334,12 +334,9 @@ dependencies = [ "image", "imageproc", "indexmap", - "itertools", "lazy_static", "log", - "lru", "more-asserts", - "natord", "ndarray", "num", "rand 0.8.5", @@ -350,13 +347,26 @@ dependencies = [ "spirv-std-macros", "spirv_backend", "spirv_backend_runner", - "structopt", "threadpool", "typetag", "wgpu", "y4m", ] +[[package]] +name = "coremem_post" +version = "0.1.0" +dependencies = [ + "bincode", + "coremem", + "crossterm", + "itertools", + "lru", + "natord", + "rayon", + "structopt", +] + [[package]] name = "crc32fast" version = "1.3.2" diff --git a/Cargo.toml b/Cargo.toml index fa81d6e..1c9fccc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "crates/spirv_backend", "crates/spirv_backend_builder", "crates/spirv_backend_runner", + "crates/post", "crates/applications/buffer_proto5", "crates/applications/multi_core_inverter", diff --git a/README.md b/README.md index 6d74986..8a5c7ec 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ allowing you to dig further into the simulation in an _interactive_ way (versus renderer used in the `wavefront` example): ```rust -// serialize frames for later viewing with `cargo run --release --bin viewer` +// serialize frames for later viewing with `cargo run -p coremem_post --release --bin viewer` driver.add_serializer_renderer(&*format!("{}frame-", prefix), 36000, None); ``` @@ -134,7 +134,7 @@ $ cargo run --release --example sr_latch and then investigate the results with ``` -$ pushd crates/coremem ; cargo run --bin viewer ../../out/applications/sr_latch ; popd +$ cargo run -p coremem_post --bin viewer ./out/applications/sr_latch ``` ![screencapture of Viewer for SR latch at t=2.8ns. it shows two rings spaced horizontally, with arrows circulating them](readme_images/sr_latch_EzBxy_2800ps.png "SR latch at t=2.8ns") @@ -252,7 +252,7 @@ measurements include ([src/meas.rs](crates/coremem/src/meas.rs)): output targets include ([src/render.rs](crates/coremem/src/render.rs)): - `ColorTermRenderer`: renders 2d-slices in real-time to the terminal. - `Y4MRenderer`: outputs 2d-slices to an uncompressed `y4m` video file. -- `SerializerRenderer`: dumps the full 3d simulation state to disk. parseable after the fact with [src/bin/viewer.rs](crates/coremem/src/bin/viewer.rs). +- `SerializerRenderer`: dumps the full 3d simulation state to disk. parseable after the fact with [src/bin/viewer.rs](crates/post/src/bin/viewer.rs). - `CsvRenderer`: dumps the output of all measurements into a `csv` file. historically there was also a plotly renderer, but that effort was redirected into developing the viewer tool better. diff --git a/crates/coremem/Cargo.toml b/crates/coremem/Cargo.toml index b9cb829..7c001bb 100644 --- a/crates/coremem/Cargo.toml +++ b/crates/coremem/Cargo.toml @@ -25,19 +25,15 @@ futures = "0.3" # MIT or Apache 2.0 image = "0.24" # MIT imageproc = "0.23" # MIT indexmap = "1.9" # MIT or Apache 2.0 -itertools = "0.10" # MIT or Apache 2.0 lazy_static = "1.4" # MIT or Apache 2.0 log = "0.4" # MIT or Apache 2.0 -lru = "0.7" # MIT more-asserts = "0.3" # CC0-1.0 -natord = "1.0" # MIT ndarray = { version = "0.15", features = ["rayon", "serde"] } # MIT or Apache 2.0 num = "0.4" # MIT or Apache 2.0 # plotly = { version = "0.6", features = ["kaleido", "plotly_ndarray"], path = "../plotly/plotly" } rand = "0.8" # MIT or Apache 2.0 rayon = "1.5" # MIT or Apache 2.0 serde = "1.0" # MIT or Apache 2.0 -structopt = "0.3" # MIT or Apache 2.0 threadpool = "1.8" # MIT or Apache 2.0 typetag = "0.2" # MIT or Apache 2.0 y4m = "0.7" # MIT diff --git a/crates/coremem/src/lib.rs b/crates/coremem/src/lib.rs index c313d9a..78f0ed6 100644 --- a/crates/coremem/src/lib.rs +++ b/crates/coremem/src/lib.rs @@ -11,7 +11,6 @@ pub mod driver; pub mod geom; pub mod mat; pub mod meas; -pub mod post; pub mod real; pub mod render; pub mod sim; diff --git a/crates/post/Cargo.toml b/crates/post/Cargo.toml new file mode 100644 index 0000000..c97429f --- /dev/null +++ b/crates/post/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "coremem_post" +version = "0.1.0" +authors = ["Colin "] +edition = "2021" + +[dependencies] +coremem = { path = "../coremem" } +crossterm = "0.24" # MIT +bincode = "1.3" # MIT +itertools = "0.10" # MIT or Apache 2.0 +lru = "0.7" # MIT +natord = "1.0" # MIT +rayon = "1.5" # MIT or Apache 2.0 +structopt = "0.3" # MIT or Apache 2.0 diff --git a/crates/coremem/src/bin/csv.rs b/crates/post/src/bin/csv.rs similarity index 91% rename from crates/coremem/src/bin/csv.rs rename to crates/post/src/bin/csv.rs index 5633158..7ab294c 100644 --- a/crates/coremem/src/bin/csv.rs +++ b/crates/post/src/bin/csv.rs @@ -1,4 +1,5 @@ -use coremem::post::{Loader, LoaderCache}; +// use crate::{Loader, LoaderCache}; +use coremem_post::{Loader, LoaderCache}; use std::path::PathBuf; use structopt::StructOpt; diff --git a/crates/coremem/src/bin/decimate.rs b/crates/post/src/bin/decimate.rs similarity index 90% rename from crates/coremem/src/bin/decimate.rs rename to crates/post/src/bin/decimate.rs index bcf77e1..362c9f6 100644 --- a/crates/coremem/src/bin/decimate.rs +++ b/crates/post/src/bin/decimate.rs @@ -1,4 +1,5 @@ -use coremem::post::Loader; +// use crate::Loader; +use coremem_post::Loader; use std::fs; use std::path::PathBuf; use structopt::StructOpt; diff --git a/crates/coremem/src/bin/viewer.rs b/crates/post/src/bin/viewer.rs similarity index 97% rename from crates/coremem/src/bin/viewer.rs rename to crates/post/src/bin/viewer.rs index 2587bac..9a16e1e 100644 --- a/crates/coremem/src/bin/viewer.rs +++ b/crates/post/src/bin/viewer.rs @@ -1,4 +1,4 @@ -use coremem::post::{Loader, Viewer}; +use coremem_post::{Loader, Viewer}; use std::path::PathBuf; use std::time::Duration; use structopt::StructOpt; diff --git a/crates/coremem/src/post.rs b/crates/post/src/lib.rs similarity index 98% rename from crates/coremem/src/post.rs rename to crates/post/src/lib.rs index 495b29a..c316d53 100644 --- a/crates/coremem/src/post.rs +++ b/crates/post/src/lib.rs @@ -1,7 +1,7 @@ //! Post-processing tools -use crate::meas::AbstractMeasurement; -use crate::render::{ColorTermRenderer, Renderer as _, RenderConfig, SerializedFrame}; -use crate::sim::{SimState, StaticSim}; +use coremem::meas::AbstractMeasurement; +use coremem::render::{ColorTermRenderer, Renderer as _, RenderConfig, SerializedFrame}; +use coremem::sim::{SimState, StaticSim}; use itertools::Itertools as _; use lru::LruCache;