CoDiPack  2.3.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::TapeValues Struct Reference

Tape information that can be printed in a pretty print format or a table format. More...

#include <tapeValues.hpp>

Public Types

enum class  LocalReductionOperation { Sum , Max }
 

Public Member Functions

 TapeValues (std::string const &tapeName)
 Constructor.
 
Add data
void addDoubleEntry (std::string const &name, double const &value, LocalReductionOperation operation=LocalReductionOperation::Sum, bool usedMem=false, bool allocatedMem=false)
 Add double entry. If it is a memory entry, it should be in bytes.
 
void addLongEntry (std::string const &name, long const &value, LocalReductionOperation operation=LocalReductionOperation::Sum)
 Add long entry.
 
void addSection (std::string const &name)
 Add section. All further entries are added under this section.
 
void addUnsignedLongEntry (std::string const &name, unsigned long const &value, LocalReductionOperation operation=LocalReductionOperation::Sum)
 Add unsigned long entry.
 
Format data
template<typename Stream = std::ostream>
void formatDefault (Stream &out=std::cout) const
 Output in a human readable format. One row per entry.
 
template<typename Stream = std::ostream>
void formatHeader (Stream &out=std::cout) const
 Output the header for a table output.
 
template<typename Stream = std::ostream>
void formatRow (Stream &out=std::cout) const
 Output this data in one row. One entry per column.
 
Misc.
void combineData (TapeValues const &other)
 Perform entry-wise additions.
 
void combineData ()
 Perform an MPI_Allreduce with MPI_COMM_WORLD.
 
template<typename Comm >
void combineDataMPI (Comm communicator)
 Perform an MPI_Allreduce with the given communicator.
 
double getAllocatedMemorySize ()
 Get the allocated memory in bytes.
 
double getUsedMemorySize ()
 Get the used memory in bytes.
 

Detailed Description

Tape information that can be printed in a pretty print format or a table format.

This structure is generated for tapes with the ReverseTapeInterface::getTapeValues() function. The tape provides the information for all internal data structures and the user can then output this information for further analysis. To make the output as useful as possible, tapes should provide information about all DataInterface members, arrays, and IndexManagerInterface members.

  • Functions for adding data:
  • Format data:
    • formatDefault(): Default human readable format. One row per entry.
    • formatHeader(): Output the header for the table output.
    • formatRow(): Output the data in this object in one row. One column per entry.
  • Misc:
    • combineData(TapeVales const& other): Perform element-wise addition with other tape values.
    • combineData(): Deprecated. Kept for backwards compatibility. Perform an MPI_Allreduce on MPI_COMM_WORLD.
    • combineDataMPI(): Perform an MPI_Allreduce on a given communicator.
    • getAllocatedMemorySize(): Get the allocated memory size.
    • getUsedMemorySize(): Get the used memory size.

Member Function Documentation

◆ combineData()

void codi::TapeValues::combineData ( )
inline

Perform an MPI_Allreduce with MPI_COMM_WORLD.

This method is deprecated and only kept for backwards compatibility. combineDataMPI should be used instead.


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