Skip to content

Commit

Permalink
gyre profile num fix for parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
gautam-404 committed Mar 6, 2024
1 parent 78a3e5a commit b9a3c97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesaport/ProjectOps/ops_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ def run_subprocess(commands, wdir, silent=True, runlog='', status=None,
if gyre_in is not None:
gyre_obj = GyreAccess()
if parallel:
num = filename.split(".")[0]
new_gyre_in = os.path.join(wdir, f"gyre{num}.in")
profile_num = filename.split('/')[-1].split(f".{data_format}")[0]
new_gyre_in = os.path.join(wdir, f"gyre{profile_num}.in")
gyre_obj.modify_gyre_params(wdir, filename, data_format, gyre_in=new_gyre_in)
gyre_obj.set(arg=gyre_input_params, wdir=wdir, gyre_in=new_gyre_in)
time.sleep(1)

# Update gyre_in to the new file
gyre_in = new_gyre_in
commands = commands.replace("gyre.in", f"gyre{num}.in")
runlog = runlog.replace("gyre.log", f"gyre{num}.log")
commands = commands.replace("gyre.in", f"gyre{profile_num}.in")
runlog = runlog.replace("gyre.log", f"gyre{profile_num}.log")
else:
new_gyre_in = os.path.join(wdir, "gyre.in")
shutil.copyfile(gyre_in, new_gyre_in)
Expand Down

0 comments on commit b9a3c97

Please sign in to comment.