44 #ifndef EPETRA_MPICOMM_H
45 #define EPETRA_MPICOMM_H
55 #ifdef EPETRA_HAVE_OMP
121 int Broadcast(
double * MyVals,
int Count,
int Root)
const;
135 int Broadcast(
int * MyVals,
int Count,
int Root)
const;
149 int Broadcast(
long * MyVals,
int Count,
int Root)
const;
163 int Broadcast(
long long * MyVals,
int Count,
int Root)
const;
177 int Broadcast(
char * MyVals,
int Count,
int Root)
const;
193 int GatherAll(
double * MyVals,
double * AllVals,
int Count)
const;
206 int GatherAll(
int * MyVals,
int * AllVals,
int Count)
const;
219 int GatherAll(
long * MyVals,
long * AllVals,
int Count)
const;
232 int GatherAll(
long long * MyVals,
long long * AllVals,
int Count)
const;
249 int SumAll(
double * PartialSums,
double * GlobalSums,
int Count)
const;
262 int SumAll(
int * PartialSums,
int * GlobalSums,
int Count)
const;
275 int SumAll(
long * PartialSums,
long * GlobalSums,
int Count)
const;
288 int SumAll(
long long * PartialSums,
long long * GlobalSums,
int Count)
const;
304 int MaxAll(
double * PartialMaxs,
double * GlobalMaxs,
int Count)
const;
317 int MaxAll(
int * PartialMaxs,
int * GlobalMaxs,
int Count)
const;
330 int MaxAll(
long * PartialMaxs,
long * GlobalMaxs,
int Count)
const;
343 int MaxAll(
long long * PartialMaxs,
long long * GlobalMaxs,
int Count)
const;
356 int MinAll(
double * PartialMins,
double * GlobalMins,
int Count)
const;
369 int MinAll(
int * PartialMins,
int * GlobalMins,
int Count)
const;
382 int MinAll(
long * PartialMins,
long * GlobalMins,
int Count)
const;
395 int MinAll(
long long * PartialMins,
long long * GlobalMins,
int Count)
const;
411 int ScanSum(
double * MyVals,
double * ScanSums,
int Count)
const;
424 int ScanSum(
int * MyVals,
int * ScanSums,
int Count)
const;
437 int ScanSum(
long * MyVals,
long * ScanSums,
int Count)
const;
450 int ScanSum(
long long * MyVals,
long long * ScanSums,
int Count)
const;
457 MPI_Comm
Comm()
const {
return(MpiCommData_->Comm_);};
463 int MyPID()
const {
return(MpiCommData_->rank_);};
469 int NumProc()
const {
return(MpiCommData_->size_);};
482 int GetMpiTag()
const {
int tag = MpiCommData_->curTag_++;
if (tag > MpiCommData_->maxTag_) tag = MpiCommData_->minTag_;
return(tag);};
490 inline void Print(std::ostream & os)
const {
492 #ifdef EPETRA_HAVE_OMP
495 int numThreads = omp_get_num_threads();
496 int threadNum = omp_get_thread_num();
498 os <<
"\n Thread/TotalThreads " << threadNum <<
"/" << numThreads <<
" on Processor/TotalProcs "
502 os <<
"::Processor "<<
MyPID()<<
" of " <<
NumProc() <<
" total processors.";
527 int CheckInput(
double * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
528 int CheckInput(
int * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
529 int CheckInput(
long * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
530 int CheckInput(
char * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
531 int CheckInput(
long long * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
int CheckInput(double *ptr, int count) const
virtual void Print(std::ostream &os) const
Print object to an output stream Print method.
const Epetra_MpiCommData * DataPtr() const
Returns a pointer to the MpiCommData instance this MpiComm uses.
MPI_Comm GetMpiComm() const
Get the MPI Communicator (identical to Comm() method; used when we know we are MPI.
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
virtual int GatherAll(double *MyVals, double *AllVals, int Count) const =0
Epetra_Comm All Gather function.
Epetra_Comm * Clone() const
Clone method.
virtual Epetra_Directory * CreateDirectory(const Epetra_BlockMap &Map) const =0
Create a directory object for the given Epetra_BlockMap.
int NumProc() const
Returns total number of processes.
void Print(std::ostream &os) const
Print method that implements Epetra_Object virtual Print method.
int ReferenceCount() const
Returns the reference count of MpiCommData.
virtual int MinAll(double *PartialMins, double *GlobalMins, int Count) const =0
Epetra_Comm Global Min function.
Epetra_MpiComm: The Epetra MPI Communication Class.
virtual void Barrier() const =0
Epetra_Comm Barrier function.
virtual int MyPID() const =0
Return my process ID.
virtual int MaxAll(double *PartialMaxs, double *GlobalMaxs, int Count) const =0
Epetra_Comm Global Max function.
void PrintInfo(std::ostream &os) const
Print method that implements Epetra_Comm virtual PrintInfo method.
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const =0
Epetra_Comm Global Sum function.
Epetra_Directory: This class is a pure virtual class whose interface allows Epetra_Map and Epetr_Bloc...
Epetra_Comm: The Epetra Communication Abstract Base Class.
Epetra_Object & operator=(const Epetra_Object &src)
Epetra_Object: The base Epetra class.
Epetra_MpiCommData * MpiCommData_
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
MPI_Comm Comm() const
Extract MPI Communicator from a Epetra_MpiComm object.
virtual int Broadcast(double *MyVals, int Count, int Root) const =0
Epetra_Comm Broadcast function.
Epetra_MpiCommData: The Epetra Mpi Communication Data Class.
int CheckInput(long *ptr, int count) const
int CheckInput(long long *ptr, int count) const
virtual int NumProc() const =0
Returns total number of processes.
virtual Epetra_Distributor * CreateDistributor() const =0
Create a distributor object.
int CheckInput(int *ptr, int count) const
int CheckInput(char *ptr, int count) const
virtual int ScanSum(double *MyVals, double *ScanSums, int Count) const =0
Epetra_Comm Scan Sum function.
int MyPID() const
Return my process ID.