Skip to content
Closed
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
10 changes: 8 additions & 2 deletions bluephos/modules/dft_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import multiprocessing
import os
import subprocess
import socket
from textwrap import dedent

from bluephos.modules.dft_extract import extract
Expand Down Expand Up @@ -112,9 +113,14 @@ def create_orca_input_files(temp_dir, xyz_value):

def run_orca_command(input_file, output_file, orca_path):
"""
Run the ORCA command and log outputs.
Run the ORCA command with MPI-related options and log outputs.
"""
command = [orca_path, input_file]
# Get the hostname and configure MPI options
task_host = socket.gethostname()
mpi_options = ["--host", task_host, "--oversubscribe"]

command = [orca_path, input_file, f'{" ".join(mpi_options)}']
print("Command to be executed:", " ".join(command))
with open(output_file, "w") as output:
result = subprocess.run(command, stdout=output, stderr=subprocess.PIPE, check=True, text=True)
if result.stderr: # Check if stderr is not empty
Expand Down
Loading