COMBINATORIAL_BLAS 1.6
Loading...
Searching...
No Matches
combblas::SpParHelper Class Reference

#include <SpParHelper.h>

Static Public Member Functions

template<typename IT>
static void ReDistributeToVector (int *&map_scnt, std::vector< std::vector< IT > > &locs_send, std::vector< std::vector< std::string > > &data_send, std::vector< std::array< char, MAXVERTNAME > > &distmapper_array, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void GlobalSelect (IT gl_rank, std::pair< KEY, VAL > *&low, std::pair< KEY, VAL > *&upp, std::pair< KEY, VAL > *array, IT length, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void BipartiteSwap (std::pair< KEY, VAL > *low, std::pair< KEY, VAL > *array, IT length, int nfirsthalf, int color, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void MemoryEfficientPSort (std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static std::vector< std::pair< KEY, VAL > > KeyValuePSort (std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void DebugPrintKeys (std::pair< KEY, VAL > *array, IT length, IT *dist, MPI_Comm &World)
template<typename IT, typename NT, typename DER>
static void FetchMatrix (SpMat< IT, NT, DER > &MRecv, const std::vector< IT > &essentials, std::vector< MPI_Win > &arrwin, int ownind)
template<typename IT, typename NT, typename DER>
static void BCastMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, const std::vector< IT > &essentials, int root)
template<typename IT, typename NT, typename DER>
static void IBCastMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, const std::vector< IT > &essentials, int root, std::vector< MPI_Request > &indarrayReq, std::vector< MPI_Request > &numarrayReq)
template<typename IT, typename NT, typename DER>
static void GatherMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, int root)
template<typename IT, typename NT, typename DER>
static void SetWindows (MPI_Comm &comm1d, const SpMat< IT, NT, DER > &Matrix, std::vector< MPI_Win > &arrwin)
template<typename IT, typename NT, typename DER>
static void GetSetSizes (const SpMat< IT, NT, DER > &Matrix, IT **&sizes, MPI_Comm &comm1d)
template<typename IT, typename DER>
static void AccessNFetch (DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
template<typename IT, typename DER>
static void LockNFetch (DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
static void StartAccessEpoch (int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group)
static void PostExposureEpoch (int self, std::vector< MPI_Win > &arrwin, MPI_Group &group)
static void LockWindows (int ownind, std::vector< MPI_Win > &arrwin)
static void UnlockWindows (int ownind, std::vector< MPI_Win > &arrwin)
static void Print (const std::string &s)
static void Print (const std::string &s, MPI_Comm &world)
static void PrintFile (const std::string &s, const std::string &filename)
static void PrintFile (const std::string &s, const std::string &filename, MPI_Comm &world)
static void check_newline (int *bytes_read, int bytes_requested, char *buf)
static bool FetchBatch (MPI_File &infile, MPI_Offset &curpos, MPI_Offset end_fpos, bool firstcall, std::vector< std::string > &lines, int myrank)
static void WaitNFree (std::vector< MPI_Win > &arrwin)
static void FreeWindows (std::vector< MPI_Win > &arrwin)
template<typename IT>
static void ReDistributeToVector (int *&map_scnt, std::vector< std::vector< IT > > &locs_send, std::vector< std::vector< std::string > > &data_send, std::vector< std::array< char, MAXVERTNAME > > &distmapper_array, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void GlobalSelect (IT gl_rank, std::pair< KEY, VAL > *&low, std::pair< KEY, VAL > *&upp, std::pair< KEY, VAL > *array, IT length, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void BipartiteSwap (std::pair< KEY, VAL > *low, std::pair< KEY, VAL > *array, IT length, int nfirsthalf, int color, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void MemoryEfficientPSort (std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static std::vector< std::pair< KEY, VAL > > KeyValuePSort (std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
template<typename KEY, typename VAL, typename IT>
static void DebugPrintKeys (std::pair< KEY, VAL > *array, IT length, IT *dist, MPI_Comm &World)
template<typename IT, typename NT, typename DER>
static void FetchMatrix (SpMat< IT, NT, DER > &MRecv, const std::vector< IT > &essentials, std::vector< MPI_Win > &arrwin, int ownind)
template<typename IT, typename NT, typename DER>
static void BCastMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, const std::vector< IT > &essentials, int root)
template<typename IT, typename NT, typename DER>
static void IBCastMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, const std::vector< IT > &essentials, int root, std::vector< MPI_Request > &indarrayReq, std::vector< MPI_Request > &numarrayReq)
template<typename IT, typename NT, typename DER>
static void GatherMatrix (MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, int root)
template<typename IT, typename NT, typename DER>
static void SetWindows (MPI_Comm &comm1d, const SpMat< IT, NT, DER > &Matrix, std::vector< MPI_Win > &arrwin)
template<typename IT, typename NT, typename DER>
static void GetSetSizes (const SpMat< IT, NT, DER > &Matrix, IT **&sizes, MPI_Comm &comm1d)
template<typename IT, typename DER>
static void AccessNFetch (DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
template<typename IT, typename DER>
static void LockNFetch (DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
static void StartAccessEpoch (int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group)
static void PostExposureEpoch (int self, std::vector< MPI_Win > &arrwin, MPI_Group &group)
static void LockWindows (int ownind, std::vector< MPI_Win > &arrwin)
static void UnlockWindows (int ownind, std::vector< MPI_Win > &arrwin)
static void Print (const std::string &s)
static void Print (const std::string &s, MPI_Comm &world)
static void PrintFile (const std::string &s, const std::string &filename)
static void PrintFile (const std::string &s, const std::string &filename, MPI_Comm &world)
static void check_newline (int *bytes_read, int bytes_requested, char *buf)
static bool FetchBatch (MPI_File &infile, MPI_Offset &curpos, MPI_Offset end_fpos, bool firstcall, std::vector< std::string > &lines, int myrank)
static void WaitNFree (std::vector< MPI_Win > &arrwin)
static void FreeWindows (std::vector< MPI_Win > &arrwin)

Detailed Description

Definition at line 48 of file SpParHelper.h.

Member Function Documentation

◆ AccessNFetch() [1/2]

template<class IT, class DER>
void combblas::SpParHelper::AccessNFetch ( DER *& Matrix,
int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group,
IT ** sizes )
static

Definition at line 767 of file SpParHelper.cpp.

◆ AccessNFetch() [2/2]

template<typename IT, typename DER>
void combblas::SpParHelper::AccessNFetch ( DER *& Matrix,
int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group,
IT ** sizes )
static

◆ BCastMatrix() [1/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::BCastMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
const std::vector< IT > & essentials,
int root )
static
Parameters
[in]Matrix{For the root processor, the local object to be sent to all others. For all others, it is a (yet) empty object to be filled by the received data}
[in]essentials{irrelevant for the root}

Definition at line 583 of file SpParHelper.cpp.

◆ BCastMatrix() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::BCastMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
const std::vector< IT > & essentials,
int root )
static

◆ BipartiteSwap() [1/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::BipartiteSwap ( std::pair< KEY, VAL > * low,
std::pair< KEY, VAL > * array,
IT length,
int nfirsthalf,
int color,
const MPI_Comm & comm )
static

Definition at line 397 of file SpParHelper.cpp.

◆ BipartiteSwap() [2/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::BipartiteSwap ( std::pair< KEY, VAL > * low,
std::pair< KEY, VAL > * array,
IT length,
int nfirsthalf,
int color,
const MPI_Comm & comm )
static

◆ check_newline() [1/2]

void combblas::SpParHelper::check_newline ( int * bytes_read,
int bytes_requested,
char * buf )
inlinestatic

Definition at line 857 of file SpParHelper.cpp.

◆ check_newline() [2/2]

void combblas::SpParHelper::check_newline ( int * bytes_read,
int bytes_requested,
char * buf )
static

◆ DebugPrintKeys() [1/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::DebugPrintKeys ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
MPI_Comm & World )
static

Definition at line 492 of file SpParHelper.cpp.

◆ DebugPrintKeys() [2/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::DebugPrintKeys ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
MPI_Comm & World )
static

◆ FetchBatch() [1/2]

bool combblas::SpParHelper::FetchBatch ( MPI_File & infile,
MPI_Offset & curpos,
MPI_Offset end_fpos,
bool firstcall,
std::vector< std::string > & lines,
int myrank )
inlinestatic

Definition at line 871 of file SpParHelper.cpp.

◆ FetchBatch() [2/2]

bool combblas::SpParHelper::FetchBatch ( MPI_File & infile,
MPI_Offset & curpos,
MPI_Offset end_fpos,
bool firstcall,
std::vector< std::string > & lines,
int myrank )
static

◆ FetchMatrix() [1/2]

template<class IT, class NT, class DER>
void combblas::SpParHelper::FetchMatrix ( SpMat< IT, NT, DER > & MRecv,
const std::vector< IT > & essentials,
std::vector< MPI_Win > & arrwin,
int ownind )
static
Parameters
[in,out]MRecv{an already existing, but empty SpMat<...> object}
[in]essentials{carries essential information (i.e. required array sizes) about ARecv}
[in]arrwin{windows array of size equal to the number of built-in arrays in the SpMat data structure}
[in]ownind{processor index (within this processor row/column) of the owner of the matrix to be received}
Remarks
{The communicator information is implicitly contained in the MPI::Win objects}

Definition at line 552 of file SpParHelper.cpp.

◆ FetchMatrix() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::FetchMatrix ( SpMat< IT, NT, DER > & MRecv,
const std::vector< IT > & essentials,
std::vector< MPI_Win > & arrwin,
int ownind )
static

◆ FreeWindows() [1/2]

void combblas::SpParHelper::FreeWindows ( std::vector< MPI_Win > & arrwin)
inlinestatic

Definition at line 945 of file SpParHelper.cpp.

◆ FreeWindows() [2/2]

void combblas::SpParHelper::FreeWindows ( std::vector< MPI_Win > & arrwin)
static

◆ GatherMatrix() [1/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::GatherMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
int root )
static

Just a test function to see the time to gather a matrix on an MPI process The ultimate object would be to create the whole matrix on rank 0 (TODO)

Parameters
[in]Matrix{For the root processor, the local object to be sent to all others. For all others, it is a (yet) empty object to be filled by the received data}
[in]essentials{irrelevant for the root}

Definition at line 637 of file SpParHelper.cpp.

◆ GatherMatrix() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::GatherMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
int root )
static

◆ GetSetSizes() [1/2]

template<class IT, class NT, class DER>
void combblas::SpParHelper::GetSetSizes ( const SpMat< IT, NT, DER > & Matrix,
IT **& sizes,
MPI_Comm & comm1d )
static
Parameters
[in]sizes2D array where sizes[i] is an array of size r/s representing the ith essential component of all local blocks within that row/col sizes[i][j] is the size of the ith essential component of the jth local block within this row/col

Definition at line 798 of file SpParHelper.cpp.

◆ GetSetSizes() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::GetSetSizes ( const SpMat< IT, NT, DER > & Matrix,
IT **& sizes,
MPI_Comm & comm1d )
static

◆ GlobalSelect() [1/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::GlobalSelect ( IT gl_rank,
std::pair< KEY, VAL > *& low,
std::pair< KEY, VAL > *& upp,
std::pair< KEY, VAL > * array,
IT length,
const MPI_Comm & comm )
static

Definition at line 279 of file SpParHelper.cpp.

◆ GlobalSelect() [2/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::GlobalSelect ( IT gl_rank,
std::pair< KEY, VAL > *& low,
std::pair< KEY, VAL > *& upp,
std::pair< KEY, VAL > * array,
IT length,
const MPI_Comm & comm )
static

◆ IBCastMatrix() [1/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::IBCastMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
const std::vector< IT > & essentials,
int root,
std::vector< MPI_Request > & indarrayReq,
std::vector< MPI_Request > & numarrayReq )
static
Parameters
[in]Matrix{For the root processor, the local object to be sent to all others. For all others, it is a (yet) empty object to be filled by the received data}
[in]essentials{irrelevant for the root}

Definition at line 609 of file SpParHelper.cpp.

◆ IBCastMatrix() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::IBCastMatrix ( MPI_Comm & comm1d,
SpMat< IT, NT, DER > & Matrix,
const std::vector< IT > & essentials,
int root,
std::vector< MPI_Request > & indarrayReq,
std::vector< MPI_Request > & numarrayReq )
static

◆ KeyValuePSort() [1/2]

template<typename KEY, typename VAL, typename IT>
std::vector< std::pair< KEY, VAL > > combblas::SpParHelper::KeyValuePSort ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
const MPI_Comm & comm )
static

Definition at line 198 of file SpParHelper.cpp.

◆ KeyValuePSort() [2/2]

template<typename KEY, typename VAL, typename IT>
std::vector< std::pair< KEY, VAL > > combblas::SpParHelper::KeyValuePSort ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
const MPI_Comm & comm )
static

◆ LockNFetch() [1/2]

template<class IT, class DER>
void combblas::SpParHelper::LockNFetch ( DER *& Matrix,
int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group,
IT ** sizes )
static

Definition at line 780 of file SpParHelper.cpp.

◆ LockNFetch() [2/2]

template<typename IT, typename DER>
void combblas::SpParHelper::LockNFetch ( DER *& Matrix,
int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group,
IT ** sizes )
static

◆ LockWindows() [1/2]

void combblas::SpParHelper::LockWindows ( int ownind,
std::vector< MPI_Win > & arrwin )
inlinestatic

Definition at line 719 of file SpParHelper.cpp.

◆ LockWindows() [2/2]

void combblas::SpParHelper::LockWindows ( int ownind,
std::vector< MPI_Win > & arrwin )
static

◆ MemoryEfficientPSort() [1/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::MemoryEfficientPSort ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
const MPI_Comm & comm )
static

Definition at line 103 of file SpParHelper.cpp.

◆ MemoryEfficientPSort() [2/2]

template<typename KEY, typename VAL, typename IT>
void combblas::SpParHelper::MemoryEfficientPSort ( std::pair< KEY, VAL > * array,
IT length,
IT * dist,
const MPI_Comm & comm )
static

◆ PostExposureEpoch() [1/2]

void combblas::SpParHelper::PostExposureEpoch ( int self,
std::vector< MPI_Win > & arrwin,
MPI_Group & group )
inlinestatic
Parameters
[in]self{rank of "this" processor to be excluded when starting the exposure epoch}

Definition at line 759 of file SpParHelper.cpp.

◆ PostExposureEpoch() [2/2]

void combblas::SpParHelper::PostExposureEpoch ( int self,
std::vector< MPI_Win > & arrwin,
MPI_Group & group )
static

◆ Print() [1/4]

void combblas::SpParHelper::Print ( const std::string & s)
inlinestatic

Definition at line 836 of file SpParHelper.cpp.

◆ Print() [2/4]

void combblas::SpParHelper::Print ( const std::string & s)
static

◆ Print() [3/4]

void combblas::SpParHelper::Print ( const std::string & s,
MPI_Comm & world )
inlinestatic

Definition at line 846 of file SpParHelper.cpp.

◆ Print() [4/4]

void combblas::SpParHelper::Print ( const std::string & s,
MPI_Comm & world )
static

◆ PrintFile() [1/4]

void combblas::SpParHelper::PrintFile ( const std::string & s,
const std::string & filename )
inlinestatic

Definition at line 811 of file SpParHelper.cpp.

◆ PrintFile() [2/4]

void combblas::SpParHelper::PrintFile ( const std::string & s,
const std::string & filename )
static

◆ PrintFile() [3/4]

void combblas::SpParHelper::PrintFile ( const std::string & s,
const std::string & filename,
MPI_Comm & world )
inlinestatic

Definition at line 823 of file SpParHelper.cpp.

◆ PrintFile() [4/4]

void combblas::SpParHelper::PrintFile ( const std::string & s,
const std::string & filename,
MPI_Comm & world )
static

◆ ReDistributeToVector() [1/2]

template<typename IT>
void combblas::SpParHelper::ReDistributeToVector ( int *& map_scnt,
std::vector< std::vector< IT > > & locs_send,
std::vector< std::vector< std::string > > & data_send,
std::vector< std::array< char, MAXVERTNAME > > & distmapper_array,
const MPI_Comm & comm )
static

Definition at line 35 of file SpParHelper.cpp.

◆ ReDistributeToVector() [2/2]

template<typename IT>
void combblas::SpParHelper::ReDistributeToVector ( int *& map_scnt,
std::vector< std::vector< IT > > & locs_send,
std::vector< std::vector< std::string > > & data_send,
std::vector< std::array< char, MAXVERTNAME > > & distmapper_array,
const MPI_Comm & comm )
static

◆ SetWindows() [1/2]

template<class IT, class NT, class DER>
void combblas::SpParHelper::SetWindows ( MPI_Comm & comm1d,
const SpMat< IT, NT, DER > & Matrix,
std::vector< MPI_Win > & arrwin )
static

Definition at line 695 of file SpParHelper.cpp.

◆ SetWindows() [2/2]

template<typename IT, typename NT, typename DER>
void combblas::SpParHelper::SetWindows ( MPI_Comm & comm1d,
const SpMat< IT, NT, DER > & Matrix,
std::vector< MPI_Win > & arrwin )
static

◆ StartAccessEpoch() [1/2]

void combblas::SpParHelper::StartAccessEpoch ( int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group )
inlinestatic
Parameters
[in]owner{target processor rank within the processor group}
[in]arrwin{start access epoch only to owner's arrwin (-windows) }

Definition at line 740 of file SpParHelper.cpp.

◆ StartAccessEpoch() [2/2]

void combblas::SpParHelper::StartAccessEpoch ( int owner,
std::vector< MPI_Win > & arrwin,
MPI_Group & group )
static

◆ UnlockWindows() [1/2]

void combblas::SpParHelper::UnlockWindows ( int ownind,
std::vector< MPI_Win > & arrwin )
inlinestatic

Definition at line 727 of file SpParHelper.cpp.

◆ UnlockWindows() [2/2]

void combblas::SpParHelper::UnlockWindows ( int ownind,
std::vector< MPI_Win > & arrwin )
static

◆ WaitNFree() [1/2]

void combblas::SpParHelper::WaitNFree ( std::vector< MPI_Win > & arrwin)
inlinestatic

Definition at line 933 of file SpParHelper.cpp.

◆ WaitNFree() [2/2]

void combblas::SpParHelper::WaitNFree ( std::vector< MPI_Win > & arrwin)
static

The documentation for this class was generated from the following files: