def submit(self, previous_job=None): from xfel.command_line.striping import Script from xfel.command_line.cxi_mpi_submit import get_submission_id from libtbx import easy_run configs_dir = os.path.join(settings_dir, "cfgs") identifier_string = self.get_identifier_string() target_phil_path = os.path.join(configs_dir, identifier_string + "_params.phil") with open(target_phil_path, 'w') as f: f.write(self.task.parameters) path = get_run_path(self.app.params.output_folder, self.trial, self.rungroup, self.run, self.task) os.mkdir(path) arguments = """ mp.queue={} mp.nproc={} mp.method={} {} mp.use_mpi=False striping.results_dir={} striping.trial={} striping.rungroup={} striping.run={} {} striping.chunk_size=3000 striping.stripe=False striping.dry_run=True striping.output_folder={} """.format( self.app.params.mp.queue if len(self.app.params.mp.queue) > 0 else None, self.app.params.mp.nproc, self.app.params.mp.method, '\n'.join([ 'mp.env_script={}'.format(p) for p in self.app.params.mp.env_script ]), self.app.params.output_folder, self.trial.trial, self.rungroup.id, self.run.run, target_phil_path, path, ).split() commands = Script(arguments).run() submission_ids = [] for command in commands: try: result = easy_run.fully_buffered(command=command) result.raise_if_errors() except Exception as e: if not "Warning: job being submitted without an AFS token." in str( e): raise e submission_ids.append( get_submission_id(result, self.app.params.mp.method)) return ",".join(submission_ids)
def submit(self, previous_job = None): from xfel.command_line.striping import Script from xfel.command_line.cxi_mpi_submit import get_submission_id from libtbx import easy_run configs_dir = os.path.join(settings_dir, "cfgs") identifier_string = self.get_identifier_string() target_phil_path = os.path.join(configs_dir, identifier_string + "_params.phil") with open(target_phil_path, 'w') as f: if self.task.parameters: f.write(self.task.parameters) path = get_run_path(self.app.params.output_folder, self.trial, self.rungroup, self.run, self.task) os.mkdir(path) arguments = """ mp.queue={} mp.nnodes={} mp.nproc_per_node={} mp.method={} {} {} mp.use_mpi=False mp.mpi_command={} {} striping.results_dir={} striping.trial={} striping.rungroup={} striping.run={} {} striping.chunk_size=200 striping.stripe=False striping.dry_run=True striping.output_folder={} reintegration.integration.lookup.mask={} mp.local.include_mp_in_command=False """.format(self.app.params.mp.queue if len(self.app.params.mp.queue) > 0 else None, 1,#self.app.params.mp.nproc, self.app.params.mp.nproc_per_node, self.app.params.mp.method, '\n'.join(['mp.env_script={}'.format(p) for p in self.app.params.mp.env_script if p]), '\n'.join(['mp.phenix_script={}'.format(p) for p in self.app.params.mp.phenix_script if p]), self.app.params.mp.mpi_command, "\n".join(["extra_options={}".format(opt) for opt in self.app.params.mp.extra_options]), self.app.params.output_folder, self.trial.trial, self.rungroup.id, self.run.run, target_phil_path, path, self.rungroup.untrusted_pixel_mask_path, ).split() try: commands = Script(arguments).run() except Exception as e: if 'no DIALS integration results found' in str(e): print("No DIALS integration results found") self.status = "EXIT" return else: raise submission_ids = [] if self.app.params.mp.method == 'local': self.status = "RUNNING" for command in commands: try: result = easy_run.fully_buffered(command=command) result.raise_if_errors() except Exception as e: if not "Warning: job being submitted without an AFS token." in str(e): raise e submission_ids.append(get_submission_id(result, self.app.params.mp.method)) if self.app.params.mp.method == 'local': self.status = "DONE" else: return ",".join(submission_ids)