Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix benchmarks because of Rug #66

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Rust/Savina/src/parallelism/PiPrecision.lf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ target Rust {
cargo-features: ["cli"],
cargo-dependencies: {
rug: {
version: "1"
version: "1.26.1"
}
}
}
Expand All @@ -34,7 +34,6 @@ reactor Manager(numWorkers: usize = 20, scale: u32 = 5000) {
// only this way do we get the correct result.
preamble {=
const PRECISION: u32 = 16610 + 2;
const PRECISIONI64: i64 = PRECISION as i64;
=}

state result: Float = {= Float::new(PRECISION) =}
Expand Down Expand Up @@ -100,7 +99,7 @@ reactor Manager(numWorkers: usize = 20, scale: u32 = 5000) {
for port in response {
if let Some(x) = ctx.use_ref_opt(port, Clone::clone) {
self.result += x.as_ref();
if (x.as_ref() - &self.tolerance).complete(PRECISIONI64) < 0u32 {
if (x.as_ref() - &self.tolerance).complete(PRECISION) < 0u32 {
stop = true;
}
}
Expand Down Expand Up @@ -131,11 +130,10 @@ reactor Worker {
let two = Float::with_val(PRECISION, 2u32);
let one = Float::with_val(PRECISION, 1u32);

const PREC_I64 : i64 = PRECISION as i64;
let mut term: Float = (&four / (eight_k + 1)).complete(PREC_I64);
term -= (&two / (eight_k + 4)).complete(PREC_I64);
term -= (&one / (eight_k + 5)).complete(PREC_I64);
term -= (&one / (eight_k + 6)).complete(PREC_I64);
let mut term: Float = (&four / (eight_k + 1)).complete(PRECISION);
term -= (&two / (eight_k + 4)).complete(PRECISION);
term -= (&one / (eight_k + 5)).complete(PRECISION);
term -= (&one / (eight_k + 6)).complete(PRECISION);

let mut sixteen_pow = Float::with_val(PRECISION, 16u32).pow(k);
term /= sixteen_pow;
Expand Down
Loading