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

Lyse field #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 15 additions & 5 deletions runmanager/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,8 @@ def on_engage_clicked(self):
send_to_BLACS = self.ui.checkBox_run_shots.isChecked()
send_to_runviewer = self.ui.checkBox_view_shots.isChecked()
labscript_file = self.ui.lineEdit_labscript_file.text()
lyse_host = self.ui.lineEdit_Lyse_hostname.text()

# even though we shuffle on a per global basis, if ALL of the globals are set to shuffle, then we may as well shuffle again. This helps shuffle shots more randomly than just shuffling within each level (because without this, you would still do all shots with the outer most variable the same, etc)
shuffle = self.ui.pushButton_shuffle.checkState() == QtCore.Qt.Checked
if not labscript_file:
Expand All @@ -1819,7 +1821,7 @@ def on_engage_clicked(self):
labscript_file, run_files = self.make_h5_files(
labscript_file, output_folder, sequenceglobals, shots, shuffle)
self.ui.pushButton_abort.setEnabled(True)
self.compile_queue.put([labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer])
self.compile_queue.put([labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer, lyse_host])
except Exception as e:
self.output_box.output('%s\n\n' % str(e), red=True)
logger.info('end engage')
Expand Down Expand Up @@ -3044,9 +3046,12 @@ def get_save_data(self):
if is_using_default_shot_output_folder:
shot_output_folder = ''

# Get the server hostnames:
# Get the BLACS server hostnames:
blacs_host = self.ui.lineEdit_BLACS_hostname.text()

# Get the lyse server hostnames:
lyse_host = self.ui.lineEdit_Lyse_hostname.text()

send_to_runviewer = self.ui.checkBox_view_shots.isChecked()
send_to_blacs = self.ui.checkBox_run_shots.isChecked()
shuffle = self.ui.pushButton_shuffle.isChecked()
Expand All @@ -3070,7 +3075,8 @@ def get_save_data(self):
'send_to_blacs': send_to_blacs,
'shuffle': shuffle,
'axes': axes,
'blacs_host': blacs_host}
'blacs_host': blacs_host,
'lyse_host': lyse_host}
return save_data

def save_configuration(self, save_file):
Expand Down Expand Up @@ -3205,6 +3211,10 @@ def warning(message):
if blacs_host is not None:
self.ui.lineEdit_BLACS_hostname.setText(blacs_host)

lyse_host = runmanager_config.get('lyse_host')
if blacs_host is not None:
self.ui.lineEdit_Lyse_hostname.setText(lyse_host)

# Set as self.last_save_data:
save_data = self.get_save_data()
self.last_save_data = save_data
Expand All @@ -3214,7 +3224,7 @@ def warning(message):
def compile_loop(self):
while True:
try:
labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer = self.compile_queue.get()
labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer, lyse_host = self.compile_queue.get()
run_files = iter(run_files) # Should already be in iterator but just in case
while True:
if self.compilation_aborted.is_set():
Expand All @@ -3230,7 +3240,7 @@ def compile_loop(self):
self.output_box.output('Ready.\n\n')
break
else:
self.to_child.put(['compile', [labscript_file, run_file]])
self.to_child.put(['compile', [labscript_file, run_file, lyse_host]])
signal, success = self.from_child.get()
assert signal == 'done'
if not success:
Expand Down
6 changes: 4 additions & 2 deletions runmanager/batch_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def mainloop(self):
else:
raise ValueError(signal)

def compile(self, labscript_file, run_file):
def compile(self, labscript_file, run_file, lyse_host):
self.script_module.__file__ = labscript_file

# Save the current working directory before changing it to the location of the
Expand All @@ -64,7 +64,9 @@ def compile(self, labscript_file, run_file):
try:
# Do not let the modulewatcher unload any modules whilst we're working:
with kill_lock, module_watcher.lock:
labscript.labscript_init(run_file, labscript_file=labscript_file)
labscript.labscript_init(run_file,
labscript_file=labscript_file,
lyse_host=lyse_host)
with open(labscript_file) as f:
code = compile(
f.read(), self.script_module.__file__, 'exec', dont_inherit=True
Expand Down
Loading