I think we need to make some decisions about how to use the
task_label only uses the
name field from the job.
# write any additional data
for filename, data in self.write_additional_data.items():
dumpfn(data, filename.replace(":", "."))
# run vasp
# parse vasp outputs
task_doc = TaskDocument.from_directory(Path.cwd(), **self.task_document_kwargs)
task_doc.task_label = self.name
# decide whether child jobs should proceed
stop_children = should_stop_children(task_doc, **self.stop_children_kwargs)
# gzip folder
I think the
name of a job is not a super well-protected field since many workflows use it for bookkeeping.
We should make this a bit more formal and make sure that the task label is only going to be things that is interoperable with atomate1 tasks databases.
This is related to this PR on the foundation
Create 0002-scope-of-emmet-models.md by rkingsbury · Pull Request #2 · materialsproject/foundation · GitHub
So not sure where to discuss this.
Were we discussing this in a PR somewhere too?
task_label was also not particularly well-defined in atomate v1. I’ve always been of the opinion that relying on task label as reliable metadata was dangerous, since it’s typically not encoded in the launch directory (correct?) so can get lost on re-parse.
I wanted to put this here first since this is code specific issue but we can bring it to the other PR once higher-level stuff has been decided.
Does anyone know if the validation builder can be used for this kind of purpose?
I don’t know about the validation builder, but I can say that 1) I have frequently used the
task_label to add user-defined metadata to a job name and 2) it is not very robust!
I think it is important to have a human-interpretable name for task documents, but enforcing a rigid schema would be valuable
So I think
atomate 2 should have a
task_label populated by the workflow in some way that is more protected than the
name field which currently gets modified a bit by the more complex workflows:
elph = elph_maker.make(
# use static as prev_dir so we don't inherit elph settings; using a prev
# directory is useful as we can turn off magnetism if necessary which gives a
# reasonable speedup
supercell_dos = self.uniform_maker.make(
supercell_dos.append_name(" bulk supercell")
displaced_doses = run_elph_displacements(
Maybe we can use this to tag things:
elif incar.get("IBRION", 1) == 0:
if len(acalc_type) == 0:
return TaskType(" ".join(acalc_type))
inputs: Dict[Literal["incar", "poscar", "kpoints", "potcar"], Dict],
) -> CalcType:
Determine the calc type.
Inputs dict with an incar, kpoints, potcar, and poscar dictionaries.