Epetra Package Browser (Single Doxygen Collection)
Development
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Epetra_SerialComm.h
Go to the documentation of this file.
1
/*
2
//@HEADER
3
// ************************************************************************
4
//
5
// Epetra: Linear Algebra Services Package
6
// Copyright 2011 Sandia Corporation
7
//
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
10
//
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
13
// met:
14
//
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
17
//
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
21
//
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
25
//
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39
//
40
// ************************************************************************
41
//@HEADER
42
*/
43
44
#ifndef EPETRA_SERIALCOMM_H
45
#define EPETRA_SERIALCOMM_H
46
47
#include "
Epetra_ConfigDefs.h
"
48
#include "
Epetra_Object.h
"
49
#include "
Epetra_Comm.h
"
50
#include "
Epetra_SerialCommData.h
"
51
#ifdef EPETRA_HAVE_OMP
52
#include <omp.h>
53
#endif
54
class
Epetra_Distributor
;
55
57
60
61
class
EPETRA_LIB_DLL_EXPORT
Epetra_SerialComm
:
public
Epetra_Object
,
public
virtual
Epetra_Comm
{
62
63
public
:
65
66
68
73
Epetra_SerialComm
();
74
75
77
79
Epetra_SerialComm
(
const
Epetra_SerialComm
& Comm);
80
82
Epetra_Comm
*
Clone
()
const
{
83
return
(
dynamic_cast<
Epetra_Comm
*
>
(
new
Epetra_SerialComm
(*
this
)));
84
};
85
87
92
virtual
~Epetra_SerialComm
();
94
96
97
100
void
Barrier()
const
;
102
104
105
116
117
int
Broadcast(
double
* MyVals,
int
Count,
int
Root)
const
;
118
120
130
131
int
Broadcast(
int
* MyVals,
int
Count,
int
Root)
const
;
132
134
144
145
int
Broadcast(
long
* MyVals,
int
Count,
int
Root)
const
;
146
148
158
159
int
Broadcast(
long
long
* MyVals,
int
Count,
int
Root)
const
;
160
162
172
173
int
Broadcast(
char
* MyVals,
int
Count,
int
Root)
const
;
175
177
178
187
188
int
GatherAll(
double
* MyVals,
double
* AllVals,
int
Count)
const
;
189
191
199
200
int
GatherAll(
int
* MyVals,
int
* AllVals,
int
Count)
const
;
201
203
211
212
int
GatherAll(
long
* MyVals,
long
* AllVals,
int
Count)
const
;
213
215
223
224
int
GatherAll(
long
long
* MyVals,
long
long
* AllVals,
int
Count)
const
;
226
228
229
239
240
int
SumAll(
double
* PartialSums,
double
* GlobalSums,
int
Count)
const
;
241
243
252
int
SumAll(
int
* PartialSums,
int
* GlobalSums,
int
Count)
const
;
253
255
264
int
SumAll(
long
* PartialSums,
long
* GlobalSums,
int
Count)
const
;
265
267
276
int
SumAll(
long
long
* PartialSums,
long
long
* GlobalSums,
int
Count)
const
;
278
280
281
291
int
MaxAll(
double
* PartialMaxs,
double
* GlobalMaxs,
int
Count)
const
;
292
294
303
int
MaxAll(
int
* PartialMaxs,
int
* GlobalMaxs,
int
Count)
const
;
304
306
315
int
MaxAll(
long
* PartialMaxs,
long
* GlobalMaxs,
int
Count)
const
;
316
318
327
int
MaxAll(
long
long
* PartialMaxs,
long
long
* GlobalMaxs,
int
Count)
const
;
328
330
339
int
MinAll(
double
* PartialMins,
double
* GlobalMins,
int
Count)
const
;
340
342
351
int
MinAll(
int
* PartialMins,
int
* GlobalMins,
int
Count)
const
;
352
354
363
int
MinAll(
long
* PartialMins,
long
* GlobalMins,
int
Count)
const
;
364
366
375
int
MinAll(
long
long
* PartialMins,
long
long
* GlobalMins,
int
Count)
const
;
377
379
380
389
int
ScanSum(
double
* MyVals,
double
* ScanSums,
int
Count)
const
;
390
392
400
int
ScanSum(
int
* MyVals,
int
* ScanSums,
int
Count)
const
;
401
403
411
int
ScanSum(
long
* MyVals,
long
* ScanSums,
int
Count)
const
;
412
414
422
int
ScanSum(
long
long
* MyVals,
long
long
* ScanSums,
int
Count)
const
;
424
426
427
429
432
int
MyPID
()
const
{
return
(
SerialCommData_
->MyPID_);};
433
435
int
NumProc
()
const
{
return
(
SerialCommData_
->NumProc_);};
436
438
440
441
442
Epetra_Distributor
* CreateDistributor()
const
;
444
// CreateDirectory is defined in Winbase.h as a macro!
445
#ifdef CreateDirectory
446
#undef CreateDirectory
447
#endif
448
Epetra_Directory
* CreateDirectory(
const
Epetra_BlockMap
& Map)
const
;
450
452
453
454
inline
void
Print
(std::ostream & os)
const
{
455
#ifdef EPETRA_HAVE_OMP
456
#pragma omp parallel
457
{
458
int
numThreads = omp_get_num_threads();
459
int
threadNum = omp_get_thread_num();
460
#pragma omp single
461
os <<
"::Processor "
<<
MyPID
()<<
" of "
<<
NumProc
() <<
" total processors."
;
462
#pragma omp critical
463
os <<
"\n Thread "
<< threadNum <<
" of "
<< numThreads <<
" total threads."
;
464
}
465
#else
466
os <<
"::Processor "
<<
MyPID
()<<
" of "
<<
NumProc
() <<
" total processors."
;
467
#endif
468
469
return
;
470
}
471
472
void
PrintInfo
(std::ostream & os)
const
{
473
Epetra_SerialComm::Print
(os);
474
return
;
475
};
476
477
479
480
482
483
int
ReferenceCount()
const
;
484
486
487
const
Epetra_SerialCommData
*
DataPtr
()
const
{
return
(
SerialCommData_
);};
488
490
492
Epetra_SerialComm
& operator=(
const
Epetra_SerialComm
& Comm);
493
494
private
:
495
496
void
CleanupData();
497
Epetra_SerialCommData
*
SerialCommData_
;
498
499
};
500
#endif
/* EPETRA_SERIALCOMM_H */
Epetra_Comm.h
Epetra_ConfigDefs.h
Epetra_Object.h
Epetra_SerialCommData.h
Epetra_BlockMap
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Definition
Epetra_BlockMap.h:194
Epetra_Comm
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition
Epetra_Comm.h:73
Epetra_Directory
Epetra_Directory: This class is a pure virtual class whose interface allows Epetra_Map and Epetr_Bloc...
Definition
Epetra_Directory.h:59
Epetra_Distributor
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
Definition
Epetra_Distributor.h:61
Epetra_Object::Epetra_Object
Epetra_Object(int TracebackModeIn=-1, bool set_label=true)
Epetra_Object Constructor.
Definition
Epetra_Object.cpp:50
Epetra_SerialCommData
Epetra_SerialCommData: The Epetra Serial Communication Data Class.
Definition
Epetra_SerialCommData.h:55
Epetra_SerialComm
Epetra_SerialComm: The Epetra Serial Communication Class.
Definition
Epetra_SerialComm.h:61
Epetra_SerialComm::PrintInfo
void PrintInfo(std::ostream &os) const
Print method that implements Epetra_Comm virtual PrintInfo method.
Definition
Epetra_SerialComm.h:472
Epetra_SerialComm::SerialCommData_
Epetra_SerialCommData * SerialCommData_
Definition
Epetra_SerialComm.h:497
Epetra_SerialComm::MyPID
int MyPID() const
Return my process ID.
Definition
Epetra_SerialComm.h:432
Epetra_SerialComm::Print
void Print(std::ostream &os) const
Print method that implements Epetra_Object virtual Print method.
Definition
Epetra_SerialComm.h:454
Epetra_SerialComm::Clone
Epetra_Comm * Clone() const
Clone method.
Definition
Epetra_SerialComm.h:82
Epetra_SerialComm::Epetra_SerialComm
Epetra_SerialComm()
Epetra_SerialComm Serial Constructor.
Definition
Epetra_SerialComm.cpp:48
Epetra_SerialComm::DataPtr
const Epetra_SerialCommData * DataPtr() const
Returns a pointer to the SerialCommData instance this SerialComm uses.
Definition
Epetra_SerialComm.h:487
Epetra_SerialComm::NumProc
int NumProc() const
Returns total number of processes (always returns 1 for SerialComm).
Definition
Epetra_SerialComm.h:435
Generated by
1.18.0