Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug related to swpref when updating SpinW #29

Open
henrikjacobsenfys opened this issue Feb 13, 2017 · 4 comments
Open

Bug related to swpref when updating SpinW #29

henrikjacobsenfys opened this issue Feb 13, 2017 · 4 comments
Labels

Comments

@henrikjacobsenfys
Copy link

Hi Sandor

I get the following error message after updating to the latest version:
Error using swpref.pref (line 86)
The requested SpinW preference does not exists!

Error in swpref.getpref (line 33)
rPref = swpref.pref(prefName,'get',varargin{:});

Error in spinw/spinwave (line 175)
useMex = swpref.getpref('usemex',[]);

Error in CuO_AFM (line 403)
CuOSpec = CuO.spinwave({ Gamma, X, N, Gamma, M, X, 200},'hermit',false);

I assume it's related to me running SpinW on Linux. If needed, I can provide a minimal example of the bug, but it's probably something general. I tried bug hunting a bit, but it's not easy.. What I know is that in getpref, the input variables when it fails are

prefName =

usemex

varargin =

cell

{[]}

Cheers,

Henrik

@mducle
Copy link
Collaborator

mducle commented Feb 13, 2017

Hi @henrikjacobsenfys,

I got this bug on Windows too, but it was because I was updating within a Matlab session, and for some reason, matlab still used an old version of swpref. I solved it using clear classes (but restarting Matlab should also work). E.g. do

clear classes
swpref.getpref('usemex')

If you still get the The requested SpinW preference does not exists! error, then could you do a which swpref.pref to find out which +swpref/pref.m file is being used and paste its contents here (or send it to us).

Note that clear classes will also clear all your variables, so you might want to save everything first...

Duc.

@henrikjacobsenfys
Copy link
Author

Hi Duc
Thanks a lot, this worked. I'm so used to getting bugs because of mex in Linux that I jumped to conclusions..
Henrik

@tsdev
Copy link
Owner

tsdev commented Feb 14, 2017

The problem is that swpref uses mlock to avoid reinitialisation of persistent variables that store the settings. I am surprised that clear classes actually worked. I might have to add a piece of code into install_spinw to update swpref.
@mducle any insight?

@henrikjacobsenfys
Copy link
Author

I actually decided to just restart matlab right away, since I found out I had several versions of spinw lying around anywhere, and my computer could use a reboot in any case. So it may be that clear classes wouldn't have worked...

@tsdev tsdev added the bug label Feb 14, 2017
@tsdev tsdev changed the title Bug related to mex in Linux Bug related to swpref when updating SpinW Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants