Skip to content
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
28 changes: 20 additions & 8 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,14 +3240,14 @@ 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:
self.compilation_aborted.set()
continue
if send_to_BLACS:
self.send_to_BLACS(run_file, BLACS_host)
self.send_to_BLACS(run_file, BLACS_host, lyse_host)
if send_to_runviewer:
self.send_to_runviewer(run_file)
except Exception as e:
Expand Down Expand Up @@ -3462,12 +3472,14 @@ def make_h5_files(self, labscript_file, output_folder, sequence_globals, shots,
logger.debug(run_files)
return labscript_file, run_files

def send_to_BLACS(self, run_file, BLACS_hostname):
def send_to_BLACS(self, run_file, BLACS_hostname, lyse_host):
port = int(self.exp_config.get('ports', 'BLACS'))
agnostic_path = shared_drive.path_to_agnostic(run_file)
self.output_box.output('Submitting run file %s.\n' % os.path.basename(run_file))
try:
response = zmq_get(port, BLACS_hostname, data=agnostic_path)
message = {"agnostic_path": agnostic_path,
"lyse_host": lyse_host}
response = zmq_get(port, BLACS_hostname, data=message)
if 'added successfully' in response:
self.output_box.output(response)
else:
Expand Down
5 changes: 3 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,8 @@ 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)
with open(labscript_file) as f:
code = compile(
f.read(), self.script_module.__file__, 'exec', dont_inherit=True
Expand Down
Loading