escript  Revision_
Utils.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
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 #ifndef __ESCRIPT_UTILS_H__
18 #define __ESCRIPT_UTILS_H__
19 
20 #include "system_dep.h"
21 #include <boost/python/dict.hpp>
22 
23 #ifdef ESYS_HAVE_BOOST_NUMPY
24 #include <boost/python/numpy.hpp>
25 #endif
26 
27 namespace escript {
28 
40 
46 
52 ESCRIPT_DLL_API void setNumberOfThreads(const int num_threads);
53 
59 
65 
71 
76 ESCRIPT_DLL_API int getMPIWorldMax(const int val);
77 
81 ESCRIPT_DLL_API int getMPIWorldSum(const int val);
82 
87 
91 ESCRIPT_DLL_API int runMPIProgram(const boost::python::list args);
92 
98 
99 /*
100  \brief
101  return largest positive float
102 */
104 
105 ESCRIPT_DLL_API void saveDataCSV(const std::string& filename,
106  boost::python::dict arg,
107  const std::string& sep,
108  const std::string& csep,
109  bool refid=false,
110  bool append=false);
111 
112 #ifdef ESYS_HAVE_BOOST_NUMPY
113 ESCRIPT_DLL_API boost::python::list getNumpy(boost::python::dict arg);
114 #else
115 ESCRIPT_DLL_API void getNumpy(boost::python::dict arg);
116 #endif
117 
118 
126 ESCRIPT_DLL_API void resolveGroup(boost::python::object obj);
127 
128 } // end of namespace
129 
130 #endif // __ESCRIPT_UTILS_H__
131 
int getSvnVersion()
some functions
Definition: Utils.cpp:42
void saveDataCSV(const std::string &filename, bp::dict arg, const std::string &sep, const std::string &csep, bool refid, bool append)
Definition: Utils.cpp:387
void getNumpy(bp::dict arg)
Definition: Utils.cpp:919
Definition: AbstractContinuousDomain.cpp:22
void resolveGroup(bp::object obj)
Definition: Utils.cpp:924
int runMPIProgram(bp::list args)
Definition: Utils.cpp:311
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:93
int getMPIWorldSum(int val)
returns sum of an integer over all processors with MPI_COMM_WORLD
Definition: Utils.cpp:123
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:84
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
double getMachinePrecision()
returns the machine precision
Definition: Utils.cpp:366
void printParallelThreadCnt()
print a message about how many MPI CPUs and OpenMP threads we&#39;re using
Definition: Utils.cpp:135
int getMPIWorldMax(int val)
returns the maximum value of an integer over all processors within MPI_COMM_WORLD ...
Definition: Utils.cpp:111
void setNumberOfThreads(int num_threads)
set the number of threads
Definition: Utils.cpp:77
double getMaxFloat()
Definition: Utils.cpp:371
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:102
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:376