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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 797 - (show annotations)
Thu Aug 3 02:03:18 2006 UTC (13 years, 1 month ago) by gross
File size: 928 byte(s)
function added to manually free unused memory in the memory manager
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 #include "DataVector.h"
15
16 #ifdef _OPENMP
17 #include <omp.h>
18 #endif
19
20 namespace escript {
21
22 void setNumberOfThreads(const int num_threads)
23 {
24
25 #ifdef _OPENMP
26 omp_set_num_threads(num_threads);
27 #endif
28
29 }
30
31 int getNumberOfThreads()
32 {
33 #ifdef _OPENMP
34 return omp_get_max_threads();
35 #else
36 return 1;
37 #endif
38
39 }
40
41 } // end of namespace

  ViewVC Help
Powered by ViewVC 1.1.26