Skip to content
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
1 change: 0 additions & 1 deletion src/MGmol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@ void MGmol<OrbitalsType>::dumpRestart()

// create restart file
std::string filename(std::string(ct.out_restart_file));
if (ct.out_restart_file_naming_strategy) filename += "0";
HDFrestart h5restartfile(
filename, myPEenv, gdim, ct.out_restart_file_type);

Expand Down
9 changes: 6 additions & 3 deletions src/md.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,12 @@ int MGmol<OrbitalsType>::dumpMDrestartFile(OrbitalsType& orbitals, Ions& ions,
std::string filename(std::string(ct.out_restart_file));
// add an integer corresponding to attempt number/count
// to allow several attempts at creating and writing file
std::stringstream s;
s << count;
filename += s.str();
if (count > 0)
{
std::stringstream s;
s << count;
filename += s.str();
}

HDFrestart h5file(filename, myPEenv, gdim, ct.out_restart_file_type);

Expand Down
2 changes: 1 addition & 1 deletion tests/MD_D72/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
print(line)

#run MD
command = "ls -ld snapshot0* | awk '{ print $9 }' | tail -n1"
command = "ls -ld snapshot* | awk '{ print $9 }' | tail -n1"
print(command)
restart_file = subprocess.check_output(command,shell=True)
restart_file=str(restart_file[:-1],'utf-8')
Expand Down
2 changes: 1 addition & 1 deletion tests/MD_MVP/md.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ solver=MVP
nb_inner_it=1
mixing=1.
[Restart]
input_filename=wave.out
input_filename=snapshotMVP
input_level=3
output_level=3
8 changes: 4 additions & 4 deletions tests/MD_MVP/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@

#run MD
for i in range(2):
command = "ls -ld snapshot0* | awk '{ print $9 }' | tail -n1"
command = "ls -ld snapshot* | awk '{ print $9 }' | tail -n1"
print(command)
restart_file = subprocess.check_output(command,shell=True)
restart_file=str(restart_file[:-1],'utf-8')
print(restart_file)

os.rename(restart_file, 'wave.out')
os.rename(restart_file, 'snapshotMVP')

#run MGmol
command = "{} {} -c {} -i {}".format(mpicmd,exe,inp2,coords)
output2 = subprocess.check_output(command,shell=True)

#remove used restart files
shutil.rmtree('wave.out')
shutil.rmtree('snapshotMVP')

#analyse mgmol standard output
lines=output2.split(b'\n')
Expand All @@ -81,7 +81,7 @@
sys.exit(1)

#remove last restart files
command = "ls -ld snapshot0* | awk '{ print $9 }' | tail -n1"
command = "ls -ld snapshot* | awk '{ print $9 }' | tail -n1"
restart_file = subprocess.check_output(command,shell=True)
restart_file=str(restart_file[:-1],'utf-8')
shutil.rmtree(restart_file)
Expand Down
2 changes: 1 addition & 1 deletion tests/ShortSighted/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
print(line)

#run MD
command = "ls -ld snapshot0* | awk '{ print $9 }' | tail -n1"
command = "ls -ld snapshot* | awk '{ print $9 }' | tail -n1"
print(command)
restart_file = subprocess.check_output(command,shell=True)
restart_file=str(restart_file[:-1],'utf-8')
Expand Down