Skip to content
Snippets Groups Projects
Commit 95652f60 authored by Oliver Bock's avatar Oliver Bock
Browse files

Preparations to read/parse project preferences (XML)

parent aae8ed8b
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,11 @@ BOINCClientAdapter::BOINCClientAdapter(string sharedMemoryIdentifier) ...@@ -25,6 +25,11 @@ BOINCClientAdapter::BOINCClientAdapter(string sharedMemoryIdentifier)
m_Initialized = false; m_Initialized = false;
m_SharedMemoryAreaIdentifier = sharedMemoryIdentifier; m_SharedMemoryAreaIdentifier = sharedMemoryIdentifier;
m_SharedMemoryAreaAvailable = false; m_SharedMemoryAreaAvailable = false;
m_GraphicsFrameRate = 20;
m_GraphicsQualitySetting = BOINCClientAdapter::LowGraphicsQualitySetting;
m_GraphicsWindowWidth = 800;
m_GraphicsWindowHeight = 600;
} }
BOINCClientAdapter::~BOINCClientAdapter() BOINCClientAdapter::~BOINCClientAdapter()
...@@ -35,6 +40,7 @@ void BOINCClientAdapter::initialize() ...@@ -35,6 +40,7 @@ void BOINCClientAdapter::initialize()
{ {
readUserInfo(); readUserInfo();
readSharedMemoryArea(); readSharedMemoryArea();
readProjectPreferences();
m_Initialized = true; m_Initialized = true;
} }
...@@ -48,7 +54,8 @@ void BOINCClientAdapter::refresh() ...@@ -48,7 +54,8 @@ void BOINCClientAdapter::refresh()
/// \todo Check that we're still watching our own WU (or science app)! /// \todo Check that we're still watching our own WU (or science app)!
} }
else { else {
cerr << "The BOINC Client Adapter has not yet been initialized!"; cerr << "The BOINC Client Adapter has not yet been initialized! Doing so now...";
initialize();
} }
} }
...@@ -82,6 +89,11 @@ void BOINCClientAdapter::readSharedMemoryArea() ...@@ -82,6 +89,11 @@ void BOINCClientAdapter::readSharedMemoryArea()
} }
} }
void BOINCClientAdapter::readProjectPreferences()
{
}
string BOINCClientAdapter::applicationInformation() const string BOINCClientAdapter::applicationInformation() const
{ {
return m_SharedMemoryAreaContents; return m_SharedMemoryAreaContents;
...@@ -95,26 +107,22 @@ string BOINCClientAdapter::projectInformation() const ...@@ -95,26 +107,22 @@ string BOINCClientAdapter::projectInformation() const
int BOINCClientAdapter::graphicsFrameRate() const int BOINCClientAdapter::graphicsFrameRate() const
{ {
// TODO: parse projectInformation() when available return m_GraphicsFrameRate;
return 20;
} }
BOINCClientAdapter::GraphicsQualitySetting BOINCClientAdapter::graphicsQualitySetting() const BOINCClientAdapter::GraphicsQualitySetting BOINCClientAdapter::graphicsQualitySetting() const
{ {
// TODO: parse projectInformation() when available return m_GraphicsQualitySetting;
return BOINCClientAdapter::LowGraphicsQualitySetting;
} }
int BOINCClientAdapter::graphicsWindowWidth() const int BOINCClientAdapter::graphicsWindowWidth() const
{ {
// TODO: parse projectInformation() when available return m_GraphicsWindowWidth;
return 800;
} }
int BOINCClientAdapter::graphicsWindowHeight() const int BOINCClientAdapter::graphicsWindowHeight() const
{ {
// TODO: parse projectInformation() when available return m_GraphicsWindowHeight;
return 600;
} }
string BOINCClientAdapter::coreVersion() const string BOINCClientAdapter::coreVersion() const
......
...@@ -162,9 +162,45 @@ public: ...@@ -162,9 +162,45 @@ public:
*/ */
string wuName() const; string wuName() const;
/**
* \brief Retrieves the estimated number of floating-point operations to complete the currently active work unit.
*
* An estimate of the average number of floating-point operations (FPOPS) required to complete the computation.
* This is used to estimate how long the computation will take on a given host.
*
* \return The estimated number of FPOPS to complete the currently active work unit
*/
double wuFPOpsEstimated() const; double wuFPOpsEstimated() const;
/**
* \brief Retrieves the maximum number of floating-point operations allowed for the currently active work unit.
*
* A bound on the number of floating-point operations (FPOPS) required to complete the computation.
* If this bound is exceeded, the application will be aborted.
*
* \return The maximum number of FPOPS allowed for the currently active work unit
*/
double wuFPOpsBound() const; double wuFPOpsBound() const;
/**
* \brief Retrieves an estimate of application's largest working set size.
*
* An estimate of application's largest working set size.
* The workunit will only be sent to hosts with at least this much available RAM.
*
* \return The estimate of application's largest working set size
*/
double wuMemoryBound() const; double wuMemoryBound() const;
/**
* \brief Retrieves the maximum disk space allowed to be used by the application.
*
* A bound on the maximum disk space used by the application, including all input, temporary, and output files.
* The workunit will only be sent to hosts with at least this much available disk space.
* If this bound is exceeded, the application will be aborted.
*
* \return The maximum disk space allowed to be used by the application
*/
double wuDiskBound() const; double wuDiskBound() const;
/** /**
...@@ -296,6 +332,20 @@ private: ...@@ -296,6 +332,20 @@ private:
*/ */
void readSharedMemoryArea(); void readSharedMemoryArea();
/**
* \brief Parse the project-specific preferences (XML)
*
* The project-specific preferences are retrieved by projectInformation().
* This method parses the XML string returned and populates the respective data members.
*
* \see projectInformation()
* \see m_GraphicsFrameRate
* \see m_GraphicsQualitySetting
* \see m_GraphicsWindowWidth
* \see m_GraphicsWindowHeight
*/
void readProjectPreferences();
/// State flag which indicates whether the adapter instance is ready to be used /// State flag which indicates whether the adapter instance is ready to be used
bool m_Initialized; bool m_Initialized;
...@@ -311,6 +361,18 @@ private: ...@@ -311,6 +361,18 @@ private:
/// Flag to indicate whether the shared memory area is available or not /// Flag to indicate whether the shared memory area is available or not
bool m_SharedMemoryAreaAvailable; bool m_SharedMemoryAreaAvailable;
/// Frame rate at which the project's graphics application should be rendered
int m_GraphicsFrameRate;
/// Quality setting at which the project's graphics application should be rendered
GraphicsQualitySetting m_GraphicsQualitySetting;
/// Initial window width when running in windowed mode
int m_GraphicsWindowWidth;
/// Initial window height when running in windowed mode
int m_GraphicsWindowHeight;
/** /**
* \brief Information structure returned by the BOINC client API. * \brief Information structure returned by the BOINC client API.
* *
......
...@@ -59,6 +59,8 @@ void EinsteinRadioAdapter::parseApplicationInformation() ...@@ -59,6 +59,8 @@ void EinsteinRadioAdapter::parseApplicationInformation()
if(info.length() > 0) { if(info.length() > 0) {
string temp; string temp;
// TODO: SAX-style xmlReader could be an alternative to this (wrt performance)!
// parse data into members // parse data into members
m_xmlIFace->setXmlDocument(info, "http://einstein.phys.uwm.edu"); m_xmlIFace->setXmlDocument(info, "http://einstein.phys.uwm.edu");
temp = m_xmlIFace->getSingleNodeContentByXPath("/graphics_info/skypos_rac"); temp = m_xmlIFace->getSingleNodeContentByXPath("/graphics_info/skypos_rac");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment