Skip to content

Commit 665eebe

Browse files
committed
update runEVM
1 parent 7e04ded commit 665eebe

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

bin/splitEVMCommands.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@
33
import math
44
import random
55
import os
6+
import re
67

78
def split_file(input_file, num_files):
89
with open(input_file, 'r') as infile:
910
lines = infile.readlines()
10-
random.shuffle(lines) # Shuffle the lines
1111

12-
total_lines = len(lines)
12+
# Fix paths in commands: replace standalone EVM/ with results/EVM/
13+
# This handles cases where partitions_list.out was generated with old paths
14+
fixed_lines = []
15+
for line in lines:
16+
# Replace --exec_dir EVM/ with --exec_dir results/EVM/
17+
line = re.sub(r'--exec_dir\s+EVM/', '--exec_dir results/EVM/', line)
18+
# Replace > EVM/ with > results/EVM/ (for output redirection)
19+
line = re.sub(r'>\s*EVM/', '> results/EVM/', line)
20+
# Replace 2> EVM/ with 2> results/EVM/ (for stderr redirection)
21+
line = re.sub(r'2>\s*EVM/', '2> results/EVM/', line)
22+
fixed_lines.append(line)
23+
24+
random.shuffle(fixed_lines) # Shuffle the lines
25+
26+
total_lines = len(fixed_lines)
1327
lines_per_file = total_lines // num_files
1428
remainder_lines = total_lines % num_files
1529

@@ -20,7 +34,7 @@ def split_file(input_file, num_files):
2034
if file_num < remainder_lines:
2135
lines_to_write += 1
2236
for _ in range(lines_to_write):
23-
outfile.write(lines.pop())
37+
outfile.write(fixed_lines.pop())
2438

2539
# Example usage
2640
input_file = "results/EVM/commands.list" # Specify your input file here

0 commit comments

Comments
 (0)