AQUAgpusph 4.1.2
|
Exception raised when the user manually interrupts the simulation. More...
#include <CalcServer.h>
Public Member Functions | |
CalcServer (const Aqua::InputOutput::ProblemSetup &sim_data) | |
Constructor. | |
~CalcServer () | |
Destructor. | |
void | update (InputOutput::TimeManager &t_manager) |
Internal time loop. | |
void | setup () |
Setup some additional simulation data. | |
InputOutput::Variables * | variables () |
std::vector< std::string > | definitions () const |
std::vector< Tool * > | tools () const |
cl_context | context () const |
cl_platform_id | platform () const |
cl_device_id | device () const |
cl_command_queue | command_queue (bool parallel=false) const |
cl_event | getUnsortedMem (const std::string var_name, size_t offset, size_t cb, void *ptr) |
Download a unsorted variable from the device. | |
const std::string | base_path () const |
Get the AQUAgpusph root path. | |
bool | debug_mode () const |
Report if the tools debug mode is enabled. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Aqua::Singleton< Aqua::CalcServer::CalcServer > | |
static Aqua::CalcServer::CalcServer * | singleton () |
Returns the instance of the class. | |
Protected Member Functions inherited from Aqua::Singleton< Aqua::CalcServer::CalcServer > | |
Singleton () | |
Constructor. | |
virtual | ~Singleton () |
Destructor. | |
Exception raised when the user manually interrupts the simulation.
Entity that perform the main work of the simulation.
The target of this exception is handling the users interrumptions without returning back a core dump in the command line, which might be wrongly interpreted as an error.
In the Aqua::CalcServer::CalcServer a time subloop is performed where the SPH simulation is performed while no output files should be updated.
Aqua::CalcServer::CalcServer::CalcServer | ( | const Aqua::InputOutput::ProblemSetup & | sim_data | ) |
Constructor.
sim_data | Simulation data read from XML files |
Aqua::CalcServer::CalcServer::~CalcServer | ( | ) |
Destructor.
|
inline |
Get the AQUAgpusph root path.
|
inline |
Get the command queue
Two different command queues are available. Indeed, OpenCL specification allows to create the command queues with the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE option, which allows that a subsequent kernel/task execution begins before the preceding one has already finished. However, the specification does not allows, by any means, that a preceding kernel/task execution can be triggered after a subsequent one. Therefore, parallel tasks shall use a different queue to ensure the correct order within each queue
parallel | true if the command queue for task executed in parallel is queried, false otherwise |
|
inline |
Get the active context
|
inline |
Report if the tools debug mode is enabled.
|
inline |
Get the definitions registered.
|
inline |
Get the device
cl_event Aqua::CalcServer::CalcServer::getUnsortedMem | ( | const std::string | var_name, |
size_t | offset, | ||
size_t | cb, | ||
void * | ptr | ||
) |
Download a unsorted variable from the device.
var_name | Variable to unsort and download. |
offset | The offset in bytes in the memory object to read from. |
cb | The size in bytes of data being downloaded. |
ptr | The host memory where the data should be copied |
|
inline |
Get the platform
void Aqua::CalcServer::CalcServer::setup | ( | ) |
Setup some additional simulation data.
Even thought this work is associated with the constructor CalcServer(), when something may fail it is preferable to let it to a separated method that could report errors, allowing the program to deal with them.
|
inline |
Get the tools registered.
void Aqua::CalcServer::CalcServer::update | ( | InputOutput::TimeManager & | t_manager | ) |
Internal time loop.
Calculation server will be iterating while no output files should be updated (or even the simulation is finished).
t_manager | Time manager to let the calculation server when shall stop the internal loop. |
|
inline |
Get the variables manager