From c9d63d7bf61f4d5fe2ef7a79148e0958a6c72241 Mon Sep 17 00:00:00 2001 From: romnnn Date: Mon, 3 Jul 2023 20:19:59 +0200 Subject: [PATCH] refactor: split accelsim tools into packages --- Cargo.lock | 41 +- Cargo.toml | 2 + WIP.md | 1 + accelsim/Cargo.lock | 2021 +++++++++++++++++ accelsim/Cargo.toml | 28 +- .../gpu-simulator/gpgpu-sim/setup_environment | 9 +- accelsim/build.rs | 273 --- accelsim/parse/Cargo.toml | 8 + accelsim/parse/src/main.rs | 3 + accelsim/sim/Cargo.toml | 23 + accelsim/sim/build.rs | 105 + accelsim/sim/src/main.rs | 200 ++ .../src/{parse.rs => bin/accelsim-parse.rs} | 0 accelsim/src/build.rs | 38 + accelsim/src/git.rs | 41 + accelsim/src/lib.rs | 102 +- accelsim/src/sim.rs | 198 -- accelsim/trace/Cargo.toml | 29 + accelsim/trace/build.rs | 120 + accelsim/{src/trace.rs => trace/src/main.rs} | 111 +- playground/Cargo.toml | 5 - playground/src/main.rs | 26 +- utils/Cargo.toml | 3 +- utils/src/build.rs | 1 + utils/src/lib.rs | 36 +- 25 files changed, 2783 insertions(+), 641 deletions(-) create mode 100644 accelsim/Cargo.lock delete mode 100644 accelsim/build.rs create mode 100644 accelsim/parse/Cargo.toml create mode 100644 accelsim/parse/src/main.rs create mode 100644 accelsim/sim/Cargo.toml create mode 100644 accelsim/sim/build.rs create mode 100644 accelsim/sim/src/main.rs rename accelsim/src/{parse.rs => bin/accelsim-parse.rs} (100%) create mode 100644 accelsim/src/build.rs create mode 100644 accelsim/src/git.rs create mode 100644 accelsim/trace/Cargo.toml create mode 100644 accelsim/trace/build.rs rename accelsim/{src/trace.rs => trace/src/main.rs} (96%) create mode 100644 utils/src/build.rs diff --git a/Cargo.lock b/Cargo.lock index 93e9a8e9..00e16f63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,25 +6,44 @@ version = 3 name = "accelsim" version = "0.1.0" dependencies = [ - "async-process", - "bzip2", "clap", "color-eyre", - "console", "csv", - "dialoguer", "duct", "duration-string", - "indicatif", + "glob", "itertools", "regex", - "reqwest", "rev_buf_reader", +] + +[[package]] +name = "accelsim-sim" +version = "0.1.0" +dependencies = [ + "accelsim", + "async-process", + "clap", + "color-eyre", + "duct", + "tokio", +] + +[[package]] +name = "accelsim-trace" +version = "0.1.0" +dependencies = [ + "accelsim", + "async-process", + "bzip2", + "color-eyre", + "console", + "dialoguer", + "duct", + "reqwest", "tar", - "thiserror", "tokio", "trace-model", - "utils", ] [[package]] @@ -2200,15 +2219,11 @@ dependencies = [ "cc", "clap", "color-eyre", - "console", "cxx", "cxx-build", - "dialoguer", "duct", "glob", - "indicatif", "pretty_assertions", - "thiserror", ] [[package]] @@ -3415,7 +3430,7 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" name = "utils" version = "0.1.0" dependencies = [ - "glob", + "color-eyre", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index c6672d04..62d64d68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,8 @@ members = [ "profile", "playground", "accelsim", + "accelsim/trace", + "accelsim/sim", "utils", "plot", "trace", diff --git a/WIP.md b/WIP.md index d8e68f07..49d0eae9 100644 --- a/WIP.md +++ b/WIP.md @@ -1,6 +1,7 @@ #### TODO - fix github actions build +- DONE: update accelsim reference source - get more stats to match - DONE: use separate cache stats per cache - implement per structure stats diff --git a/accelsim/Cargo.lock b/accelsim/Cargo.lock new file mode 100644 index 00000000..0063f7e8 --- /dev/null +++ b/accelsim/Cargo.lock @@ -0,0 +1,2021 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "accelsim" +version = "0.1.0" +dependencies = [ + "clap", + "color-eyre", + "csv", + "duct", + "duration-string", + "glob", + "itertools", + "regex", + "rev_buf_reader", +] + +[[package]] +name = "accelsim-sim" +version = "0.1.0" +dependencies = [ + "accelsim", + "async-process", + "clap", + "color-eyre", + "duct", + "tokio", + "utils", +] + +[[package]] +name = "accelsim-trace" +version = "0.1.0" +dependencies = [ + "accelsim", + "async-process", + "bzip2", + "color-eyre", + "console", + "dialoguer", + "duct", + "reqwest", + "tar", + "tokio", + "trace-model", + "utils", +] + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.22", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 0.37.22", + "signal-hook", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "color-eyre" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "csv" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "duct" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ae3fc31835f74c2a7ceda3aeede378b0ae2e74c8f1c36559fcc9ae2a4e7d3e" +dependencies = [ + "libc", + "once_cell", + "os_pipe", + "shared_child", +] + +[[package]] +name = "duration-string" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcc1d9ae294a15ed05aeae8e11ee5f2b3fe971c077d45a42fb20825fba6ee13" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "windows-sys 0.48.0", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +dependencies = [ + "hermit-abi", + "rustix 0.38.2", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0aa48fab2893d8a49caa94082ae8488f4e1050d73b367881dcd2198f4199fd8" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "nvbit-model" +version = "0.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed8221fc0c459a801decee6c2abdfbe62e3824dd14127917e5aa5a414131229a" +dependencies = [ + "serde", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "rev_buf_reader" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c0f2e47e00e29920959826e2e1784728a3780d1a784247be5257258cc75f910" +dependencies = [ + "memchr", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.37.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabcb0461ebd01d6b79945797c27f8529082226cb630a9865a71870ff63532a4" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.165" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c939f902bb7d0ccc5bce4f03297e161543c2dcb30914faf032c2bd0b7a0d48fc" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.165" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eaae920e25fffe4019b75ff65e7660e72091e59dd204cb5849bbd6a3fd343d7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "2.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.37.22", + "windows-sys 0.48.0", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "trace-model" +version = "0.1.0" +dependencies = [ + "nvbit-model", + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "utils" +version = "0.1.0" +dependencies = [ + "color-eyre", + "libc", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" diff --git a/accelsim/Cargo.toml b/accelsim/Cargo.toml index b33f05de..ed0cbb8c 100644 --- a/accelsim/Cargo.toml +++ b/accelsim/Cargo.toml @@ -2,22 +2,12 @@ name = "accelsim" version = "0.1.0" edition = "2021" -default-run = "accelsim-trace" [lib] crate-type = ["rlib"] -[[bin]] -name = "accelsim-trace" -path = "src/trace.rs" - -[[bin]] -name = "accelsim-sim" -path = "src/sim.rs" - [[bin]] name = "accelsim-parse" -path = "src/parse.rs" [features] default = [] @@ -26,26 +16,12 @@ default = [] denylist = ["default"] [dependencies] -thiserror = "1" color-eyre = "0" -dialoguer = "0" -indicatif = "0" -console = "0" +duct = "0" itertools = "0" csv = "1" +glob = "0" regex = "1" rev_buf_reader = "0" duration-string = "0" -async-process = "1" clap = { version = "4", features = [ "derive" ] } -tokio = { version = "1", features = ["full"] } -trace-model = { path = "../trace/model" } -utils = { path = "../utils" } - -[build-dependencies] -color-eyre = "0" -duct = "0" -reqwest = { version = "0", features = ["blocking", "rustls-tls"] } -bzip2 = "0.4" -tar = "0.4" -utils = { path = "../utils" } diff --git a/accelsim/accel-sim-framework-dev/gpu-simulator/gpgpu-sim/setup_environment b/accelsim/accel-sim-framework-dev/gpu-simulator/gpgpu-sim/setup_environment index 7eeaa4f1..e15f22b9 100644 --- a/accelsim/accel-sim-framework-dev/gpu-simulator/gpgpu-sim/setup_environment +++ b/accelsim/accel-sim-framework-dev/gpu-simulator/gpgpu-sim/setup_environment @@ -7,10 +7,11 @@ export GPGPUSIM_ROOT="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )" GPGPUSIM_VERSION_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Version/ {print $8}'` #Detect Git branch and commit # -GIT_COMMIT=`git --git-dir=$GPGPUSIM_ROOT/.git log --abbrev-commit -n 1 | head -1 | sed -re 's/commit (.*)/\1/'` -GIT_FILES_CHANGED=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1./'` -GIT_FILES_CHANGED+=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat --cached | wc | sed -re 's/^\s+([0-9]+).*/\1/'` -GPGPUSIM_BUILD_STRING="gpgpu-sim_git-commit-$GIT_COMMIT-modified_$GIT_FILES_CHANGED" +# GIT_COMMIT=`git --git-dir=$GPGPUSIM_ROOT/.git log --abbrev-commit -n 1 | head -1 | sed -re 's/commit (.*)/\1/'` +# GIT_FILES_CHANGED=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1./'` +# GIT_FILES_CHANGED+=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat --cached | wc | sed -re 's/^\s+([0-9]+).*/\1/'` +# GPGPUSIM_BUILD_STRING="gpgpu-sim_git-commit-$GIT_COMMIT-modified_$GIT_FILES_CHANGED" +GPGPUSIM_BUILD_STRING="gpgpu-sim" echo -n "GPGPU-Sim version $GPGPUSIM_VERSION_STRING (build $GPGPUSIM_BUILD_STRING) "; diff --git a/accelsim/build.rs b/accelsim/build.rs deleted file mode 100644 index 2d42e82f..00000000 --- a/accelsim/build.rs +++ /dev/null @@ -1,273 +0,0 @@ -#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)] - -use color_eyre::{eyre, Section, SectionExt}; -use duct::cmd; -use std::env; -use std::fs::{File, OpenOptions}; -use std::io::Write; -use std::path::{Path, PathBuf}; - -static NVBIT_RELEASES: &str = "https://github.com/NVlabs/NVBit/releases/download"; -static NVBIT_VERSION: &str = "1.5.5"; - -static DEFAULT_TERM: &str = "xterm-256color"; - -#[must_use] -pub fn output_path() -> PathBuf { - PathBuf::from(env::var("OUT_DIR").unwrap()) - .canonicalize() - .unwrap() -} - -#[must_use] -pub fn manifest_path() -> PathBuf { - PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()) - .canonicalize() - .unwrap() -} - -#[must_use] -pub fn is_debug_build() -> bool { - matches!(env::var("PROFILE").ok().as_deref(), Some("DEBUG")) -} - -fn decompress_tar_bz2(src: impl AsRef, dest: impl AsRef) -> eyre::Result<()> { - let compressed = File::open(src)?; - let stream = bzip2::read::BzDecoder::new(compressed); - let mut archive = tar::Archive::new(stream); - archive.set_overwrite(true); - archive.set_preserve_mtime(true); - archive.unpack(&dest)?; - Ok(()) -} - -fn download_nvbit( - version: impl AsRef, - arch: impl AsRef, - dest: impl AsRef, -) -> eyre::Result<()> { - let nvbit_release_name = format!("nvbit-Linux-{}-{}", arch.as_ref(), version.as_ref()); - let nvbit_release_archive_name = format!("{nvbit_release_name}.tar.bz2"); - let nvbit_release_archive_url = reqwest::Url::parse(&format!( - "{NVBIT_RELEASES}/{}/{nvbit_release_archive_name}", - version.as_ref(), - ))?; - println!("cargo:warning=downloading {nvbit_release_archive_url}"); - - let archive_path = output_path().join(&nvbit_release_archive_name); - std::fs::remove_file(&archive_path).ok(); - - let mut nvbit_release_archive_file = File::create(&archive_path)?; - let mut data = reqwest::blocking::get(nvbit_release_archive_url)?; - data.copy_to(&mut nvbit_release_archive_file)?; - - decompress_tar_bz2(&archive_path, &dest)?; - - println!( - "cargo:warning=extracted {nvbit_release_archive_name} to {}", - dest.as_ref().display() - ); - Ok(()) -} - -pub struct GitRepository { - pub url: String, - pub path: PathBuf, - pub branch: Option, -} - -impl GitRepository { - pub fn shallow_clone(&self) -> eyre::Result<()> { - let _ = std::fs::remove_dir_all(&self.path); - let mut args = vec!["clone", "--depth=1"]; - if let Some(branch) = &self.branch { - args.extend(["-b", branch]); - } - let path = &*self.path.to_string_lossy(); - args.extend([self.url.as_str(), path]); - - let clone_cmd = cmd("git", &args) - .env("TERM", env::var("TERM").as_deref().unwrap_or(DEFAULT_TERM)) - .unchecked(); - - let result = clone_cmd.run()?; - println!("{}", String::from_utf8_lossy(&result.stdout)); - eprintln!("{}", String::from_utf8_lossy(&result.stderr)); - - if !result.status.success() { - eyre::bail!( - "git clone command {:?} exited with code {:?}", - [&["git"], args.as_slice()].concat(), - result.status.code() - ); - } - - Ok(()) - } -} - -fn build_accelsim(accel_path: &Path, cuda_path: &Path, force: bool) -> eyre::Result<()> { - let profile = if is_debug_build() { "debug" } else { "release" }; - let artifact = accel_path - .join("gpu-simulator/bin") - .join(profile) - .join("accel-sim.out"); - if !force && artifact.is_file() { - println!("cargo:warning=using existing {}", &artifact.display()); - return Ok(()); - } - - let tmp_build_sh_path = output_path().join("build.tmp.sh"); - let tmp_build_sh = format!( - "set -e -source {setup_script} {profile} -make -C {src} clean -make -j -C {src}", - setup_script = &accel_path - .join("gpu-simulator/setup_environment.sh") - .canonicalize()? - .to_string_lossy(), - profile = profile, - src = accel_path - .join("gpu-simulator/") - .canonicalize()? - .to_string_lossy() - .to_string(), - ); - dbg!(&tmp_build_sh); - - let mut tmp_build_sh_file = OpenOptions::new() - .write(true) - .truncate(true) - .create(true) - .open(&tmp_build_sh_path)?; - tmp_build_sh_file.write_all(tmp_build_sh.as_bytes())?; - - let make_cmd = cmd!( - "bash", - &*tmp_build_sh_path.canonicalize()?.to_string_lossy() - ) - .env("TERM", env::var("TERM").as_deref().unwrap_or(DEFAULT_TERM)) - .env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()) - .stderr_capture() - .stdout_capture() - .unchecked(); - - let result = make_cmd.run()?; - println!("{}", &String::from_utf8_lossy(&result.stdout)); - eprintln!("{}", &String::from_utf8_lossy(&result.stderr)); - - // write build logs - for (log_name, content) in &[ - ("build.log.stdout", result.stdout), - ("build.log.stderr", result.stderr), - ] { - let mut log_file = OpenOptions::new() - .write(true) - .truncate(true) - .create(true) - .open(manifest_path().join(log_name))?; - // todo: strip ansi color escape codes here - log_file.write_all(content)?; - } - - if !result.status.success() { - eyre::bail!("accelsim build exited with code {:?}", result.status.code()); - } - - println!("cargo:warning=built {}", &artifact.display()); - Ok(()) -} - -fn build_accelsim_tracer_tool( - accel_path: &Path, - cuda_path: &Path, - force: bool, -) -> eyre::Result<()> { - let nvbit_version = env::var("NVBIT_VERSION").unwrap_or_else(|_| NVBIT_VERSION.to_string()); - let target_arch = env::var("CARGO_CFG_TARGET_ARCH")?; - - let tracer_nvbit_tool_path = accel_path.join("util/tracer_nvbit"); - - let nvbit_path = tracer_nvbit_tool_path.join("nvbit_release"); - if force || !nvbit_path.is_dir() { - download_nvbit(nvbit_version, target_arch, &tracer_nvbit_tool_path)?; - } - - let artifact = tracer_nvbit_tool_path.join("tracer_tool/tracer_tool.so"); - if force || !artifact.is_file() { - let make_cmd = cmd!("make", "-j") - .dir(tracer_nvbit_tool_path) - .env("TERM", env::var("TERM").as_deref().unwrap_or(DEFAULT_TERM)) - .env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()) - .stderr_capture() - .stdout_capture() - .unchecked(); - - let result = make_cmd.run()?; - println!("{}", String::from_utf8_lossy(&result.stdout)); - eprintln!("{}", String::from_utf8_lossy(&result.stderr)); - - if !result.status.success() { - eyre::bail!( - "tracer tool build exited with code {:?}", - result.status.code() - ); - } - - println!("cargo:warning=built {}", &artifact.display()); - } else { - println!("cargo:warning=using existing {}", &artifact.display()); - } - - Ok(()) -} - -fn main() -> eyre::Result<()> { - color_eyre::install()?; - - println!("cargo:rerun-if-env-changed=USE_UPSTREAM_ACCELSIM"); - println!("cargo:rerun-if-env-changed=FORCE"); - println!("cargo:rerun-if-env-changed=BUILD"); - println!("cargo:rerun-if-changed=accel-sim-framework-dev/"); - - let use_upstream = env::var("USE_UPSTREAM_ACCELSIM") - .is_ok_and(|use_remote| use_remote.to_lowercase() == "yes"); - - let accel_path = if use_upstream { - let dest = output_path().join("accelsim"); - let repo = GitRepository { - url: "https://github.com/accel-sim/accel-sim-framework.git".to_string(), - path: dest.clone(), - branch: Some("release".to_string()), - }; - repo.shallow_clone()?; - dest - } else { - println!("cargo:rerun-if-changed=accel-sim-framework-dev/"); - manifest_path().join("accel-sim-framework-dev") - }; - - println!( - "cargo:warning=using accelsim source at {}", - &accel_path.display() - ); - - let cuda_candidates = utils::find_cuda(); - let cuda_path = cuda_candidates.first().ok_or( - eyre::eyre!("CUDA install path not found") - .with_section(|| format!("{:?}", &cuda_candidates).header("candidates:")), - )?; - println!("cargo:warning=using cuda at {}", &cuda_path.display()); - - let force = ["BUILD", "FORCE"] - .into_iter() - .filter_map(|name| env::var(name).ok()) - .map(|var| var.to_lowercase()) - .any(|var| var == "yes"); - println!("cargo:warning=force={}", &force); - - build_accelsim_tracer_tool(&accel_path, &cuda_path, force)?; - build_accelsim(&accel_path, &cuda_path, force)?; - Ok(()) -} diff --git a/accelsim/parse/Cargo.toml b/accelsim/parse/Cargo.toml new file mode 100644 index 00000000..9f237418 --- /dev/null +++ b/accelsim/parse/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "parse" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/accelsim/parse/src/main.rs b/accelsim/parse/src/main.rs new file mode 100644 index 00000000..e7a11a96 --- /dev/null +++ b/accelsim/parse/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/accelsim/sim/Cargo.toml b/accelsim/sim/Cargo.toml new file mode 100644 index 00000000..30c7d6fd --- /dev/null +++ b/accelsim/sim/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "accelsim-sim" +version = "0.1.0" +edition = "2021" + +[features] +default = [] + +[package.metadata.cargo-feature-combinations] +denylist = ["default"] + +[dependencies] +color-eyre = "0" +async-process = "1" +clap = { version = "4", features = [ "derive" ] } +tokio = { version = "1", features = ["full"] } + +accelsim = { path = "../" } + +[build-dependencies] +color-eyre = "0" +duct = "0" +accelsim = { path = "../" } diff --git a/accelsim/sim/build.rs b/accelsim/sim/build.rs new file mode 100644 index 00000000..6b68033e --- /dev/null +++ b/accelsim/sim/build.rs @@ -0,0 +1,105 @@ +use color_eyre::eyre::{self, WrapErr}; +use std::path::Path; + +fn build_accelsim(accel_path: &Path, cuda_path: &Path, force: bool) -> eyre::Result<()> { + use std::fs; + use std::io::Write; + + let artifact = accelsim::executable(accel_path); + if !force && artifact.is_file() { + println!("cargo:warning=using existing {}", &artifact.display()); + return Ok(()); + } + + let tmp_build_sh_path = accelsim::build::output_path()?.join("build.tmp.sh"); + + let setup_script = accel_path.join("gpu-simulator/setup_environment.sh"); + let setup_script = setup_script + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", setup_script.display()))?; + + let accel_build_src = accel_path.join("gpu-simulator/"); + let accel_build_src = accel_build_src + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", accel_build_src.display()))?; + + let tmp_build_sh = format!( + "set -e +source {setup_script} {profile} +make -C {src} clean +make -j -C {src}", + setup_script = &setup_script.to_string_lossy(), + profile = &accelsim::profile(), + src = &accel_build_src.to_string_lossy() + ); + dbg!(&tmp_build_sh); + + let mut tmp_build_sh_file = fs::OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(&tmp_build_sh_path)?; + tmp_build_sh_file.write_all(tmp_build_sh.as_bytes())?; + + let tmp_build_sh_path = tmp_build_sh_path + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", tmp_build_sh_path.display()))?; + + let make_cmd = duct::cmd!("bash", &*tmp_build_sh_path.to_string_lossy()) + .env("TERM", std::env::var("TERM").as_deref().unwrap_or_default()) + .env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()) + .stderr_capture() + .stdout_capture() + .unchecked(); + + let result = make_cmd.run()?; + println!("{}", &String::from_utf8_lossy(&result.stdout)); + eprintln!("{}", &String::from_utf8_lossy(&result.stderr)); + + // write build logs + for (log_name, content) in &[ + ("build.log.stdout", result.stdout), + ("build.log.stderr", result.stderr), + ] { + let mut log_file = fs::OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(accelsim::build::manifest_path()?.join(log_name))?; + // todo: strip ansi color escape codes here + log_file.write_all(content)?; + } + + if !result.status.success() { + eyre::bail!("accelsim build exited with code {:?}", result.status.code()); + } + + println!("cargo:warning=built {}", &artifact.display()); + Ok(()) +} + +fn main() -> eyre::Result<()> { + color_eyre::install()?; + + println!("cargo:rerun-if-env-changed=USE_UPSTREAM_ACCELSIM"); + println!("cargo:rerun-if-env-changed=FORCE"); + println!("cargo:rerun-if-env-changed=BUILD"); + println!("cargo:rerun-if-env-changed=build.rs"); + + let (_use_upstream, accel_path) = accelsim::locate()?; + println!("cargo:rerun-if-changed={}", accel_path.display()); + + println!( + "cargo:warning=using accelsim source at {}", + &accel_path.display() + ); + + let cuda_path = accelsim::find_cuda()?; + println!("cargo:warning=using cuda at {}", &cuda_path.display()); + + let force = accelsim::build::is_force(); + println!("cargo:warning=force={}", &force); + + build_accelsim(&accel_path, &cuda_path, force)?; + Ok(()) +} diff --git a/accelsim/sim/src/main.rs b/accelsim/sim/src/main.rs new file mode 100644 index 00000000..a9207e46 --- /dev/null +++ b/accelsim/sim/src/main.rs @@ -0,0 +1,200 @@ +use accelsim::parser::{parse, Options as ParseOptions}; +use accelsim::{Options, SimConfig}; +use async_process::Command; +use clap::Parser; +use color_eyre::eyre::{self, WrapErr}; +use std::io::Write; +use std::path::{Path, PathBuf}; +use std::time::{Duration, Instant}; + +fn locate_accelsim_bin(accel_path: &Path, profile: &str) -> eyre::Result { + let use_box = + std::option_env!("USE_BOX").is_some_and(|use_box| use_box.to_lowercase() == "yes"); + let accelsim_bin = if use_box { + accelsim::build::manifest_path()? + .join("../target") + .join(profile) + .join("playground") + } else { + accelsim::executable(accel_path) + // sim_root.join("bin").join(profile).join("accel-sim.out") + }; + Ok(accelsim_bin) +} + +async fn sim_trace( + traces_dir: impl AsRef, + config: SimConfig, + timeout: Option, +) -> eyre::Result { + let (_is_upstream, accelsim_path) = accelsim::locate()?; + let profile = accelsim::profile(); + + // #[cfg(debug_assertions)] + // let profile = "debug"; + // #[cfg(not(debug_assertions))] + // let profile = "release"; + + let accelsim_bin = locate_accelsim_bin(&accelsim_path, &profile)?; + let accelsim_bin = accelsim_bin + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", accelsim_bin.display()))?; + + // if !accelsim_bin.is_file() { + // eyre::bail!("missing {}", accelsim_bin.display()); + // } + + let sim_root = accelsim_path.join("gpu-simulator/"); + let setup_env = sim_root.join("setup_environment.sh"); + let setup_env = setup_env + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", setup_env.display()))?; + + // if !setup_env.is_file() { + // eyre::bail!("missing {}", setup_env.display()); + // } + + let mut tmp_sim_sh = vec!["set -e".to_string()]; + + // change current working dir + let config_dir = &config.config_dir; + let config_dir = config_dir + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", config_dir.display()))?; + + if !config_dir.is_dir() { + eyre::bail!("config dir {} is not a directory", config_dir.display()); + } + + tmp_sim_sh.push(format!("cd {}", config_dir.display())); + + // source simulator setup + tmp_sim_sh.push(format!( + "source {} {}", + &*setup_env.to_string_lossy(), + &profile, + )); + + // run accelsim binary + let gpgpusim_config = config.config()?; + let kernelslist = traces_dir.as_ref().join("kernelslist.g"); + let kernelslist = kernelslist + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", kernelslist.display()))?; + + let mut trace_cmd: Vec = vec![ + accelsim_bin.to_string_lossy().to_string(), + "-trace".to_string(), + kernelslist.to_string_lossy().to_string(), + "-config".to_string(), + gpgpusim_config.to_string_lossy().to_string(), + ]; + + let gpgpusim_trace_config = config.trace_config()?; + + if gpgpusim_trace_config.is_file() { + trace_cmd.extend([ + "-config".to_string(), + gpgpusim_trace_config.to_string_lossy().to_string(), + ]); + } + tmp_sim_sh.push(trace_cmd.join(" ")); + let tmp_sim_sh = tmp_sim_sh.join("\n"); + // dbg!(&tmp_sim_sh); + + let tmp_sim_sh_path = traces_dir.as_ref().join("sim.tmp.sh"); + let mut tmp_sim_sh_file = std::fs::OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(&tmp_sim_sh_path)?; + tmp_sim_sh_file.write_all(tmp_sim_sh.as_bytes())?; + let tmp_sim_sh_path = tmp_sim_sh_path + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", tmp_sim_sh_path.display()))?; + + let mut cmd = Command::new("bash"); + cmd.current_dir(config_dir); + + let args = [tmp_sim_sh_path.to_string_lossy().to_string()]; + cmd.args(&args); + + let cuda_path = accelsim::find_cuda()?; + cmd.env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()); + + let result = match timeout { + Some(timeout) => tokio::time::timeout(timeout, cmd.output()).await, + None => Ok(cmd.output().await), + }; + let result = result??; + + if !result.status.success() { + println!("{}", String::from_utf8_lossy(&result.stdout).to_string()); + println!("{}", String::from_utf8_lossy(&result.stderr).to_string()); + + // if we want to debug, we leave the file in place + // gdb --args bash test-apps/vectoradd/traces/vectoradd-100-32-trace/sim.tmp.sh + eyre::bail!( + "cmd `bash {:?}` ({}) failed with code {:?}", + args, + cuda_path.display(), + result.status.code() + ); + } + + // for now, we want to keep the file + // std::fs::remove_file(&tmp_sim_sh_path); + Ok(result) +} + +#[tokio::main] +async fn main() -> eyre::Result<()> { + color_eyre::install()?; + + let options = Options::parse(); + // dbg!(&options.traces_dir); + + let start = Instant::now(); + let output = sim_trace(&options.traces_dir, options.sim_config, options.timeout).await?; + println!("simulating took {:?}", start.elapsed()); + + // write log + let stdout = String::from_utf8_lossy(&output.stdout).to_string(); + let stderr = String::from_utf8_lossy(&output.stderr).to_string(); + println!("\n\n STDOUT \n\n"); + println!("{}", &stdout); + + eprintln!("\n\n STDERR \n\n"); + eprintln!("{}", &stderr); + + let log_file_path = options + .log_file + .unwrap_or(options.traces_dir.join("accelsim_log.txt")); + { + let mut log_file = std::fs::OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(&log_file_path)?; + log_file.write_all(stdout.as_bytes())?; + } + + // parse stats + let stats_file_path = options + .stats_file + .unwrap_or(log_file_path.with_extension("csv")); + let mut parse_options = ParseOptions::new(log_file_path); + parse_options.save_to(stats_file_path); + let stats = parse(parse_options)?; + + let mut preview: Vec<_> = stats + .iter() + .map(|(idx, val)| (format!("{} / {} / {}", idx.0, idx.1, idx.2), val)) + .collect(); + preview.sort_by(|a, b| a.0.cmp(&b.0)); + + for (key, val) in preview { + println!(" => {key}: {val}"); + } + Ok(()) +} diff --git a/accelsim/src/parse.rs b/accelsim/src/bin/accelsim-parse.rs similarity index 100% rename from accelsim/src/parse.rs rename to accelsim/src/bin/accelsim-parse.rs diff --git a/accelsim/src/build.rs b/accelsim/src/build.rs new file mode 100644 index 00000000..6b171040 --- /dev/null +++ b/accelsim/src/build.rs @@ -0,0 +1,38 @@ +use color_eyre::eyre::{self, WrapErr}; +use std::path::PathBuf; + +#[must_use] +pub fn is_debug() -> bool { + #[cfg(debug_assertions)] + return true; + #[cfg(not(debug_assertions))] + return false; + // std::option_env!("PROFILE").is_some_and(|profile| profile.to_lowercase() == "debug") + // std::env!("PROFILE").to_lowercase() == "debug" +} + +#[must_use] +pub fn is_force() -> bool { + ["BUILD", "FORCE"] + .into_iter() + .filter_map(|name| std::env::var(name).ok()) + .map(|var| var.to_lowercase()) + .any(|var| var == "yes") +} + +pub fn manifest_path() -> eyre::Result { + // let path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?); + let path = PathBuf::from(std::env!("CARGO_MANIFEST_DIR")); + let path = path + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", path.display()))?; + Ok(path) +} + +pub fn output_path() -> eyre::Result { + let path = PathBuf::from(std::env::var("OUT_DIR")?); + let path = path + .canonicalize() + .wrap_err_with(|| format!("{} does not exist", path.display()))?; + Ok(path) +} diff --git a/accelsim/src/git.rs b/accelsim/src/git.rs new file mode 100644 index 00000000..b1ad6e07 --- /dev/null +++ b/accelsim/src/git.rs @@ -0,0 +1,41 @@ +use color_eyre::eyre; + +pub struct Repository { + pub url: String, + pub path: std::path::PathBuf, + pub branch: Option, +} + +impl Repository { + pub fn shallow_clone(&self) -> eyre::Result<()> { + let _ = std::fs::remove_dir_all(&self.path); + let mut args = vec!["clone", "--depth=1"]; + if let Some(branch) = &self.branch { + args.extend(["-b", branch]); + } + let path = &*self.path.to_string_lossy(); + args.extend([self.url.as_str(), path]); + + // static DEFAULT_TERM: &str = "xterm-256color"; + let clone_cmd = duct::cmd("git", &args) + .env( + "TERM", + std::option_env!("TERM").as_deref().unwrap_or_default(), + ) + .unchecked(); + + let result = clone_cmd.run()?; + println!("{}", String::from_utf8_lossy(&result.stdout)); + eprintln!("{}", String::from_utf8_lossy(&result.stderr)); + + if !result.status.success() { + eyre::bail!( + "git clone command {:?} exited with code {:?}", + [&["git"], args.as_slice()].concat(), + result.status.code() + ); + } + + Ok(()) + } +} diff --git a/accelsim/src/lib.rs b/accelsim/src/lib.rs index e8f7f66d..2fee356f 100644 --- a/accelsim/src/lib.rs +++ b/accelsim/src/lib.rs @@ -1,35 +1,86 @@ #![allow(clippy::missing_panics_doc, clippy::missing_errors_doc)] -// #![allow(warnings)] +pub mod build; pub mod cache; +pub mod git; pub mod options; pub mod parser; pub mod read; -use color_eyre::eyre; +use color_eyre::{eyre, Section, SectionExt}; pub use options::{Options, SimConfig}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; -pub fn manifest_path() -> Result { - PathBuf::from(std::env!("CARGO_MANIFEST_DIR")).canonicalize() +#[must_use] +pub fn use_upstream() -> bool { + let use_upstream = std::env::var("USE_UPSTREAM_ACCELSIM"); + use_upstream.is_ok_and(|v| v.to_lowercase() == "yes") } -pub fn locate() -> Result { - let use_remote = std::option_env!("USE_REMOTE_ACCELSIM") - .map(|use_remote| use_remote.to_lowercase() == "yes") - .unwrap_or(false); - let accelsim_path = if use_remote { - PathBuf::from(std::env!("OUT_DIR")) - .canonicalize()? - .join("accelsim") +#[must_use] +pub fn find_cuda() -> eyre::Result { + let cuda_candidates = cuda_candidates(); + cuda_candidates.iter().cloned().next().ok_or( + eyre::eyre!("CUDA install path not found") + .with_section(|| format!("{:?}", &cuda_candidates).header("candidates:")), + ) +} + +#[must_use] +pub fn cuda_candidates() -> Vec { + let mut candidates = vec![ + std::env::var("CUDAHOME").ok().map(PathBuf::from), + std::env::var("CUDA_HOME").ok().map(PathBuf::from), + std::env::var("CUDA_LIBRARY_PATH").ok().map(PathBuf::from), + Some(PathBuf::from("/opt/cuda")), + Some(PathBuf::from("/usr/local/cuda")), + ]; + candidates.extend( + // specific cuda versions + glob::glob("/usr/local/cuda-*") + .expect("glob cuda") + .map(Result::ok), + ); + + let mut valid_paths = vec![]; + for base in candidates.iter().flatten() { + if base.is_dir() { + valid_paths.push(base.clone()); + } + let lib = base.join("lib64"); + if lib.is_dir() { + valid_paths.extend([lib.clone(), lib.join("stubs")]); + } + let base = base.join("targets/x86_64-linux"); + if base.join("include/cuda.h").is_file() { + valid_paths.extend([base.join("lib"), base.join("lib/stubs")]); + } + } + valid_paths +} + +pub fn locate() -> eyre::Result<(bool, PathBuf)> { + let use_upstream = use_upstream(); + let accelsim_path = build::manifest_path()?.join(if use_upstream { + "upstream/accel-sim-framework" } else { - manifest_path()?.join("accel-sim-framework-dev") - }; - Ok(accelsim_path) + "accel-sim-framework-dev" + }); + + if use_upstream && !accelsim_path.is_dir() { + // clone repository + let repo = git::Repository { + url: "https://github.com/accel-sim/accel-sim-framework.git".to_string(), + path: accelsim_path.clone(), + branch: Some("dev".to_string()), + }; + repo.shallow_clone()?; + } + Ok((use_upstream, accelsim_path)) } pub fn locate_nvbit_tracer() -> eyre::Result { - let accelsim_path = locate()?; + let (_, accelsim_path) = locate()?; let default_tracer_root = accelsim_path.join("util/tracer_nvbit/"); let tracer_root = if let Ok(path) = std::env::var("NVBIT_TRACER_ROOT") { PathBuf::from(path) @@ -42,3 +93,20 @@ pub fn locate_nvbit_tracer() -> eyre::Result { }; Ok(tracer_root) } + +#[must_use] +pub fn profile() -> &'static str { + if build::is_debug() { + "debug" + } else { + "release" + } +} + +#[must_use] +pub fn executable(accel_path: &Path) -> PathBuf { + accel_path + .join("gpu-simulator/bin") + .join(profile()) + .join("accel-sim.out") +} diff --git a/accelsim/src/sim.rs b/accelsim/src/sim.rs index 4561d6aa..c7bb8232 100644 --- a/accelsim/src/sim.rs +++ b/accelsim/src/sim.rs @@ -1,199 +1 @@ #![allow(warnings)] - -use accelsim::parser::{parse, Options as ParseOptions}; -use accelsim::{Options, SimConfig}; -use async_process::Command; -use clap::Parser; -use color_eyre::{eyre, Section, SectionExt}; -use std::collections::HashMap; -use std::io::Write; -use std::os::unix::fs::DirBuilderExt; -use std::path::{Path, PathBuf}; -use std::time::{Duration, Instant}; - -fn locate_accelsim_bin(sim_root: &Path, profile: &str) -> eyre::Result { - let use_box = std::env::var("USE_BOX") - .as_deref() - .unwrap_or("") - .to_lowercase() - == "yes"; - let accelsim_bin = if use_box { - accelsim::manifest_path()? - .join("../target") - .join(profile) - .join("playground") - } else { - sim_root.join("bin").join(profile).join("accel-sim.out") - }; - Ok(accelsim_bin) -} - -async fn sim_trace( - traces_dir: impl AsRef, - config: SimConfig, - timeout: Option, -) -> eyre::Result { - let accelsim_path = accelsim::locate()?; - let sim_root = accelsim_path.join("gpu-simulator/"); - - #[cfg(debug_assertions)] - let profile = "debug"; - #[cfg(not(debug_assertions))] - let profile = "release"; - - let accelsim_bin = locate_accelsim_bin(&sim_root, &profile)?; - if !accelsim_bin.is_file() { - eyre::bail!("missing {}", accelsim_bin.display()); - } - - let setup_env = sim_root.join("setup_environment.sh"); - if !setup_env.is_file() { - eyre::bail!("missing {}", setup_env.display()); - } - - let mut tmp_sim_sh = vec!["set -e".to_string()]; - - // change current working dir - tmp_sim_sh.push(format!( - "cd {}", - config.config_dir.canonicalize()?.display() - )); - - // source simulator setup - tmp_sim_sh.push(format!( - "source {} {}", - &*setup_env.canonicalize()?.to_string_lossy(), - &profile, - )); - - // run accelsim binary - let gpgpusim_config = config.config()?; - let kernelslist = traces_dir.as_ref().join("kernelslist.g").canonicalize()?; - - let mut trace_cmd: Vec = vec![ - accelsim_bin.canonicalize()?.to_string_lossy().to_string(), - "-trace".to_string(), - kernelslist.to_string_lossy().to_string(), - "-config".to_string(), - gpgpusim_config.to_string_lossy().to_string(), - ]; - - let gpgpusim_trace_config = config.trace_config()?; - - if gpgpusim_trace_config.is_file() { - trace_cmd.extend([ - "-config".to_string(), - gpgpusim_trace_config.to_string_lossy().to_string(), - ]); - } - tmp_sim_sh.push(trace_cmd.join(" ")); - let tmp_sim_sh = tmp_sim_sh.join("\n"); - // dbg!(&tmp_sim_sh); - - let tmp_sim_sh_path = traces_dir.as_ref().join("sim.tmp.sh"); - let mut tmp_sim_sh_file = std::fs::OpenOptions::new() - .write(true) - .truncate(true) - .create(true) - .open(&tmp_sim_sh_path)?; - tmp_sim_sh_file.write_all(tmp_sim_sh.as_bytes())?; - - if !config.config_dir.is_dir() { - eyre::bail!( - "config dir {} is not a directory", - config.config_dir.display() - ); - } - - let mut cmd = Command::new("bash"); - cmd.current_dir(config.config_dir); - let args = [tmp_sim_sh_path - .canonicalize()? - .to_string_lossy() - .to_string()]; - cmd.args(&args); - let cuda_candidates = utils::find_cuda(); - let Some(cuda_path) = cuda_candidates.first() else { - return Err(eyre::eyre!("CUDA install path not found") - .with_section(|| format!("{:?}", &cuda_candidates).header("candidates:"))); - - }; - cmd.env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()); - - let result = match timeout { - Some(timeout) => tokio::time::timeout(timeout, cmd.output()).await, - None => Ok(cmd.output().await), - }; - let result = result??; - - if !result.status.success() { - println!("{}", String::from_utf8_lossy(&result.stdout).to_string()); - println!("{}", String::from_utf8_lossy(&result.stderr).to_string()); - - // if we want to debug, we leave the file in place - // gdb --args bash test-apps/vectoradd/traces/vectoradd-100-32-trace/sim.tmp.sh - eyre::bail!( - "cmd `bash {:?}` ({}) failed with code {:?}", - args, - cuda_path.display(), - result.status.code() - ); - } - - // for now, we want to keep the file - // std::fs::remove_file(&tmp_sim_sh_path); - Ok(result) -} - -#[tokio::main] -async fn main() -> eyre::Result<()> { - color_eyre::install()?; - - let mut options = Options::parse(); - - // dbg!(&options.traces_dir); - - let start = Instant::now(); - let output = sim_trace(&options.traces_dir, options.sim_config, options.timeout).await?; - println!("simulating took {:?}", start.elapsed()); - - // write log - let stdout = String::from_utf8_lossy(&output.stdout).to_string(); - let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - println!("\n\n STDOUT \n\n"); - println!("{}", &stdout); - - eprintln!("\n\n STDERR \n\n"); - eprintln!("{}", &stderr); - - let log_file_path = options - .log_file - .unwrap_or(options.traces_dir.join("accelsim_log.txt")); - { - let mut log_file = std::fs::OpenOptions::new() - .write(true) - .truncate(true) - .create(true) - .open(&log_file_path)?; - log_file.write_all(stdout.as_bytes())?; - } - - // parse stats - let stats_file_path = options - .stats_file - .unwrap_or(log_file_path.with_extension("csv")); - let mut parse_options = ParseOptions::new(log_file_path); - parse_options.save_to(stats_file_path); - let stats = parse(parse_options)?; - - let mut preview: Vec<_> = stats - .iter() - .map(|(idx, val)| (format!("{} / {} / {}", idx.0, idx.1, idx.2), val)) - .collect(); - preview.sort_by(|a, b| a.0.cmp(&b.0)); - - for (key, val) in preview { - println!(" => {key}: {val}"); - } - Ok(()) -} diff --git a/accelsim/trace/Cargo.toml b/accelsim/trace/Cargo.toml new file mode 100644 index 00000000..49301e26 --- /dev/null +++ b/accelsim/trace/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "accelsim-trace" +version = "0.1.0" +edition = "2021" + +[features] +default = [] + +[package.metadata.cargo-feature-combinations] +denylist = ["default"] + +[dependencies] +color-eyre = "0" +dialoguer = "0" +console = "0" +async-process = "1" +tokio = { version = "1", features = ["full"] } + +trace-model = { path = "../../trace/model" } +accelsim = { path = "../" } + +[build-dependencies] +color-eyre = "0" +duct = "0" +reqwest = { version = "0", features = ["blocking", "rustls-tls"] } +bzip2 = "0.4" +tar = "0.4" + +accelsim = { path = "../" } diff --git a/accelsim/trace/build.rs b/accelsim/trace/build.rs new file mode 100644 index 00000000..956a1b25 --- /dev/null +++ b/accelsim/trace/build.rs @@ -0,0 +1,120 @@ +#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)] + +use color_eyre::eyre; +use std::env; +use std::fs::{self, File}; +use std::path::Path; + +fn decompress_tar_bz2(src: impl AsRef, dest: impl AsRef) -> eyre::Result<()> { + let compressed = File::open(src)?; + let stream = bzip2::read::BzDecoder::new(compressed); + let mut archive = tar::Archive::new(stream); + archive.set_overwrite(true); + archive.set_preserve_mtime(true); + archive.unpack(&dest)?; + Ok(()) +} + +fn download_nvbit( + version: impl AsRef, + arch: impl AsRef, + dest: impl AsRef, +) -> eyre::Result<()> { + let nvbit_release_name = format!("nvbit-Linux-{}-{}", arch.as_ref(), version.as_ref()); + let nvbit_release_archive_name = format!("{nvbit_release_name}.tar.bz2"); + let nvbit_release_archive_url = reqwest::Url::parse(&format!( + "{NVBIT_RELEASES}/{}/{nvbit_release_archive_name}", + version.as_ref(), + ))?; + println!("cargo:warning=downloading {nvbit_release_archive_url}"); + + let archive_path = accelsim::build::output_path()?.join(&nvbit_release_archive_name); + fs::remove_file(&archive_path).ok(); + + let mut nvbit_release_archive_file = File::create(&archive_path)?; + let mut data = reqwest::blocking::get(nvbit_release_archive_url)?; + data.copy_to(&mut nvbit_release_archive_file)?; + + decompress_tar_bz2(&archive_path, &dest)?; + + println!( + "cargo:warning=extracted {nvbit_release_archive_name} to {}", + dest.as_ref().display() + ); + Ok(()) +} + +static NVBIT_RELEASES: &str = "https://github.com/NVlabs/NVBit/releases/download"; +static NVBIT_VERSION: &str = "1.5.5"; + +fn build_accelsim_tracer_tool( + accel_path: &Path, + cuda_path: &Path, + force: bool, +) -> eyre::Result<()> { + let nvbit_version = env::var("NVBIT_VERSION") + .ok() + .unwrap_or_else(|| NVBIT_VERSION.to_string()); + let target_arch = env::var("CARGO_CFG_TARGET_ARCH")?; + + let tracer_nvbit_tool_path = accel_path.join("util/tracer_nvbit"); + + let nvbit_path = tracer_nvbit_tool_path.join("nvbit_release"); + if force || !nvbit_path.is_dir() { + download_nvbit(nvbit_version, target_arch, &tracer_nvbit_tool_path)?; + } + + let artifact = tracer_nvbit_tool_path.join("tracer_tool/tracer_tool.so"); + if force || !artifact.is_file() { + let make_cmd = duct::cmd!("make", "-j") + .dir(tracer_nvbit_tool_path) + // .env("TERM", env::var("TERM").as_deref().unwrap_or(DEFAULT_TERM)) + .env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()) + .stderr_capture() + .stdout_capture() + .unchecked(); + + let result = make_cmd.run()?; + println!("{}", String::from_utf8_lossy(&result.stdout)); + eprintln!("{}", String::from_utf8_lossy(&result.stderr)); + + if !result.status.success() { + eyre::bail!( + "tracer tool build exited with code {:?}", + result.status.code() + ); + } + + println!("cargo:warning=built {}", &artifact.display()); + } else { + println!("cargo:warning=using existing {}", &artifact.display()); + } + + Ok(()) +} + +fn main() -> eyre::Result<()> { + color_eyre::install()?; + + println!("cargo:rerun-if-env-changed=USE_UPSTREAM_ACCELSIM"); + println!("cargo:rerun-if-env-changed=FORCE"); + println!("cargo:rerun-if-env-changed=BUILD"); + println!("cargo:rerun-if-env-changed=build.rs"); + + let (_use_upstream, accel_path) = accelsim::locate()?; + println!("cargo:rerun-if-changed={}", accel_path.display()); + + println!( + "cargo:warning=using accelsim source at {}", + &accel_path.display() + ); + + let cuda_path = accelsim::find_cuda()?; + println!("cargo:warning=using cuda at {}", &cuda_path.display()); + + let force = accelsim::build::is_force(); + println!("cargo:warning=force={}", &force); + + build_accelsim_tracer_tool(&accel_path, &cuda_path, force)?; + Ok(()) +} diff --git a/accelsim/src/trace.rs b/accelsim/trace/src/main.rs similarity index 96% rename from accelsim/src/trace.rs rename to accelsim/trace/src/main.rs index 8813f1e8..fd392cd9 100644 --- a/accelsim/src/trace.rs +++ b/accelsim/trace/src/main.rs @@ -1,7 +1,5 @@ -#![allow(warnings)] - -use color_eyre::eyre; use async_process::Command; +use color_eyre::eyre; use console::style; use std::collections::HashMap; use std::io::Write; @@ -9,57 +7,6 @@ use std::os::unix::fs::DirBuilderExt; use std::path::{Path, PathBuf}; use std::time::Instant; -#[tokio::main] -async fn main() -> eyre::Result<()> { - color_eyre::install()?; - - let args: Vec<_> = std::env::args().collect(); - let exec = PathBuf::from(args.get(1).expect("usage ./trace [args]")); - - let exec_args: Vec<_> = args.iter().skip(2).cloned().collect(); - - let exec_dir = exec.parent().expect("executable has no parent dir"); - let traces_dir = exec_dir.join("traces").join(format!( - "{}-trace", - &trace_model::app_prefix(std::option_env!("CARGO_BIN_NAME")) - )); - - let mut trace_cmd_string = exec.to_string_lossy().to_string(); - if !exec_args.is_empty() { - trace_cmd_string += "1"; - trace_cmd_string += &exec_args.join(" "); - } - if !dialoguer::Confirm::new() - .with_prompt(format!( - " => tracing command `{}` and saving traces to `{}` ... proceed?", - &style(trace_cmd_string).red(), - &style(traces_dir.display()).red(), - )) - .interact()? - { - println!("exit"); - return Ok(()); - } - - std::fs::DirBuilder::new() - .recursive(true) - .mode(0o777) - .create(&traces_dir) - .ok(); - - dbg!(&traces_dir); - - let start = Instant::now(); - run_trace(&exec, exec_args.clone(), &traces_dir).await?; - println!( - "tracing {} {} took {:?}", - exec.display(), - exec_args.join(" "), - start.elapsed() - ); - Ok(()) -} - async fn run_trace( exec: impl AsRef, exec_args: Vec, @@ -148,9 +95,8 @@ async fn run_trace( let mut cmd = Command::new("bash"); cmd.arg(&*tmp_trace_sh_path.canonicalize().unwrap().to_string_lossy()); - if let Some(cuda_path) = utils::find_cuda().first() { - cmd.env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()); - } + let cuda_path = accelsim::find_cuda()?; + cmd.env("CUDA_INSTALL_PATH", &*cuda_path.to_string_lossy()); dbg!(&cmd); let result = cmd.output().await?; @@ -166,3 +112,54 @@ async fn run_trace( std::fs::remove_file(&tmp_trace_sh_path).ok(); Ok(()) } + +#[tokio::main] +async fn main() -> eyre::Result<()> { + color_eyre::install()?; + + let args: Vec<_> = std::env::args().collect(); + let exec = PathBuf::from(args.get(1).expect("usage ./trace [args]")); + + let exec_args: Vec<_> = args.iter().skip(2).cloned().collect(); + + let exec_dir = exec.parent().expect("executable has no parent dir"); + let traces_dir = exec_dir.join("traces").join(format!( + "{}-trace", + &trace_model::app_prefix(std::option_env!("CARGO_BIN_NAME")) + )); + + let mut trace_cmd_string = exec.to_string_lossy().to_string(); + if !exec_args.is_empty() { + trace_cmd_string += "1"; + trace_cmd_string += &exec_args.join(" "); + } + if !dialoguer::Confirm::new() + .with_prompt(format!( + " => tracing command `{}` and saving traces to `{}` ... proceed?", + &style(trace_cmd_string).red(), + &style(traces_dir.display()).red(), + )) + .interact()? + { + println!("exit"); + return Ok(()); + } + + std::fs::DirBuilder::new() + .recursive(true) + .mode(0o777) + .create(&traces_dir) + .ok(); + + dbg!(&traces_dir); + + let start = Instant::now(); + run_trace(&exec, exec_args.clone(), &traces_dir).await?; + println!( + "tracing {} {} took {:?}", + exec.display(), + exec_args.join(" "), + start.elapsed() + ); + Ok(()) +} diff --git a/playground/Cargo.toml b/playground/Cargo.toml index 09c374f5..33a0893c 100644 --- a/playground/Cargo.toml +++ b/playground/Cargo.toml @@ -22,13 +22,8 @@ parallel = ["cc/parallel"] [dependencies] cxx = "1" accelsim = { path = "../accelsim" } - color-eyre = "0" -thiserror = "1" clap = { version = "4", features = [ "derive" ] } -dialoguer = "0" -indicatif = "0" -console = "0" [dev-dependencies] pretty_assertions = "1" diff --git a/playground/src/main.rs b/playground/src/main.rs index 6ff0569f..daca64d4 100644 --- a/playground/src/main.rs +++ b/playground/src/main.rs @@ -1,6 +1,5 @@ -#[allow(unused_imports)] +// #[allow(unused_imports)] use accelsim::Options; -#[allow(unused_imports)] use clap::Parser; use color_eyre::eyre; use playground::bridge::main::{accelsim, accelsim_config, AccelsimStats}; @@ -19,23 +18,22 @@ use std::path::PathBuf; // } // } -#[allow(unused_mut, unused_assignments)] +#[allow(unused_assignments)] fn main() -> eyre::Result<()> { color_eyre::install()?; + let _options = Options::parse(); + // let gpgpusim_config = options.sim_config.config()?; + // let trace_config = options.sim_config.trace_config()?; + // let kernelslist = options.kernelslist()?; + // let inter_config = options.sim_config.inter_config; + // temp let base = PathBuf::from("/home/roman/dev/box/"); - let mut kernelslist = - base.join("test-apps/vectoradd/traces/vectoradd-100-32-trace/kernelslist.g"); - let mut gpgpusim_config = base.join("accelsim/gtx1080/gpgpusim.config"); - let mut trace_config = base.join("accelsim/gtx1080/gpgpusim.trace.config"); - let mut inter_config = Some(base.join("accelsim/gtx1080/config_fermi_islip.icnt")); - - // let options = Options::parse(); - // gpgpusim_config = options.sim_config.config()?; - // trace_config = options.sim_config.trace_config()?; - // kernelslist = options.kernelslist()?; - // inter_config = options.sim_config.inter_config; + let kernelslist = base.join("test-apps/vectoradd/traces/vectoradd-100-32-trace/kernelslist.g"); + let gpgpusim_config = base.join("accelsim/gtx1080/gpgpusim.config"); + let trace_config = base.join("accelsim/gtx1080/gpgpusim.trace.config"); + let inter_config = Some(base.join("accelsim/gtx1080/config_fermi_islip.icnt")); assert!(gpgpusim_config.is_file()); assert!(trace_config.is_file()); diff --git a/utils/Cargo.toml b/utils/Cargo.toml index 80865ebe..8627b4c3 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -5,4 +5,5 @@ edition = "2021" [dependencies] libc = "0" -glob = "0" +color-eyre = "0" +# duct = "0" diff --git a/utils/src/build.rs b/utils/src/build.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/utils/src/build.rs @@ -0,0 +1 @@ + diff --git a/utils/src/lib.rs b/utils/src/lib.rs index 6da1881f..0df87c74 100644 --- a/utils/src/lib.rs +++ b/utils/src/lib.rs @@ -1,5 +1,7 @@ #![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)] -use std::path::{Path, PathBuf}; +pub mod build; + +use std::path::Path; pub const GID_NOBODY: libc::gid_t = 65534; pub const UID_NOBODY: libc::uid_t = 65534; @@ -38,35 +40,3 @@ pub fn rchown( } Ok(()) } - -pub fn find_cuda() -> Vec { - let mut candidates = vec![ - std::env::var("CUDAHOME").ok().map(PathBuf::from), - std::env::var("CUDA_HOME").ok().map(PathBuf::from), - std::env::var("CUDA_LIBRARY_PATH").ok().map(PathBuf::from), - Some(PathBuf::from("/opt/cuda")), - Some(PathBuf::from("/usr/local/cuda")), - ]; - candidates.extend( - // specific cuda versions - glob::glob("/usr/local/cuda-*") - .expect("glob cuda") - .map(Result::ok), - ); - - let mut valid_paths = vec![]; - for base in candidates.iter().flatten() { - if base.is_dir() { - valid_paths.push(base.clone()); - } - let lib = base.join("lib64"); - if lib.is_dir() { - valid_paths.extend([lib.clone(), lib.join("stubs")]); - } - let base = base.join("targets/x86_64-linux"); - if base.join("include/cuda.h").is_file() { - valid_paths.extend([base.join("lib"), base.join("lib/stubs")]); - } - } - valid_paths -}