Rosetta  2020.46
 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]

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 ()
 
 ~WorkUnitBase () override=default
 
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_2 ()
 
core::Size extra_data_3 ()
 
void set_extra_data_1 (core::Size const value)
 
void set_extra_data_2 (core::Size const value)
 
void set_extra_data_3 (core::Size const value)
 
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...
 
void set_options (const std::string &text)
 Accesor to the "options" text field. 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...
 
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_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
 

Detailed Description

The base class for all work units.

Constructor & Destructor Documentation

protocols::wum::WorkUnitBase::WorkUnitBase ( )
protocols::wum::WorkUnitBase::~WorkUnitBase ( )
overridedefault

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 ( )
inlinevirtual

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

References serial_data_.

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

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

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.

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.

core::Size protocols::wum::WorkUnitBase::extra_data_2 ( )
inline
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_.

Referenced by protocols::mpi_refinement::WorkUnit_KicCloser::run().

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
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

References last_received_from_.

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

Return the memory usage of this WorkUnit.

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.

References header, raw_data_size(), serial_data(), 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.

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

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

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.

References serial_data_.

virtual void protocols::wum::WorkUnitBase::serialize ( )
inlineprotectedvirtual
void protocols::wum::WorkUnitBase::set_extra_data_1 ( core::Size const  value)
inline
void protocols::wum::WorkUnitBase::set_extra_data_2 ( core::Size const  value)
inline
void protocols::wum::WorkUnitBase::set_extra_data_3 ( core::Size const  value)
inline
void protocols::wum::WorkUnitBase::set_options ( const std::string &  text)
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 protocols::wum::WorkUnitBase::WU_Header::BUFFER_SIZE, 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().

WU_Header protocols::wum::WorkUnitBase::header
protected

The header data.

Referenced by extra_data_1(), extra_data_2(), extra_data_3(), protocols::mpi_refinement::WorkUnit_CombinePose::get_cartesian(), protocols::mpi_refinement::WorkUnit_bbGauss::get_centroid(), protocols::mpi_refinement::WorkUnit_MD::get_cstweight(), protocols::mpi_refinement::WorkUnit_Relax::get_cstweight(), protocols::loophash::WorkUnit_LoopHash::get_end(), protocols::mpi_refinement::WorkUnit_LoopHash::get_end(), protocols::mpi_refinement::WorkUnit_LoopHash::get_global(), protocols::mpi_refinement::WorkUnit_bbGauss::get_kT(), protocols::mpi_refinement::WorkUnit_RamaPerturber::get_kT(), protocols::mpi_refinement::WorkUnit_NormalMode::get_maxscale(), protocols::mpi_refinement::WorkUnit_NormalMode::get_nmodes(), protocols::mpi_refinement::WorkUnit_NormalMode::get_nmtype(), protocols::mpi_refinement::WorkUnit_Relax::get_nrepeat(), protocols::mpi_refinement::WorkUnit_FragInsert::get_nsteps(), protocols::mpi_refinement::WorkUnit_KicCloser::get_nsteps(), protocols::mpi_refinement::WorkUnit_RamaPerturber::get_nsteps(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::get_nsteps(), protocols::mpi_refinement::WorkUnit_bbGauss::get_nstruct(), protocols::mpi_refinement::WorkUnit_CombinePose::get_nstruct(), protocols::mpi_refinement::WorkUnit_MD::get_nstruct(), get_options(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::get_reconstruct(), protocols::mpi_refinement::WorkUnit_MD::get_relaxtype(), protocols::mpi_refinement::WorkUnit_NormalMode::get_relaxtype(), protocols::mpi_refinement::WorkUnit_Relax::get_relaxtype(), protocols::mpi_refinement::WorkUnit_FragInsert::get_res1(), protocols::mpi_refinement::WorkUnit_KicCloser::get_res1(), protocols::mpi_refinement::WorkUnit_RamaPerturber::get_res1(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::get_res1(), protocols::mpi_refinement::WorkUnit_FragInsert::get_res2(), protocols::mpi_refinement::WorkUnit_KicCloser::get_res2(), protocols::mpi_refinement::WorkUnit_RamaPerturber::get_res2(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::get_res2(), get_run_time(), protocols::mpi_refinement::WorkUnit_MD::get_scoretype(), protocols::mpi_refinement::WorkUnit_FragInsert::get_scoretype(), protocols::mpi_refinement::WorkUnit_Relax::get_scoretype(), protocols::mpi_refinement::WorkUnit_KicCloser::get_scoretype(), protocols::mpi_refinement::WorkUnit_bbGauss::get_segdef(), protocols::loophash::WorkUnit_LoopHash::get_ssid(), protocols::mpi_refinement::WorkUnit_LoopHash::get_ssid(), protocols::loophash::WorkUnit_LoopHash::get_start(), protocols::mpi_refinement::WorkUnit_LoopHash::get_start(), get_wu_type(), id(), print(), raw_data_dump(), raw_data_load(), protocols::wum::WorkUnit_Wait::run(), protocols::mpi_refinement::WorkUnit_CombinePose::set_cartesian(), protocols::mpi_refinement::WorkUnit_bbGauss::set_centroid(), protocols::mpi_refinement::WorkUnit_MD::set_cstweight(), protocols::mpi_refinement::WorkUnit_Relax::set_cstweight(), protocols::loophash::WorkUnit_LoopHash::set_end(), protocols::mpi_refinement::WorkUnit_LoopHash::set_end(), set_extra_data_1(), set_extra_data_2(), set_extra_data_3(), protocols::mpi_refinement::WorkUnit_LoopHash::set_global(), protocols::mpi_refinement::WorkUnit_bbGauss::set_kT(), protocols::mpi_refinement::WorkUnit_RamaPerturber::set_kT(), protocols::mpi_refinement::WorkUnit_NormalMode::set_maxscale(), protocols::mpi_refinement::WorkUnit_NormalMode::set_nmodes(), protocols::mpi_refinement::WorkUnit_NormalMode::set_nmtype(), protocols::mpi_refinement::WorkUnit_Relax::set_nrepeat(), protocols::mpi_refinement::WorkUnit_FragInsert::set_nsteps(), protocols::mpi_refinement::WorkUnit_KicCloser::set_nsteps(), protocols::mpi_refinement::WorkUnit_RamaPerturber::set_nsteps(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::set_nsteps(), protocols::mpi_refinement::WorkUnit_bbGauss::set_nstruct(), protocols::mpi_refinement::WorkUnit_CombinePose::set_nstruct(), protocols::mpi_refinement::WorkUnit_MD::set_nstruct(), set_options(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::set_reconstruct(), protocols::mpi_refinement::WorkUnit_MD::set_relaxtype(), protocols::mpi_refinement::WorkUnit_NormalMode::set_relaxtype(), protocols::mpi_refinement::WorkUnit_Relax::set_relaxtype(), protocols::mpi_refinement::WorkUnit_FragInsert::set_res1(), protocols::mpi_refinement::WorkUnit_KicCloser::set_res1(), protocols::mpi_refinement::WorkUnit_RamaPerturber::set_res1(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::set_res1(), protocols::mpi_refinement::WorkUnit_FragInsert::set_res2(), protocols::mpi_refinement::WorkUnit_KicCloser::set_res2(), protocols::mpi_refinement::WorkUnit_RamaPerturber::set_res2(), protocols::mpi_refinement::WorkUnit_PartialAbinitio::set_res2(), set_run_start(), set_run_stop(), protocols::mpi_refinement::WorkUnit_MD::set_scoretype(), protocols::mpi_refinement::WorkUnit_FragInsert::set_scoretype(), protocols::mpi_refinement::WorkUnit_Relax::set_scoretype(), protocols::mpi_refinement::WorkUnit_KicCloser::set_scoretype(), protocols::mpi_refinement::WorkUnit_bbGauss::set_segdef(), protocols::loophash::WorkUnit_LoopHash::set_ssid(), protocols::mpi_refinement::WorkUnit_LoopHash::set_ssid(), protocols::loophash::WorkUnit_LoopHash::set_start(), protocols::mpi_refinement::WorkUnit_LoopHash::set_start(), set_wu_type(), protocols::wum::WorkUnit_Wait::WorkUnit_Wait(), and WorkUnitBase().

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

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

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.

Referenced by clear_serial_data(), and serial_data().


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