diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a819cef..ca3a4c87b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI -#on: [pull_request, push] -on: [push] +on: [pull_request, push] +#on: [push] # Cancel a job if there's a new on on the same branch started. # Based on https://stackoverflow.com/questions/58895283/stop-already-running-workflow-job-in-github-actions/67223051#67223051 diff --git a/storage-proofs-porep/Cargo.toml b/storage-proofs-porep/Cargo.toml index c4333573e..5ea6d0818 100644 --- a/storage-proofs-porep/Cargo.toml +++ b/storage-proofs-porep/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs" readme = "README.md" [dependencies] -filecoin-hashers = { workspace = true, features = ["poseidon", "sha256"]} +filecoin-hashers = { workspace = true, features = ["poseidon", "sha256"] } fr32.workspace = true sha2raw.workspace = true storage-proofs-core.workspace = true @@ -28,7 +28,7 @@ ff.workspace = true generic-array.workspace = true glob = "0.3.0" hex.workspace = true -hwloc = { version = "0.5.0", optional = true } +hwloc = { version = "2.2.0", optional = true, package = "hwloc2" } lazy_static.workspace = true libc = "0.2" log.workspace = true @@ -53,7 +53,11 @@ sha2 = { workspace = true, features = ["compress", "asm"] } sha2 = { workspace = true, features = ["compress"] } [dev-dependencies] -filecoin-hashers = { workspace = true, features = ["poseidon", "sha256", "blake2s"]} +filecoin-hashers = { workspace = true, features = [ + "poseidon", + "sha256", + "blake2s", +] } # Sorted alphabetically criterion.workspace = true fil_logger.workspace = true @@ -63,8 +67,18 @@ tempfile.workspace = true [features] default = ["opencl", "multicore-sdr"] -cuda = ["storage-proofs-core/cuda", "filecoin-hashers/cuda", "neptune/cuda", "bellperson/cuda"] -opencl = ["storage-proofs-core/opencl", "filecoin-hashers/opencl", "neptune/opencl", "bellperson/opencl"] +cuda = [ + "storage-proofs-core/cuda", + "filecoin-hashers/cuda", + "neptune/cuda", + "bellperson/cuda", +] +opencl = [ + "storage-proofs-core/opencl", + "filecoin-hashers/opencl", + "neptune/opencl", + "bellperson/opencl", +] isolated-testing = [] multicore-sdr = ["hwloc"] # This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD` diff --git a/storage-proofs-porep/src/stacked/vanilla/cores.rs b/storage-proofs-porep/src/stacked/vanilla/cores.rs index c7b6632f5..7c909947c 100644 --- a/storage-proofs-porep/src/stacked/vanilla/cores.rs +++ b/storage-proofs-porep/src/stacked/vanilla/cores.rs @@ -2,14 +2,15 @@ use std::convert::TryInto; use std::sync::{Mutex, MutexGuard}; use anyhow::{format_err, Result}; -use hwloc::{Bitmap, ObjectType, Topology, TopologyObject, CPUBIND_THREAD}; +use hwloc::{Bitmap, CpuBindFlags, ObjectType, Topology, TopologyObject}; use lazy_static::lazy_static; use log::{debug, warn}; use storage_proofs_core::settings::SETTINGS; type CoreUnit = Vec; lazy_static! { - pub static ref TOPOLOGY: Mutex = Mutex::new(Topology::new()); + pub static ref TOPOLOGY: Mutex = + Mutex::new(Topology::new().expect("failed to initialize and load cpu topology")); pub static ref CORE_GROUPS: Option>> = { let num_producers = &SETTINGS.multicore_sdr_producers; let cores_per_unit = num_producers + 1; @@ -69,7 +70,8 @@ impl Drop for Cleanup { if let Some(prior) = self.prior_state.take() { let child_topo = &TOPOLOGY; let mut locked_topo = child_topo.lock().expect("poisded lock"); - let _ = locked_topo.set_cpubind_for_thread(self.tid, prior, CPUBIND_THREAD); + let _ = + locked_topo.set_cpubind_for_thread(self.tid, prior, CpuBindFlags::CPUBIND_THREAD); } } } @@ -82,7 +84,7 @@ pub fn bind_core(core_index: CoreIndex) -> Result { .map_err(|err| format_err!("failed to get core at index {}: {:?}", core_index.0, err))?; let cpuset = core - .allowed_cpuset() + .cpuset() .ok_or_else(|| format_err!("no allowed cpuset for core at index {}", core_index.0,))?; debug!("allowed cpuset: {:?}", cpuset); let mut bind_to = cpuset; @@ -91,12 +93,12 @@ pub fn bind_core(core_index: CoreIndex) -> Result { bind_to.singlify(); // Thread binding before explicit set. - let before = locked_topo.get_cpubind_for_thread(tid, CPUBIND_THREAD); + let before = locked_topo.get_cpubind_for_thread(tid, CpuBindFlags::CPUBIND_THREAD); debug!("binding to {:?}", bind_to); // Set the binding. let result = locked_topo - .set_cpubind_for_thread(tid, bind_to, CPUBIND_THREAD) + .set_cpubind_for_thread(tid, bind_to, CpuBindFlags::CPUBIND_THREAD) .map_err(|err| format_err!("failed to bind CPU: {:?}", err)); if result.is_err() { @@ -239,7 +241,7 @@ fn core_units(cores_per_unit: usize) -> Option>> { .get_cpubind(hwloc::CpuBindFlags::empty()) .unwrap_or_else(|| { topo.object_at_root() - .allowed_cpuset() + .cpuset() .unwrap_or_else(hwloc::CpuSet::full) });