Muesli
 All Classes Namespaces Files Functions Typedefs Enumerations
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
muesli.h File Reference

Contains global definitions such as macros, functions, enums and classes, and constants in order to configure Muesli. More...

#include <mpi.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <limits>
#include <omp.h>
#include <sstream>
#include <cstdarg>
#include <vector>
#include "exception.h"
#include "curry.h"
#include "conversion.h"
#include "timer.h"
#include "../src/muesli_com.cpp"

Go to the source code of this file.

Classes

class  msl::Muesli
 Class Muesli contains globally available variables that determine the properties (number of running processes, threads, etc.) of the Muesli application. More...
 

Namespaces

 msl
 Namespace msl is the main namespace of Muesli.
 

Typedefs

typedef int msl::ProcessorNo
 Typedef for process numbers.
 

Enumerations

enum  msl::Distribution { DIST, COPY }
 Enum Distribution to represent the distribution mode of distributed data structures. More...
 

Functions

void msl::initSkeletons (int argc, char **argv, bool debug_communication=0)
 Initializes Muesli. Needs to be called before any skeleton is used.
 
void msl::terminateSkeletons ()
 Terminates Muesli. Needs to be called at the end of a Muesli application.
 
void msl::printv (const char *format,...)
 Wrapper for printf. Only process with id 0 prints the given format string.
 
void msl::setNumThreads (int num_threads)
 Sets the number of CPU threads. More...
 
void msl::setNumRuns (int num_runs)
 Sets the number of runs for a benchmark application. More...
 
void msl::setNumGpus (int num_gpus)
 Sets the number of GPUs to be used by each process. More...
 
void msl::setThreadsPerBlock (int threads_per_block)
 Sets the number of threads per (one dimensional) block. Note that threads_per_block <= 1024. More...
 
void msl::setThreadsPerBlock (int tpbX, int tpbY)
 Sets the number of threads per (two dimensional) block. Note that tpbX * tpbY <= 1024. More...
 
void msl::setNumConcurrentKernels (int num_kernels)
 Sets the number of concurrent kernels per GPU. Only for the farm skeleton. More...
 
void msl::setTaskGroupSize (int size)
 Sets the task group size (i.e. size of sets to be processed) for the heterogeneous farm skeleton. More...
 
void msl::syncStreams ()
 Synchronizes the CUDA streams.
 
void msl::startTiming ()
 Starts timing.
 
void msl::splitTime (int run)
 Prints the time elapsed since last split time.
 
double msl::stopTiming ()
 Ends timing. More...
 
bool msl::isRootProcess ()
 Checks whether this is process with id 0. More...
 
void msl::setFarmStatistics (bool val)
 Switches on or off (depending on the value of val) collecting farm statistics.
 
MSL_USERFUNC size_t msl::getUniqueID ()
 Returns a unique thread id. More...
 
template<typename T >
msl::getNegativeInfinity ()
 Returns the value which represents the negative infinity for the given type T. In case the given type has no representation for infinity, the minimum value is returned. More...
 
template<typename T >
msl::getPositiveInfinity ()
 Returns the value which represents the positive infinity for the given type T. In case the given type has no representation for infinity, the maximum value is returned. More...
 
void msl::MSL_SendTag (int destination, int tag)
 Sends a message without content. Mainly used for control messages such as stop messages. More...
 
void msl::MSL_ReceiveTag (int source, int tag)
 Receives a message without content. Mainly used for control messages such as stop messages. More...
 
template<typename T >
void msl::MSL_Send (int destination, T *send_buffer, size_t size, int tag=MYTAG)
 Sends a buffer of type T to process destination. More...
 
template<typename T >
void msl::MSL_ISend (int destination, T *send_buffer, MPI_Request &req, size_t size, int tag=MYTAG)
 Sends (non-blocking) a buffer of type T to process destination. More...
 
template<typename T >
void msl::MSL_Recv (int source, T *recv_buffer, size_t size, int tag=MYTAG)
 Receives a buffer of type T from process source. More...
 
template<typename T >
void msl::MSL_Recv (int source, T *recv_buffer, MPI_Status &stat, size_t size, int tag=MYTAG)
 Receives a buffer of type T from process source. More...
 
template<typename T >
void msl::MSL_IRecv (int source, T *recv_buffer, MPI_Request &req, size_t size, int tag=MYTAG)
 Receives (non-blockig) a buffer of type T from process source. More...
 
template<typename T >
void msl::MSL_SendReceive (int destination, T *send_buffer, T *recv_buffer, size_t size=1)
 
template<typename T >
void msl::broadcast (T *buffer, int *const ids, int np, int idRoot, size_t count)
 Implementation of the MPI_Broadcast routine. Only the processes in ids participate. More...
 
template<typename T >
void msl::allgather (T *send_buffer, T *recv_buffer, int *const ids, int np, size_t count)
 Implementation of the MPI_Allgather routine. Only the processes in ȩm ids participate. More...
 
template<typename T >
void msl::allgather (T *send_buffer, T *recv_buffer, size_t count)
 Wrapper for the MPI_Allgather routine. Every process in MPI_COMM WORLD participates. More...
 
template<typename T >
void msl::MSL_Broadcast (int source, T *buffer, int size)
 Wrapper for the MPI_Broadcast routine. Every process in MPI_COMM WORLD participates. More...
 
template<typename T >
void msl::MSL_Send (int destination, std::vector< T > &send_buffer, int tag=MYTAG)
 Sends a std::vector of type T to process destination. More...
 
template<typename T >
void msl::MSL_Recv (int source, std::vector< T > &recv_buffer, int tag=MYTAG)
 Receives a std::vector of type T from process source. More...
 
void msl::fail_exit ()
 Used to quit the program on failure, must be used after initSkeletons()
 
void msl::throws (const detail::Exception &e)
 Throws an Exception. More...
 
template<typename C1 , typename C2 >
C1 msl::proj1_2 (C1 a, C2 b)
 
template<typename C1 , typename C2 >
C2 msl::proj2_2 (C1 a, C2 b)
 
template<typename F >
int msl::auxRotateRows (const Fct1< int, int, F > &f, int blocks, int row, int col)
 
template<typename F >
int msl::auxRotateCols (const Fct1< int, int, F > &f, int blocks, int row, int col)
 
template<typename T >
void msl::show (T *a, int size)
 

Detailed Description

Contains global definitions such as macros, functions, enums and classes, and constants in order to configure Muesli.