FasTensor  1.0.0
Transform Supercomputing for AI
Macros | Functions
ft_mpi.h File Reference
#include <ctime>
#include <iostream>
#include "ft_merge.h"
#include "mpi.h"

Go to the source code of this file.

Macros

#define ENABLE_MPI   1
 
#define MPI_COMM_TYPE   MPI_Comm
 
#define AU_WTIME_TYPE   double
 
#define AU_WTIME   MPI_Wtime()
 
#define MPI_COMM_WORLD_DEFAULT   MPI_COMM_WORLD
 
#define MPI_INFO_NULL_DEFAULT   MPI_INFO_NULL
 
#define AU_MPI_Datatype   MPI_Datatype
 
#define AU_MPI_Op   MPI_Op
 
#define MPI_INIT(argc, argv, au_mpi_comm_global, au_mpi_rank_global, au_mpi_size_global)
 
#define MPI_FINALIZE()
 
#define AU_Reduce(local_buffer_p, reduced_buffer_p, size, type, op, root, comm)
 
#define AU_Bcast(data_bffer_p, count_p, datatype_p, root_p, comm_p)
 

Functions

template<typename T >
MPI_Datatype InferMPIType ()
 
MPI_Op InferMPIMergeOp (std::string &opt_str)
 
template<typename T >
void MPIReduceStats (const T local_value, std::vector< T > &stats_vector)
 get max/min/sum of local_value More...
 

Macro Definition Documentation

◆ AU_Bcast

#define AU_Bcast (   data_bffer_p,
  count_p,
  datatype_p,
  root_p,
  comm_p 
)
Value:
{ \
MPI_Bcast(data_bffer_p, count_p, datatype_p, root_p, comm_p); \
}

◆ AU_MPI_Datatype

#define AU_MPI_Datatype   MPI_Datatype

◆ AU_MPI_Op

#define AU_MPI_Op   MPI_Op

◆ AU_Reduce

#define AU_Reduce (   local_buffer_p,
  reduced_buffer_p,
  size,
  type,
  op,
  root,
  comm 
)
Value:
{ \
MPI_Reduce(local_buffer_p, reduced_buffer_p, size, type, op, root, comm); \
}

◆ AU_WTIME

#define AU_WTIME   MPI_Wtime()

◆ AU_WTIME_TYPE

#define AU_WTIME_TYPE   double

◆ ENABLE_MPI

#define ENABLE_MPI   1

Author: Bin Dong dbin@.nosp@m.lbl..nosp@m.gov Web: https://crd.lbl.gov/bin-dong Scientific Data Management Research Group Lawrence Berkeley National Laboratory

◆ MPI_COMM_TYPE

#define MPI_COMM_TYPE   MPI_Comm

◆ MPI_COMM_WORLD_DEFAULT

#define MPI_COMM_WORLD_DEFAULT   MPI_COMM_WORLD

◆ MPI_FINALIZE

#define MPI_FINALIZE ( )
Value:
{ \
int mpi_finalize_flag = 0; \
MPI_Finalized(&mpi_finalize_flag); \
if (!mpi_finalize_flag) \
{ \
MPI_Finalize(); \
} \
}

◆ MPI_INFO_NULL_DEFAULT

#define MPI_INFO_NULL_DEFAULT   MPI_INFO_NULL

◆ MPI_INIT

#define MPI_INIT (   argc,
  argv,
  au_mpi_comm_global,
  au_mpi_rank_global,
  au_mpi_size_global 
)
Value:
{ \
int mpi_init_flag = 0; \
MPI_Initialized(&mpi_init_flag); \
if (!mpi_init_flag) \
{ \
MPI_Init(&argc, &argv); \
} \
MPI_Comm_rank(au_mpi_comm_global, &au_mpi_rank_global); \
MPI_Comm_size(au_mpi_comm_global, &au_mpi_size_global); \
}
MPI_COMM_TYPE au_mpi_comm_global

Function Documentation

◆ InferMPIMergeOp()

MPI_Op InferMPIMergeOp ( std::string &  opt_str)
inline

◆ InferMPIType()

template<typename T >
MPI_Datatype InferMPIType ( )
inline

◆ MPIReduceStats()

template<typename T >
void MPIReduceStats ( const T  local_value,
std::vector< T > &  stats_vector 
)
inline

get max/min/sum of local_value

Template Parameters
T
Parameters
local_value: input value
stats_vector: stats result: max, min, sum