public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* large array, ia64, "segmentation fault"
@ 2004-11-27  2:43 hx w
  2004-11-27  2:46 ` Peter Barada
  0 siblings, 1 reply; 8+ messages in thread
From: hx w @ 2004-11-27  2:43 UTC (permalink / raw)
  To: gcc mail-list gcc, ia64, RHEL3 RHEL3

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312, Size: 1776 bytes --]


I compile a source , when N=100, everything is good;
but 
when i modify N=1000, i got the info: segmentation
fault. i am using icc 8.1.

My sys info:
RHEL3-64bit update 2.
2.4.21-4.EL kernel
4-way Iatnium2 .
8G RAM.

So, does any one meet the same thing as me? What cause
the error info? And how cuold i do to resolve it?

Thanks !
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
#include <stdio.h>
#include <sys/time.h>
#include <stdlib.h>

#define  N 1000
void Input(double A[N][N], double B[N][N]);
void MultiplyS(double A[][N], double B[][N], double
C[][N]);

int main()
{
    int i,j,k;
    double A[N][N],B[N][N],C[N][N];
    struct timeval start_time,end_time;
    double  elapsed_time;

    gettimeofday(&start_time,NULL);
    Input(A,B);
    MultiplyS(A,B,C);
    gettimeofday(&end_time,NULL);
   
elapsed_time=1000000*(end_time.tv_sec-start_time.tv_sec)+
end_time.tv_usec-start_time.tv_usec;
    elapsed_time/=1000000;

    printf("Used Time:%f seconds\n",elapsed_time);

    return 0;
}


void Input(double A[N][N],double B[N][N])
{
   int i,j;
   for( i=0; i<N; i++)
     for( j=0; j<N; j++)
     {
       A[i][j] = 1;
       B[i][j] = 0.8;
     }
  }

void MultiplyS(double A[][N], double B[][N], double
C[][N])
{
   int i,j,k;
   for(i=0; i<N; i++)
      for( j=0; j<N; j++)
      {
        C[i][j] = 0;
        for( k=0; k<N; k++)
           C[i][j]+= (A[i][k]* B[k][j]);
      }
}
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½

_________________________________________________________
Do You Yahoo!?
×¢²áÊÀ½çÒ»Á÷Æ·ÖʵÄÑÅ»¢Ãâ·ÑµçÓÊ
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: large array, ia64, "segmentation fault"
@ 2004-11-29  9:12 Luck, Tony
  0 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2004-11-29  9:12 UTC (permalink / raw)
  To: Discussion of Linux on the Intel IA-64 processor,
	gcc mail-list gcc, RHEL3 RHEL3


>Excuse me , In the REHL3 64bit platform ,how many can
>i increase the stack size? I mean the maximum size.

Use "ulimit -s {size}" ... you need to be "root" to increase
the limit.  The default seems to be 10MB:

 $ ulimit -s
 10240

-Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-11-29 19:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-27  2:43 large array, ia64, "segmentation fault" hx w
2004-11-27  2:46 ` Peter Barada
2004-11-27  8:27   ` hx w
2004-11-27 23:42     ` Mike Stump
2004-11-28  3:50       ` Dave Korn
2004-11-29 19:15     ` David Mosberger
2004-11-29 19:30       ` Joe Buck
2004-11-29  9:12 Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).