ntamas / plfit

Fitting power-law distributions to empirical data, according to the method of Clauset, Shalizi and Newman
GNU General Public License v2.0
48 stars 17 forks source link

L-BFGS optimization signaled an error #5

Open mvngu opened 12 years ago

mvngu commented 12 years ago

The error message is

Error at /home/mvngu/apps/plfit/src/plfit.c:401 : L-BFGS optimization signaled an error (error code = -1000), Failed Aborted

The data that produced the error are available at

https://bitbucket.org/mvngu/misc/downloads/lifespan-seq.dat.bz2

ntamas commented 12 years ago

What parameters are you running plfit with? It seems to work for me with no command line arguments apart from the filename:

../data/lifespan-seq.dat:
    Discrete MLE
    alpha =      1.72162
    xmin  =      3.00000
    L     = -110576.40443
    D     =      0.11863
    p     =      0.00000
mvngu commented 12 years ago

I didn't run plfit with any paramters other than the file name. On a fresh compile, I think the problem might lie with cmake not able to locate emmintrin.h on my system. See this transcript:

$ git clone https://github.com/ntamas/plfit.git
Cloning into plfit...
remote: Counting objects: 350, done.
remote: Compressing objects: 100% (173/173), done.
remote: Total 350 (delta 231), reused 291 (delta 172)
Receiving objects: 100% (350/350), 133.88 KiB | 33 KiB/s, done.
Resolving deltas: 100% (231/231), done.
$ cd plfit/
$ mkdir build
$ cd build/
$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include files HAVE_EMMINTRIN_H
-- Looking for include files HAVE_EMMINTRIN_H - not found.
-- Looking for include files HAVE_MALLOC_H
-- Looking for include files HAVE_MALLOC_H - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mvngu/plfit/build
$ make
<SNIP>
$ cd src/
$ ./plfit ~/lifespan-seq.dat 
Error at /home/mvngu/plfit/src/plfit.c:401 : L-BFGS optimization signaled an error (error code = -1000), Failed
Aborted

Notice the line

-- Looking for include files HAVE_EMMINTRIN_H - not found.

That is strange because

$ locate emmintrin.h
/usr/lib/clang/2.9/include/emmintrin.h
/usr/lib/gcc/i686-linux-gnu/4.6/include/emmintrin.h
ntamas commented 12 years ago

emmintrin.h is optional; the L-BFGS optimizer will use SSE/SSE2 instructions if possible and that's why it is looking for emmintrin.h, but plfit is perfectly fine without it.

Am I right to assume that this is a 32-bit Linux machine? I have just tried it on a 64-bit Ubuntu box (with and without SSE) and it worked fine, so my only bet right now is that this bug is specific for 32-bit machines only.

mvngu commented 12 years ago

You're right. I'm using a 32-bit Linux machine. I think this issue can be closed now.

ntamas commented 12 years ago

I'm gonna install a minimal 32-bit Linux system on a virtual machine and check this out when I get some free time. Leaving this open for the time being so I don't forget it.

ntamas commented 12 years ago

The line search in the L-BFGS-B optimization routine reaches its minimum step length and L-BFGS-B bails out with an error code. I have experimented with different line search backtracking algorithms that are built-in into L-BFGS-B, but it seems that either they fall into an infinite loop or they reach the minimum step length. The error happens with xmin=27. I will try to dig deeper into this when I have more time.

ntamas commented 12 years ago

It is also quite strange that running plfit through valgrind does not result in an error, only when plfit is run "alone", and only for xmin=27.