Exemplo n.º 1
0
    def define(cls, spec: CalcJobProcessSpec):
        super(CryDossCalculation, cls).define(spec)

        spec.input("metadata.options.output_isovalue_fname",
                   valid_type=str,
                   default="fort.25")

        spec.input("metadata.options.parser_name",
                   valid_type=str,
                   default="crystal17.doss")

        spec.exit_code(
            352,
            "ERROR_ISOVALUE_FILE_MISSING",
            message="parser could not find the output isovalue (fort.25) file",
        )
        spec.exit_code(
            353,
            "ERROR_PARSING_ISOVALUE_FILE",
            message="error parsing output isovalue (fort.25) file",
        )

        spec.output(
            "arrays",
            valid_type=DataFactory("array"),
            required=False,
            help="energies and DoS arrays",
        )
    def define(cls, spec: CalcJobProcessSpec):
        super(Symmetrise3DStructure, cls).define(spec)
        spec.input("structure", valid_type=StructureData, required=False)
        spec.input("cif", valid_type=DataFactory("cif"), required=False)
        spec.input(
            "settings",
            valid_type=DataFactory("dict"),
            serializer=to_aiida_type,
            required=True,
            validator=cls.validate_settings,
        )

        spec.outline(cls.validate_inputs, cls.compute)

        spec.output("symmetry", valid_type=SymmetryData, required=True)
        spec.output("structure", valid_type=StructureData, required=False)

        spec.exit_code(
            300,
            "ERROR_INVALID_INPUT_RESOURCES",
            message="one of either a structure or cif input must be supplied",
        )
        spec.exit_code(
            301,
            "ERROR_NON_3D_STRUCTURE",
            message='the supplied structure must be 3D (i.e. have all dimensions pbc=True)"',
        )
        spec.exit_code(
            302,
            "ERROR_COMPUTE_OPTIONS",
            message="idealize can only be used when standardize=True",
        )
        spec.exit_code(
            303,
            "ERROR_RESET_KIND_NAMES",
            message="the kind names supplied are not compatible with the structure",
        )
        spec.exit_code(
            304, "ERROR_NEW_STRUCTURE", message="error creating new structure"
        )
        spec.exit_code(
            305,
            "ERROR_COMPUTING_SYMMETRY",
            message="error computing symmetry operations",
        )
Exemplo n.º 3
0
    def define(cls, spec: CalcJobProcessSpec):
        """Define the process specification, including its inputs, outputs and known exit codes.

        :param spec: the calculation job process spec to define.
        """
        super().define(spec)
        spec.input('x', valid_type=(orm.Int, orm.Float), help='The left operand.')
        spec.input('y', valid_type=(orm.Int, orm.Float), help='The right operand.')
        spec.output('sum', valid_type=(orm.Int, orm.Float), help='The sum of the left and right operand.')
        # set default options (optional)
        spec.inputs['metadata']['options']['parser_name'].default = 'arithmetic.add'
        spec.inputs['metadata']['options']['input_filename'].default = 'aiida.in'
        spec.inputs['metadata']['options']['output_filename'].default = 'aiida.out'
        spec.inputs['metadata']['options']['resources'].default = {'num_machines': 1, 'num_mpiprocs_per_machine': 1}
        # start exit codes - marker for docs
        spec.exit_code(300, 'ERROR_NO_RETRIEVED_FOLDER', message='The retrieved output node does not exist.')
        spec.exit_code(310, 'ERROR_READING_OUTPUT_FILE', message='The output file could not be read.')
        spec.exit_code(320, 'ERROR_INVALID_OUTPUT', message='The output file contains invalid output.')
        spec.exit_code(410, 'ERROR_NEGATIVE_NUMBER', message='The sum of the operands is a negative number.')
Exemplo n.º 4
0
    def define(cls, spec: CalcJobProcessSpec):

        super(PropAbstractCalculation, cls).define(spec)

        spec.input("metadata.options.input_file_name",
                   valid_type=str,
                   default="INPUT")
        spec.input("metadata.options.input_wf_name",
                   valid_type=str,
                   default="fort.9")
        spec.input("metadata.options.stdout_file_name",
                   valid_type=str,
                   default="main.out")

        spec.input(
            "wf_folder",
            valid_type=(FolderData, RemoteData, SinglefileData),
            required=True,
            help="the folder containing the wavefunction fort.9 file",
        )
        spec.input(
            "parameters",
            valid_type=DataFactory("dict"),
            required=True,
            validator=cls.validate_parameters,
            help="the input parameters to create the properties input file.",
        )

        # subclasses should implement
        # spec.input('metadata.options.parser_name', valid_type=str, default='crystal17.')

        # Unrecoverable errors: resources like the retrieved folder or its expected contents are missing
        spec.exit_code(
            200,
            "ERROR_NO_RETRIEVED_FOLDER",
            message="The retrieved folder data node could not be accessed.",
        )
        spec.exit_code(
            210,
            "ERROR_OUTPUT_FILE_MISSING",
            message="the main (stdout) output file was not found",
        )
        spec.exit_code(
            211,
            "ERROR_TEMP_FOLDER_MISSING",
            message="the temporary retrieved folder was not found",
        )

        # Unrecoverable errors: required retrieved files could not be read, parsed or are otherwise incomplete
        spec.exit_code(
            300,
            "ERROR_PARSING_STDOUT",
            message=("An error was flagged trying to parse the "
                     "crystal exec stdout file"),
        )

        spec.exit_code(
            350,
            "ERROR_CRYSTAL_INPUT",
            message="the input file could not be read by CRYSTAL",
        )
        spec.exit_code(
            351,
            "ERROR_WAVEFUNCTION_NOT_FOUND",
            message="CRYSTAL could not find the required wavefunction file",
        )
        spec.exit_code(
            352,
            "UNIT_CELL_NOT_NEUTRAL",
            message="Possibly due to erroneous CHEMOD basis set modification",
        )
        spec.exit_code(
            353,
            "SHELL_SYMMETRY_ERROR",
            message="Possibly due to erroneous CHEMOD basis set modification",
        )
        spec.exit_code(354,
                       "CHEMMOD_ERROR",
                       message="Error in CHEMOD basis set modification")

        # Significant errors but calculation can be used to restart
        spec.exit_code(
            400,
            "ERROR_OUT_OF_WALLTIME",
            message=
            "The calculation stopped prematurely because it ran out of walltime.",
        )
        spec.exit_code(
            401,
            "ERROR_OUT_OF_MEMORY",
            message=
            "The calculation stopped prematurely because it ran out of memory.",
        )
        spec.exit_code(
            402,
            "ERROR_OUT_OF_VMEMORY",
            message=
            "The calculation stopped prematurely because it ran out of virtual memory.",
        )

        spec.exit_code(
            413,
            "BASIS_SET_LINEARLY_DEPENDENT",
            message="an error encountered usually during geometry optimisation",
        )
        spec.exit_code(
            414,
            "ERROR_SCF_ABNORMAL_END",
            message="an error was encountered during an SCF computation",
        )
        spec.exit_code(
            415,
            "ERROR_MPI_ABORT",
            message=
            "an unknown error was encountered, causing the MPI to abort",
        )
        spec.exit_code(
            499,
            "ERROR_CRYSTAL_RUN",
            message="The main crystal output file flagged an unhandled error",
        )

        spec.output(
            cls.link_output_results,
            valid_type=DataFactory("dict"),
            required=True,
            help="Summary Data extracted from the output file(s)",
        )
        spec.default_output_node = cls.link_output_results
Exemplo n.º 5
0
    def define(cls, spec: CalcJobProcessSpec):
        """Define the process specification, including its inputs, outputs and known exit codes.

        :param spec: the calculation job process spec to define.
        """
        super().define(spec)
        spec.input(
            "time",
            serializer=to_aiida_type,
            valid_type=(orm.Int, orm.Float),
            default=lambda: orm.Int(1),
            validator=_time_validator,
            help="The time to sleep.",
        )
        spec.input(
            "payload",
            serializer=to_aiida_type,
            valid_type=orm.Dict,
            default=lambda: orm.Dict(dict={}),
            help="A dictionary that will be uploaded and retrieved.",
        )
        spec.output(
            "result",
            valid_type=orm.Bool,
            help='If the output file contains "success".',
        )
        spec.output(
            "out_dict",
            valid_type=orm.Dict,
            help="Output Dict (with size metadata.options.output_dict_size).",
        )
        spec.output(
            "out_array",
            valid_type=orm.ArrayData,
            help=
            "Output ArrayData (with size metadata.options.output_array_size).",
        )
        # set default options (optional)
        spec.inputs["metadata"]["options"]["parser_name"].default = "sleep"
        spec.inputs["metadata"]["options"][
            "input_filename"].default = "aiida.in"
        spec.inputs["metadata"]["options"][
            "output_filename"].default = "aiida.out"
        spec.inputs["metadata"]["options"]["resources"].default = {
            "num_machines": 1,
            "num_mpiprocs_per_machine": 1,
        }
        spec.input(
            "metadata.options.payload_filename",
            valid_type=str,
            default="payload.json",
            help=
            "Filename to which the content of the payload JSON is written.",
        )
        spec.input(
            "metadata.options.fail_calcjob",
            valid_type=bool,
            default=False,
            help="Intentionally fail the calculation (with code 410).",
        )
        spec.input(
            "metadata.options.output_dict_size",
            valid_type=int,
            default=100,
            help="The number of attributes for the output Dict.",
        )
        spec.input(
            "metadata.options.output_array_size",
            valid_type=int,
            default=100,
            help="The size of the numpy array for the output ArrayData.",
        )

        spec.exit_code(
            310,
            "ERROR_READING_OUTPUT_FILE",
            message="The output file could not be read.",
        )
        spec.exit_code(
            311,
            "ERROR_READING_PAYLOAD_FILE",
            message="The payload file could not be read.",
        )
        spec.exit_code(
            410,
            "ERROR_FAILED_OUTPUT",
            message="The output file contains a failed output.",
        )
Exemplo n.º 6
0
    def define(cls, spec: CalcJobProcessSpec):

        super(CryMainCalculation, cls).define(spec)

        spec.input(
            "parameters",
            valid_type=DataFactory("crystal17.parameters"),
            required=True,
            serializer=lambda x: DataFactory("crystal17.parameters")(data=x),
            help="the input parameters to create the .d12 file content.",
        )
        spec.input(
            "structure",
            valid_type=StructureData,
            required=True,
            help="structure used to construct the input fort.34 (gui) file",
        )
        spec.input(
            "symmetry",
            valid_type=DataFactory("crystal17.symmetry"),
            required=False,
            help=(
                "the symmetry of the structure, "
                "used to construct the input .gui file (fort.34)"
            ),
        )
        spec.input(
            "kinds",
            valid_type=DataFactory("crystal17.kinds"),
            required=False,
            help=("additional structure kind specific data " "(e.g. initial spin)"),
        )
        spec.input_namespace(
            "basissets",
            valid_type=BasisSetData,
            dynamic=True,
            help=(
                "Use a node for the basis set of one of "
                "the elements in the structure. You have to pass "
                "an additional parameter ('element') specifying the "
                "atomic element symbol for which you want to use this "
                "basis set."
            ),
        )

        spec.input(
            "wf_folder",
            valid_type=RemoteData,
            required=False,
            help=(
                "An optional working directory, "
                "of a previously completed calculation, "
                "containing a fort.9 wavefunction file to restart from"
            ),
        )

        # TODO allow for input of HESSOPT.DAT file

        # Note: OPTINFO.DAT is also meant for geometry restarts (with RESTART),
        #       but on both crystal and Pcrystal, a read file error is encountered trying to use it.

        spec.output(
            "optimisation",
            valid_type=TrajectoryData,
            required=False,
            help="atomic configurations, for each optimisation step",
        )
Exemplo n.º 7
0
    def define(cls, spec: CalcJobProcessSpec):

        super(CryAbstractCalculation, cls).define(spec)

        spec.input("metadata.options.input_file_name",
                   valid_type=str,
                   default="INPUT")
        spec.input("metadata.options.output_main_file_name",
                   valid_type=str,
                   default="main.out")

        spec.input("metadata.options.parser_name",
                   valid_type=str,
                   default="crystal17.main")

        # TODO review aiidateam/aiida_core#2997, when closed, for exit code formalization

        # Unrecoverable errors: resources like the retrieved folder or its expected contents are missing
        spec.exit_code(
            200,
            "ERROR_NO_RETRIEVED_FOLDER",
            message="The retrieved folder data node could not be accessed.",
        )
        spec.exit_code(
            210,
            "ERROR_OUTPUT_FILE_MISSING",
            message="the main (stdout) output file was not found",
        )
        spec.exit_code(
            211,
            "ERROR_TEMP_FOLDER_MISSING",
            message="the temporary retrieved folder was not found",
        )

        # Unrecoverable errors: required retrieved files could not be read, parsed or are otherwise incomplete
        spec.exit_code(
            300,
            "ERROR_PARSING_STDOUT",
            message=("An error was flagged trying to parse the "
                     "crystal exec stdout file"),
        )
        spec.exit_code(  # TODO is this an unrecoverable error?
            301,
            "ERROR_PARSING_OPTIMISATION_GEOMTRIES",
            message=(
                "An error occurred parsing the 'opta'/'optc' geometry files"),
        )
        spec.exit_code(
            302,
            "TESTGEOM_DIRECTIVE",
            message=
            ("The crystal exec stdout file denoted that the run was a testgeom"
             ),
        )

        spec.exit_code(
            350,
            "ERROR_CRYSTAL_INPUT",
            message="the input file could not be read by CRYSTAL",
        )
        spec.exit_code(
            351,
            "ERROR_WAVEFUNCTION_NOT_FOUND",
            message="CRYSTAL could not find the required wavefunction file",
        )
        spec.exit_code(
            352,
            "UNIT_CELL_NOT_NEUTRAL",
            message="Possibly due to erroneous CHEMOD basis set modification",
        )
        spec.exit_code(
            353,
            "SHELL_SYMMETRY_ERROR",
            message="Possibly due to erroneous CHEMOD basis set modification",
        )
        spec.exit_code(354,
                       "CHEMMOD_ERROR",
                       message="Error in CHEMOD basis set modification")

        # Significant errors but calculation can be used to restart
        spec.exit_code(
            400,
            "ERROR_OUT_OF_WALLTIME",
            message=
            "The calculation stopped prematurely because it ran out of walltime.",
        )
        spec.exit_code(
            401,
            "ERROR_OUT_OF_MEMORY",
            message=
            "The calculation stopped prematurely because it ran out of memory.",
        )
        spec.exit_code(
            402,
            "ERROR_OUT_OF_VMEMORY",
            message=
            "The calculation stopped prematurely because it ran out of virtual memory.",
        )

        spec.exit_code(
            411,
            "UNCONVERGED_SCF",
            message=
            "SCF convergence did not finalise (usually due to reaching step limit)",
        )
        spec.exit_code(
            412,
            "UNCONVERGED_GEOMETRY",
            message=
            "Geometry convergence did not finalise (usually due to reaching step limit)",
        )
        spec.exit_code(
            413,
            "BASIS_SET_LINEARLY_DEPENDENT",
            message="an error encountered usually during geometry optimisation",
        )
        spec.exit_code(
            414,
            "ERROR_SCF_ABNORMAL_END",
            message="an error was encountered during an SCF computation",
        )
        spec.exit_code(
            415,
            "ERROR_MPI_ABORT",
            message=
            "an unknown error was encountered, causing the MPI to abort",
        )
        spec.exit_code(
            499,
            "ERROR_CRYSTAL_RUN",
            message="The main crystal output file flagged an unhandled error",
        )

        # errors in symmetry node consistency checks
        spec.exit_code(
            510,
            "ERROR_SYMMETRY_INCONSISTENCY",
            message=("inconsistency in the input and output symmetry"),
        )
        spec.exit_code(
            520,
            "ERROR_SYMMETRY_NOT_FOUND",
            message=("primitive symmops were not found in the output file"),
        )

        spec.output(
            cls.link_output_results,
            valid_type=DataFactory("dict"),
            required=True,
            help="the data extracted from the main output file",
        )
        spec.default_output_node = cls.link_output_results
        spec.output(
            cls.link_output_structure,
            valid_type=DataFactory("structure"),
            required=False,
            help="the structure output from the calculation",
        )
        spec.output(
            cls.link_output_symmetry,
            valid_type=DataFactory("crystal17.symmetry"),
            required=False,
            help="the symmetry data from the calculation",
        )