logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

sc::FileGrp - The FileGrp abstract class provides a way of accessing distributed file in a parallel

Author

       Generated automatically by Doxygen for MPQC from the source code.

Version 2.3.1                                    Sun Oct 4 2020                                   sc::FileGrp(3)

Detailed Description

       The FileGrp abstract class provides a way of accessing distributed file in a parallel machine.

       Several specializations are available. For one processor, ProcFileGrp provides a simple stub
       implementation. Otherwise, the specializations that should work are MPIIOIFileGrp and MTMPIFileGrp.

       If a FileGrp is not given to the program, then one will be automatically chosen depending on which
       MessageGrp is used by default, the type of machine on which the code was compiled, and what options were
       given at configuration time.

Member Function Documentation

virtualvoidsc::FileGrp::catchup()[virtual]
       Processes outstanding requests. Some file group implementations don't have access to real shared memory
       or even active messages. Instead, requests are processed whenever certain file group routines are called.
       This can cause large latencies and buffer overflows. If this is a problem, then the catchup member can be
       called to process all outstanding requests.

   staticFileGrp*sc::FileGrp::initial_filegrp(int&argc,char**argv)[static]
       Create a file group. This routine looks for a -filegrp argument, then the environmental variable FILEGRP,
       and, finally, the default MessageGrp object to decide which specialization of FileGrp would be
       appropriate. The argument to -integralgrp should be either string for a ParsedKeyVal constructor or a
       classname. The default ThreadGrp and MessageGrp objects should be initialized before this is called.

       References initial_filegrp().

       Referenced by initial_filegrp().

   virtualvoid*sc::FileGrp::obtain_readwrite(distsize_toffset,intsize)[purevirtual]
       Only one thread can have an unreleased obtain_readwrite at a time. The actual file region locked can be
       larger than that requested. If the file region is already locked this will block. For this reason, data
       should be held as read/write for as short a time as possible.

       Implemented in sc::ProcFileGrp.

   virtualvoidsc::FileGrp::release_readwrite(void*data,distsize_toffset,intsize)[purevirtual]
       This is called when read/write access is no longer needed. The data will be unlocked.

       Implemented in sc::ProcFileGrp.

   virtualvoidsc::FileGrp::set_localsize(size_t)[purevirtual]
       Set the size of locally held data. When data is accessed using a global offset counting starts at node 0
       and proceeds up to node n() - 1.

       Implemented in sc::ProcFileGrp.

   virtualvoidsc::FileGrp::sync()[purevirtual]
       Synchronizes all the nodes. Consider using this when the way you you access data changes.

       Implemented in sc::ProcFileGrp.

Name

       sc::FileGrp - The FileGrp abstract class provides a way of accessing distributed file in a parallel
       machine.

Synopsis

       #include <file.h>

       Inherits sc::DescribedClass.

       Inherited by sc::ProcFileGrp.

   PublicMemberFunctionsFileGrp (const Ref< KeyVal > &)
       void open ()
           Opens the files.
       void close ()
           Closes the files.
       void set_filename (char *name)
           Sets the filename for the FileGrp.
       const char * get_filename () const
           Returns the filename for the FileGrp.
       int me () const
           Returns who I am.
       int n () const
           Returns how many nodes there are.
       virtual void set_localsize (size_t)=0
           Set the size of locally held data.
       size_t localsize ()
           Returns the amount of data residing locally on me().
       distsize_tlocaloffset ()
           Returns the global offset to this node's data.
       int size (int node)
           Returns the amount of data residing on node.
       distsize_toffset (int node)
           Returns the global offset to node's data.
       distsize_ttotalsize ()
           Returns the sum of all data allocated on all nodes.
       virtual void activate ()
           Activate is called before the data is to be used.
       virtual void deactivate ()
           Deactivate is called after the data has been used.
       virtual void * obtain_writeonly (distsize_toffset, int size)=0
           This gives write access to the data location. No locking is done.
       virtual void * obtain_readwrite (distsize_toffset, int size)=0
           Only one thread can have an unreleased obtain_readwrite at a time.
       virtual void * obtain_readonly (distsize_toffset, int size)=0
           This gives read access to the file location. No locking is done.
       virtual void release_readonly (void *data, distsize_toffset, int size)=0
           This is called when read access is no longer needed.
       virtual void release_writeonly (void *data, distsize_toffset, int size)=0
           This is called when write access is no longer needed.
       virtual void release_readwrite (void *data, distsize_toffset, int size)=0
           This is called when read/write access is no longer needed.
       virtual void sum_reduction (double *data, distsize_t doffset, int dsize)
       virtual void sum_reduction_on_node (double *data, size_t doffset, int dsize, int node=-1)
       virtual void sync ()=0
           Synchronizes all the nodes.
       virtual void catchup ()
           Processes outstanding requests.
       virtual void print (std::ostream &o=ExEnv::out0()) const
           Prints out information about the object.
       virtual FileGrp * clone ()=0
           Clones the given FileGrp. The new FileGrp may need to be initialized additionally.

   StaticPublicMemberFunctions
       static FileGrp * initial_filegrp (int &argc, char **argv)
           Create a file group.
       static FileGrp * initial_filegrp ()
       static void set_default_filegrp (const Ref< FileGrp > &)
           The default file group contains the primary file group to be used by an application.
       static FileGrp * get_default_filegrp ()
           Returns the default file group.

   ProtectedMemberFunctions
       void obtain_local_lock (size_t start, size_t fence)
       void release_local_lock (size_t start, size_t fence)

   ProtectedAttributes
       int me_
       int n_distsize_t * offsets_
       int debug_

See Also