Rosetta 3.4
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
protocols::wum::WorkUnitBase Class Reference

The base class for all work units. More...

#include <WorkUnitBase.hh>

Inheritance diagram for protocols::wum::WorkUnitBase:
Inheritance graph
[legend]
Collaboration diagram for protocols::wum::WorkUnitBase:
Collaboration graph
[legend]

List of all members.

Classes

struct  WU_Header
 this structure can contain any non-dynamicly allocated data. Any simple data types can be used here, ints, real, floats, char, etc.. More...

Public Member Functions

 WorkUnitBase ()
virtual ~WorkUnitBase ()
virtual
protocols::wum::WorkUnitBaseOP 
clone () const
virtual void clear_serial_data ()
 Remove all data, make sure that the memory is also cleared, hence the cals to reserve.
virtual void run ()
 Run the workunit - overloaded by children of this class.
void print (std::ostream &out, bool verbose=false) const
 Print header information to the stream, single line by default or verbose if verbose is set to true.
core::Size id ()
 Accessor to the ID of the WorkUnit.
core::Size extra_data_1 ()
 Accessor to the extra_data_1 and 3 field of the header.
core::Size extra_data_3 ()
void add_blacklist (int mpi_rank)
 Adds to the blacklist.
void clear_blacklist ()
 Erases the blacklist.
bool in_blacklist (int mpi_rank)
 Finds in blacklist, true if is, false if it isn't.
core::Size get_run_time ()
 Returns the differrence between unix start and stop times.
std::string get_wu_type () const
 Accessor to header structure, return the WorkUnit Type.
void set_wu_type (const std::string &text)
 Accessor to header structure, sets the WorkUnit Type.
std::string get_options () const
 Optain the options string from the header.
virtual core::Size mem_footprint () const
 Return the memory usage of this WorkUnit.
core::Size last_received_from ()

Protected Member Functions

virtual void serialize ()
 Make ready for sending.
virtual void deserialize ()
 Make ready for working - i.o.w. take information in serial_data_ and turn it into whatever real data the derivative class has.
virtual void create_unique_id ()
 Make a unique number out of Processor Number and unix timestamp ?
std::string & serial_data ()
 Accessor to the serial data field.
const std::string & serial_data () const
 Accessor to the serial data field.
void set_options (const std::string &text)
 Accesor to the "options" text field.
void set_run_start ()
 Set the unixtime of the start of the execution of this WorkUnit.
void set_run_stop ()
 Set the unixtime of the stop of the execution of this WorkUnit.

Protected Attributes

WU_Header header
 The header data.
core::Size last_received_from_
 Contains the serial number of whatever Rank/Node this WU was last receeived from.
std::vector< intblacklist_
 Contains blacklist of nodes. This data is NOT sent, and is only used on the sending side to determine where not to send a workunit.

Friends

class MPI_WorkUnitManager
class MPI_WorkUnitManager_Slave
class WorkUnitManager
class WorkUnitQueue

Detailed Description

The base class for all work units.


Constructor & Destructor Documentation

protocols::wum::WorkUnitBase::WorkUnitBase ( )
virtual protocols::wum::WorkUnitBase::~WorkUnitBase ( ) [inline, virtual]

Member Function Documentation

void protocols::wum::WorkUnitBase::add_blacklist ( int  mpi_rank)

Adds to the blacklist.

References blacklist_.

void protocols::wum::WorkUnitBase::clear_blacklist ( )

Erases the blacklist.

References blacklist_.

virtual void protocols::wum::WorkUnitBase::clear_serial_data ( ) [inline, virtual]

Remove all data, make sure that the memory is also cleared, hence the cals to reserve.

virtual protocols::wum::WorkUnitBaseOP protocols::wum::WorkUnitBase::clone ( ) const [inline, virtual]
virtual void protocols::wum::WorkUnitBase::create_unique_id ( ) [inline, protected, virtual]

Make a unique number out of Processor Number and unix timestamp ?

Referenced by WorkUnitBase().

virtual void protocols::wum::WorkUnitBase::deserialize ( ) [inline, protected, virtual]

Make ready for working - i.o.w. take information in serial_data_ and turn it into whatever real data the derivative class has.

Reimplemented in protocols::wum::DatabaseEntryWorkUnit, and protocols::wum::WorkUnit_SilentStructStore.

core::Size protocols::wum::WorkUnitBase::extra_data_1 ( ) [inline]

Accessor to the extra_data_1 and 3 field of the header.

References protocols::wum::WorkUnitBase::WU_Header::extra_data_1_, and header.

Referenced by protocols::loophash::MPI_LoopHashRefine_Master::process_inbound_wus().

core::Size protocols::wum::WorkUnitBase::extra_data_3 ( ) [inline]
std::string protocols::wum::WorkUnitBase::get_options ( ) const

Optain the options string from the header.

References header, and protocols::wum::WorkUnitBase::WU_Header::options_.

core::Size protocols::wum::WorkUnitBase::get_run_time ( )
std::string protocols::wum::WorkUnitBase::get_wu_type ( ) const
core::Size protocols::wum::WorkUnitBase::id ( ) [inline]

Accessor to the ID of the WorkUnit.

References header, and protocols::wum::WorkUnitBase::WU_Header::id_.

bool protocols::wum::WorkUnitBase::in_blacklist ( int  mpi_rank)

Finds in blacklist, true if is, false if it isn't.

References blacklist_, and protocols::wum::mpi_rank().

core::Size protocols::wum::WorkUnitBase::last_received_from ( ) [inline]
virtual core::Size protocols::wum::WorkUnitBase::mem_footprint ( ) const [inline, virtual]

Return the memory usage of this WorkUnit.

References serial_data().

void protocols::wum::WorkUnitBase::print ( std::ostream &  out,
bool  verbose = false 
) const
void protocols::wum::WorkUnitBase::run ( ) [virtual]
std::string& protocols::wum::WorkUnitBase::serial_data ( ) [inline, protected]
const std::string& protocols::wum::WorkUnitBase::serial_data ( ) const [inline, protected]

Accessor to the serial data field.

virtual void protocols::wum::WorkUnitBase::serialize ( ) [inline, protected, virtual]
void protocols::wum::WorkUnitBase::set_options ( const std::string &  text) [protected]

Accesor to the "options" text field.

References header, and protocols::wum::WorkUnitBase::WU_Header::options_.

Referenced by WorkUnitBase().

void protocols::wum::WorkUnitBase::set_run_start ( ) [protected]

Set the unixtime of the start of the execution of this WorkUnit.

References header, and protocols::wum::WorkUnitBase::WU_Header::unixtime_start_.

void protocols::wum::WorkUnitBase::set_run_stop ( ) [protected]

Set the unixtime of the stop of the execution of this WorkUnit.

References header, and protocols::wum::WorkUnitBase::WU_Header::unixtime_stop_.

void protocols::wum::WorkUnitBase::set_wu_type ( const std::string &  text)

Accessor to header structure, sets the WorkUnit Type.

References header, and protocols::wum::WorkUnitBase::WU_Header::wu_type_.

Referenced by WorkUnitBase().


Friends And Related Function Documentation

friend class MPI_WorkUnitManager [friend]
friend class MPI_WorkUnitManager_Slave [friend]
friend class WorkUnitManager [friend]
friend class WorkUnitQueue [friend]

Member Data Documentation

std::vector< int > protocols::wum::WorkUnitBase::blacklist_ [protected]

Contains blacklist of nodes. This data is NOT sent, and is only used on the sending side to determine where not to send a workunit.

Referenced by add_blacklist(), clear_blacklist(), and in_blacklist().

Contains the serial number of whatever Rank/Node this WU was last receeived from.

Referenced by last_received_from(), and WorkUnitBase().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines