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

Working OS info save function #163

Merged
merged 2 commits into from
Jan 9, 2025
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
13 changes: 13 additions & 0 deletions benchmarks/scripts/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from time import time
import platform
import os
import pandas as pd
from datetime import datetime
from cirq import CZTargetGateset, optimize_for_target_gateset
Expand Down Expand Up @@ -143,6 +145,17 @@ def get_header(df):
f"{key}={value}" for key, value in compiler_versions.items()
)

# Get Operating System Info
os_info = platform.system() # OS name (e.g., 'Darwin' for macOS, 'Linux', 'Windows')
os_version = platform.version() # OS version
architecture = platform.architecture() # System architecture (e.g., '64bit')

# Get Parallelism Info (number of CPU cores)
cpu_count = os.cpu_count() # Number of available CPU cores

# Combine the information into a header
header_info = f"OS: {os_info} {os_version}, Architecture: {architecture[0]}, CPU Cores: {cpu_count}"
version_header += f" # {header_info}"
return version_header

def save_results(results_log, benchmark_name="gates", folder="../results", append=False):
Expand Down
Loading