[FieldTrip] Peer module thinks it has too little memory

Kyle Hird kyle.hird at gmail.com
Fri Jul 19 00:24:48 CEST 2013


Hi

I am attempting to set up the distributed peer system on a 32-bit
Linux machine, using version 20130419 from the ftp server (I'm using
the shipped binaries because peerslave segfaults on receiving a job if
compiled on my system).  My tests involve one local slave and one
local master on this four-core machine with 4GB of memory.  After
starting the slave peer, I attempt to run the example command
peercellfun(@rand, {10, 20, 30}, 'UniformOutput', false).  This fails
with the message:

    'there are no slave peers available that meet the memory requirements'

Examining the output of the slave peer, it contains the following
lines (edited for personal info):

    executing job 1 from myusername at HOSTNAME (jobid=672774519,
memreq=2147483648, timreq=3600)
    executing job took 0.042167 seconds and 22957802788233216 bytes
    executing job 2 from myusername at HOSTNAME (jobid=1862053136,
memreq=2147483648, timreq=3600)
    executing job took 0.001907 seconds and 22957802787971072 bytes

While the times seem reasonable for such a simple problem, the memory
usage does not (nearly 23,000 terabytes).  The memory usage is
reported by fexec, which in turn calculates it from the output of
memprofile.  Memprofile itself appears to discover resident and
virtual size from getmem.  I looked at the source for getmem and it
appears that it should return -1 in my case (because the elif block
for PLATFORM_LINUX is empty), causing memprofile_sample to report
zeros for both.  However, if I invoke memprofile_sample by using
memprofile('info') at the command line, I get:

    ans =

        time: 1.3742e+09
        mem: 3.6693e+18

I wonder exactly what is happening when getmem gets called.  I'm not
too experienced with C, but from my understanding the #if statement is
evaluated at compile time, so getmem will behave according to the
platform on which it was compiled, which may be different from that on
which it is executed.  As written, the function won't compile on my
system due to the absence of <mach/task.h>.  I can't actually find the
binary mex getmem in the module, so although the source has
mexFunction framework in it, I can't call it from MATLAB.

What behaviour should I be getting from memprofile?  Should I be doing
something differently to get peercellfun to behave correctly?

Thanks for your consideration
Kyle Hird



More information about the fieldtrip mailing list