escript  Revision_4925
Utils.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
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 
18 #if !defined escript_Utils_H
19 #define escript_Utils_H
20 #include "system_dep.h"
21 
22 namespace escript {
23 
36 
42 
48  ESCRIPT_DLL_API void setNumberOfThreads(const int num_threads);
49 
55 
61 
71  ESCRIPT_DLL_API int getMPIWorldMax(const int val);
72 
76  ESCRIPT_DLL_API int getMPIWorldSum(const int val);
77 
82 
86  ESCRIPT_DLL_API int runMPIProgram(const boost::python::list args);
87 
93  /*
94  \brief
95  return largest positive float
96  */
98 
100  void
101  saveDataCSV(const std::string& filename, boost::python::dict arg, const std::string& sep, const std::string& csep,
102 bool append=false);
103 
104 
112  void
113  resolveGroup(boost::python::object obj);
114 
115 } // end of namespace
116 #endif
void saveDataCSV(const std::string &filename, boost::python::dict arg, const std::string &sep, const std::string &csep, bool append)
Definition: Utils.cpp:220
int getSvnVersion()
some functions
Definition: Utils.cpp:45
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:128
int getMPIWorldSum(const int val)
returns sum of an integer over all processors with MPI_COMM_WORLD
Definition: Utils.cpp:155
void resolveGroup(boost::python::object obj)
Definition: Utils.cpp:560
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:118
int runMPIProgram(boost::python::list args)
uses MPI_Comm_spawn to run an external MPI program safely.
Definition: Utils.cpp:166
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:64
double getMachinePrecision()
returns machine precision
Definition: Utils.cpp:198
void printParallelThreadCnt()
print a message about how many MPI CPUs and OpenMP threads we're using
Definition: Utils.cpp:79
int getMPIWorldMax(const int val)
returns the maximum value of an integer over all processors within MPI_COMM_WORLD ...
Definition: Utils.cpp:144
void setNumberOfThreads(const int num_threads)
set the number of threads
Definition: Utils.cpp:109
double getMaxFloat()
Definition: Utils.cpp:201
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:136
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:204