Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: Thompson, Aidan P. (athomps_at_[hidden])
Date: 2007-09-04 16:22:08


This is more a comment that a question. I think the compile-time required
for large applications that use Open MPI is unnecessarily long. The
situation could be greatly improved by streamlining the number of C++ header
files that are included. Currently, compiling LAMMPS (lammps.sandia.gov)
takes 61 seconds to compile with a dummy MPI library and 262 seconds with
Open MPI, a 4x slowdown.

I noticed that iostream.h is included by mpicxx.h, for no good reason. To
measure the cost of this, I compiled the follow source file 1) without any
include files 2) with mpi.h 3) with iostream.h and 4) with both:

$ more foo.cpp
#ifdef FOO_MPI
#include "mpi.h"
#endif

#ifdef FOO_IO
#include <iostream>
#endif

void foo() {};

$ time mpic++ -c foo.cpp
        0.04 real 0.02 user 0.02 sys
$ time mpic++ -DFOO_MPI -c foo.cpp
        0.58 real 0.47 user 0.07 sys
$ time mpic++ -DFOO_IO -c foo.cpp
        0.30 real 0.23 user 0.05 sys
$ time mpic++ -DFOO_IO -DFOO_MPI -c foo.cpp
        0.56 real 0.47 user 0.07 sys

Including mpi.h adds about 0.5 seconds to the compile time and iostream
accounts for about half of that. With optimization, the effect is even
greater. When you have hundreds of source files, that really adds up.

How about cleaning up your include system?

Aidan

 

-- 
      Aidan P. Thompson
      01435 Multiscale Dynamic Materials Modeling
      Sandia National Laboratories
      PO Box 5800, MS 1322     Phone: 505-844-9702
      Albuquerque, NM 87185    FAX  : 505-845-7442
      mailto:athomps_at_[hidden]