![]() |
Rosetta Protocols
2014.35
|
The base class for all work units. More...
#include <WorkUnitBase.hh>
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< int > | blacklist_ |
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 |
The base class for all work units.
protocols::wum::WorkUnitBase::WorkUnitBase | ( | ) |
References create_unique_id(), protocols::wum::WorkUnitBase::WU_Header::extra_data_1_, protocols::wum::WorkUnitBase::WU_Header::extra_data_2_, protocols::wum::WorkUnitBase::WU_Header::extra_data_3_, protocols::wum::WorkUnitBase::WU_Header::extra_data_4_, header, protocols::wum::WorkUnitBase::WU_Header::id_, last_received_from_, set_options(), set_wu_type(), protocols::wum::TR, protocols::wum::WorkUnitBase::WU_Header::unixtime_creation_, protocols::wum::WorkUnitBase::WU_Header::unixtime_start_, and protocols::wum::WorkUnitBase::WU_Header::unixtime_stop_.
Referenced by clone().
|
inlinevirtual |
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_.
|
inlinevirtual |
Remove all data, make sure that the memory is also cleared, hence the cals to reserve.
References runtime_assert, and serial_data_.
|
inlinevirtual |
Reimplemented in protocols::wum::WorkUnit_MoverWrapper, protocols::wum::WorkUnit_SilentStructStore, protocols::wum::WorkUnit_Wait, protocols::relax::WorkUnit_BatchRelax_and_PostRescore, protocols::relax::WorkUnit_BatchRelax, protocols::wum::DatabaseEntryWorkUnit, and protocols::loophash::WorkUnit_LoopHash.
References WorkUnitBase().
|
inlineprotectedvirtual |
Make a unique number out of Processor Number and unix timestamp ?
Referenced by WorkUnitBase().
|
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.
|
inline |
Accessor to the extra_data_1 and 3 field of the header.
References protocols::wum::WorkUnitBase::WU_Header::extra_data_1_, and header.
|
inline |
References protocols::wum::WorkUnitBase::WU_Header::extra_data_3_, and header.
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 | ( | ) |
Returns the differrence between unix start and stop times.
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.
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().
|
inline |
Accessor to the ID of the WorkUnit.
References header, and protocols::wum::WorkUnitBase::WU_Header::id_.
Finds in blacklist, true if is, false if it isn't.
References blacklist_, and protocols::wum::mpi_rank().
|
inline |
References last_received_from_.
|
inlinevirtual |
Return the memory usage of this WorkUnit.
References serial_data().
void protocols::wum::WorkUnitBase::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.
References protocols::wum::WorkUnitBase::WU_Header::extra_data_1_, protocols::wum::WorkUnitBase::WU_Header::extra_data_2_, protocols::wum::WorkUnitBase::WU_Header::extra_data_3_, protocols::wum::WorkUnitBase::WU_Header::extra_data_4_, header, protocols::wum::WorkUnitBase::WU_Header::id_, max(), protocols::wum::WorkUnitBase::WU_Header::options_, serial_data(), protocols::wum::WorkUnitBase::WU_Header::unixtime_creation_, protocols::wum::WorkUnitBase::WU_Header::unixtime_start_, protocols::wum::WorkUnitBase::WU_Header::unixtime_stop_, and protocols::wum::WorkUnitBase::WU_Header::wu_type_.
|
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.
References header, raw_data_size(), serial_data(), size(), and protocols::wum::TR.
|
private |
Read in Header and serial data from a raw block of memeory, like one you'd get from a lowlevel network communication.
References header, serial_data(), and protocols::wum::TR.
|
private |
References serial_data(), and protocols::wum::TR.
Referenced by raw_data_dump().
|
virtual |
Run the workunit - overloaded by children of this class.
Reimplemented in protocols::wum::WorkUnit_MoverWrapper, protocols::wum::WorkUnit_SilentStructStore, protocols::wum::WorkUnit_Wait, protocols::relax::WorkUnit_BatchRelax, and protocols::loophash::WorkUnit_LoopHash.
References protocols::wum::TR.
|
inlineprotected |
Accessor to the serial data field.
References serial_data_.
Referenced by protocols::wum::DatabaseEntryWorkUnit::deserialize(), protocols::wum::WorkUnit_SilentStructStore::deserialize(), mem_footprint(), print(), raw_data_dump(), raw_data_load(), raw_data_size(), protocols::wum::DatabaseEntryWorkUnit::serialize(), and protocols::wum::WorkUnit_SilentStructStore::serialize().
|
inlineprotected |
Accessor to the serial data field.
References serial_data_.
|
inlineprotectedvirtual |
Make ready for sending.
Reimplemented in protocols::wum::WorkUnit_SilentStructStore, and protocols::wum::DatabaseEntryWorkUnit.
|
protected |
Accesor to the "options" text field.
References header, length, min, and protocols::wum::WorkUnitBase::WU_Header::options_.
Referenced by WorkUnitBase().
|
protected |
Set the unixtime of the start of the execution of this WorkUnit.
References header, and protocols::wum::WorkUnitBase::WU_Header::unixtime_start_.
|
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, length, min, and protocols::wum::WorkUnitBase::WU_Header::wu_type_.
Referenced by WorkUnitBase().
|
friend |
|
friend |
|
friend |
|
friend |
|
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().
|
protected |
The header data.
Referenced by extra_data_1(), extra_data_3(), protocols::loophash::WorkUnit_LoopHash::get_end(), get_options(), get_run_time(), protocols::loophash::WorkUnit_LoopHash::get_ssid(), protocols::loophash::WorkUnit_LoopHash::get_start(), get_wu_type(), id(), print(), raw_data_dump(), raw_data_load(), protocols::wum::WorkUnit_Wait::run(), protocols::loophash::WorkUnit_LoopHash::set_end(), set_options(), set_run_start(), set_run_stop(), protocols::loophash::WorkUnit_LoopHash::set_ssid(), protocols::loophash::WorkUnit_LoopHash::set_start(), set_wu_type(), protocols::wum::WorkUnit_Wait::WorkUnit_Wait(), and WorkUnitBase().
|
protected |
Contains the serial number of whatever Rank/Node this WU was last receeived from.
Referenced by last_received_from(), and WorkUnitBase().
|
private |
Contains more data, such as decoys, silent structucts, .. whatever really. Must be serialized, i.e. in plain text form read for transmission.
Referenced by clear_serial_data(), and serial_data().