[pymvpa] Surface searchlight taking 6 to 8 hours

2015-07-22 Thread John Baublitz
Hi all,
I have been battling with a surface searchlight that has been taking 6 to 8
hours for a small dataset. It outputs a usable analysis but the time it
takes is concerning given that our lab is looking to use even higher
resolution fMRI datasets in the future. I profiled the searchlight call and
it looks like approximately 90% of those hours is spent mapping in the
function from feature IDs to linear voxel IDs (the
function feature_id2linear_voxel_ids). I looked into the source code and it
appears that it is using the in keyword on a list which has to search
through every element of the list for each iteration of the list
comprehension and then calls that function for each feature. This might
account for the slowdown. I'm wondering if there is a way to work around
this or speed it up.

Thanks,
John
___
Pkg-ExpPsy-PyMVPA mailing list
Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa

Re: [pymvpa] LinearCSVMC not found in PyMVPA-upstream-2.4.0 release (Nick Oosterhof)

2015-07-22 Thread Feilong Ma
Hi Nick,

Switching to an earlier version of SWIG works for me.  I had problems with
SWIG 3.0.5, but when I switched to SWIG 3.0.4 the problem was solved.  I
installed SWIG using Homebrew, which should work in the same way as
installing from source.

The error message I talked about with CLANG still appears while running
`python setup.py build_ext`.  I guess it's not related to this issue.  The
message is:
 ['clang', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-g',
'-O2', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes']
###
Missing compiler_cxx fix for UnixCCompiler

Best,
Feilong

On Sun, Jul 19, 2015 at 9:44 AM 
pkg-exppsy-pymvpa-requ...@lists.alioth.debian.org wrote:

 Send Pkg-ExpPsy-PyMVPA mailing list submissions to
 pkg-exppsy-pymvpa@lists.alioth.debian.org

 To subscribe or unsubscribe via the World Wide Web, visit

 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa

 or, via email, send a message with subject or body 'help' to
 pkg-exppsy-pymvpa-requ...@lists.alioth.debian.org

 You can reach the person managing the list at
 pkg-exppsy-pymvpa-ow...@lists.alioth.debian.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Pkg-ExpPsy-PyMVPA digest...
 Today's Topics:

1. Re: LinearCSVMC not found in PyMVPA-upstream-2.4.0 release
   (Nick Oosterhof)



 -- Forwarded message --
 From: Nick Oosterhof n.n.ooster...@googlemail.com
 To: Development and support of PyMVPA 
 pkg-exppsy-pymvpa@lists.alioth.debian.org
 Cc:
 Date: Sun, 19 Jul 2015 15:44:23 +0200
 Subject: Re: [pymvpa] LinearCSVMC not found in PyMVPA-upstream-2.4.0
 release

  On 15 Jul 2015, at 18:46, Feilong Ma mafeil...@gmail.com wrote:
 
  I had a similar problem while installing PyMVPA on Mac OS (10.10.4).  I
 think the problem is related to this line:
 
 https://github.com/PyMVPA/PyMVPA/blob/master/mvpa2/clfs/libsvmc/_svm.py#L22
 
  When I tried to run this line in ipython
  from mvpa2.clfs.libsvmc._svmc import C_SVC, NU_SVC, ONE_CLASS,
 EPSILON_SVR
  What I got is:
  ImportError: cannot import name C_SVC

 I get the same error. Briefly (see below for details), it seems due to a
 change in SWIG, with later versions giving issues.

 When running python setup.py build_ext” and copying over the .o and .so
 files from the build directory to PyMVPA’s root directory (across the
 corresponding subdirectories), the following reproduces the error directly:

 python -c from mvpa2.clfs.libsvmc._svmc import C_SVC”

 Strangely enough, the following works for the failing PyMVPA installation
 (but not for the working one):

 python -c from mvpa2.clfs.libsvmc._svmc import C_SVC_swigconstant”

 Digging a bit further, the mvpa2/clfs/libsvmc/svmc.py file differs between
 my “working” (generated using SWIG 3.0.2) and “failing” (SWIG 3.0.6) PyMVPA
 setup. One difference is that the working version has contents such as

 C_SVC = _svmc.C_SVC

 whereas the failing version has extra lines that includes “swigconstant”

 _svmc.C_SVC_swigconstant(_svmc)
 C_SVC = _svmc.C_SVC

 (For completeness I’m including the full content of both versions below. )

 Tracing this back further, I compiled swig from source, both for the
 latest version on github and for version 3.0.0 (version 3.0.2 gave an error
 when compiling). When using 3.0.0, the import works fine; with 3.0.6 or the
 latest (3.0.7 development) it breaks.

 
  I guess the problem might be related to compiling LibSVM.  I vaguely
 remember there was some error messages with CLANG blah blah.

 I installed GCC 5.1 and get the same problem as when using CLANG.

 To summarize, the following worked for me to get libsvm to work on OS X
 Yosemite:

 - clone swig from https://github.com/swig/swig, then “git checkout -tag
 tags/tags/rel-3.0.0”
 - in the swig directory, run “autoconf  ./configure  make  sudo make
 install” (although it gives an error when installing the man-pages due to
 missing yodl2man, the binaries are installed fine). This requires autoconf,
 automake and libconf.
 - in the PyMVPA directory, run python setup.py build_ext”
 - copy the .so and .o files from the build directory to the PyMVPA root
 directory, for example in the PyMVPA root directory do for ext in .so .o;
 do for i in `find build -iname *${ext}`; do j=`echo $i | cut -f3- -d/`;
 cp $i $j; done; done”

 If anyone can confirm that using an earlier version of SWIG fixes the
 problem, that would be great. In that case I can also raise the issue with
 the developers.



 (Below: contents of mvpa2/clfs/libsvmc/svmc.py for working and failing
 libsvm in PyMVPA)

 
 # *Failing* mvpa2/clfs/libsvmc/svmc.py
 

 # This file was automatically generated by SWIG (http://www.swig.org).
 # Version 3.0.6
 #
 # Do not make changes to this file unless you know what you are
 doing--modify
 # the SWIG interface file instead.





 from sys import version_info
 if