AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  [Q] XL fortran array size larger than 2Gb problem

    Posted Sun December 20, 2009 06:05 PM

    Originally posted by: Jiseok


    PROGRAM memory_test

    IMPLICIT NONE

    Integer, PARAMETER :: n=12000

    Complex*16, ALLOCATABLE :: a(:,:)

    double precision, parameter :: double_cmplx_size=16 !byte

    INTEGER :: i, j, alloc_error, dealloc_error

    Double Precision :: memsize

    memsize = double_cmplx_size*n*n/(1024*1024) !Mb

    ALLOCATE(a(n,n), STAT=alloc_error)
    If (alloc_error .ne. 0) Then
    print *, 'alloc_error = ',alloc_error
    print *, 'ERROR :: Allocate'

    print *, 'size of the memory space needed = ', memsize, 'Mb'
    !stop
    End If
    DEALLOCATE(a, stat=dealloc_error)
    print *, 'dealloc_error = ',dealloc_error

    END PROGRAM memory_test
    ================================================

    Hi.

    I have a array allocation test code above.
    The size of the array would exceed 2Gb which is larger than the limit in 32-bit mode.
    So I boot in 64 bit mode and tried to use -q64 option when compiling but it still shows 'Segmentation Fault'.

    Anyone help would be appreciated.

    Below shows the hardware info of my box

    > prtconf

    System Model: IBM,9114-275
    Machine Serial Number: 104685C
    Processor Type: PowerPC_POWER4
    Number Of Processors: 2
    Processor Clock Speed: 1452 MHz
    CPU Type: 64-bit
    Kernel Type: 64-bit
    LPAR Info: 1 NULL
    Memory Size: 8192 MB
    Good Memory Size: 8192 MB
    Platform Firmware level: 3F041029
    Firmware Version: IBM,RG041029_d79e00_r
    Console Login: enable
    Auto Restart: true
    Full Core: false


  • 2.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Sun December 20, 2009 11:45 PM

    Originally posted by: Kosala


    Hi,

    Can you check what the "ulimit -a" says in the terminal you're executing this from.

    Kosala


  • 3.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Mon December 21, 2009 12:04 AM

    Originally posted by: Jiseok


    > ulimit -a

    core file size (blocks, -c) 1048575
    data seg size (kbytes, -d) 131072
    file size (blocks, -f) 1048575
    max memory size (kbytes, -m) 32768
    open files (-n) 2000
    pipe size (512 bytes, -p) 64
    stack size (kbytes, -s) 32768
    cpu time (seconds, -t) unlimited
    max user processes (-u) 128
    virtual memory (kbytes, -v) unlimited

    ========================================================

    Thank you for your reply.
    I'm not that familiar with AIX and UNIX system.
    If you can give some advices, it would be appreciated.


  • 4.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Mon December 21, 2009 01:00 AM

    Originally posted by: Kosala


    Hi,

    You can override the default settings in the /etc/security/limits for your user. Try setting data, data_hard, stack, stack_hard to -1 for you user. You will need to re-login after these changes.

    Kosala


  • 5.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Mon December 21, 2009 10:53 PM

    Originally posted by: Jiseok


    I appreciated for you help.
    The problem is solved.
    But I'm just wondering if it is safe to set data and stack size unlimited.
    Also, just in case, can I set the max memory size, rss=-1 ?

    Thank you again.


  • 6.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Tue December 22, 2009 03:03 AM

    Originally posted by: jklotz


    It's a common practice to put most limits (in perticular data, filesize, stack, cpu and rss) to -1. I never had problems because of this (the opposite is not true), and this is one of the first thing support line checks if you call them :)


  • 7.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Tue December 22, 2009 04:22 AM

    Originally posted by: Kosala


    Hi,

    Generally I do this for WebSphere as the JVM consumes some crazy memory limits most of the times. But you have to make sure your application is not leaking memory, or the end result can be disastrous.

    Kosala


  • 8.  Re: [Q] XL fortran array size larger than 2Gb problem

    Posted Tue December 22, 2009 11:23 AM

    Originally posted by: Jiseok


    I really appreciate for your help.
    Everything works fine for now :)