[CPMD-list] "MEMORY| ALLOCATION FAILED" error message

Robert Williams bob at bob.usuhs.mil
Fri Mar 4 19:33:15 CET 2005


Dear Leonardo,

I'm not quite sure I know what the memory
limitations might be for a 32 bit kernel running
on an opteron.   Are you sure this is a Fedora distributed
kernel for opteron that is configured for only 32 bits?
Assuming that your test job
is a very small one and that memory is not an issue,
the kernel may be the problem.

I have not tested this particular patched
version of 2.6.9.  I'm surprized and pleased
to hear that it works for you in serial non-smp mode.
All I can say about 2.6.9
is that a pristine 2.6.9, and early Fedora 2
2.6.8 and 2.6.9 kernels, (non-smp) yielded the allocation error even
with stacksize unlimited.  I never identified
the specific problem with the kernels that did not
work.  I just tested about ten variations on three
kernel versions and stopped when I found one that worked.

The 2.6.5 kernel that I am presently using with CPMD
is not SMP, although I vaguely recall that the SMP version did
work...on a single multithreaded P4 cpu.

However, you can compile and run a pristine unpatched
kernel on Fedora 3, so you would not have to change
distributions.   You can test 2.6.5, and perhaps
some other kernels depending on how much experience
you have in configuring and building linux kernels.
If you do this, it would be useful to know what you learn.
I should warn you that I have not run the 2.6.5 kernel
on Fedora 3 yet.  I've built one...and I'm a weekend
away from trying it.

This is a job only for someone who has a day or two
to waste, and some experience with kernel builds:
Briefly, fetch 2.6.5 from kernel.org,
unpack it in /usr/src, symlink it to "linux", cp my
.config file to that directory (The name must be ".config"),
edit .config and set the following:

CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_SMP=y

Note that there may be other options
related to running on an opteron that may
require some testing.  You indicate that you
are running a 32 bit kernel...why?...for example.

Run "make oldconfig".
At this point you may want to run "make xconfig"
to change anything else that seems appropriate.
Edit "Makefile" and make the change "EXTRAVERSION = -lg1"
to make this version unique.
Run "make bzImage; make modules; make modules_install;
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.6.5-lg1;
cp /usr/src/linux/System.map /boot/System.map-2.6.5-lg1;
cp /usr/src/linux/.config /boot/config-2.6.5-lg1;
/sbin/new-kernel-pkg --mkinitrd --depmod --install 2.6.5-lg1",
and edit /boot/grub/grub.conf and change your 2.6.5 entry to
point at your specific device.  My grub.conf entry for this
kernel is thus:
title Fedora Core (2.6.5-bob1)
         root (hd0,0)
         kernel /vmlinuz-2.6.5-bob1 ro root=/dev/hda2 rhgb quiet
         initrd /initrd-2.6.5-bob1.img
And...edit /etc/fstab to change your entries there in
a similar fashion:
/dev/hda2               /                       ext3    defaults        1 1
/dev/hda1               /boot                   ext3    defaults        1 2
#LABEL=/                 /                       ext3    defaults        1 1
#LABEL=/boot             /boot                   ext3    defaults        1 2

Use comments "#" so you can find your way
back.
and, assuming I've not left something out,
you should be ready to boot your new 2.6.5 kernel.

You might want to edit /boot/grub/grub.conf to change the
default boot kernel, and if you find that it works you
may want to run "make xconfig" on the kernel to fix
it up for your own system, but there it is.

I must admit that I'm a bit irritated that this
problem with the linux kernel has cropped up and continues
to bite us.  One path toward a real solution would be
to provide a willing kernel developer with a binary of
cpmd and a little makefile to run test jobs.
I don't have the authority to be handing out cpmd codes.

Bob

Leonardo Guidoni wrote:
> Dear Bob, dear Bayu and dear all,
> 	I am working on a Fedora 3 with a 2.6.9-1.667smp kernel
> (opteron double proc. with 32 bit kernel).
> and I have the same problem of MEMORY ALLOCATION FAILED.
> On one processor I found that setting
> limit stacksize unlimited
> solves the problem.
> Anyway as son as I run in parallel one of the processor other
> than parent has the same fatal error.
> I put the limit instruction on
> /etc/profile and /etc/csh.cshrc but with no results.
> Do you think I can solve the problem without changing
> distribution?
> Thanks in advance
> 
> 	Leonardo
> 
> Dear Bayu,
> 
> There is a "bug" in at least some kernel versions greater than
> 2.6.5 that appear to be related to this problem.
> I ran quite a few tests and found that a pristine
> (non-fedora) 2.6.5 kernel will solve this memory allocation
> error.
> I'm not sure about the latest kernels.  I haven't tested 2.6.10
> yet.
> I've attached my .config file.
> 
> Bob Williams
> 
> s101bayu at mail.chem.itb.ac.id wrote:
> 
>>Dear All,
>>
>>I am having some issues in running the test programs that is
> 
> provided at the
> 
>>cpmd.org site. When I ran the code using the test inputs I
> 
> get, "MEMORY|
> 
>>ALLOCATION FAILED" error message.
>>
>>My machine is an Intel Pentium 4 based running Fedora Core 3,
> 
> Clustering
> 
>>with OSCAR and I
>>compiled the code using intel fortran compiler. Here is my
> 
> make file:
> 
>>#QMMM_FLAGS = -D__QMECHCOUPL
>>#QMMM_LIBS  = -L. -lmm
>>FFLAGS = -c -r8 -w95 -O3 -pc64 -axiKMWN -tpp7 -unroll -cm
> 
> -tune pn4 -arch pn4
> 
>>LFLAGS = -L. -latlas -lsvml -Vaxlib -static $(QMMM_LIBS)
>>CFLAGS = -c -O2 -Wall
>>CPP = /lib/cpp -P -C -traditional
>>CPPFLAGS = -DADD_ONE_UNDERSCORE -D__Linux -D__PGI -DLAPACK
> 
> -DFFT_DEFAULT
> 
>>-DPARALLEL -DMP_LIBRARY=__MPI -DMYRINET -DLINUX_IFC
>>NOOPT_FLAG =
>>CC = cc
>>FC = env LAMHF77=ifort mpif77
>>LD = env LAMHF77=ifort mpif77
>>
>>
>>Here is the error message:
>>
> 
> ****************************************************************
> 
>> PROCESSOR     0 ALLOCATION OF       64672 WORDS OF MEMORY
> 
> FAILED
> 
> ****************************************************************
> 
>> ***    MEMORY| THE NEW SIZE OF THE PROGRAM IS   2212/  21808
> 
> kBYTES ***
> ...
> 
> Leonardo Guidoni
> Universita' degli studi di Roma "La Sapienza"
> Dip. di Fisica, Ed. Fermi, P.le A. Moro 5, 00185 Roma
> Tel: +39 06 4991 3437,  Fax: +39 06 446 3158
> 



More information about the CPMD-list mailing list