AQUAgpusph 5.0.4
|
Set of auxiliar functions. More...
#include <algorithm>
#include <cctype>
#include <locale>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <mutex>
#include <limits.h>
#include <unistd.h>
#include "AuxiliarMethods.hpp"
#include "ProblemSetup.hpp"
#include "InputOutput/Logger.hpp"
#include <iostream>
Namespaces | |
namespace | Aqua |
Main AQUAgpusph namespace. | |
namespace | Aqua::MPI |
Functions | |
bool | Aqua::hasPrefix (const std::string &str, const std::string &prefix) |
Check if a string starts with an specific prefix. | |
bool | Aqua::hasSuffix (const std::string &str, const std::string &suffix) |
Check if a string ends with an specific suffix. | |
void | Aqua::replaceAll (std::string &str, const std::string &search, const std::string &replace) |
Replace all substring occurrences by another substring. | |
std::string | Aqua::replaceAllCopy (std::string str, std::string search, std::string replace) |
Replace all substring occurrences by another substring. | |
void | Aqua::ltrim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix. | |
void | Aqua::rtrim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
void | Aqua::trim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix. | |
std::string | Aqua::ltrimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
std::string | Aqua::rtrimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
std::string | Aqua::trimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix. | |
std::string | Aqua::xxd2string (unsigned char *arr, unsigned int len) |
Transform a xxd exported file into a C++ string. | |
void | Aqua::toLower (std::string &str) |
Convert a string to lower case. | |
std::string | Aqua::toLowerCopy (std::string str) |
Convert a string to lower case. | |
void | Aqua::setStrConstants (std::string &str) |
Set several constants into a string. | |
std::string | Aqua::setStrConstantsCopy (std::string str) |
Set several constants into a string. | |
std::vector< std::string > | Aqua::split (std::string str, char chr) |
Split a string by a character. | |
std::vector< std::string > | Aqua::split_formulae (std::string str) |
Split a list of split_formulae. | |
std::string | Aqua::newFilePath (const std::string &basename, unsigned int &i, unsigned int digits=5) |
Look for a file path which is not already taken. | |
unsigned int | Aqua::nextPowerOf2 (unsigned int n) |
unsigned int | Aqua::isPowerOf2 (unsigned int n) |
const std::string | Aqua::getExePath () |
Get the executable path. | |
const std::string | Aqua::getRootPath () |
Get the root path. | |
const std::string | Aqua::getFolderFromFilePath (const std::string file_path) |
Gets the folder path which contains the file <strong class=. | |
const std::string | Aqua::getFileNameFromFilePath (const std::string file_path) |
Gets the file name of the path <strong class=. | |
const std::string | Aqua::getExtensionFromFilePath (const std::string file_path) |
Gets the file extension. | |
bool | Aqua::isFile (const std::string file_name) |
Check if the file <strong class= exist on the system. | |
bool | Aqua::isRelativePath (const std::string path) |
Check if the path <strong class= is a relative or an absolute one. | |
size_t | Aqua::getLocalWorkSize (cl_command_queue queue) |
Compute the maximum local work size allowed by a device. | |
size_t | Aqua::getGlobalWorkSize (size_t n, size_t local_work_size) |
Compute the global work size needed to compute <strong class= threads. | |
unsigned int | Aqua::numberOfDigits (unsigned int number) |
Get the number of digits of an integer decimal text representation. | |
void | Aqua::MPI::error_handler (MPI_Comm UNUSED_PARAM *comm, int *err,...) |
std::string | Aqua::MPI::error_str (int errorcode) |
Wrapper for MPI_Error_string() | |
void | Aqua::MPI::init (int *argc, char ***argv) |
Wrapper for MPI_Init() | |
void | Aqua::MPI::finalize () |
Wrapper for MPI_Finalize() | |
int | Aqua::MPI::rank (MPI_Comm comm) |
Wrapper for MPI_Comm_rank() | |
int | Aqua::MPI::size (MPI_Comm comm) |
Wrapper for MPI_Comm_size() | |
void | Aqua::MPI::barrier (MPI_Comm comm) |
Wrapper for MPI_Barrier() | |
void | Aqua::MPI::send (const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) |
Wrapper for MPI_Send() | |
MPI_Request | Aqua::MPI::isend (const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) |
Wrapper for MPI_Isend() | |
MPI_Status | Aqua::MPI::recv (void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm) |
Wrapper for MPI_Recv() | |
MPI_Request | Aqua::MPI::irecv (void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm) |
Wrapper for MPI_Irecv() | |
MPI_Status | Aqua::MPI::wait (MPI_Request *request) |
Wrapper for MPI_Wait() |
Set of auxiliar functions.