public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/40852]  New: parallel sort run time increases ~10 fold when vector size gets over ~4*10^9
@ 2009-07-24 20:15 jaffe at broad dot mit dot edu
  2009-07-24 20:29 ` [Bug libgomp/40852] " rguenth at gcc dot gnu dot org
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: jaffe at broad dot mit dot edu @ 2009-07-24 20:15 UTC (permalink / raw)
  To: gcc-bugs

Parallel sorts get ~10 times slower as one increases the vector size from
4*10^9 to 5*10^9, perhaps at exactly 2^32, but this wasn't checked.  The
example below is for a vector of ints but the same phenomenon is observed on a
vector of long longs.

To reproduce (sort_test.cc is below):

0. Adjust 'processors' in sort_test.cc.
1. g++ -O3 -fopenmp sort_test.cc -lgomp
2. ./a.out

output:

58 seconds used in sort [for vector of size 4,000,000,000]
667 seconds used in sort [for vector of size 5,000,000,000]

gcc version information:

crd4% gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.4.1/configure
--with-gmp=/broad/tools/Linux/x86_64/pkgs/gcc_4.4.1
--with-mpfr=/broad/tools/Linux/x86_64/pkgs/gcc_4.4.1
--prefix=/broad/tools/Linux/x86_64/pkgs/gcc_4.4.1
Thread model: posix
gcc version 4.4.1 (GCC) 
We first observed the problem under gcc 4.3.3.

hardware info:

crd4% uname -a
Linux crd4 2.6.16.54-0.2.5-smp #1 SMP Mon Jan 21 13:29:51 UTC 2008 x86_64
x86_64 x86_64 GNU/Linux
This is a 32-processor machine with 256 GB of memory, but I don't think the
problem is 
specific to this architecture.

sort_test.cc:

#include <iostream>
#include <omp.h>
#include <time.h>
#include <vector>
using namespace std;
int main( )
{    for ( long long  m = 4; m <= 5; m++ )
     {    const long long entries = m * (long long) 1000000000;
          const int processors = 32;
          vector<int> x(entries);
          for ( long long i = 0; i < entries; i++ )
               x[i] = (i*i) % 123456789;
          time_t clock1, clock2; time( &clock1 );
          omp_set_num_threads(processors);
          sort( x.begin( ), x.end( ) );
          time( &clock2 );           
          cout << clock2 - clock1 << " seconds used in sort" << endl;    }    }


-- 
           Summary: parallel sort run time increases ~10 fold when vector
                    size gets over ~4*10^9
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaffe at broad dot mit dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40852


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

end of thread, other threads:[~2009-10-29 16:52 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24 20:15 [Bug libgomp/40852] New: parallel sort run time increases ~10 fold when vector size gets over ~4*10^9 jaffe at broad dot mit dot edu
2009-07-24 20:29 ` [Bug libgomp/40852] " rguenth at gcc dot gnu dot org
2009-07-24 20:44 ` [Bug libstdc++/40852] " jaffe at broadinstitute dot org
2009-07-24 21:15 ` paolo dot carlini at oracle dot com
2009-07-24 21:20 ` jaffe at broadinstitute dot org
2009-07-24 21:24 ` [Bug libstdc++/40852] [parallel-mode] " paolo dot carlini at oracle dot com
2009-10-19 18:08 ` jason at gcc dot gnu dot org
2009-10-20  7:46 ` singler at gcc dot gnu dot org
2009-10-20 10:55 ` jaffe at broadinstitute dot org
2009-10-22  6:57 ` singler at gcc dot gnu dot org
2009-10-22  7:16 ` singler at gcc dot gnu dot org
2009-10-22  7:17 ` singler at gcc dot gnu dot org
2009-10-22  7:17 ` singler at gcc dot gnu dot org
2009-10-22  7:42 ` singler at gcc dot gnu dot org
2009-10-22  9:01 ` pluto at agmk dot net
2009-10-22 10:23 ` jaffe at broadinstitute dot org
2009-10-22 16:41 ` singler at gcc dot gnu dot org
2009-10-22 17:46 ` paolo dot carlini at oracle dot com
2009-10-23 10:00 ` singler at gcc dot gnu dot org
2009-10-23 10:01 ` singler at gcc dot gnu dot org
2009-10-23 16:00 ` paolo dot carlini at oracle dot com
2009-10-27  9:45 ` jaffe at broadinstitute dot org
2009-10-27 15:54 ` paolo dot carlini at oracle dot com
2009-10-28 10:04 ` singler at gcc dot gnu dot org
2009-10-28 10:05 ` singler at gcc dot gnu dot org
2009-10-28 10:11 ` singler at gcc dot gnu dot org
2009-10-28 10:44 ` paolo dot carlini at oracle dot com
2009-10-29 16:53 ` law at gcc dot gnu dot org

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).