/usr/include/paraview/vtkMaterialInterfacePieceTransactionMatrix.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile$
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkMaterialInterfacePieceTransactionMatrix
// .SECTION Description
// Container to hold a sets of transactions (sends/recvs)
// indexed by fragment and proc, inteneded to facilitiate
// moving fragment peices around.
//
// Internaly we have a 2D matrix. On one axis is fragment id
// on the other is proc id.
//
// Transaction are intended to execute in fragment order
// so that no deadlocks occur.
#ifndef vtkMaterialInterfacePieceTransactionMatrix_h
#define vtkMaterialInterfacePieceTransactionMatrix_h
#include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
#include "vtkMaterialInterfacePieceTransaction.h" //
#include "vtkType.h" //
#include <vector> //
class vtkCommunicator;
class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkMaterialInterfacePieceTransactionMatrix
{
public:
// Description:
// Set the object to an un-initialized state.
vtkMaterialInterfacePieceTransactionMatrix();
// Description:
// Allocate internal resources and set the object
// to an initialized state.
vtkMaterialInterfacePieceTransactionMatrix(int nFragments, int nProcs);
// Description:
// Free allocated resources and leave the object in an
// un-initialized state.
~vtkMaterialInterfacePieceTransactionMatrix();
void Initialize(int nProcs, int nFragments);
// Description:
// Free allocated resources and leave the object in an
// un-initialized state.
void Clear();
// Description:
// Get the number of transaction a given process will
// execute.
vtkIdType GetNumberOfTransactions(int procId);
// Description:
// Given a proc and a fragment, return a ref to
// the associated list of tranactions.
std::vector<vtkMaterialInterfacePieceTransaction> &GetTransactions(
int fragmentId,
int procId);
// Description:
// Add a transaction to the end of the given a proc,fragment pair's
// transaction list.
void PushTransaction(
int fragmentId,
int procId,
vtkMaterialInterfacePieceTransaction &transaction);
// Description:
// Send the transaction matrix on srcProc to all
// other procs.
void Broadcast(vtkCommunicator *comm, int srcProc);
//
void Print();
// Description:
// Tells how much memory the matrix has allocated.
vtkIdType Capacity()
{
return this->FlatMatrixSize
+ this->NumberOfTransactions*sizeof(vtkMaterialInterfacePieceTransaction);
}
private:
// Description:
// Put the matrix into a buffer for communication.
// returns size of the buffer in ints. The buffer
// will be allocated, and is expected to be null
// on entry.
vtkIdType Pack(int *&buffer);
// Description:
// Put a set of rows into a buffer for communication.
// This is used to send a subset of the TM.
vtkIdType PackPartial(int *&buffer, int *rows, int nRows);
// Description:
// Load state from a buffer containing a Pack'ed
// transaction matrix. 0 is returned on error.
int UnPack(int *buffer);
int UnPackPartial(int *buffer);
///
int NProcs;
int NFragments;
std::vector<vtkMaterialInterfacePieceTransaction> *Matrix;
vtkIdType FlatMatrixSize;
vtkIdType NumberOfTransactions;
};
//
inline
std::vector<vtkMaterialInterfacePieceTransaction> &
vtkMaterialInterfacePieceTransactionMatrix::GetTransactions(
int fragmentId,
int procId)
{
int idx=fragmentId+procId*this->NFragments;
return this->Matrix[idx];
}
//
inline
vtkIdType
vtkMaterialInterfacePieceTransactionMatrix::GetNumberOfTransactions(
int procId)
{
size_t nTransactions = 0;
for (int fragmentId=0; fragmentId<this->NFragments; ++fragmentId)
{
nTransactions+=this->GetTransactions(fragmentId,procId).size();
}
return static_cast<vtkIdType>(nTransactions);
}
#endif
// VTK-HeaderTest-Exclude: vtkMaterialInterfacePieceTransactionMatrix.h
|