diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7bb33700..0e9d4085a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,16 @@ jobs: - name: Checkout the Repository uses: actions/checkout@v2 + - name: Install CUDA + run: | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + curl -L -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb + sudo dpkg -i cuda-keyring_1.0-1_all.deb + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + sudo apt-get update -q + sudo apt-get install cuda -y --no-install-recommends + - name: Install OpenMPI run: | sudo apt-get update -q @@ -88,6 +98,16 @@ jobs: - name: Checkout the Repository uses: actions/checkout@v2 + - name: Install CUDA + run: | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + curl -L -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb + sudo dpkg -i cuda-keyring_1.0-1_all.deb + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + sudo apt-get update -q + sudo apt-get install cuda -y --no-install-recommends + - name: Install OpenMPI run: | sudo apt-get update -q diff --git a/Cargo.lock b/Cargo.lock index 544e73147..c7c4c3eef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "array-init-cursor" @@ -195,7 +195,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.40", + "syn 2.0.48", "which", ] @@ -256,7 +256,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -276,9 +276,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -292,7 +292,7 @@ dependencies = [ "camino", "cargo-platform", "derive_builder", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -334,20 +334,20 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading", ] [[package]] name = "clap" -version = "4.4.11" +version = "4.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" dependencies = [ "clap_builder", "clap_derive", @@ -355,9 +355,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -374,7 +374,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -401,9 +401,9 @@ dependencies = [ [[package]] name = "const-type-layout" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00831a53858b3d71267f15d72570373e27806b108ed2b955e24643ce4fc833fa" +checksum = "f4a8a1418a7c3cfdf6db57795ced0855a24249ddd38f1a3373d648cc3ef390d9" dependencies = [ "const-type-layout-derive", ] @@ -564,7 +564,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -671,22 +671,22 @@ dependencies = [ [[package]] name = "git-version" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ad01ffa8221f7fe8b936d6ffb2a3e7ad428885a04fad51866a5f33eafda57c" +checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19" dependencies = [ "git-version-macro", ] [[package]] name = "git-version-macro" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84488ccbdb24ad6f56dc1863b4a8154a7856cd3c6c7610401634fab3cb588dae" +checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -743,11 +743,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -820,16 +820,6 @@ version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.1" @@ -881,9 +871,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -931,7 +921,7 @@ source = "git+https://github.com/juntyr/rsmpi?rev=ed8c10d#ed8c10d1a64b6f63c57d91 dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -1080,7 +1070,7 @@ name = "necsim-plugins-core" version = "0.1.0" dependencies = [ "erased-serde", - "libloading 0.8.1", + "libloading", "log", "necsim-core", "process_path", @@ -1147,7 +1137,7 @@ dependencies = [ "necsim-core-bond", "necsim-plugins-core", "rustc_version 0.4.0", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "tskit", @@ -1200,9 +1190,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -1211,9 +1201,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "planus" @@ -1232,12 +1222,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -1266,9 +1256,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -1293,16 +1283,16 @@ dependencies = [ "lazy_static", "libc", "regex", - "semver 1.0.20", + "semver 1.0.21", "thiserror", "toml", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1485,7 +1475,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.21", ] [[package]] @@ -1666,9 +1656,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -1684,22 +1674,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -1715,9 +1705,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -1726,9 +1716,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" dependencies = [ "itoa", "serde", @@ -1816,9 +1806,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.40" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1827,22 +1817,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -1978,7 +1968,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -2000,7 +1990,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2185,20 +2175,20 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zerocopy" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] diff --git a/Cargo.toml b/Cargo.toml index d82e98018..f603d80fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,7 @@ [workspace] +resolver = "2" + members = [ "necsim/core", "necsim/core/bond", diff --git a/docs/simulate.ron b/docs/simulate.ron index 90409129a..3bebafd72 100644 --- a/docs/simulate.ron +++ b/docs/simulate.ron @@ -518,10 +518,10 @@ delta_t: (0.0 < f64), /* CUDA thread block 1D size, should be a power of 2 * optional, default = 64 */ - block_size: (u32), + block_size: (0 < u32), /* CUDA thread grid 1D size, should be a power of 2 * optional, default = 64 */ - grid_size: (u32), + grid_size: (0 < u32), /* number of steps which an individual performs on the GPU without supervision * -> shorter slices enable quicker termination of single individuals * -> longer slices incur less overhead from kernel launches diff --git a/necsim/core/Cargo.toml b/necsim/core/Cargo.toml index a8dc8899f..de5b6c629 100644 --- a/necsim/core/Cargo.toml +++ b/necsim/core/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-core" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/core/bond/Cargo.toml b/necsim/core/bond/Cargo.toml index 5e8419b4c..c9c8651f6 100644 --- a/necsim/core/bond/Cargo.toml +++ b/necsim/core/bond/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-core-bond" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/core/maths/Cargo.toml b/necsim/core/maths/Cargo.toml index cabab1e5f..7bf9cfcd8 100644 --- a/necsim/core/maths/Cargo.toml +++ b/necsim/core/maths/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-core-maths" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/impls/cuda/Cargo.toml b/necsim/impls/cuda/Cargo.toml index 08f6c1ccb..677c9e908 100644 --- a/necsim/impls/cuda/Cargo.toml +++ b/necsim/impls/cuda/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-impls-cuda" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/impls/cuda/src/cogs/maths.rs b/necsim/impls/cuda/src/cogs/maths.rs index 209e64be6..6326ffa2a 100644 --- a/necsim/impls/cuda/src/cogs/maths.rs +++ b/necsim/impls/cuda/src/cogs/maths.rs @@ -134,7 +134,7 @@ impl MathsCore for NvptxMathsCore { #[cfg(target_os = "cuda")] unsafe { - core::arch::asm!("copysign.f64 {}, {}, {};", out(reg64) offset, in(reg64) x, const ROUND_TRUNC_OFFSET.to_bits(), options(pure, nomem, nostack)); + core::arch::asm!("copysign.f64 {}, {}, {};", out(reg64) offset, in(reg64) x, in(reg64) ROUND_TRUNC_OFFSET, options(pure, nomem, nostack)); } #[cfg(not(target_os = "cuda"))] unsafe { diff --git a/necsim/impls/no-std/Cargo.toml b/necsim/impls/no-std/Cargo.toml index 674c9a19f..d1cad4374 100644 --- a/necsim/impls/no-std/Cargo.toml +++ b/necsim/impls/no-std/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-impls-no-std" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs index f3c191fdf..5485cce7d 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs @@ -28,7 +28,7 @@ impl From> for AliasSamplerRange { fn from(range: Range) -> Self { Self { start: range.start, - end: range.start, + end: range.end, } } } diff --git a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_2d.rs b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_2d.rs index b2b0b9363..502328a46 100644 --- a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_2d.rs +++ b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_2d.rs @@ -71,7 +71,6 @@ impl NoiseEvaluator> for OpenSimplexNoise2D { } impl OpenSimplexNoise2D { - #[cfg_attr(target_os = "cuda", inline)] fn get_value( grid: Vec2, origin: Vec2, diff --git a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs index 7d632aabf..24bb72672 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs @@ -87,7 +87,7 @@ impl<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> WaterLevelReporterProxy<'l, fn advance_water_level(&mut self, water_level: NonNegativeF64) { // Report all events below the water level in sorted order - self.slow_events.sort(); + self.slow_events.sort_unstable(); for event in self.slow_events.drain(..) { match event.into() { @@ -124,7 +124,7 @@ impl<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> Drop { fn drop(&mut self) { // Report all events below the water level in sorted order - self.slow_events.sort(); + self.slow_events.sort_unstable(); for event in self.slow_events.drain(..) { match event.into() { @@ -142,7 +142,7 @@ impl<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> Drop } // Report all events above the water level in sorted order - self.fast_events.sort(); + self.fast_events.sort_unstable(); for event in self.fast_events.drain(..) { match event.into() { diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs index bb5109217..b12afb7d7 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs @@ -135,7 +135,7 @@ pub fn simulate< )); } - immigrants.sort(); + immigrants.sort_unstable(); // A global rollback is required if at least one partition received unexpected // immigration diff --git a/necsim/impls/std/Cargo.toml b/necsim/impls/std/Cargo.toml index 9e7db8f7e..4a1626026 100644 --- a/necsim/impls/std/Cargo.toml +++ b/necsim/impls/std/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-impls-std" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/impls/std/src/event_log/recorder.rs b/necsim/impls/std/src/event_log/recorder.rs index 3be651a62..b12ed5be6 100644 --- a/necsim/impls/std/src/event_log/recorder.rs +++ b/necsim/impls/std/src/event_log/recorder.rs @@ -177,7 +177,7 @@ impl EventLogRecorder { } fn sort_and_write_segment(&mut self) -> Result<()> { - self.buffer.sort(); + self.buffer.sort_unstable(); let segment_path = self.directory.join(format!("{}", self.segment_index)); self.segment_index += 1; diff --git a/necsim/impls/std/src/event_log/replay/mod.rs b/necsim/impls/std/src/event_log/replay/mod.rs index 65ece1931..bc6a342a6 100644 --- a/necsim/impls/std/src/event_log/replay/mod.rs +++ b/necsim/impls/std/src/event_log/replay/mod.rs @@ -43,7 +43,7 @@ impl Serialize for EventLogReplay { } } - segments.sort(); + segments.sort_unstable(); EventLog { segments, capacity }.serialize(serializer) } diff --git a/necsim/partitioning/core/Cargo.toml b/necsim/partitioning/core/Cargo.toml index ab5292bd8..ad52d3dd9 100644 --- a/necsim/partitioning/core/Cargo.toml +++ b/necsim/partitioning/core/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-partitioning-core" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/partitioning/monolithic/Cargo.toml b/necsim/partitioning/monolithic/Cargo.toml index f81c7ecc7..a4b96c672 100644 --- a/necsim/partitioning/monolithic/Cargo.toml +++ b/necsim/partitioning/monolithic/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-partitioning-monolithic" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/partitioning/mpi/Cargo.toml b/necsim/partitioning/mpi/Cargo.toml index 254c8d23f..d392f8e1b 100644 --- a/necsim/partitioning/mpi/Cargo.toml +++ b/necsim/partitioning/mpi/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-partitioning-mpi" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/plugins/common/Cargo.toml b/necsim/plugins/common/Cargo.toml index fa08f3923..6e7d4e24c 100644 --- a/necsim/plugins/common/Cargo.toml +++ b/necsim/plugins/common/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-common" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib", "lib"] diff --git a/necsim/plugins/core/Cargo.toml b/necsim/plugins/core/Cargo.toml index 84e37a4f4..d9c179082 100644 --- a/necsim/plugins/core/Cargo.toml +++ b/necsim/plugins/core/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-core" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/necsim/plugins/csv/Cargo.toml b/necsim/plugins/csv/Cargo.toml index bfa0d1f5b..b6363d3cf 100644 --- a/necsim/plugins/csv/Cargo.toml +++ b/necsim/plugins/csv/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-csv" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/necsim/plugins/metacommunity/Cargo.toml b/necsim/plugins/metacommunity/Cargo.toml index 27e186e9a..ecab1b606 100644 --- a/necsim/plugins/metacommunity/Cargo.toml +++ b/necsim/plugins/metacommunity/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-metacommunity" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/necsim/plugins/species/Cargo.toml b/necsim/plugins/species/Cargo.toml index cdc56d5cc..96543ed6d 100644 --- a/necsim/plugins/species/Cargo.toml +++ b/necsim/plugins/species/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-species" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/necsim/plugins/statistics/Cargo.toml b/necsim/plugins/statistics/Cargo.toml index f2f57e266..6f3c8202e 100644 --- a/necsim/plugins/statistics/Cargo.toml +++ b/necsim/plugins/statistics/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-statistics" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/necsim/plugins/tskit/Cargo.toml b/necsim/plugins/tskit/Cargo.toml index 8f973944a..4eff8f963 100644 --- a/necsim/plugins/tskit/Cargo.toml +++ b/necsim/plugins/tskit/Cargo.toml @@ -3,7 +3,7 @@ name = "necsim-plugins-tskit" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/rustcoalescence/Cargo.toml b/rustcoalescence/Cargo.toml index d1639ed89..ebf41fc18 100644 --- a/rustcoalescence/Cargo.toml +++ b/rustcoalescence/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/algorithms/Cargo.toml b/rustcoalescence/algorithms/Cargo.toml index a78d5aa56..48f1d4f3b 100644 --- a/rustcoalescence/algorithms/Cargo.toml +++ b/rustcoalescence/algorithms/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/algorithms/cuda/Cargo.toml b/rustcoalescence/algorithms/cuda/Cargo.toml index 14663602a..e25ab2387 100644 --- a/rustcoalescence/algorithms/cuda/Cargo.toml +++ b/rustcoalescence/algorithms/cuda/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms-cuda" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml b/rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml index c9722a023..7587473ae 100644 --- a/rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml +++ b/rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms-cuda-cpu-kernel" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/algorithms/cuda/gpu-kernel/Cargo.toml b/rustcoalescence/algorithms/cuda/gpu-kernel/Cargo.toml index 79f8f56c5..2a13df0fc 100644 --- a/rustcoalescence/algorithms/cuda/gpu-kernel/Cargo.toml +++ b/rustcoalescence/algorithms/cuda/gpu-kernel/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms-cuda-gpu-kernel" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib", "rlib"] diff --git a/rustcoalescence/algorithms/cuda/src/arguments.rs b/rustcoalescence/algorithms/cuda/src/arguments.rs index 94cd9ff21..77fcbd5b3 100644 --- a/rustcoalescence/algorithms/cuda/src/arguments.rs +++ b/rustcoalescence/algorithms/cuda/src/arguments.rs @@ -1,4 +1,4 @@ -use std::num::NonZeroU64; +use std::num::{NonZeroU32, NonZeroU64}; use serde::{Deserialize, Serialize}; use serde_state::DeserializeState; @@ -59,8 +59,8 @@ pub struct CudaArguments { pub device: u32, pub ptx_jit: bool, pub delta_t: PositiveF64, - pub block_size: u32, - pub grid_size: u32, + pub block_size: NonZeroU32, + pub grid_size: NonZeroU32, pub step_slice: NonZeroU64, pub dedup_cache: DedupCache, pub parallelism_mode: ParallelismMode, @@ -107,8 +107,8 @@ pub struct CudaArgumentsRaw { pub device: u32, pub ptx_jit: bool, pub delta_t: PositiveF64, - pub block_size: u32, - pub grid_size: u32, + pub block_size: NonZeroU32, + pub grid_size: NonZeroU32, pub step_slice: NonZeroU64, pub dedup_cache: DedupCache, #[serde(deserialize_state)] @@ -121,8 +121,8 @@ impl Default for CudaArgumentsRaw { device: 0_u32, ptx_jit: true, delta_t: PositiveF64::new(3.0_f64).unwrap(), - block_size: 64_u32, - grid_size: 64_u32, + block_size: NonZeroU32::new(64_u32).unwrap(), + grid_size: NonZeroU32::new(64_u32).unwrap(), step_slice: NonZeroU64::new(150_u64).unwrap(), dedup_cache: DedupCache::Relative(RelativeCapacity { factor: PositiveF64::new(0.1_f64).unwrap(), diff --git a/rustcoalescence/algorithms/cuda/src/info.rs b/rustcoalescence/algorithms/cuda/src/info.rs index 5bd3866aa..1abf4ec07 100644 --- a/rustcoalescence/algorithms/cuda/src/info.rs +++ b/rustcoalescence/algorithms/cuda/src/info.rs @@ -34,8 +34,8 @@ pub fn print_context_resource_limits() { println!("{:=^80}", ""); } -pub fn print_kernel_function_attributes(function: &Function) { - println!("{:=^80}", " Kernel Function Attributes "); +pub fn print_kernel_function_attributes(name: &str, function: &Function) { + println!("{:=^80}", format!(" {name} Kernel Function Attributes ")); println!( "MaxThreadsPerBlock: {:?}", diff --git a/rustcoalescence/algorithms/cuda/src/launch.rs b/rustcoalescence/algorithms/cuda/src/launch.rs index bdd11276f..12589699a 100644 --- a/rustcoalescence/algorithms/cuda/src/launch.rs +++ b/rustcoalescence/algorithms/cuda/src/launch.rs @@ -184,8 +184,8 @@ where .build(); // Note: It seems to be more performant to spawn smaller blocks - let block_size = BlockSize::x(args.block_size); - let grid_size = GridSize::x(args.grid_size); + let block_size = BlockSize::x(args.block_size.get()); + let grid_size = GridSize::x(args.grid_size.get()); let event_slice = match args.parallelism_mode { ParallelismMode::Monolithic(MonolithicParallelismMode { event_slice }) @@ -202,7 +202,7 @@ where block_size.clone(), args.ptx_jit, Box::new(|kernel| { - crate::info::print_kernel_function_attributes(kernel); + crate::info::print_kernel_function_attributes("simulate", kernel); Ok(()) }), )?; @@ -228,10 +228,7 @@ where Status::Paused => Ok(SimulationOutcome::Paused { time, steps, - lineages: lineages - .into_iter() - .chain(passthrough) - .collect(), + lineages: lineages.into_iter().chain(passthrough).collect(), rng: simulation.rng_mut().clone(), marker: PhantomData::, }), diff --git a/rustcoalescence/algorithms/gillespie/Cargo.toml b/rustcoalescence/algorithms/gillespie/Cargo.toml index a2ec0a594..d63a4facb 100644 --- a/rustcoalescence/algorithms/gillespie/Cargo.toml +++ b/rustcoalescence/algorithms/gillespie/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms-gillespie" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/fixup.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/fixup.rs index d6d0518b2..661b792d9 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/fixup.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/fixup.rs @@ -185,7 +185,7 @@ where ); }, CoalescenceStrategy::Coalescence => { - coalescence.sort(); + coalescence.sort_unstable(); for (coalescing_lineage, parent) in coalescence { local_partition.get_reporter().report_dispersal( @@ -230,7 +230,7 @@ where return Err(ResumeError::Sample(exceptional_lineages)); } - fixable_lineages.sort(); + fixable_lineages.sort_unstable(); let active_lineage_sampler = RestartFixUpActiveLineageSampler::new( active_lineage_sampler, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/fixup.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/fixup.rs index 9a6644be8..1011efbb5 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/fixup.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/fixup.rs @@ -143,7 +143,7 @@ impl, M: MathsCore, G: RngCore, O: Scena ); }, CoalescenceStrategy::Coalescence => { - coalescence.sort(); + coalescence.sort_unstable(); for (coalescing_lineage, parent) in coalescence { local_partition.get_reporter().report_dispersal( @@ -188,7 +188,7 @@ impl, M: MathsCore, G: RngCore, O: Scena return Err(ResumeError::Sample(exceptional_lineages)); } - fixable_lineages.sort(); + fixable_lineages.sort_unstable(); let dispersal_sampler = TrespassingDispersalSampler::new( dispersal_sampler, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/fixup.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/fixup.rs index ae0df9263..7fc69036f 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/fixup.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/fixup.rs @@ -162,7 +162,7 @@ impl, M: MathsCore, G: RngCore, O: Scena ); }, CoalescenceStrategy::Coalescence => { - coalescence.sort(); + coalescence.sort_unstable(); for (coalescing_lineage, parent) in coalescence { local_partition.get_reporter().report_dispersal( @@ -207,7 +207,7 @@ impl, M: MathsCore, G: RngCore, O: Scena return Err(ResumeError::Sample(exceptional_lineages)); } - fixable_lineages.sort(); + fixable_lineages.sort_unstable(); let dispersal_sampler = TrespassingDispersalSampler::new( dispersal_sampler, diff --git a/rustcoalescence/algorithms/independent/Cargo.toml b/rustcoalescence/algorithms/independent/Cargo.toml index 82fd8bc61..7a92e142b 100644 --- a/rustcoalescence/algorithms/independent/Cargo.toml +++ b/rustcoalescence/algorithms/independent/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-algorithms-independent" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rustcoalescence/scenarios/Cargo.toml b/rustcoalescence/scenarios/Cargo.toml index ffe3731e6..455dc3a23 100644 --- a/rustcoalescence/scenarios/Cargo.toml +++ b/rustcoalescence/scenarios/Cargo.toml @@ -3,7 +3,7 @@ name = "rustcoalescence-scenarios" version = "0.1.0" authors = ["Juniper Tyree "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html