From 3c20fd9b834d7f6c11b02f6483f8a843698ce79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 13:13:13 +0100 Subject: [PATCH 01/10] Use Executor without context --- amorphouspy_api/src/amorphouspy_api/worker.py | 130 +++++++++--------- 1 file changed, 66 insertions(+), 64 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 5e1d8fd0..808a4711 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -88,70 +88,72 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, logger.info(f"Task {task_id}: Using shared project directory: {project_path}") # Create executor for caching workflow results - with SingleNodeExecutor(cache_directory=project_path) as exe: - atoms_dict = exe.submit( - get_structure_dict, - composition=composition, - # n_molecules=5000, # Default number of molecules - target_atoms=request.n_atoms, - ).result() - logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") - - structure_future = exe.submit( - get_ase_structure, - atoms_dict=atoms_dict, - ) - logger.info(f"Task {task_id}: ASE structure created") - - potential_future = exe.submit( - generate_potential, - atoms_dict=atoms_dict, - potential_type=request.potential_type, - ) - logger.info(f"Task {task_id}: Potential generated") - - # Update task status - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running meltquench simulation" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting meltquench simulation") - - # Use simulation parameters from the request - logger.info( - f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" - ) - - # Run meltquench simulation - logger.info(f"Task {task_id}: Executing simulation workflow") - result = exe.submit( - melt_quench_simulation, - structure=structure_future, - potential=potential_future, - n_print=request.n_print, - # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level - heating_rate=request.heating_rate, - cooling_rate=request.cooling_rate, - langevin=False, - server_kwargs={}, - ).result() - logger.info(f"Task {task_id}: Simulation completed successfully") - - # Update task status for structural analysis - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running structural analysis" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting structural analysis") - - # Perform structural analysis on the final structure (includes density calculation) - final_structure = result["structure"] - logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") - - # Run structural analysis - structural_data = exe.submit( - analyze_structure, - atoms=final_structure, - ).result() - logger.info(f"Task {task_id}: Structural analysis completed successfully") + exe = SingleNodeExecutor(cache_directory=project_path) + atoms_dict = exe.submit( + get_structure_dict, + composition=composition, + # n_molecules=5000, # Default number of molecules + target_atoms=request.n_atoms, + ).result() + logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") + + structure_future = exe.submit( + get_ase_structure, + atoms_dict=atoms_dict, + ) + logger.info(f"Task {task_id}: ASE structure created") + + potential_future = exe.submit( + generate_potential, + atoms_dict=atoms_dict, + potential_type=request.potential_type, + ) + logger.info(f"Task {task_id}: Potential generated") + + # Update task status + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running meltquench simulation" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting meltquench simulation") + + # Use simulation parameters from the request + logger.info( + f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" + ) + + # Run meltquench simulation + logger.info(f"Task {task_id}: Executing simulation workflow") + result = exe.submit( + melt_quench_simulation, + structure=structure_future, + potential=potential_future, + n_print=request.n_print, + # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level + heating_rate=request.heating_rate, + cooling_rate=request.cooling_rate, + langevin=False, + server_kwargs={}, + ).result() + logger.info(f"Task {task_id}: Simulation completed successfully") + + # Update task status for structural analysis + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running structural analysis" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting structural analysis") + + # Perform structural analysis on the final structure (includes density calculation) + final_structure = result["structure"] + logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") + + # Run structural analysis + structural_data_future = exe.submit( + analyze_structure, + atoms=final_structure, + ) + logger.info(f"Task {task_id}: Structural analysis completed successfully") + exe.shutdown(wait=False, cancel_futures=False) + structural_data = structural_data_future.result() # Debug: Check what fields are present in the structural_data object logger.info(f"Task {task_id}: StructureData type: {type(structural_data)}") From a89568570ce8c9b8c47b2d651e229cfdba133643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 13:21:17 +0100 Subject: [PATCH 02/10] Use result only after shutdown --- amorphouspy_api/src/amorphouspy_api/worker.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 808a4711..3621ca91 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -65,7 +65,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, melt_quench_simulation, ) from amorphouspy.workflows.structural_analysis import analyze_structure - from executorlib import SingleNodeExecutor + from executorlib import SingleNodeExecutor, get_item_from_future # Create composition string from request comp_parts = [] @@ -123,7 +123,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, # Run meltquench simulation logger.info(f"Task {task_id}: Executing simulation workflow") - result = exe.submit( + result_future = exe.submit( melt_quench_simulation, structure=structure_future, potential=potential_future, @@ -133,7 +133,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, cooling_rate=request.cooling_rate, langevin=False, server_kwargs={}, - ).result() + ) logger.info(f"Task {task_id}: Simulation completed successfully") # Update task status for structural analysis @@ -143,16 +143,17 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, logger.info(f"Task {task_id}: Starting structural analysis") # Perform structural analysis on the final structure (includes density calculation) - final_structure = result["structure"] - logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") + # final_structure = get_item_from_future(result_future, key="structure") + # logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") # Run structural analysis structural_data_future = exe.submit( analyze_structure, - atoms=final_structure, + atoms=get_item_from_future(result_future, key="structure") ) logger.info(f"Task {task_id}: Structural analysis completed successfully") exe.shutdown(wait=False, cancel_futures=False) + result = result_future.result() structural_data = structural_data_future.result() # Debug: Check what fields are present in the structural_data object From 71aec2f605a05e811d03313253ba40d1d8fe3a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 13:34:02 +0100 Subject: [PATCH 03/10] ruff fixes --- amorphouspy_api/src/amorphouspy_api/worker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 3621ca91..65983a2f 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -148,8 +148,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, # Run structural analysis structural_data_future = exe.submit( - analyze_structure, - atoms=get_item_from_future(result_future, key="structure") + analyze_structure, atoms=get_item_from_future(result_future, key="structure") ) logger.info(f"Task {task_id}: Structural analysis completed successfully") exe.shutdown(wait=False, cancel_futures=False) From fc51fdb8797eef6bfedf09c24b130bd39f303344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 13:40:49 +0100 Subject: [PATCH 04/10] wait on shutdown --- amorphouspy_api/src/amorphouspy_api/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 65983a2f..94c3eb58 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -151,7 +151,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, analyze_structure, atoms=get_item_from_future(result_future, key="structure") ) logger.info(f"Task {task_id}: Structural analysis completed successfully") - exe.shutdown(wait=False, cancel_futures=False) + exe.shutdown(wait=True, cancel_futures=False) result = result_future.result() structural_data = structural_data_future.result() From 60b8106175583233d6725185dd02341c9636ff96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 13:51:18 +0100 Subject: [PATCH 05/10] use context again --- amorphouspy_api/src/amorphouspy_api/worker.py | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 94c3eb58..82bb3795 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -88,70 +88,70 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, logger.info(f"Task {task_id}: Using shared project directory: {project_path}") # Create executor for caching workflow results - exe = SingleNodeExecutor(cache_directory=project_path) - atoms_dict = exe.submit( - get_structure_dict, - composition=composition, - # n_molecules=5000, # Default number of molecules - target_atoms=request.n_atoms, - ).result() - logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") - - structure_future = exe.submit( - get_ase_structure, - atoms_dict=atoms_dict, - ) - logger.info(f"Task {task_id}: ASE structure created") - - potential_future = exe.submit( - generate_potential, - atoms_dict=atoms_dict, - potential_type=request.potential_type, - ) - logger.info(f"Task {task_id}: Potential generated") - - # Update task status - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running meltquench simulation" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting meltquench simulation") - - # Use simulation parameters from the request - logger.info( - f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" - ) - - # Run meltquench simulation - logger.info(f"Task {task_id}: Executing simulation workflow") - result_future = exe.submit( - melt_quench_simulation, - structure=structure_future, - potential=potential_future, - n_print=request.n_print, - # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level - heating_rate=request.heating_rate, - cooling_rate=request.cooling_rate, - langevin=False, - server_kwargs={}, - ) - logger.info(f"Task {task_id}: Simulation completed successfully") - - # Update task status for structural analysis - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running structural analysis" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting structural analysis") - - # Perform structural analysis on the final structure (includes density calculation) - # final_structure = get_item_from_future(result_future, key="structure") - # logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") - - # Run structural analysis - structural_data_future = exe.submit( - analyze_structure, atoms=get_item_from_future(result_future, key="structure") - ) - logger.info(f"Task {task_id}: Structural analysis completed successfully") - exe.shutdown(wait=True, cancel_futures=False) + with SingleNodeExecutor(cache_directory=project_path) as exe: + atoms_dict_future = exe.submit( + get_structure_dict, + composition=composition, + # n_molecules=5000, # Default number of molecules + target_atoms=request.n_atoms, + ) + # logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") + + structure_future = exe.submit( + get_ase_structure, + atoms_dict=atoms_dict_future, + ) + logger.info(f"Task {task_id}: ASE structure created") + + potential_future = exe.submit( + generate_potential, + atoms_dict=atoms_dict_future, + potential_type=request.potential_type, + ) + logger.info(f"Task {task_id}: Potential generated") + + # Update task status + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running meltquench simulation" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting meltquench simulation") + + # Use simulation parameters from the request + logger.info( + f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" + ) + + # Run meltquench simulation + logger.info(f"Task {task_id}: Executing simulation workflow") + result_future = exe.submit( + melt_quench_simulation, + structure=structure_future, + potential=potential_future, + n_print=request.n_print, + # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level + heating_rate=request.heating_rate, + cooling_rate=request.cooling_rate, + langevin=False, + server_kwargs={}, + ) + logger.info(f"Task {task_id}: Simulation completed successfully") + + # Update task status for structural analysis + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running structural analysis" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting structural analysis") + + # Perform structural analysis on the final structure (includes density calculation) + # final_structure = get_item_from_future(result_future, key="structure") + # logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") + + # Run structural analysis + structural_data_future = exe.submit( + analyze_structure, atoms=get_item_from_future(result_future, key="structure") + ) + logger.info(f"Task {task_id}: Structural analysis completed successfully") + result = result_future.result() structural_data = structural_data_future.result() From 05ab41f560e5253485638d935a791c9c88789160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 14:22:58 +0100 Subject: [PATCH 06/10] wait for result --- amorphouspy_api/src/amorphouspy_api/worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 82bb3795..4ab2d714 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -152,8 +152,8 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, ) logger.info(f"Task {task_id}: Structural analysis completed successfully") - result = result_future.result() - structural_data = structural_data_future.result() + result = result_future.result() + structural_data = structural_data_future.result() # Debug: Check what fields are present in the structural_data object logger.info(f"Task {task_id}: StructureData type: {type(structural_data)}") From 56122fe78ed816b3186e5163a92c2dda991c2582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 14:26:29 +0100 Subject: [PATCH 07/10] ruff fixes --- amorphouspy_api/src/amorphouspy_api/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index 4ab2d714..d40aad1a 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -151,7 +151,7 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, analyze_structure, atoms=get_item_from_future(result_future, key="structure") ) logger.info(f"Task {task_id}: Structural analysis completed successfully") - + result = result_future.result() structural_data = structural_data_future.result() From 86b7d83192098eebd0ffd6a1599c089edab57ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 13 Feb 2026 14:30:35 +0100 Subject: [PATCH 08/10] without context --- amorphouspy_api/src/amorphouspy_api/worker.py | 133 +++++++++--------- 1 file changed, 67 insertions(+), 66 deletions(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index d40aad1a..d44875c3 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -88,72 +88,73 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, logger.info(f"Task {task_id}: Using shared project directory: {project_path}") # Create executor for caching workflow results - with SingleNodeExecutor(cache_directory=project_path) as exe: - atoms_dict_future = exe.submit( - get_structure_dict, - composition=composition, - # n_molecules=5000, # Default number of molecules - target_atoms=request.n_atoms, - ) - # logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") - - structure_future = exe.submit( - get_ase_structure, - atoms_dict=atoms_dict_future, - ) - logger.info(f"Task {task_id}: ASE structure created") - - potential_future = exe.submit( - generate_potential, - atoms_dict=atoms_dict_future, - potential_type=request.potential_type, - ) - logger.info(f"Task {task_id}: Potential generated") - - # Update task status - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running meltquench simulation" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting meltquench simulation") - - # Use simulation parameters from the request - logger.info( - f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" - ) - - # Run meltquench simulation - logger.info(f"Task {task_id}: Executing simulation workflow") - result_future = exe.submit( - melt_quench_simulation, - structure=structure_future, - potential=potential_future, - n_print=request.n_print, - # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level - heating_rate=request.heating_rate, - cooling_rate=request.cooling_rate, - langevin=False, - server_kwargs={}, - ) - logger.info(f"Task {task_id}: Simulation completed successfully") - - # Update task status for structural analysis - current_task = task_store.get(task_id) or {"state": "processing"} - current_task["status"] = "Running structural analysis" - task_store.set(task_id, current_task) - logger.info(f"Task {task_id}: Starting structural analysis") - - # Perform structural analysis on the final structure (includes density calculation) - # final_structure = get_item_from_future(result_future, key="structure") - # logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") - - # Run structural analysis - structural_data_future = exe.submit( - analyze_structure, atoms=get_item_from_future(result_future, key="structure") - ) - logger.info(f"Task {task_id}: Structural analysis completed successfully") - - result = result_future.result() - structural_data = structural_data_future.result() + exe = SingleNodeExecutor(cache_directory=project_path) + atoms_dict_future = exe.submit( + get_structure_dict, + composition=composition, + # n_molecules=5000, # Default number of molecules + target_atoms=request.n_atoms, + ) + # logger.info(f"Task {task_id}: Structure dictionary created with {len(atoms_dict['atoms'])} atoms") + + structure_future = exe.submit( + get_ase_structure, + atoms_dict=atoms_dict_future, + ) + logger.info(f"Task {task_id}: ASE structure created") + + potential_future = exe.submit( + generate_potential, + atoms_dict=atoms_dict_future, + potential_type=request.potential_type, + ) + logger.info(f"Task {task_id}: Potential generated") + + # Update task status + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running meltquench simulation" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting meltquench simulation") + + # Use simulation parameters from the request + logger.info( + f"Task {task_id}: Using heating_rate={request.heating_rate}, cooling_rate={request.cooling_rate}, n_print={request.n_print}" + ) + + # Run meltquench simulation + logger.info(f"Task {task_id}: Executing simulation workflow") + result_future = exe.submit( + melt_quench_simulation, + structure=structure_future, + potential=potential_future, + n_print=request.n_print, + # tmp_working_directory=str(tmp_dir_base), # note: if provided needs to be static - or prevents caching at executor level + heating_rate=request.heating_rate, + cooling_rate=request.cooling_rate, + langevin=False, + server_kwargs={}, + ) + logger.info(f"Task {task_id}: Simulation completed successfully") + + # Update task status for structural analysis + current_task = task_store.get(task_id) or {"state": "processing"} + current_task["status"] = "Running structural analysis" + task_store.set(task_id, current_task) + logger.info(f"Task {task_id}: Starting structural analysis") + + # Perform structural analysis on the final structure (includes density calculation) + # final_structure = get_item_from_future(result_future, key="structure") + # logger.info(f"Task {task_id}: Analyzing structure with {len(final_structure)} atoms") + + # Run structural analysis + structural_data_future = exe.submit( + analyze_structure, atoms=get_item_from_future(result_future, key="structure") + ) + logger.info(f"Task {task_id}: Structural analysis completed successfully") + + result = result_future.result() + structural_data = structural_data_future.result() + exe.shutdown(wait=True, cancel_futures=False) # Debug: Check what fields are present in the structural_data object logger.info(f"Task {task_id}: StructureData type: {type(structural_data)}") From 3377fe647d128feb63f698c32136bfad8db1a5b8 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 14 Feb 2026 08:53:19 +0100 Subject: [PATCH 09/10] Change executor shutdown behavior to non-blocking --- amorphouspy_api/src/amorphouspy_api/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amorphouspy_api/src/amorphouspy_api/worker.py b/amorphouspy_api/src/amorphouspy_api/worker.py index d44875c3..89120e70 100644 --- a/amorphouspy_api/src/amorphouspy_api/worker.py +++ b/amorphouspy_api/src/amorphouspy_api/worker.py @@ -152,9 +152,9 @@ def meltquench_worker(task_id: str, request_dict: dict[str, Any], db_path: str, ) logger.info(f"Task {task_id}: Structural analysis completed successfully") + exe.shutdown(wait=False, cancel_futures=False) result = result_future.result() structural_data = structural_data_future.result() - exe.shutdown(wait=True, cancel_futures=False) # Debug: Check what fields are present in the structural_data object logger.info(f"Task {task_id}: StructureData type: {type(structural_data)}") From a6af70679d82612f015e32f7bc0b5c1b30c019e2 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 14 Feb 2026 08:54:10 +0100 Subject: [PATCH 10/10] Update executorlib version to 1.8.1 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index ed75f161..9b915367 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ dependencies: - python =3.13 - ase >=3.25.0 - cryptography =45.0.7 -- executorlib =1.7.4 +- executorlib =1.8.1 - hatchling - jupyter - lammps =2024.08.29=*_openmpi_*