Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
protocols::jd2::MpiFileBuffer Class Referenceabstract

#include <MpiFileBuffer.hh>

Inheritance diagram for protocols::jd2::MpiFileBuffer:
Inheritance graph
[legend]

Public Member Functions

 MpiFileBuffer (core::Size file_buf_rank_)
 
virtual ~MpiFileBuffer ()
 
void release_file (std::string filename)
 
void block_file (std::string const &filename)
 
bool close_file (std::string fname)
 
void run ()
 
void stop ()
 
void set_SlaveCanOpenFile (bool setting=true)
 
void garbage_collection ()
 

Protected Member Functions

virtual SingleFileBufferOP generate_new_channel (std::string const &filename, core::Size channel, bool append, core::Size &status)=0
 

Private Types

typedef std::map< std::string,
core::Size
Filenames
 
typedef std::map< int,
SingleFileBufferOP
Buffers
 
typedef std::pair< time_t, int > TimeStampedChannel
 
typedef std::map< int, time_t > GarbageList
 

Private Member Functions

void receive_str (core::Size slave, core::Size size, std::string &line)
 
void open_channel (core::Size slave, std::string const &filename, bool append, core::Size &status)
 
bool is_open_channel (std::string const &filename)
 
void store_to_channel (core::Size slave, core::Size channel, std::string const &line)
 
void show_status (std::ostream &) const
 
void flush_channel (core::Size slave, core::Size channel_id)
 
void close_channel (core::Size slave, core::Size channel_id)
 
void block_file (core::Size slave, std::string const &filename)
 
void close_file (core::Size channel)
 
bool remote_close_file (std::string const &filename)
 
void clear_channel_from_garbage_collector (core::Size channel)
 

Private Attributes

core::Size buffer_rank_
 
core::Size my_rank_
 
Filenames open_files_
 
Buffers open_buffers_
 
core::Size last_channel_
 
bool bSlaveCanOpenFile_
 
bool bKeepFilesAlive_
 
time_t seconds_to_keep_files_alive_
 
GarbageList garbage_collector_
 
time_t last_garbage_collection_
 
std::list< std::string > blocked_files_
 

Member Typedef Documentation

typedef std::map< std::string, core::Size > protocols::jd2::MpiFileBuffer::Filenames
private
typedef std::map< int, time_t > protocols::jd2::MpiFileBuffer::GarbageList
private
typedef std::pair< time_t, int > protocols::jd2::MpiFileBuffer::TimeStampedChannel
private

Constructor & Destructor Documentation

protocols::jd2::MpiFileBuffer::MpiFileBuffer ( core::Size  file_buf_rank_)
protocols::jd2::MpiFileBuffer::~MpiFileBuffer ( )
virtual

Member Function Documentation

void protocols::jd2::MpiFileBuffer::block_file ( core::Size  slave,
std::string const &  filename 
)
private
void protocols::jd2::MpiFileBuffer::block_file ( std::string const &  filename)
void protocols::jd2::MpiFileBuffer::clear_channel_from_garbage_collector ( core::Size  channel)
private
void protocols::jd2::MpiFileBuffer::close_channel ( core::Size  slave,
core::Size  channel_id 
)
private
void protocols::jd2::MpiFileBuffer::close_file ( core::Size  channel)
private
bool protocols::jd2::MpiFileBuffer::close_file ( std::string  fname)
void protocols::jd2::MpiFileBuffer::flush_channel ( core::Size  slave,
core::Size  channel_id 
)
private

References open_buffers_, and protocols::jd2::tr().

Referenced by run(), and store_to_channel().

void protocols::jd2::MpiFileBuffer::garbage_collection ( )
virtual SingleFileBufferOP protocols::jd2::MpiFileBuffer::generate_new_channel ( std::string const &  filename,
core::Size  channel,
bool  append,
core::Size status 
)
protectedpure virtual
bool protocols::jd2::MpiFileBuffer::is_open_channel ( std::string const &  filename)
private

References open_files_.

Referenced by close_file(), and run().

void protocols::jd2::MpiFileBuffer::open_channel ( core::Size  slave,
std::string const &  filename,
bool  append,
core::Size status 
)
private

References last_channel_.

Referenced by run().

void protocols::jd2::MpiFileBuffer::receive_str ( core::Size  slave,
core::Size  size,
std::string &  line 
)
private

Referenced by run().

void protocols::jd2::MpiFileBuffer::release_file ( std::string  filename)
bool protocols::jd2::MpiFileBuffer::remote_close_file ( std::string const &  filename)
private
void protocols::jd2::MpiFileBuffer::run ( )
void protocols::jd2::MpiFileBuffer::set_SlaveCanOpenFile ( bool  setting = true)
inline

References bSlaveCanOpenFile_.

void protocols::jd2::MpiFileBuffer::show_status ( std::ostream &  os) const
private
void protocols::jd2::MpiFileBuffer::stop ( )
void protocols::jd2::MpiFileBuffer::store_to_channel ( core::Size  slave,
core::Size  channel,
std::string const &  line 
)
private

References flush_channel(), open_buffers_, and protocols::jd2::tr().

Referenced by run().

Member Data Documentation

bool protocols::jd2::MpiFileBuffer::bKeepFilesAlive_
private

Referenced by close_channel(), and MpiFileBuffer().

std::list< std::string > protocols::jd2::MpiFileBuffer::blocked_files_
private
bool protocols::jd2::MpiFileBuffer::bSlaveCanOpenFile_
private
core::Size protocols::jd2::MpiFileBuffer::buffer_rank_
private
GarbageList protocols::jd2::MpiFileBuffer::garbage_collector_
private
core::Size protocols::jd2::MpiFileBuffer::last_channel_
private

Referenced by open_channel().

time_t protocols::jd2::MpiFileBuffer::last_garbage_collection_
private
core::Size protocols::jd2::MpiFileBuffer::my_rank_
private
Buffers protocols::jd2::MpiFileBuffer::open_buffers_
private
Filenames protocols::jd2::MpiFileBuffer::open_files_
private
time_t protocols::jd2::MpiFileBuffer::seconds_to_keep_files_alive_
private

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