mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-02-01 11:53:22 +00:00
add --disable_measure_queue_data_msg
This commit is contained in:
parent
17a9d168d5
commit
91a67ca9a4
@ -15,10 +15,12 @@ fn aggregate(path: &str) {
|
||||
schema.with_column("random_topology".into(), DataType::Boolean);
|
||||
schema.with_column("peering_degree".into(), DataType::String);
|
||||
schema.with_column("min_queue_size".into(), DataType::Int64);
|
||||
schema.with_column("transmission_rate".into(), DataType::Int64);
|
||||
schema.with_column("transmission_rate".into(), DataType::Float32);
|
||||
schema.with_column("num_senders".into(), DataType::Int64);
|
||||
schema.with_column("num_sender_msgs".into(), DataType::Int64);
|
||||
schema.with_column("num_sender_data_msgs".into(), DataType::Int64);
|
||||
schema.with_column("sender_data_msg_prob".into(), DataType::Float32);
|
||||
schema.with_column("sender_data_msg_interval".into(), DataType::Float32);
|
||||
schema.with_column("mix_data_msg_prob".into(), DataType::Float32);
|
||||
schema.with_column("num_mixes_sending_data".into(), DataType::Int64);
|
||||
schema.with_column("queue_type".into(), DataType::String);
|
||||
|
||||
@ -21,6 +21,7 @@ pub struct Iteration {
|
||||
pub paramset: ParamSet,
|
||||
pub iteration_idx: usize,
|
||||
pub paramset_dir: String,
|
||||
pub disable_measure_queue_data_msg: bool,
|
||||
}
|
||||
|
||||
impl Iteration {
|
||||
@ -211,9 +212,10 @@ impl Iteration {
|
||||
);
|
||||
|
||||
// Record the number of data messages in each mix node's queues
|
||||
if vtime == 0.0
|
||||
|| vtime - recent_vtime_queue_data_msg_count_measured
|
||||
>= QUEUE_DATA_MSG_COUNT_MEASUREMENT_INTERVAL
|
||||
if !self.disable_measure_queue_data_msg
|
||||
&& (vtime == 0.0
|
||||
|| vtime - recent_vtime_queue_data_msg_count_measured
|
||||
>= QUEUE_DATA_MSG_COUNT_MEASUREMENT_INTERVAL)
|
||||
{
|
||||
outputs.add_queue_data_msg_counts(vtime, &mixnodes);
|
||||
recent_vtime_queue_data_msg_count_measured = vtime;
|
||||
|
||||
@ -32,6 +32,8 @@ struct Args {
|
||||
num_threads: usize,
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
reverse_order: bool,
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
disable_measure_queue_data_msg: bool,
|
||||
#[arg(short, long)]
|
||||
from_paramset: Option<u16>,
|
||||
#[arg(short, long)]
|
||||
@ -50,6 +52,7 @@ fn main() {
|
||||
outdir,
|
||||
num_threads,
|
||||
reverse_order,
|
||||
disable_measure_queue_data_msg,
|
||||
from_paramset,
|
||||
to_paramset,
|
||||
} = args;
|
||||
@ -78,6 +81,7 @@ fn main() {
|
||||
from_paramset,
|
||||
to_paramset,
|
||||
reverse_order,
|
||||
disable_measure_queue_data_msg,
|
||||
&rootdir,
|
||||
);
|
||||
run_all_iterations(iterations, num_threads, paramsets.len());
|
||||
@ -107,6 +111,7 @@ fn prepare_all_iterations(
|
||||
from_paramset: Option<u16>,
|
||||
to_paramset: Option<u16>,
|
||||
reverse_order: bool,
|
||||
disable_measure_queue_data_msg: bool,
|
||||
rootdir: &str,
|
||||
) -> Vec<Iteration> {
|
||||
let mut iterations: Vec<Iteration> = Vec::new();
|
||||
@ -128,6 +133,7 @@ fn prepare_all_iterations(
|
||||
paramset: paramset.clone(),
|
||||
iteration_idx: i,
|
||||
paramset_dir: paramset_dir.clone(),
|
||||
disable_measure_queue_data_msg,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ pub struct ParamSet {
|
||||
pub random_topology: bool,
|
||||
pub peering_degree: PeeringDegree,
|
||||
pub min_queue_size: u16,
|
||||
pub transmission_rate: u16,
|
||||
pub transmission_rate: f32,
|
||||
pub num_senders: u8,
|
||||
pub num_sender_msgs: u32,
|
||||
pub num_sender_data_msgs: Option<u32>,
|
||||
@ -123,7 +123,7 @@ impl ParamSet {
|
||||
}
|
||||
|
||||
fn new_session1_paramsets(exp_id: ExperimentId, queue_type: QueueType) -> Vec<ParamSet> {
|
||||
let transmission_rate: u16 = 1;
|
||||
let transmission_rate: f32 = 1.0;
|
||||
let min_queue_size: u16 = 10;
|
||||
let num_senders: u8 = match exp_id {
|
||||
ExperimentId::Experiment3 | ExperimentId::Experiment4 => 2,
|
||||
@ -226,7 +226,7 @@ impl ParamSet {
|
||||
}
|
||||
|
||||
fn new_session2_paramsets(exp_id: ExperimentId, queue_type: QueueType) -> Vec<ParamSet> {
|
||||
let transmission_rate: u16 = 1;
|
||||
let transmission_rate: f32 = 1.0;
|
||||
let min_queue_size: u16 = 10;
|
||||
let num_senders: u8 = 1;
|
||||
let num_sender_msgs: u32 = 10000;
|
||||
@ -311,7 +311,7 @@ impl ParamSet {
|
||||
(24, 0.007),
|
||||
]),
|
||||
min_queue_size: 10,
|
||||
transmission_rate: 1,
|
||||
transmission_rate: 1.0,
|
||||
num_senders: 1,
|
||||
num_sender_msgs: match exp_id {
|
||||
ExperimentId::Experiment6 => 10000,
|
||||
@ -342,30 +342,32 @@ impl ParamSet {
|
||||
let mut id: u16 = 1;
|
||||
let mut paramsets: Vec<ParamSet> = Vec::new();
|
||||
match exp_id {
|
||||
ExperimentId::Experiment6 => {
|
||||
ExperimentId::Experiment7 => {
|
||||
for num_mixes in [100, 1000, 10000, 100000] {
|
||||
for peering_degree in [10, 9, 8, 7, 6, 5, 4, 3] {
|
||||
for transmission_rate in [100, 70, 40, 10] {
|
||||
let paramset = ParamSet {
|
||||
id,
|
||||
num_mixes,
|
||||
num_paths: 0, // since we're gonna build random topology
|
||||
random_topology: true,
|
||||
peering_degree: PeeringDegree::Fixed(peering_degree),
|
||||
min_queue_size: 10,
|
||||
transmission_rate,
|
||||
num_senders: 1,
|
||||
num_sender_msgs: 0,
|
||||
num_sender_data_msgs: Some(50),
|
||||
sender_data_msg_prob: 1.0,
|
||||
sender_data_msg_interval: Some(20.0),
|
||||
mix_data_msg_prob: 1.0 / transmission_rate as f32, // to let mix send data_msg every 1s approx.
|
||||
num_mixes_sending_data: num_mixes, // All mixes try to send data msg following mix_data_msg_prob
|
||||
queue_type,
|
||||
num_iterations: 3,
|
||||
};
|
||||
id += 1;
|
||||
paramsets.push(paramset);
|
||||
for peering_degree in [8, 6, 4] {
|
||||
for transmission_rate in [1.0, 0.5, 0.2, 0.1, 0.05] {
|
||||
for num_mixes_sending_data in [0, 1, 2, 3, 4] {
|
||||
let paramset = ParamSet {
|
||||
id,
|
||||
num_mixes,
|
||||
num_paths: 0, // since we're gonna build random topology
|
||||
random_topology: true,
|
||||
peering_degree: PeeringDegree::Fixed(peering_degree),
|
||||
min_queue_size: 10,
|
||||
transmission_rate,
|
||||
num_senders: 1,
|
||||
num_sender_msgs: 0,
|
||||
num_sender_data_msgs: Some(50),
|
||||
sender_data_msg_prob: 1.0,
|
||||
sender_data_msg_interval: Some(20.0),
|
||||
mix_data_msg_prob: 1.0,
|
||||
num_mixes_sending_data,
|
||||
queue_type,
|
||||
num_iterations: 10,
|
||||
};
|
||||
id += 1;
|
||||
paramsets.push(paramset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -453,8 +455,8 @@ mod tests {
|
||||
((ExperimentId::Experiment5, SessionId::Session3), 6),
|
||||
((ExperimentId::Experiment6, SessionId::Session3), 3 * 3),
|
||||
(
|
||||
(ExperimentId::Experiment6, SessionId::Session100),
|
||||
4 * 8 * 4,
|
||||
(ExperimentId::Experiment7, SessionId::Session100),
|
||||
4 * 3 * 5 * 5,
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user