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

Annotation of /trunk/escript/src/Utils.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2607 - (hide annotations)
Tue Aug 18 01:02:56 2009 UTC (10 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 2035 byte(s)
Added getMPIWorldSum function to the esys.escript module.
This function takes an integer from each member of the MPIWorld.
This will hopefully address mantis issue 359

Added unit tests for most of the c++ free functions in the module.



1 jgs 474
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
15 gross 391 #if !defined escript_Utils_H
16     #define escript_Utils_H
17 woo409 757 #include "system_dep.h"
18 gross 391
19     namespace escript {
20    
21     /**
22     \brief
23     some functions
24    
25     */
26    
27     /**
28     \brief
29 ksteube 1247 return the latest SVN version number
30     */
31     ESCRIPT_DLL_API int getSvnVersion();
32    
33     /**
34     \brief
35 ksteube 1561 print a message about how many MPI CPUs and OpenMP threads we're using
36     */
37     ESCRIPT_DLL_API void printParallelThreadCnt();
38    
39     /**
40     \brief
41 gross 391 set the number of threads
42 jfenwick 2607 \warning Use of this method is strongly discouraged. It may be deprecated in future.
43 gross 391 */
44 woo409 757 ESCRIPT_DLL_API void setNumberOfThreads(const int num_threads);
45 gross 391
46     /**
47     \brief
48     returns the number of threads
49     */
50 woo409 757 ESCRIPT_DLL_API int getNumberOfThreads();
51 gross 391
52 ksteube 1805 /**
53     \brief
54     returns the total number of available MPI processes for MPI_COMM_WORLD
55     */
56     ESCRIPT_DLL_API int getMPISizeWorld();
57    
58     /**
59     \brief
60     returns the MPI processor number within MPI_COMM_WORLD
61     */
62     ESCRIPT_DLL_API int getMPIRankWorld();
63 gross 2308 /**
64     \brief
65     returns the maximum value of an integer over all processors within MPI_COMM_WORLD
66     */
67     ESCRIPT_DLL_API int getMPIWorldMax(const int val);
68 ksteube 1805
69 jfenwick 2607 /**
70     \brief returns sum of an integer over all processors with MPI_COMM_WORLD
71     */
72     ESCRIPT_DLL_API int getMPIWorldSum(const int val);
73 gross 2313
74     /**
75     \brief performs a barrier synchronization across all processors.
76     */
77    
78     ESCRIPT_DLL_API void MPIBarrierWorld();
79    
80 gross 2100 /**
81     \brief
82     returns machine precision
83     */
84     ESCRIPT_DLL_API double getMachinePrecision();
85     /*
86     \brief
87     return largest positive float
88     */
89     ESCRIPT_DLL_API double getMaxFloat();
90    
91 gross 391 } // end of namespace
92     #endif

  ViewVC Help
Powered by ViewVC 1.1.26