34#ifndef _SP_PAR_HELPER_H_
35#define _SP_PAR_HELPER_H_
44#include "psort/psort.h"
51 template <
typename IT>
55 template<
typename KEY,
typename VAL,
typename IT>
58 template<
typename KEY,
typename VAL,
typename IT>
68 template<
typename KEY,
typename VAL,
typename IT>
71 template<
typename KEY,
typename VAL,
typename IT>
74 template<
typename KEY,
typename VAL,
typename IT>
77 template<
typename IT,
typename NT,
typename DER>
80 template<
typename IT,
typename NT,
typename DER>
83 template<
typename IT,
typename NT,
typename DER>
86 template<
typename IT,
typename NT,
typename DER>
89 template<
typename IT,
typename NT,
typename DER>
92 template <
typename IT,
typename NT,
typename DER>
95 template <
typename IT,
typename DER>
98 template <
typename IT,
typename DER>
106 static void Print(
const std::string & s);
static void GatherMatrix(MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, int root)
static void FetchMatrix(SpMat< IT, NT, DER > &MRecv, const std::vector< IT > &essentials, std::vector< MPI_Win > &arrwin, int ownind)
static void Print(const std::string &s, MPI_Comm &world)
static void DebugPrintKeys(std::pair< KEY, VAL > *array, IT length, IT *dist, MPI_Comm &World)
static void LockWindows(int ownind, std::vector< MPI_Win > &arrwin)
static void check_newline(int *bytes_read, int bytes_requested, char *buf)
static void StartAccessEpoch(int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group)
static void WaitNFree(std::vector< MPI_Win > &arrwin)
static void PrintFile(const std::string &s, const std::string &filename, MPI_Comm &world)
static void GetSetSizes(const SpMat< IT, NT, DER > &Matrix, IT **&sizes, MPI_Comm &comm1d)
static void BipartiteSwap(std::pair< KEY, VAL > *low, std::pair< KEY, VAL > *array, IT length, int nfirsthalf, int color, const MPI_Comm &comm)
static void Print(const std::string &s)
static void AccessNFetch(DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
static void FreeWindows(std::vector< MPI_Win > &arrwin)
static void LockNFetch(DER *&Matrix, int owner, std::vector< MPI_Win > &arrwin, MPI_Group &group, IT **sizes)
static bool FetchBatch(MPI_File &infile, MPI_Offset &curpos, MPI_Offset end_fpos, bool firstcall, std::vector< std::string > &lines, int myrank)
static void UnlockWindows(int ownind, std::vector< MPI_Win > &arrwin)
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)
static void PrintFile(const std::string &s, const std::string &filename)
static void MemoryEfficientPSort(std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
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)
static std::vector< std::pair< KEY, VAL > > KeyValuePSort(std::pair< KEY, VAL > *array, IT length, IT *dist, const MPI_Comm &comm)
static void SetWindows(MPI_Comm &comm1d, const SpMat< IT, NT, DER > &Matrix, std::vector< MPI_Win > &arrwin)
static void PostExposureEpoch(int self, std::vector< MPI_Win > &arrwin, MPI_Group &group)
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)
static void BCastMatrix(MPI_Comm &comm1d, SpMat< IT, NT, DER > &Matrix, const std::vector< IT > &essentials, int root)