Skip to content

Commit

Permalink
Fix bugs in Paired WAN setup
Browse files Browse the repository at this point in the history
  • Loading branch information
samkumar committed Apr 24, 2021
1 parent 4122d31 commit 0acf08f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def copy_scripts(machine, global_id):
cluster.for_each_concurrently(copy_scripts, worker_ids)

def generate_input(machine, global_id, thread_id):
id = ((global_id // workers_per_node) * workers_per_node) + thread_id
id = ((global_id * workers_per_node) + thread_id) % (workers_per_node * nodes_per_party)
remote.exec_sync(machine.public_ip_address, "~/generate_input.sh {0} {1} {2} {3} {4}".format(problem_name, problem_size, protocol, id, workers_per_node * nodes_per_party))
if generate_fresh_input:
cluster.for_each_multiple_concurrently(generate_input, workers_per_node, worker_ids)

def generate_memprog(machine, global_id, thread_id):
party = wan_party_from_global_id(cluster, global_id)
id = ((global_id // workers_per_node) * workers_per_node) + thread_id
id = ((global_id * workers_per_node) + thread_id) % (workers_per_node * nodes_per_party)
if scenario == "mage":
log_name_to_use = log_name_to_use = "{0}_w{1}".format(log_name, id)
else:
Expand All @@ -55,10 +55,10 @@ def generate_memprog(machine, global_id, thread_id):

def run_mage(machine, global_id, thread_id):
party = wan_party_from_global_id(cluster, global_id)
id = ((global_id // workers_per_node) * workers_per_node) + thread_id
id = ((global_id * workers_per_node) + thread_id) % (workers_per_node * nodes_per_party)
time.sleep(10 * id)
if party == 1:
time.sleep(10 * workers_per_node + 20) # Wait for all evaluator workers to start first
time.sleep(10 * workers_per_node * nodes_per_party + 20) # Wait for all evaluator workers to start first
log_name_to_use = "{0}_w{1}".format(log_name, id)
remote.exec_sync(machine.public_ip_address, "~/run_mage.sh {0} {1} {2} {3} {4} {5} {6} {7} {8}".format(scenario, mem_limit, protocol, config_file, party, id, program_name, log_name_to_use, "true"))

Expand Down
5 changes: 5 additions & 0 deletions magebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ def purge(args):
def logs_directory(c, id, logs_directory):
if id < c.num_lan_machines:
directory_name = "{0:02d}".format(id)
elif c.paired:
for location, loc_id in c.location_to_id.items():
if id in range(loc_id, loc_id + c.num_lan_machines):
directory_name = "{0}-{1:02d}".format(location, id)
break
else:
for location, loc_id in c.location_to_id.items():
if id == loc_id:
Expand Down

0 comments on commit 0acf08f

Please sign in to comment.