Utilities::System Namespace Reference
[Utility functions and classes]


Classes

class  MPI_InitFinalize

Functions

double get_cpu_load ()
std::string get_hostname ()
std::string get_time ()
bool job_supports_mpi ()
unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator)
unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator)
std::vector< unsigned intcompute_point_to_point_communication_pattern (const MPI_Comm &mpi_comm, const std::vector< unsigned int > &destinations)
MPI_Comm duplicate_communicator (const MPI_Comm &mpi_communicator)
bool program_uses_mpi ()


Detailed Description

A namespace for utility functions that probe system properties.

Function Documentation

double Utilities::System::get_cpu_load (  ) 

Return the CPU load as returned by "uptime". Note that the interpretation of this number depends on the actual number of processors in the machine. This is presently only implemented on Linux, using the /proc/loadavg pseudo-file, on other systems we simply return zero.

std::string Utilities::System::get_hostname (  ) 

Return the name of the host this process runs on.

std::string Utilities::System::get_time (  ) 

Return the present time as HH:MM:SS.

bool Utilities::System::job_supports_mpi (  ) 

Return whether (i) deal.II has been compiled to support MPI (for example by compiling with CXX=mpiCC) and if so whether (ii) MPI_Init() has been called (for example using the Utilities::System::MPI_InitFinalize class). In other words, the result indicates whether the current job is running under MPI.

unsigned int Utilities::System::get_n_mpi_processes ( const MPI_Comm &  mpi_communicator  ) 

Return the number of MPI processes there exist in the given communicator object. If this is a sequential job, it returns 1.

unsigned int Utilities::System::get_this_mpi_process ( const MPI_Comm &  mpi_communicator  ) 

Return the number of the present MPI process in the space of processes described by the given communicator. This will be a unique value for each process between zero and (less than) the number of all processes (given by get_n_mpi_processes()).

std::vector<unsigned int> Utilities::System::compute_point_to_point_communication_pattern ( const MPI_Comm &  mpi_comm,
const std::vector< unsigned int > &  destinations 
)

Consider an unstructured communication pattern where every process in an MPI universe wants to send some data to a subset of the other processors. To do that, the other processors need to know who to expect messages from. This function computes this information.

Parameters:
mpi_comm A communicator that describes the processors that are going to communicate with each other.
destinations The list of processors the current process wants to send information to. This list need not be sorted in any way. If it contains duplicate entries that means that multiple messages are intended for a given destination.
Returns:
A list of processors that have indicated that they want to send something to the current processor. The resulting list is not sorted. It may contain duplicate entries if processors enter the same destination more than once in their destinations list.

MPI_Comm Utilities::System::duplicate_communicator ( const MPI_Comm &  mpi_communicator  ) 

Given a communicator, generate a new communicator that contains the same set of processors but that has a different, unique identifier.

This functionality can be used to ensure that different objects, such as distributed matrices, each have unique communicators over which they can interact without interfering with each other.

When no longer needed, the communicator created here needs to be destroyed using MPI_Comm_free.

bool Utilities::System::program_uses_mpi (  ) 

Returns whether deal.II has been configured to use MPI and if so whether MPI has already been initialized using MPI_Init().


deal.II documentation generated on Wed Jul 28 23:07:05 2010 by doxygen 1.5.6