AMBER Archive (2003)

Subject: nmode on Linux : another memory question

From: E.S. (strand_at_chop.swmed.edu)
Date: Thu Feb 27 2003 - 16:42:15 CST


Dear Amber users --

I recently increased the physical RAM on my Linux box from 1 GB to 2 GB,
hoping that it would enable me to run 'nmode' with a MAXMEMX setting
(in nmode/sizes.h) larger than the value

   parameter (MAXMEMX=115000000)

which I could get when I had only 1 GB.

Unfortunately this doesn't seem to be happening -- I get segmentation
faults
when I run 'nmode' compiled with MAXMEMX set above 115000000, just
as I did when I had only 1 GB of RAM.

I gather from

http://www.amber.ucsf.edu/amber/Questions/mail/18.html

that 115000000 corresponds to about 1 GB.

Other programs seem to see all the memory. E.g., partial output of the
program 'free' on my system is

                     total used free
Mem: 2064528 80780 1983748

And the C program below returns

   Finished
   i = 2097152000

when SIZE = (2000*1024*1024) and

    Error: could not allocate buf...exiting

when SIZE = (2024*1024*1024).

Some of the (probably ill-advised) things I've tried, to get 'nmode'
to use all the memory are:

1) running the bash shell command 'ulimit -v nnnnnn'
  for various memory nnnnnn settings.

2) recompiling amber or just nmode with various command
  line parameters passed to the g77 command.

3) recompiling the (RedHat 8.0) kernel 2.4.18-24.8.0smp
  with various values of

      CONFIG_*HIGHMEM
      CONFIG_HIGHMEM*G
      CONFIG_*GB

  (Currently the kernel boots up and says

      1151MB HIGHMEM available
        896MB LOWMEM available

     and I've not been able to find parameter
     settings that would give me more LOWMEM.)

4) appending a 'mem=nnnnM' line to LILO's lilo.conf
  file

Nothing seems to help.

Any suggestions?

-- E. S.

---------------------------------------------------------------
/*
** allocatable memory
**
** modified from:
**
** http://strasbourg.linuxfr.org/jl3/features-2.3-2.html#ss2.1
*/

#include <stdio.h>

#define SIZE (2000*1024*1024)

main()
{
   int i;

   char *buf = malloc(SIZE);

   if ( !buf )
   {
       printf("Error: could not allocate buf...exiting\n");
       exit(1);
   }

   i = 0;
   for ( ; i < SIZE; i += 4096, buf += 4096)
   {
       *(int *)buf = 0;
   }

   printf("Finished\n");
   printf("i = %12d \n", i );
}