← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/main] Rev 4824: Add new benchmark bench/common/progress. Johannes, please backport.

 

I backported this benchmark to 0.9.7 and it ran for over 17 minutes.
On DOLFIN-dev it run for about 55 seconds. Maybe we should reduce the
problem size somewhat before I backport further?

Johannes

On Tue, Jun 29, 2010 at 9:56 AM,  <noreply@xxxxxxxxxxxxx> wrote:
> ------------------------------------------------------------
> revno: 4824
> committer: Anders Logg <logg@xxxxxxxxx>
> branch nick: dolfin-dev
> timestamp: Tue 2010-06-29 09:54:04 +0200
> message:
>  Add new benchmark bench/common/progress. Johannes, please backport.
> added:
>  bench/common/
>  bench/common/progress/
>  bench/common/progress/cpp/
>  bench/common/progress/cpp/SConstruct
>  bench/common/progress/cpp/main.cpp
>
>
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/main
>
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
>
> === added directory 'bench/common'
> === added directory 'bench/common/progress'
> === added directory 'bench/common/progress/cpp'
> === added file 'bench/common/progress/cpp/SConstruct'
> --- bench/common/progress/cpp/SConstruct        1970-01-01 00:00:00 +0000
> +++ bench/common/progress/cpp/SConstruct        2010-06-29 07:54:04 +0000
> @@ -0,0 +1,14 @@
> +import os, commands
> +
> +# Get compiler from pkg-config
> +compiler = commands.getoutput('pkg-config --variable=compiler dolfin')
> +
> +# Create a SCons Environment based on the main os environment
> +env = Environment(ENV=os.environ, CXX=compiler)
> +
> +# Get compiler flags from pkg-config
> +env.ParseConfig('pkg-config --cflags --libs dolfin')
> +
> +# Program name
> +env.Program('bench', 'main.cpp')
> +
>
> === added file 'bench/common/progress/cpp/main.cpp'
> --- bench/common/progress/cpp/main.cpp  1970-01-01 00:00:00 +0000
> +++ bench/common/progress/cpp/main.cpp  2010-06-29 07:54:04 +0000
> @@ -0,0 +1,32 @@
> +// Copyright (C) 22010 Anders Logg.
> +// Licensed under the GNU LGPL Version 2.1.
> +//
> +// First added:  2010-06-29
> +// Last changed: 2010-06-29
> +
> +#include <dolfin.h>
> +
> +using namespace dolfin;
> +
> +#define NUM_REPS 5
> +#define SIZE 1000000000
> +
> +int main(int argc, char* argv[])
> +{
> +  info("Creating progress bar with %d steps (%d repetitions)",
> +       SIZE, NUM_REPS);
> +
> +  for (int i = 0; i < NUM_REPS; i++)
> +  {
> +    Progress p("Stepping", SIZE);
> +    double sum = 0.0;
> +    for (int j = 0; j < SIZE; j++)
> +    {
> +      sum += 0.1;
> +      p++;
> +    }
> +    dolfin::cout << "sum = " << sum << dolfin::endl;
> +  }
> +
> +  return 0;
> +}
>
>
>



Follow ups