MPI_mgparc
Functions
debugd.cpp File Reference
#include <iostream>
#include <mpi.h>

Functions

int ReadIn ()
 
void DebugD (const int n, const double x[])
 
void DebugI (const int n, const int x[])
 
int CheckI (const int n, const int x[])
 

Function Documentation

int CheckI ( const int  n,
const int  x[] 
)

Checks whether the entries of a global integer vector are consistent over all processors. If not then a message with the approprate indices and values is displayed.

Parameters
[in]nnumber of elements of vector x (of my process)
[in]xlocal vector (double) on my process
Returns
0/-1 consistent or not
void DebugD ( const int  n,
const double  x[] 
)

Reads a integer number with the rank of a process from the terminal and writes the elements of vector x of this process onto the terminal. This will be repeated while rank number is valid, i.e., -1 stops the loop.

Parameters
[in]nnumber of elements of vector x (of my process)
[in]xlocal vector (double) on my process
void DebugI ( const int  n,
const int  x[] 
)
int ReadIn ( )

Reads one integer from the terminal and broadcasts it to all processes.

Returns
a number read by root process 0 which is broadcasted to all processes