[GRASS-dev] Re: [GRASS GIS] #657: add --with-openmp support to
./configure
GRASS GIS
trac at osgeo.org
Wed Apr 28 11:21:13 EDT 2010
#657: add --with-openmp support to ./configure
------------------------+---------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: task | Status: new
Priority: normal | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: openmp
Platform: All | Cpu: All
------------------------+---------------------------------------------------
Comment (by huhabla):
OpenMP support is implemented in the gpde and the gmath libraries. In the
gmath lib many linear equation solver and all blas level 2 and 3 functions
are parallelized with OpenMP.
OpenMP flags are compiler dependent, thus OpenMP support should be set
using C- and linker-flags bevor configure.
I.e: for gcc > 4.2:
{{{
CFLAGS="-O3 -Wall -Werror-implicit-function-declaration -fno-common
-fopenmp"
LDFLAGS="-lgomp"
}}}
This should enable OpenMP support in the libraries and ALL depending
modules.
You can test the OpenMP support when compiling the gpde and gmath tests by
hand (switch into the test directories in the lib dirs and type make). The
test library modules "test.gmath.lib" and "test.gpde.lib" should be
available in the path after starting grass.
The gmath lib test module "test.gmath.lib" provides additionally
benchmarks for blas level 2 and 3 functions and for many solver.
{{{
gmath/test> test.gmath.lib help
Description:
Performs benchmarks, unit and integration tests for the gmath library
Usage:
test.gmath.lib [-uia] [unit=string] [integration=string] [rows=value]
[solverbench=string] [blasbench=string] [--verbose] [--quiet]
Flags:
-u Run all unit tests
-i Run all integration tests
-a Run all unit and integration tests
--v Verbose module output
--q Quiet module output
Parameters:
unit Choose the unit tests to run
options: blas1,blas2,blas3,solver,ccmath,matconv
integration Choose the integration tests to run
options:
rows The size of the matrices and vectors for benchmarking
default: 1000
solverbench Choose solver benchmark
options: krylov,direct
blasbench Choose blas benchmark
options: blas2,blas3
}}}
I.e testing the speedup of the blas level 2 and 3 functions of the latest
svn trunk of grass7, compiled with the flags mentioned above on a 8 core
intel xeon system:
{{{
gmath/test> setenv OMP_NUM_THREADS 1
gmath/test> test.gmath.lib blasbench=blas2 rows=5000
++ Running blas level 2 benchmark ++
Computation time G_math_Ax_sparse: 0.244123
Computation time G_math_Ax_sband: 0.280636
Computation time G_math_d_Ax: 0.134494
Computation time G_math_d_Ax_by: 0.18556
Computation time G_math_d_x_dyad: 0.268684
-- gmath lib tests finished successfully --
gmath/test> setenv OMP_NUM_THREADS 4
gmath/test> test.gmath.lib blasbench=blas2 rows=5000
++ Running blas level 2 benchmark ++
Computation time G_math_Ax_sparse: 0.072549
Computation time G_math_Ax_sband: 0.192712
Computation time G_math_d_Ax: 0.036652
Computation time G_math_d_Ax_by: 0.047904
Computation time G_math_d_x_dyad: 0.080534
-- gmath lib tests finished successfully --
gmath/test> setenv OMP_NUM_THREADS 1
gmath/test> test.gmath.lib blasbench=blas3 rows=1000
++ Running blas level 3 benchmark ++
Computation time G_math_d_aA_B: 0.013263
^[[AComputation time G_math_d_AB: 18.729
-- gmath lib tests finished successfully --
gmath/test> setenv OMP_NUM_THREADS 4
gmath/test> test.gmath.lib blasbench=blas3 rows=1000
++ Running blas level 3 benchmark ++
Computation time G_math_d_aA_B: 0.006946
Computation time G_math_d_AB: 4.80446
-- gmath lib tests finished successfully --
}}}
The gmath library should work fine with OpenMP support. In the gpde
library is still a bug (race condition) in the linear equation system
creator.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/657#comment:4>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list