/[escript]/trunk/escript/src/Utils.cpp
ViewVC logotype

Contents of /trunk/escript/src/Utils.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (show annotations)
Wed Mar 22 02:12:00 2006 UTC (13 years, 5 months ago) by elspeth
File size: 904 byte(s)
More copyright information.

1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 #include "Utils.h"
14
15 #ifdef _OPENMP
16 #include <omp.h>
17 #endif
18
19 namespace escript {
20
21 void setNumberOfThreads(const int num_threads)
22 {
23
24 #ifdef _OPENMP
25 omp_set_num_threads(num_threads);
26 #endif
27
28 }
29
30 int getNumberOfThreads()
31 {
32 #ifdef _OPENMP
33 return omp_get_max_threads();
34 #else
35 return 1;
36 #endif
37
38 }
39
40 } // end of namespace

  ViewVC Help
Powered by ViewVC 1.1.26