-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement defaults via base calculation
- Loading branch information
1 parent
4c4a357
commit a1dac8e
Showing
9 changed files
with
85 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from aiida.engine import CalcJob | ||
|
||
if TYPE_CHECKING: | ||
from aiida.engine.processes.calcjobs.calcjob import CalcJobProcessSpec | ||
|
||
|
||
class BaseCalculation(CalcJob): | ||
"""docstring""" | ||
|
||
_default_parser_name = "" | ||
|
||
@classmethod | ||
def define(cls, spec: CalcJobProcessSpec) -> None: | ||
"""docstring""" | ||
|
||
super().define(spec) | ||
|
||
_DEFAULTS = { | ||
"metadata.options.parser_name": cls._default_parser_name, | ||
"metadata.options.withmpi": False, | ||
"metadata.options.max_wallclock_seconds": 3600, | ||
"metadata.options.resources": lambda: { | ||
"num_machines": 1, | ||
"num_mpiprocs_per_machine": 1, | ||
}, | ||
} | ||
|
||
for port, default in _DEFAULTS.items(): | ||
spec.inputs.get_port(port).default = default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.