Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for parallel master without database #1156

Merged
merged 8 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pyiron_base/jobs/job/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ def __init__(self, project, job_name):
self.refresh_job_status()
elif os.path.exists(self.project_hdf5.file_name):
initial_status = read_hdf5(
self.project_hdf5.file_name, self.job_name + "/status"
# in most cases self.project_hdf5.h5_path == / + self.job_name but not for child jobs of GenericMasters
self.project_hdf5.file_name,
self.project_hdf5.h5_path + "/status",
)
self._status = JobStatus(initial_status=initial_status)
if "job_id" in self.list_nodes():
self._job_id = read_hdf5(
self.project_hdf5.file_name, self.job_name + "/job_id"
# in most cases self.project_hdf5.h5_path == / + self.job_name but not for child jobs of GenericMasters
self.project_hdf5.file_name,
self.project_hdf5.h5_path + "/job_id",
)
else:
self._status = JobStatus()
Expand Down
6 changes: 5 additions & 1 deletion pyiron_base/jobs/master/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ def iter_jobs(self, convert_to_object=True):
yield: Yield of GenericJob or JobCore
"""
project_working_directory = self.project.open(self.job_name + "_hdf5")
if state.database.database_is_disabled:
project_working_directory.db.update()
for job_id in self._get_jobs_sorted():
yield project_working_directory.load(
job_id, convert_to_object=convert_to_object
Expand Down Expand Up @@ -528,7 +530,9 @@ def run_static(self):
self.status.running = True
self.submission_status.total_jobs = len(self._job_generator)
self.submission_status.submitted_jobs = 0
if self.job_id and not self.is_finished():
if (
self.job_id or state.database.database_is_disabled
jan-janssen marked this conversation as resolved.
Show resolved Hide resolved
) and not self.is_finished():
self._logger.debug(
"{} child project {}".format(self.job_name, self.project.__str__())
)
Expand Down
Loading