The only case I can guess where this might occur is if you have requested the self energies to be stored on disk. Can you confirm if that is the case? If so, it seems like a "logical bug" but still something we might need to look into; if not, pls attached your input file (actually, if you can, pls do that anyway).
Also pls confirm which version of the code us used.
from NL.IO.NLSaveUtilities import nlinspect
current_file = "current.hdf5"
new_file = "new.hdf5"
file_contents = nlinspect(current_file)
for x in file_contents:
if x.cls == DeviceConfiguration:
pass
else:
data = nlread(current_file, object_id=x.object_id)[0]
nlsave(new_file, data)
nlsave("new.hdf5", device_configuration)
Well, that *should* not be needed, but I guess due to this bug, then currently yes. Or, you could just not store them at all (NoStorage), which of course lowers performance.
Could you get access to a new version and try that? We don't fix bugs in old versions anyway, and maybe it actually has been fixed; I was able to save a DeviceConfiguration in the latest version with a StoreOnDisk that used a non-existent directory, and read it back, although it was not a converged calculation.
As a workaround, which I think will work, my first suggestion is to re-save the quantities you want to analyze in the GUI into a separate new HDF5 file, except for the geometry. You could always easily add that, using your original script. You are anyway not going to perform any post-processing calculations on the laptop! (Btw, if the laptop also is Linux, you could also simply create the directory /var/tmp/pbs.6846470.pbs - the error is because that directory doesn't exist, but NanoLab is not trying to read any data from it.)
So, if your laptop is Windows, then try this on the HPC machine:Code: pythonfrom NL.IO.NLSaveUtilities import nlinspect
current_file = "current.hdf5"
new_file = "new.hdf5"
file_contents = nlinspect(current_file)
for x in file_contents:
if x.cls == DeviceConfiguration:
pass
else:
data = nlread(current_file, object_id=x.object_id)[0]
nlsave(new_file, data)
The new file should be possible to open on the laptop, I hope! You could also (still on the HPC machine) make a copy of your original script, and before the calculator is attached, addCode: pythonand then stop execution of the script when it starts the calculation (or insert a bogus statement like "ffffff" right after this nlsave line). That way, the new.hdf5 file will have the geometry in it, albeit with a different fingerprint than the analysis data. We could fix that with a few more lines of code, if needed; let me know if you have problems in the further analysis.nlsave("new.hdf5", device_configuration)
Well, that *should* not be needed, but I guess due to this bug, then currently yes. Or, you could just not store them at all (NoStorage), which of course lowers performance.
Could you get access to a new version and try that? We don't fix bugs in old versions anyway, and maybe it actually has been fixed; I was able to save a DeviceConfiguration in the latest version with a StoreOnDisk that used a non-existent directory, and read it back, although it was not a converged calculation.
As a workaround, which I think will work, my first suggestion is to re-save the quantities you want to analyze in the GUI into a separate new HDF5 file, except for the geometry. You could always easily add that, using your original script. You are anyway not going to perform any post-processing calculations on the laptop! (Btw, if the laptop also is Linux, you could also simply create the directory /var/tmp/pbs.6846470.pbs - the error is because that directory doesn't exist, but NanoLab is not trying to read any data from it.)
So, if your laptop is Windows, then try this on the HPC machine:Code: pythonfrom NL.IO.NLSaveUtilities import nlinspect
current_file = "current.hdf5"
new_file = "new.hdf5"
file_contents = nlinspect(current_file)
for x in file_contents:
if x.cls == DeviceConfiguration:
pass
else:
data = nlread(current_file, object_id=x.object_id)[0]
nlsave(new_file, data)
The new file should be possible to open on the laptop, I hope! You could also (still on the HPC machine) make a copy of your original script, and before the calculator is attached, addCode: pythonand then stop execution of the script when it starts the calculation (or insert a bogus statement like "ffffff" right after this nlsave line). That way, the new.hdf5 file will have the geometry in it, albeit with a different fingerprint than the analysis data. We could fix that with a few more lines of code, if needed; let me know if you have problems in the further analysis.nlsave("new.hdf5", device_configuration)
Dear Anders,
For your information, I have obtained the version of 2022.12 and this bug still exists. If there is anything you need to check the bug or fix it, please do not hesitate to contact me. Thank you.
Best regards,Well, that *should* not be needed, but I guess due to this bug, then currently yes. Or, you could just not store them at all (NoStorage), which of course lowers performance.
Could you get access to a new version and try that? We don't fix bugs in old versions anyway, and maybe it actually has been fixed; I was able to save a DeviceConfiguration in the latest version with a StoreOnDisk that used a non-existent directory, and read it back, although it was not a converged calculation.
As a workaround, which I think will work, my first suggestion is to re-save the quantities you want to analyze in the GUI into a separate new HDF5 file, except for the geometry. You could always easily add that, using your original script. You are anyway not going to perform any post-processing calculations on the laptop! (Btw, if the laptop also is Linux, you could also simply create the directory /var/tmp/pbs.6846470.pbs - the error is because that directory doesn't exist, but NanoLab is not trying to read any data from it.)
So, if your laptop is Windows, then try this on the HPC machine:Code: pythonfrom NL.IO.NLSaveUtilities import nlinspect
current_file = "current.hdf5"
new_file = "new.hdf5"
file_contents = nlinspect(current_file)
for x in file_contents:
if x.cls == DeviceConfiguration:
pass
else:
data = nlread(current_file, object_id=x.object_id)[0]
nlsave(new_file, data)
The new file should be possible to open on the laptop, I hope! You could also (still on the HPC machine) make a copy of your original script, and before the calculator is attached, addCode: pythonand then stop execution of the script when it starts the calculation (or insert a bogus statement like "ffffff" right after this nlsave line). That way, the new.hdf5 file will have the geometry in it, albeit with a different fingerprint than the analysis data. We could fix that with a few more lines of code, if needed; let me know if you have problems in the further analysis.nlsave("new.hdf5", device_configuration)
Yes, the bug is planned to be addressed in the upcoming V-2023.09 release. The HDF5 re-saving trick will still work, it's just that your file contains study objects, which cannot be nlsave-ed (this is something we also plan to fix soon). You can easily work around it by excluding whichever class is causing the problem, i.e. change the line before "pass" to
if x.cls in [DeviceConfiguration, <add offending class here>]:
My guess is that you have an IVCharacteristics in there, so make it
if x.cls in [DeviceConfiguration, IVCharacteristics]: