From f06ac54632ec88b58db366526e4dc6edb477755d Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 27 Apr 2024 21:23:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=98=E8=AE=B0=E5=A4=84=E7=90=86core?= =?UTF-8?q?=E4=BA=86=EF=BC=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miner/src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/miner/src/main.rs b/miner/src/main.rs index 2e0dd34..b80973a 100644 --- a/miner/src/main.rs +++ b/miner/src/main.rs @@ -101,11 +101,6 @@ fn main() { warn!("创建文件夹失败: {}", e); } - if cli_arg.bench { - cli_arg.thread_count = 1; - set_thread2core(cli_arg.bench_core); - } - info!("开始: {} 结尾: {}", cli_arg.start, cli_arg.end); info!("线程数: {}", cli_arg.thread_count); info!("八围预期: {}", cli_arg.prop_expect); @@ -116,7 +111,8 @@ fn main() { if cli_arg.bench { info!("开始 benchmark"); - let config = cli_arg.as_cacl_config(); + let mut config = cli_arg.as_cacl_config(); + config.core_affinity = Some(0001 << cli_arg.bench_core); cacluate::cacl(config, 1, &out_path); } else { let mut n = 0;