Spinroot

A forum for Spin users

You are not logged in.

#1 2015-01-02 03:29:41

Lholloway
Member
Registered: 2015-01-02
Posts: 6

BFS_PAR Error when attempting to run pan

I'm attempting to run pan using the multi-core breadth-first search on a Mac OS X Yosemite.  I setup the shared memory as explained in the documentation; however, when I run pan I receive this error:

cpu00: no shared memory n=0

Does anyone have any pointers on how I should be going about debugging / attempting to fix the problem?

Thanks!

Offline

#2 2015-01-02 04:29:23

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: BFS_PAR Error when attempting to run pan

in that mode, spin tries to allocate the largest shared memory segment it can find,
starting with 32 MB, and increasing it until allocation fails
if it prints the message you saw then it could not allocate even the smallest 32MB segment.
that does look like shared memory isn't available somehow.
The MAC implementation hasn't been tested much, so it may well need other types of setup.
What do you get as an answer when you execute this command ?
$ sudo /sbin/sysctl -a | grep shmmax           # check what the current value is

Offline

#3 2015-01-02 05:23:39

Lholloway
Member
Registered: 2015-01-02
Posts: 6

Re: BFS_PAR Error when attempting to run pan

When I run the command I get the following:

kern.sysv.shmmax: 1073741824
kern.sysv.shmmin: 1
kern.sysv.shmmni: 128
kern.sysv.shmseg: 32
kern.sysv.shmall: 4096

which should be ~1GB for shmmax.

Offline

#4 2015-01-02 05:30:13

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: BFS_PAR Error when attempting to run pan

that looks okay
could be something odd with the key that is used
i'd try a separate program first -- trying to allocate a shared memory segment
if that works, then there's something in the spin code (pangen7.h) that doesn't
jive with Macs

Offline

#5 2015-01-02 21:16:26

Lholloway
Member
Registered: 2015-01-02
Posts: 6

Re: BFS_PAR Error when attempting to run pan

I created a very simple program that allocates shared memory using code found in pangen7.h and it allocated and released just fine until I attempted to allocate 32MB.  When I did that, it could not allocate memory.  It did however, have no problem allocating 16MB and lower. 

I think it could be a configuration error on my end. hmm

Offline

#6 2015-01-02 21:28:15

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: BFS_PAR Error when attempting to run pan

yes that's most likely solvable by setting a higher limit for user-access to shared memory
please post when you've discovered how to do this on a Mac, so that I can add some notes on this for others as well!

Offline

#7 2015-01-02 22:13:53

Lholloway
Member
Registered: 2015-01-02
Posts: 6

Re: BFS_PAR Error when attempting to run pan

I got it to run, I had to set the value of kern.sysv.shmall to be the value of kern.sysv.shmmax / 4096.

As an example, if shmmax is 1GB (1073741824), shmall has to be 262144.

Offline

#8 2015-01-02 22:18:09

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: BFS_PAR Error when attempting to run pan

thanks!
that rings a bell.  i just checked http://spinroot.com/spin/multicore/setup.html  which mentioned it (but I must have forgotten):

You must also increase the maximum number of shared pages shmall to the number used above divided by the pagesize (e.g., 4096) [...etc]

Offline

Board footer

Powered by FluxBB