diff --git a/aiida_cp2k/utils/datatype_helpers.py b/aiida_cp2k/utils/datatype_helpers.py index 041bad6..77b1e5f 100644 --- a/aiida_cp2k/utils/datatype_helpers.py +++ b/aiida_cp2k/utils/datatype_helpers.py @@ -438,7 +438,7 @@ def _merge_trajectories_into_dictionary(*trajectories, unique_stepids=False): # The other arrays are then also reduced to the unique stepids. if unique_stepids: stepids = np.concatenate([traj.get_stepids() for traj in trajectories], axis=0) - final_trajectory_dict["stepids"], unique_indices = np.unique( + final_trajectory_dict["steps"], unique_indices = np.unique( stepids, return_index=True ) diff --git a/aiida_cp2k/workchains/base.py b/aiida_cp2k/workchains/base.py index cf5225d..899f878 100644 --- a/aiida_cp2k/workchains/base.py +++ b/aiida_cp2k/workchains/base.py @@ -77,9 +77,9 @@ def overwrite_input_structure(self): if "output_structure" in self.ctx.children[self.ctx.iteration-1].outputs: self.ctx.inputs.structure = self.ctx.children[self.ctx.iteration-1].outputs.output_structure - @engine.process_handler(priority=401, exit_codes=[ - Cp2kCalculation.exit_codes.ERROR_OUT_OF_WALLTIME, + @engine.process_handler(priority=303, exit_codes=[ Cp2kCalculation.exit_codes.ERROR_OUTPUT_INCOMPLETE, + Cp2kCalculation.exit_codes.ERROR_OUT_OF_WALLTIME, Cp2kCalculation.exit_codes.ERROR_SCF_NOT_CONVERGED, Cp2kCalculation.exit_codes.ERROR_MAXIMUM_NUMBER_OPTIMIZATION_STEPS_REACHED, ], enabled=False) @@ -124,6 +124,7 @@ def restart_incomplete_calculation(self, calc): first_snapshot = None try: first_snapshot = int(params['MOTION']['MD']['REFTRAJ']['FIRST_SNAPSHOT']) + calc.outputs.output_trajectory.get_shape('positions')[0] + self.report(f"First snapshot changed from {int(params['MOTION']['MD']['REFTRAJ']['FIRST_SNAPSHOT'])} to {first_snapshot}") if first_snapshot: params = utils.add_first_snapshot_in_reftraj_section(params, first_snapshot) except KeyError: