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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (hide annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 2600 byte(s)
Don't panic.
Updating copyright stamps

1 jgs 474
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 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 jfenwick 2635 return the SVN version number used to build this version.
30     \warning Only gives accurate answers for clean checkouts
31 ksteube 1247 */
32     ESCRIPT_DLL_API int getSvnVersion();
33    
34     /**
35     \brief
36 ksteube 1561 print a message about how many MPI CPUs and OpenMP threads we're using
37     */
38     ESCRIPT_DLL_API void printParallelThreadCnt();
39    
40     /**
41     \brief
42 gross 391 set the number of threads
43 jfenwick 2607 \warning Use of this method is strongly discouraged. It may be deprecated in future.
44 gross 391 */
45 woo409 757 ESCRIPT_DLL_API void setNumberOfThreads(const int num_threads);
46 gross 391
47     /**
48     \brief
49     returns the number of threads
50     */
51 woo409 757 ESCRIPT_DLL_API int getNumberOfThreads();
52 gross 391
53 ksteube 1805 /**
54     \brief
55     returns the total number of available MPI processes for MPI_COMM_WORLD
56     */
57     ESCRIPT_DLL_API int getMPISizeWorld();
58    
59     /**
60     \brief
61     returns the MPI processor number within MPI_COMM_WORLD
62     */
63     ESCRIPT_DLL_API int getMPIRankWorld();
64 gross 2308 /**
65     \brief
66     returns the maximum value of an integer over all processors within MPI_COMM_WORLD
67     */
68     ESCRIPT_DLL_API int getMPIWorldMax(const int val);
69 ksteube 1805
70 jfenwick 2607 /**
71     \brief returns sum of an integer over all processors with MPI_COMM_WORLD
72     */
73     ESCRIPT_DLL_API int getMPIWorldSum(const int val);
74 gross 2313
75     /**
76     \brief performs a barrier synchronization across all processors.
77     */
78    
79     ESCRIPT_DLL_API void MPIBarrierWorld();
80    
81 gross 2100 /**
82     \brief
83     returns machine precision
84     */
85     ESCRIPT_DLL_API double getMachinePrecision();
86     /*
87     \brief
88     return largest positive float
89     */
90     ESCRIPT_DLL_API double getMaxFloat();
91    
92 jfenwick 2635 ESCRIPT_DLL_API
93     void
94     saveDataCSV(const std::string& filename, boost::python::dict arg, const std::string& sep, const std::string& csep,
95     bool append=false);
96    
97 jfenwick 2799
98     /**
99     Resolve a collection of Data objects together now.
100     To get performance improvements, the objects will need to have the same function space and share Dag components.
101     \param obj A python list or tuple of Data objects to be resolved together.
102    
103     */
104     ESCRIPT_DLL_API
105     void
106     resolveGroup(boost::python::object obj);
107    
108 gross 391 } // end of namespace
109     #endif

  ViewVC Help
Powered by ViewVC 1.1.26