Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions measurements/A.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
import psutil
import sys

# --- Fallback Definitions for Direct Execution ---
# These values are normally injected by copy_with_port_portname.py during study generation.
# When running this script directly, safe defaults are used instead.
_STANDALONE_MODE = False

if 'PORT_NAME_F1_F2' not in globals():
PORT_NAME_F1_F2 = "F1_F2"
_STANDALONE_MODE = True

if 'PORT_F1_F2' not in globals():
PORT_F1_F2 = "5555"
_STANDALONE_MODE = True

if _STANDALONE_MODE:
print("Warning: Port variables not injected. Running in standalone mode with default values.")
print(" For full study behavior, run via study generation (makestudy).")

# --- ZMQ Initialization ---
# This REQ socket connects to Node B
concore.init_zmq_port(
Expand Down
25 changes: 25 additions & 0 deletions measurements/B.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
import concore
import time

# --- Fallback Definitions for Direct Execution ---
# These values are normally injected by copy_with_port_portname.py during study generation.
# When running this script directly, safe defaults are used instead.
_STANDALONE_MODE = False

if 'PORT_NAME_F1_F2' not in globals():
PORT_NAME_F1_F2 = "F1_F2"
_STANDALONE_MODE = True

if 'PORT_F1_F2' not in globals():
PORT_F1_F2 = "5555"
_STANDALONE_MODE = True

if 'PORT_NAME_F2_F3' not in globals():
PORT_NAME_F2_F3 = "F2_F3"
_STANDALONE_MODE = True

if 'PORT_F2_F3' not in globals():
PORT_F2_F3 = "5556"
_STANDALONE_MODE = True

if _STANDALONE_MODE:
print("Warning: Port variables not injected. Running in standalone mode with default values.")
print(" For full study behavior, run via study generation (makestudy).")

# --- ZMQ Initialization ---
# This REP socket binds and waits for requests from Node A
concore.init_zmq_port(
Expand Down
17 changes: 17 additions & 0 deletions measurements/C.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
import os
import sys

# --- Fallback Definitions for Direct Execution ---
# These values are normally injected by copy_with_port_portname.py during study generation.
# When running this script directly, safe defaults are used instead.
_STANDALONE_MODE = False

if 'PORT_NAME_F2_F3' not in globals():
PORT_NAME_F2_F3 = "F2_F3"
_STANDALONE_MODE = True

if 'PORT_F2_F3' not in globals():
PORT_F2_F3 = "5556"
_STANDALONE_MODE = True

if _STANDALONE_MODE:
print("Warning: Port variables not injected. Running in standalone mode with default values.")
print(" For full study behavior, run via study generation (makestudy).")

# --- ZMQ Initialization ---
# This REP socket binds and waits for requests from Node B
concore.init_zmq_port(
Expand Down
5 changes: 4 additions & 1 deletion measurements/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ This folder contains studies and source code specifically for measuring communic
Here you will find studies and source code focused on measuring communication times using ZeroMQ within a single system setup.

# Network Communication Measurements (Two Systems Required)
For the Latency, Throughput, and CPU Usage measurements, two different systems are required. These systems should be connected over the same network to ensure efficient and accurate communication measurements between them. This setup is crucial for evaluating network-dependent performance metrics effectively.
For the Latency, Throughput, and CPU Usage measurements, two different systems are required. These systems should be connected to the same network to ensure efficient, accurate communication between them. This setup is crucial for effectively evaluating network-dependent performance metrics.

# Important Note on Port Variables
The measurement benchmark scripts (A.py, B.py, C.py) expect port variables such as `PORT_NAME_F1_F2`, `PORT_F1_F2`, `PORT_NAME_F2_F3`, and `PORT_F2_F3` to be injected by `copy_with_port_portname.py` during study generation. Running these scripts directly will use safe fallback defaults and may not reflect full study behavior. For accurate results, always run measurements through the study generation workflow (e.g., `makestudy`).