YAKL
Public Member Functions | List of all members
yakl::SimplePNetCDF Class Reference

Simple way to write yakl::Array objects to NetCDF files in parallel. More...

#include <YAKL_pnetcdf.h>

Public Member Functions

 SimplePNetCDF ()
 
 ~SimplePNetCDF ()
 
void begin_indep_data ()
 Begin independent data writing mode (non-collective data writing) More...
 
void close ()
 Close a file. More...
 
void create (std::string fname, int flag=-1)
 Create a file with an optional flag parameter. More...
 
void create_dim (std::string dimName, MPI_Offset len)
 Create a dimension with the given size. More...
 
void create_unlim_dim (std::string dimName)
 Create an unlimited dimension. More...
 
template<class T >
void create_var (std::string varName, std::vector< std::string > dnames)
 Create a variable with the given dimension names. More...
 
bool dim_exists (std::string dimName) const
 Determine if a dimension exists. More...
 
void end_indep_data ()
 End independent data writing mode (non-collective data writing) More...
 
void enddef ()
 End "define mode". More...
 
int get_dim_id (std::string dimName) const
 Get dimension ID of a dimension name. More...
 
MPI_Offset get_dim_size (std::string dimName) const
 Get the size of a dimension name. More...
 
int get_var_id (std::string varName) const
 Get variable ID of a variable name. More...
 
void open (std::string fname)
 Open a file. More...
 
bool var_exists (std::string varName) const
 Determine if a variable exists. More...
 
template<class T , int rank, int myMem, int myStyle>
void write (Array< T, rank, myMem, myStyle > const &arr, std::string varName)
 Serially write an entire Array at once. More...
 
template<class T , int rank, int myMem, int myStyle>
void write1 (Array< T, rank, myMem, myStyle > const &arr, std::string varName, int ind, std::string ulDimName="unlim")
 Serially write one entry of an Array into the unlimited index. More...
 
template<class T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0>
void write1 (T val, std::string varName, int ind, std::string ulDimName="unlim")
 Serially write one entry of a scalar into the unlimited index. More...
 
template<class T , int rank, int myMem, int myStyle>
void write1_all (Array< T, rank, myMem, myStyle > const &arr, std::string varName, int ind, std::vector< MPI_Offset > start_in, std::string ulDimName="unlim")
 Collectively write one entry of an Array into the unlimited index. More...
 
template<class T , int rank, int myMem, int myStyle>
void write_all (Array< T, rank, myMem, myStyle > const &arr, std::string varName, std::vector< MPI_Offset > start)
 Collectively write an entire Array at once. More...
 

Detailed Description

Simple way to write yakl::Array objects to NetCDF files in parallel.

Constructor & Destructor Documentation

◆ SimplePNetCDF()

yakl::SimplePNetCDF::SimplePNetCDF ( )
inline

◆ ~SimplePNetCDF()

yakl::SimplePNetCDF::~SimplePNetCDF ( )
inline

Member Function Documentation

◆ begin_indep_data()

void yakl::SimplePNetCDF::begin_indep_data ( )
inline

Begin independent data writing mode (non-collective data writing)

◆ close()

void yakl::SimplePNetCDF::close ( )
inline

Close a file.

◆ create()

void yakl::SimplePNetCDF::create ( std::string  fname,
int  flag = -1 
)
inline

Create a file with an optional flag parameter.

◆ create_dim()

void yakl::SimplePNetCDF::create_dim ( std::string  dimName,
MPI_Offset  len 
)
inline

Create a dimension with the given size.

◆ create_unlim_dim()

void yakl::SimplePNetCDF::create_unlim_dim ( std::string  dimName)
inline

Create an unlimited dimension.

◆ create_var()

template<class T >
void yakl::SimplePNetCDF::create_var ( std::string  varName,
std::vector< std::string >  dnames 
)
inline

Create a variable with the given dimension names.

◆ dim_exists()

bool yakl::SimplePNetCDF::dim_exists ( std::string  dimName) const
inline

Determine if a dimension exists.

◆ end_indep_data()

void yakl::SimplePNetCDF::end_indep_data ( )
inline

End independent data writing mode (non-collective data writing)

◆ enddef()

void yakl::SimplePNetCDF::enddef ( )
inline

End "define mode".

◆ get_dim_id()

int yakl::SimplePNetCDF::get_dim_id ( std::string  dimName) const
inline

Get dimension ID of a dimension name.

◆ get_dim_size()

MPI_Offset yakl::SimplePNetCDF::get_dim_size ( std::string  dimName) const
inline

Get the size of a dimension name.

◆ get_var_id()

int yakl::SimplePNetCDF::get_var_id ( std::string  varName) const
inline

Get variable ID of a variable name.

◆ open()

void yakl::SimplePNetCDF::open ( std::string  fname)
inline

Open a file.

◆ var_exists()

bool yakl::SimplePNetCDF::var_exists ( std::string  varName) const
inline

Determine if a variable exists.

◆ write()

template<class T , int rank, int myMem, int myStyle>
void yakl::SimplePNetCDF::write ( Array< T, rank, myMem, myStyle > const &  arr,
std::string  varName 
)
inline

Serially write an entire Array at once.

◆ write1() [1/2]

template<class T , int rank, int myMem, int myStyle>
void yakl::SimplePNetCDF::write1 ( Array< T, rank, myMem, myStyle > const &  arr,
std::string  varName,
int  ind,
std::string  ulDimName = "unlim" 
)
inline

Serially write one entry of an Array into the unlimited index.

◆ write1() [2/2]

template<class T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0>
void yakl::SimplePNetCDF::write1 ( val,
std::string  varName,
int  ind,
std::string  ulDimName = "unlim" 
)
inline

Serially write one entry of a scalar into the unlimited index.

◆ write1_all()

template<class T , int rank, int myMem, int myStyle>
void yakl::SimplePNetCDF::write1_all ( Array< T, rank, myMem, myStyle > const &  arr,
std::string  varName,
int  ind,
std::vector< MPI_Offset >  start_in,
std::string  ulDimName = "unlim" 
)
inline

Collectively write one entry of an Array into the unlimited index.

◆ write_all()

template<class T , int rank, int myMem, int myStyle>
void yakl::SimplePNetCDF::write_all ( Array< T, rank, myMem, myStyle > const &  arr,
std::string  varName,
std::vector< MPI_Offset >  start 
)
inline

Collectively write an entire Array at once.


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