AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Aqua::CalcServer::Reports::SetTabFile Class Reference

Particles set runtime output. More...

#include <SetTabFile.hpp>

Inheritance diagram for Aqua::CalcServer::Reports::SetTabFile:
Collaboration diagram for Aqua::CalcServer::Reports::SetTabFile:

Public Member Functions

 SetTabFile (const std::string tool_name, const std::string fields, size_t first, size_t n, const std::string output_file, unsigned int ipf=1, float fps=0.f)
 Constructor.
 ~SetTabFile ()
 Destructor.
void setup ()
 Initialize the tool.
void print ()
Public Member Functions inherited from Aqua::CalcServer::Reports::Report
 Report (const std::string tool_name, const std::string fields, unsigned int ipf=1, float fps=0.f)
 Constructor.
virtual ~Report ()
 Destructor.
const std::string data (bool with_title=true, bool with_names=true, bool synced=false)
 Return the text string of the data to be printed.
cl_event getUserEvent () const
 Get the user event generated by this tool to mark when is finished.
void setUserEventStatus (cl_int status) const
 Set the user event status.
Public Member Functions inherited from Aqua::CalcServer::Tool
 Tool (const std::string tool_name, bool once=false)
virtual ~Tool ()
virtual void execute ()
 Execute the tool measuring the elapsed time.
virtual Toolnext_tool ()
Toolprev_tool () const
void prev_tool (Tool *tool)
size_t allocatedMemory () const
unsigned int used_times () const
void addElapsedTime (float elapsed_time)
 Add new data to the average and squared elapsed times.
float elapsedTime (bool averaged=true) const
float elapsedTimeVariance () const
float elapsedTimeDeviation () const
virtual int scope_modifier () const
std::vector< InputOutput::Variable * > getInputDependencies () const
 Get the input depedencies of the tool.
std::vector< InputOutput::Variable * > getOutputDependencies () const
 Get the output depedencies of the tool.
std::tuple< std::vector< InputOutput::Variable * >, std::vector< InputOutput::Variable * > > getDependencies () const
 Get the depedencies of the tool.
cl_event getEvent () const
 Get the tool event.
void parent (Tool *tool)
 Set the tool parent.
Toolparent ()
 Get the tool parent.
Public Member Functions inherited from Aqua::CalcServer::Named
 Named (const std::string name)
 ~Named ()
void name (const std::string tool_name)
const std::string name () const
 Get the name.
Public Member Functions inherited from Aqua::CalcServer::Profiler
 Profiler ()
 ~Profiler ()
std::vector< Profile * > substages () const
 Get the substages.

Protected Member Functions

cl_event _execute (const std::vector< cl_event > events)
ulvec2 bounds ()
 Get the particle index bounds of the "set of particles" managed by this class.
std::vector< cl_event > download (std::vector< InputOutput::Variable * > vars)
Protected Member Functions inherited from Aqua::CalcServer::Reports::Report
void processFields (const std::string fields)
 Compute the fields by lines.
std::vector< InputOutput::Variable * > variables ()
 Get the variables list.
bool mustUpdate ()
 Check if an output must be performed.
cl_event setCallback (const std::vector< cl_event > events, void(CL_CALLBACK *cb)(cl_event, cl_int, void *))
 Register a callback to be executed whenever it is possible.
Protected Member Functions inherited from Aqua::CalcServer::Tool
int id_in_pipeline () const
std::string varPrefix () const
 Produce a variable name prefix.
void next_tool (Tool *tool)
void allocatedMemory (size_t mem_size)
virtual cl_event _execute (const UNUSED_PARAM std::vector< cl_event > events)
void setDependencies (std::vector< std::string > inputs, std::vector< std::string > outputs)
 Set the depedencies of the tool.
void setDependencies (std::vector< InputOutput::Variable * > inputs, std::vector< InputOutput::Variable * > outputs)
 Set the depedencies of the tool.
void setDependencies (std::vector< std::string > vars)
 Set the depedencies of the tool.
void setInputDependencies (std::vector< std::string > vars)
 Set the reading depedencies of the tool.
void setInputDependencies (std::vector< InputOutput::Variable * > vars)
 Set the reading depedencies of the tool.
void setOutputDependencies (std::vector< std::string > vars)
 Set the writing depedencies of the tool.
void setOutputDependencies (std::vector< InputOutput::Variable * > vars)
 Set the writing depedencies of the tool.
void setDependencies (std::vector< InputOutput::Variable * > vars)
 Set the depedencies of the tool.
const std::vector< cl_event > getEvents (dep_events which=dep_events::all) const
 Get the list of events that this tool shall wait for.
Protected Member Functions inherited from Aqua::CalcServer::Profiler
void substages (std::vector< Profile * > instances)
 Set the tool substages.

Additional Inherited Members

Protected Types inherited from Aqua::CalcServer::Tool
enum  dep_events { in = 0x01 , out = 0x02 , all = 0x03 }
Static Protected Member Functions inherited from Aqua::CalcServer::Tool
static std::vector< cl_kernel > compile (const std::string source, const std::vector< std::string > names, const std::string flags="")
 Compile an OpenCL source code and generate the corresponding kernel.
static cl_kernel compile_kernel (const std::string source, const std::string kernel_name, const std::string flags="")
 Compile an OpenCL source code and generate the corresponding kernel.

Detailed Description

Particles set runtime output.

A runtime output is an output which is created during the code execution, featured by:

  1. Low amount of involved memory
  2. Relatively low computational cost Thus, it can be safely computed and printed quite often

This tool is printing the selected properties of a set of particles in a tabulated file with the following columns:

  • Time instant
  • First particle, first property
  • First particle, second property
  • ...
  • First particle, last property
  • Second particle, first property
  • ...
  • Second particle, last property
  • ...
  • Last particle, first property
  • ...
  • Last particle, last property

And therefore \( n_{prop} \cdot n_{parts} \) fields should be doownloaded and printed in plain text. Please, be extremely careful about the considered particles set and fields

Constructor & Destructor Documentation

◆ SetTabFile()

Aqua::CalcServer::Reports::SetTabFile::SetTabFile ( const std::string tool_name,
const std::string fields,
size_t first,
size_t n,
const std::string output_file,
unsigned int ipf = 1,
float fps = 0.f )

Constructor.

Parameters
tool_nameTool name
fieldsFields to be printed The fields are separated by commas or semicolons, and the spaces are just ignored. The semicolons will also force a line break in the report
firstFirst particle managed by this report (unsorted indexes)
nNumber of particles managed by this report (unsorted indexes)
output_fileFile to be written. Several scape strings can be used, as described in Aqua::newFilePath()
ipfIterations per frame, 0 to just ignore this printing criteria
fpsFrames per second, 0 to just ignore this printing criteria
Remarks
The output file will be cleared
Here is the call graph for this function:

◆ ~SetTabFile()

Aqua::CalcServer::Reports::SetTabFile::~SetTabFile ( )

Destructor.

Member Function Documentation

◆ _execute()

cl_event Aqua::CalcServer::Reports::SetTabFile::_execute ( const std::vector< cl_event > events)
protected

Execute the tool

Parameters
eventsList of events that shall be waited before safe execution
Returns
OpenCL event to be waited before accessing the dependencies
Here is the call graph for this function:

◆ bounds()

ulvec2 Aqua::CalcServer::Reports::SetTabFile::bounds ( )
inlineprotected

Get the particle index bounds of the "set of particles" managed by this class.

Returns
The index bounds (first and last particle).

◆ download()

std::vector< cl_event > Aqua::CalcServer::Reports::SetTabFile::download ( std::vector< InputOutput::Variable * > vars)
protected

Download the data from the device, and store it.

Parameters
varsFields to download.
Returns
The events to be waited before the data is available.
Note
The returned data must be manually freed.
Here is the call graph for this function:

◆ print()

void Aqua::CalcServer::Reports::SetTabFile::print ( )

Print the data on the tabulated file

Note
This function is public to let the OpenCL callback call it, but it is not meant to be used by regular users
Here is the call graph for this function:

◆ setup()

void Aqua::CalcServer::Reports::SetTabFile::setup ( )
virtual

Initialize the tool.

Reimplemented from Aqua::CalcServer::Reports::Report.

Here is the call graph for this function:

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