/[escript]/branches/diaplayground/ripley/src/SConscript
ViewVC logotype

Contents of /branches/diaplayground/ripley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5065 - (show annotations)
Fri Jun 20 05:49:52 2014 UTC (4 years, 11 months ago) by caltinay
File size: 3337 byte(s)
Proof-of-concept 2:
matrix assembly on CPU as before, solving via cusp-based dia matrix on CPU
or GPU according to options.
CPU->GPU copy time is in the order of 1-2% of solver time,
solver speed-up is nice.
Unfortunately, no MPI support in cusp so this is just to confirm that
it makes sense to pursue further with custom solvers using thrust.

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2014 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 import os
18 Import('*')
19
20 local_env = env.Clone()
21 py_wrapper_local_env = env.Clone()
22 local_unroll_env = env.Clone()
23
24
25 # Remove the shared library prefix on all platforms - we don't want 'lib'
26 # mucking with our python modules
27 del py_wrapper_local_env['SHLIBPREFIX']
28
29 sources = """
30 AbstractAssembler.cpp
31 blocktools.cpp
32 blocktools2.cpp
33 Brick.cpp
34 DefaultAssembler2D.cpp
35 DefaultAssembler3D.cpp
36 domainhelpers.cpp
37 LameAssembler2D.cpp
38 LameAssembler3D.cpp
39 Rectangle.cpp
40 RipleyDomain.cpp
41 RipleyException.cpp
42 WaveAssembler2D.cpp
43 WaveAssembler3D.cpp
44 """.split()
45
46 headers = """
47 AbstractAssembler.h
48 blocktools.h
49 Brick.h
50 DefaultAssembler2D.h
51 DefaultAssembler3D.h
52 domainhelpers.h
53 LameAssembler2D.h
54 LameAssembler3D.h
55 Rectangle.h
56 Ripley.h
57 RipleyDomain.h
58 RipleyException.h
59 RipleySystemMatrix.h
60 system_dep.h
61 WaveAssembler2D.h
62 WaveAssembler3D.h
63 """.split()
64
65 local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
66 if local_env['silo']:
67 local_env.Append(CPPDEFINES = ['USE_SILO'])
68 local_env.AppendUnique(LIBS = env['silo_libs'])
69
70 if local_env['cuda']:
71 sources.append('RipleySystemMatrix.cu')
72 local_env.Append(CCFLAGS = ['-Wno-error', '-w'])
73 local_env.Append(CPPDEFINES = ['USE_CUDA'])
74 local_env.Append(LIBS = ['cudart'])
75 else:
76 sources.append('RipleySystemMatrix.cpp')
77
78 if IS_WINDOWS:
79 local_env.Append(CPPDEFINES = ['RIPLEY_EXPORTS'])
80
81 module_name = 'ripley'
82
83 lib = local_env.SharedLibrary(module_name, sources)
84 env.Alias('build_ripley_lib', lib)
85
86 include_path = Dir('ripley', local_env['incinstall'])
87
88 hdr_inst = local_env.Install(include_path, headers)
89 env.Alias('install_ripley_headers', hdr_inst)
90
91 lib_inst = local_env.Install(local_env['libinstall'], lib)
92 env.Alias('install_ripley_lib', lib_inst)
93
94 ### Python wrapper ###
95 py_wrapper_local_env.Prepend(LIBS = ['ripley', 'pasowrap', 'escript', 'paso', 'esysUtils'])
96 py_wrapper_name = module_name + 'cpp'
97 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'ripleycpp.cpp')
98 env.Alias('build_ripleycpp_lib', py_wrapper_lib)
99
100 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
101 if IS_WINDOWS:
102 wrapper_ext = '.pyd'
103 else:
104 wrapper_ext = '.so'
105
106 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
107 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
108 source=py_wrapper_lib[0])
109 env.Alias('install_ripleycpp_lib', mod_inst)
110
111 # configure python module
112 local_env.SConscript(dirs = ['#/ripley/py_src'], variant_dir='py', duplicate=0)
113
114 # configure unit tests
115 local_env.SConscript(dirs = ['#/ripley/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
116

  ViewVC Help
Powered by ViewVC 1.1.26