Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
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]

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. More...
 
virtual void run ()
 Run the workunit - overloaded by children of this class. More...
 
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. More...
 
core::Size id ()
 Accessor to the ID of the WorkUnit. More...
 
core::Size extra_data_1 ()
 Accessor to the extra_data_1 and 3 field of the header. More...
 
core::Size extra_data_3 ()
 
void add_blacklist (int mpi_rank)
 Adds to the blacklist. More...
 
void clear_blacklist ()
 Erases the blacklist. More...
 
bool in_blacklist (int mpi_rank)
 Finds in blacklist, true if is, false if it isn't. More...
 
core::Size get_run_time ()
 Returns the differrence between unix start and stop times. More...
 
std::string get_wu_type () const
 Accessor to header structure, return the WorkUnit Type. More...
 
void set_wu_type (const std::string &text)
 Accessor to header structure, sets the WorkUnit Type. More...
 
std::string get_options () const
 Optain the options string from the header. More...
 
virtual core::Size mem_footprint () const
 Return the memory usage of this WorkUnit. More...
 
core::Size last_received_from ()
 

Protected Member Functions

virtual void serialize ()
 Make ready for sending. More...
 
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. More...
 
virtual void create_unique_id ()
 Make a unique number out of Processor Number and unix timestamp ? More...
 
std::string & serial_data ()
 Accessor to the serial data field. More...
 
const std::string & serial_data () const
 Accessor to the serial data field. More...
 
void set_options (const std::string &text)
 Accesor to the "options" text field. More...
 
void set_run_start ()
 Set the unixtime of the start of the execution of this WorkUnit. More...
 
void set_run_stop ()
 Set the unixtime of the stop of the execution of this WorkUnit. More...
 

Protected Attributes

WU_Header header
 The header data. More...
 
core::Size last_received_from_
 Contains the serial number of whatever Rank/Node this WU was last receeived from. More...
 
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. More...
 

Private Member Functions

unsigned int raw_data_size () const
 
unsigned int raw_data_dump (unsigned char **raw_data_ptr) const
 This allocates and returns a pointer to a block of memory with the workunit data totally serialized. Note that it is that callers responsibility to call delete [] on this memory when they're done with it. More...
 
void raw_data_load (const unsigned char *raw_data_ptr, unsigned int size)
 Read in Header and serial data from a raw block of memeory, like one you'd get from a lowlevel network communication. More...
 

Private Attributes

std::string serial_data_
 Contains more data, such as decoys, silent structucts, .. whatever really. Must be serialized, i.e. in plain text form read for transmission. More...
 

Friends

class MPI_WorkUnitManager
 
class MPI_WorkUnitManager_Slave
 
class WorkUnitManager
 
class WorkUnitQueue
 

Detailed Description

The base class for all work units.

Definition at line 40 of file WorkUnitBase.hh.

Constructor & Destructor Documentation

protocols::wum::WorkUnitBase::WorkUnitBase ( )
virtual protocols::wum::WorkUnitBase::~WorkUnitBase ( )
inlinevirtual

Definition at line 49 of file WorkUnitBase.hh.

Member Function Documentation

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

Adds to the blacklist.

Definition at line 61 of file WorkUnitBase.cc.

References blacklist_.

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

Erases the blacklist.

Definition at line 65 of file WorkUnitBase.cc.

References blacklist_.

virtual void protocols::wum::WorkUnitBase::clear_serial_data ( )
inlinevirtual

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

Definition at line 56 of file WorkUnitBase.hh.

References serial_data_.

virtual protocols::wum::WorkUnitBaseOP protocols::wum::WorkUnitBase::clone ( ) const
inlinevirtual
virtual void protocols::wum::WorkUnitBase::create_unique_id ( )
inlineprotectedvirtual

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

Definition at line 93 of file WorkUnitBase.hh.

Referenced by WorkUnitBase().

virtual void protocols::wum::WorkUnitBase::deserialize ( )
inlineprotectedvirtual

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::WorkUnit_SilentStructStore, and protocols::wum::DatabaseEntryWorkUnit.

Definition at line 90 of file WorkUnitBase.hh.

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

Accessor to the extra_data_1 and 3 field of the header.

Definition at line 73 of file WorkUnitBase.hh.

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

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

Optain the options string from the header.

Definition at line 197 of file WorkUnitBase.cc.

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

core::Size protocols::wum::WorkUnitBase::get_run_time ( )

Returns the differrence between unix start and stop times.

Definition at line 210 of file WorkUnitBase.cc.

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

std::string protocols::wum::WorkUnitBase::get_wu_type ( ) const

Accessor to header structure, return the WorkUnit Type.

Definition at line 181 of file WorkUnitBase.cc.

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

Referenced by protocols::wum::WorkUnitList::get_work_unit(), and protocols::wum::WorkUnitList::get_work_unit_clone().

core::Size protocols::wum::WorkUnitBase::id ( )
inline

Accessor to the ID of the WorkUnit.

Definition at line 69 of file WorkUnitBase.hh.

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.

Definition at line 69 of file WorkUnitBase.cc.

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

core::Size protocols::wum::WorkUnitBase::last_received_from ( )
inline

Definition at line 172 of file WorkUnitBase.hh.

References last_received_from_.

virtual core::Size protocols::wum::WorkUnitBase::mem_footprint ( ) const
inlinevirtual

Return the memory usage of this WorkUnit.

Definition at line 144 of file WorkUnitBase.hh.

References serial_data().

void protocols::wum::WorkUnitBase::print ( std::ostream &  out,
bool  verbose = false 
) const
unsigned int protocols::wum::WorkUnitBase::raw_data_dump ( unsigned char **  raw_data_ptr) const
private

This allocates and returns a pointer to a block of memory with the workunit data totally serialized. Note that it is that callers responsibility to call delete [] on this memory when they're done with it.

Definition at line 148 of file WorkUnitBase.cc.

References header, raw_data_size(), serial_data(), core::io::serialization::size(), and protocols::wum::TR().

void protocols::wum::WorkUnitBase::raw_data_load ( const unsigned char *  raw_data_ptr,
unsigned int  size 
)
private

Read in Header and serial data from a raw block of memeory, like one you'd get from a lowlevel network communication.

Definition at line 77 of file WorkUnitBase.cc.

References header, serial_data(), and protocols::wum::TR().

unsigned int protocols::wum::WorkUnitBase::raw_data_size ( ) const
private

Definition at line 141 of file WorkUnitBase.cc.

References serial_data(), and protocols::wum::TR().

Referenced by raw_data_dump().

void protocols::wum::WorkUnitBase::run ( )
virtual
std::string& protocols::wum::WorkUnitBase::serial_data ( )
inlineprotected
const std::string& protocols::wum::WorkUnitBase::serial_data ( ) const
inlineprotected

Accessor to the serial data field.

Definition at line 101 of file WorkUnitBase.hh.

References serial_data_.

virtual void protocols::wum::WorkUnitBase::serialize ( )
inlineprotectedvirtual

Make ready for sending.

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

Definition at line 87 of file WorkUnitBase.hh.

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

Accesor to the "options" text field.

Definition at line 187 of file WorkUnitBase.cc.

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.

Definition at line 202 of file WorkUnitBase.cc.

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.

Definition at line 206 of file WorkUnitBase.cc.

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.

Definition at line 171 of file WorkUnitBase.cc.

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

Referenced by WorkUnitBase().

Friends And Related Function Documentation

friend class MPI_WorkUnitManager
friend

Definition at line 42 of file WorkUnitBase.hh.

friend class MPI_WorkUnitManager_Slave
friend

Definition at line 43 of file WorkUnitBase.hh.

friend class WorkUnitManager
friend

Definition at line 44 of file WorkUnitBase.hh.

friend class WorkUnitQueue
friend

Definition at line 45 of file WorkUnitBase.hh.

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.

Definition at line 181 of file WorkUnitBase.hh.

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

WU_Header protocols::wum::WorkUnitBase::header
protected
core::Size protocols::wum::WorkUnitBase::last_received_from_
protected

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

Definition at line 178 of file WorkUnitBase.hh.

Referenced by last_received_from(), and WorkUnitBase().

std::string protocols::wum::WorkUnitBase::serial_data_
private

Contains more data, such as decoys, silent structucts, .. whatever really. Must be serialized, i.e. in plain text form read for transmission.

Definition at line 188 of file WorkUnitBase.hh.

Referenced by clear_serial_data(), and serial_data().


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