Exemplo n.º 1
0
    def __init__(self, params, composite_tag=None, rank=0):
        super(DialsProcessorWithLogging,
              self).__init__(params, composite_tag, rank)
        self.tt_low = None
        self.tt_high = None
        if self.params.experiment_tag is None:
            return

        assert params.db.logging_batch_size >= 1

        from libtbx.mpi4py import MPI
        comm = MPI.COMM_WORLD

        self.queries = []
        self.rank = rank

        if comm.size > 1:
            if rank == 0:
                db_app = dxtbx_xfel_db_application(params,
                                                   cache_connection=False,
                                                   mode='cache_commits')
                run = db_app.get_run(run_number=self.params.input.run_num)
                run_id = run.id
                rund = run._db_dict
                trial = db_app.get_trial(trial_number=params.input.trial)
                trial_id = trial.id
                triald = trial._db_dict
            else:
                db_app = None
                run_id = None
                rund = None
                trial_id = None
                triald = None
            self.db_app, run_id, rund, trial_id, triald = comm.bcast(
                (db_app, run_id, rund, trial_id, triald), root=0)
            self.run = Run(self.db_app, run_id=run_id, **rund)
            self.trial = Trial(self.db_app, trial_id=trial_id, **triald)
        else:
            self.db_app = dxtbx_xfel_db_application(params,
                                                    cache_connection=False,
                                                    mode='cache_commits')
            self.run = self.db_app.get_run(
                run_number=self.params.input.run_num)
            self.trial = self.db_app.get_trial(trial_number=params.input.trial)
        self.n_strong = None
Exemplo n.º 2
0
 def __init__(self, params, composite_tag=None, rank=0):
     super(DialsProcessorWithLogging,
           self).__init__(params, composite_tag, rank)
     self.tt_low = None
     self.tt_high = None
     if params.db.logging_batch_size:
         self.queries = []
     else:
         self.db_app = dxtbx_xfel_db_application(params,
                                                 cache_connection=True)
     self.n_strong = None
Exemplo n.º 3
0
 def log_batched_frames(self):
     db_app = dxtbx_xfel_db_application(self.params, cache_connection=True)
     for q in self.queries:
         experiments, reflections, run, n_strong, timestamp, two_theta_low, two_theta_high, db_event = q
         log_frame(experiments,
                   reflections,
                   self.params,
                   run,
                   n_strong,
                   timestamp=timestamp,
                   two_theta_low=two_theta_low,
                   two_theta_high=two_theta_high,
                   db_event=db_event,
                   app=db_app)
     self.queries = []
Exemplo n.º 4
0
 def __init__(self, params, composite_tag=None, rank=0):
     super(DialsProcessorWithLogging,
           self).__init__(params, composite_tag, rank)
     self.tt_low = None
     self.tt_high = None
     self.db_app = dxtbx_xfel_db_application(params, cache_connection=True)