44 #ifndef EPETRA_MPICOMM_H
45 #define EPETRA_MPICOMM_H
47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
49 #warning "The Epetra package is deprecated"
63 #ifdef EPETRA_HAVE_OMP
129 int Broadcast(
double * MyVals,
int Count,
int Root)
const;
143 int Broadcast(
int * MyVals,
int Count,
int Root)
const;
157 int Broadcast(
long * MyVals,
int Count,
int Root)
const;
171 int Broadcast(
long long * MyVals,
int Count,
int Root)
const;
185 int Broadcast(
char * MyVals,
int Count,
int Root)
const;
201 int GatherAll(
double * MyVals,
double * AllVals,
int Count)
const;
214 int GatherAll(
int * MyVals,
int * AllVals,
int Count)
const;
227 int GatherAll(
long * MyVals,
long * AllVals,
int Count)
const;
240 int GatherAll(
long long * MyVals,
long long * AllVals,
int Count)
const;
257 int SumAll(
double * PartialSums,
double * GlobalSums,
int Count)
const;
270 int SumAll(
int * PartialSums,
int * GlobalSums,
int Count)
const;
283 int SumAll(
long * PartialSums,
long * GlobalSums,
int Count)
const;
296 int SumAll(
long long * PartialSums,
long long * GlobalSums,
int Count)
const;
312 int MaxAll(
double * PartialMaxs,
double * GlobalMaxs,
int Count)
const;
325 int MaxAll(
int * PartialMaxs,
int * GlobalMaxs,
int Count)
const;
338 int MaxAll(
long * PartialMaxs,
long * GlobalMaxs,
int Count)
const;
351 int MaxAll(
long long * PartialMaxs,
long long * GlobalMaxs,
int Count)
const;
364 int MinAll(
double * PartialMins,
double * GlobalMins,
int Count)
const;
377 int MinAll(
int * PartialMins,
int * GlobalMins,
int Count)
const;
390 int MinAll(
long * PartialMins,
long * GlobalMins,
int Count)
const;
403 int MinAll(
long long * PartialMins,
long long * GlobalMins,
int Count)
const;
419 int ScanSum(
double * MyVals,
double * ScanSums,
int Count)
const;
432 int ScanSum(
int * MyVals,
int * ScanSums,
int Count)
const;
445 int ScanSum(
long * MyVals,
long * ScanSums,
int Count)
const;
458 int ScanSum(
long long * MyVals,
long long * ScanSums,
int Count)
const;
465 MPI_Comm
Comm()
const {
return(MpiCommData_->Comm_);};
471 int MyPID()
const {
return(MpiCommData_->rank_);};
477 int NumProc()
const {
return(MpiCommData_->size_);};
486 #ifdef CreateDirectory
487 #undef CreateDirectory
494 int GetMpiTag()
const {
int tag = MpiCommData_->curTag_++;
if (tag > MpiCommData_->maxTag_) tag = MpiCommData_->minTag_;
return(tag);};
502 inline void Print(std::ostream & os)
const {
504 #ifdef EPETRA_HAVE_OMP
507 int numThreads = omp_get_num_threads();
508 int threadNum = omp_get_thread_num();
510 os <<
"\n Thread/TotalThreads " << threadNum <<
"/" << numThreads <<
" on Processor/TotalProcs "
514 os <<
"::Processor "<<
MyPID()<<
" of " <<
NumProc() <<
" total processors.";
539 int CheckInput(
double * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
540 int CheckInput(
int * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
541 int CheckInput(
long * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
542 int CheckInput(
char * ptr,
int count)
const {
if ((ptr==0) && (count>0))
return(-1);
return(0);};
543 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.