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

add log_tuples function #1896

Merged
merged 5 commits into from
Jun 6, 2022
Merged
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion artiq/master/worker_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ def write_results():
f["run_time"] = run_time
f["expid"] = pyon.encode(expid)

def log_tuples():
with open("tuples.txt", "a") as f:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current directory of the experiment may be subject to change (see discussions in #1747, #1543).
Would be more future-proof to put it where the master writes other files such as last_rid.pyon.

f.write("%s %s %s\n" %(rid, start_time, expid["file"]))
Copy link
Member

@sbourdeauducq sbourdeauducq May 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use new style format "".format()"


device_mgr = DeviceManager(ParentDeviceDB,
virtual_devices={"scheduler": Scheduler(),
"ccb": CCB()})
Expand Down Expand Up @@ -331,6 +335,7 @@ def write_results():
elif action == "run":
run_time = time.time()
try:
log_tuples()
exp_inst.run()
except:
# Only write results in run() on failure; on success wait
Expand All @@ -342,7 +347,7 @@ def write_results():
try:
exp_inst.analyze()
put_completed()
finally:
finally:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean up

write_results()
elif action == "examine":
examine(ExamineDeviceMgr, ExamineDatasetMgr, obj["file"])
Expand Down