<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help on memory allocation problem in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/Need-help-on-memory-allocation-problem/m-p/889680#M2023</link>
    <description>Dear Sir/Madam,&lt;BR /&gt;&lt;BR /&gt;I am a student from University of Connecticut. I am now using "SGI Altix 3700 BX2 system". The system contains 64 Intel Itanium 2 processors and 64 GB memory. I do C program on it. Now I met some problem on my project(The program can run in personal computer correctly). The problem is memory allocation and it seems caused by memory alignment.&lt;BR /&gt;&lt;BR /&gt;Now I copy part of my program to you (the error part). I do not know I can explain what happened, let me try.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I use this subroutine to allocate a 3D matrix space for my algorithm. While it runs to the line marked by /*error*/, it can run through until i=0, j=20. Then the error information shows up:&lt;BR /&gt;"Program received signal SIGSEGV, Segmentation fault.&lt;BR /&gt;0x20000000001d00c1 in _int_malloc () from /lib/tls/libc.so.6.1"&lt;BR /&gt;&lt;BR /&gt;The program is:&lt;BR /&gt;&lt;BR /&gt;/**********************************************************************************************/&lt;BR /&gt;double ***AllocMatrix1(short nxl,short nxh, short nyl,short nyh, short nzl,short nzh)&lt;BR /&gt;{&lt;BR /&gt; short i,j,k;&lt;BR /&gt; double *** m;&lt;BR /&gt;&lt;BR /&gt; m=(double ***) malloc((unsigned) ((nxh-nxl)+1)*sizeof(double**));&lt;BR /&gt; if (!m) nrerror("allocation failure 1 in matrix()");&lt;BR /&gt; m -= nxl;&lt;BR /&gt;&lt;BR /&gt; for(i=nxl;i&amp;lt;=nxh;i++) {&lt;BR /&gt; m&lt;I&gt;=(double **) malloc((unsigned) ((nyh-nyl)+1)*sizeof(double*));&lt;BR /&gt; if (!m&lt;I&gt;) nrerror("allocation failure 2 in matrix()");&lt;BR /&gt; m&lt;I&gt; -= nyl;&lt;BR /&gt; &lt;BR /&gt; for(j=nyl;j&amp;lt;=nyh;j++) {&lt;BR /&gt;&lt;BR /&gt;/**The problem happened in this loop while j=20, (now i=0),&lt;BR /&gt;&lt;BR /&gt;in this program the maxmum number is nzh=700***/&lt;BR /&gt;&lt;BR /&gt;/*error*/ m&lt;I&gt;&lt;J&gt;=(double *) malloc((unsigned) (nzh-nzl+1)*sizeof(double)); &lt;BR /&gt; if (!m&lt;I&gt;&lt;J&gt;) nrerror("allocation failure 3 in matrix()");&lt;BR /&gt; m&lt;I&gt;&lt;J&gt; -= nzl;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; for(i=nxl;i&amp;lt;=nxh;i++)&lt;BR /&gt; for(j=nyl;j&amp;lt;=nyh;j++)&lt;BR /&gt; for(k=nzl;k&amp;lt;=nzh;k++) m&lt;I&gt;&lt;J&gt;&lt;K&gt; = 0.0;&lt;BR /&gt; return m;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Rae&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
    <pubDate>Wed, 21 Nov 2007 20:15:08 GMT</pubDate>
    <dc:creator>pinkiee</dc:creator>
    <dc:date>2007-11-21T20:15:08Z</dc:date>
    <item>
      <title>Need help on memory allocation problem</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Need-help-on-memory-allocation-problem/m-p/889680#M2023</link>
      <description>Dear Sir/Madam,&lt;BR /&gt;&lt;BR /&gt;I am a student from University of Connecticut. I am now using "SGI Altix 3700 BX2 system". The system contains 64 Intel Itanium 2 processors and 64 GB memory. I do C program on it. Now I met some problem on my project(The program can run in personal computer correctly). The problem is memory allocation and it seems caused by memory alignment.&lt;BR /&gt;&lt;BR /&gt;Now I copy part of my program to you (the error part). I do not know I can explain what happened, let me try.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I use this subroutine to allocate a 3D matrix space for my algorithm. While it runs to the line marked by /*error*/, it can run through until i=0, j=20. Then the error information shows up:&lt;BR /&gt;"Program received signal SIGSEGV, Segmentation fault.&lt;BR /&gt;0x20000000001d00c1 in _int_malloc () from /lib/tls/libc.so.6.1"&lt;BR /&gt;&lt;BR /&gt;The program is:&lt;BR /&gt;&lt;BR /&gt;/**********************************************************************************************/&lt;BR /&gt;double ***AllocMatrix1(short nxl,short nxh, short nyl,short nyh, short nzl,short nzh)&lt;BR /&gt;{&lt;BR /&gt; short i,j,k;&lt;BR /&gt; double *** m;&lt;BR /&gt;&lt;BR /&gt; m=(double ***) malloc((unsigned) ((nxh-nxl)+1)*sizeof(double**));&lt;BR /&gt; if (!m) nrerror("allocation failure 1 in matrix()");&lt;BR /&gt; m -= nxl;&lt;BR /&gt;&lt;BR /&gt; for(i=nxl;i&amp;lt;=nxh;i++) {&lt;BR /&gt; m&lt;I&gt;=(double **) malloc((unsigned) ((nyh-nyl)+1)*sizeof(double*));&lt;BR /&gt; if (!m&lt;I&gt;) nrerror("allocation failure 2 in matrix()");&lt;BR /&gt; m&lt;I&gt; -= nyl;&lt;BR /&gt; &lt;BR /&gt; for(j=nyl;j&amp;lt;=nyh;j++) {&lt;BR /&gt;&lt;BR /&gt;/**The problem happened in this loop while j=20, (now i=0),&lt;BR /&gt;&lt;BR /&gt;in this program the maxmum number is nzh=700***/&lt;BR /&gt;&lt;BR /&gt;/*error*/ m&lt;I&gt;&lt;J&gt;=(double *) malloc((unsigned) (nzh-nzl+1)*sizeof(double)); &lt;BR /&gt; if (!m&lt;I&gt;&lt;J&gt;) nrerror("allocation failure 3 in matrix()");&lt;BR /&gt; m&lt;I&gt;&lt;J&gt; -= nzl;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; for(i=nxl;i&amp;lt;=nxh;i++)&lt;BR /&gt; for(j=nyl;j&amp;lt;=nyh;j++)&lt;BR /&gt; for(k=nzl;k&amp;lt;=nzh;k++) m&lt;I&gt;&lt;J&gt;&lt;K&gt; = 0.0;&lt;BR /&gt; return m;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Rae&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Wed, 21 Nov 2007 20:15:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Need-help-on-memory-allocation-problem/m-p/889680#M2023</guid>
      <dc:creator>pinkiee</dc:creator>
      <dc:date>2007-11-21T20:15:08Z</dc:date>
    </item>
  </channel>
</rss>

