BUG: Reading of FCP file does not work if the path in run.in is absolut
Background
When reading a run.in
file the fcp_order
cannot be extracted if the path to the FCP .txt
file is absolut.
Example
A run.in
file with the following first line can be successfully parsed:
potential order6_16x16x1_all_orders_tol1e-08_fcp.txt 0 1
but not if the path is absolut:
potential /cephyr/NOBACKUP/groups/cmmt-semiconductors/joabro/gpumd-hiphive-integration/MoS2/gpumd_simulations/local/gpumd/hnemd_simulation_order6_16x16x1_600K_Fe1e-5_2nd/order6_16x16x1_all_orders_tol1e-08_fcp.txt 0 1
Solution
Change the following lines in io.py
:
if 'fcp.txt' in potential_filename:
try:
with open(os.path.join(os.path.dirname(filename),
potential_filename), 'r') as f:
settings['fcp_order'] = int(f.readlines()[1].split()[0])
except IOError:
pass
to
if 'fcp.txt' in potential_filename:
try:
with open(os.path.join(os.path.dirname(filename),
os.path.basename(potential_filename)), 'r') as f:
settings['fcp_order'] = int(f.readlines()[1].split()[0])
except IOError:
pass