.TH "sc::FileGrp" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::FileGrp \- The \fBFileGrp\fP abstract class provides a way of accessing distributed file in a parallel machine\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::DescribedClass\fP\&. .PP Inherited by \fBsc::ProcFileGrp\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBFileGrp\fP (const \fBRef\fP< \fBKeyVal\fP > &)" .br .ti -1c .RI "void \fBopen\fP ()" .br .RI "Opens the files\&. " .ti -1c .RI "void \fBclose\fP ()" .br .RI "Closes the files\&. " .ti -1c .RI "void \fBset_filename\fP (char *name)" .br .RI "Sets the filename for the \fBFileGrp\fP\&. " .ti -1c .RI "const char * \fBget_filename\fP () const" .br .RI "Returns the filename for the \fBFileGrp\fP\&. " .ti -1c .RI "int \fBme\fP () const" .br .RI "Returns who I am\&. " .ti -1c .RI "int \fBn\fP () const" .br .RI "Returns how many nodes there are\&. " .ti -1c .RI "virtual void \fBset_localsize\fP (size_t)=0" .br .RI "Set the size of locally held data\&. " .ti -1c .RI "size_t \fBlocalsize\fP ()" .br .RI "Returns the amount of data residing locally on \fBme()\fP\&. " .ti -1c .RI "\fBdistsize_t\fP \fBlocaloffset\fP ()" .br .RI "Returns the global offset to this node's data\&. " .ti -1c .RI "int \fBsize\fP (int node)" .br .RI "Returns the amount of data residing on node\&. " .ti -1c .RI "\fBdistsize_t\fP \fBoffset\fP (int node)" .br .RI "Returns the global offset to node's data\&. " .ti -1c .RI "\fBdistsize_t\fP \fBtotalsize\fP ()" .br .RI "Returns the sum of all data allocated on all nodes\&. " .ti -1c .RI "virtual void \fBactivate\fP ()" .br .RI "Activate is called before the data is to be used\&. " .ti -1c .RI "virtual void \fBdeactivate\fP ()" .br .RI "Deactivate is called after the data has been used\&. " .ti -1c .RI "virtual void * \fBobtain_writeonly\fP (\fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "This gives write access to the data location\&. No locking is done\&. " .ti -1c .RI "virtual void * \fBobtain_readwrite\fP (\fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "Only one thread can have an unreleased obtain_readwrite at a time\&. " .ti -1c .RI "virtual void * \fBobtain_readonly\fP (\fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "This gives read access to the file location\&. No locking is done\&. " .ti -1c .RI "virtual void \fBrelease_readonly\fP (void *data, \fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "This is called when read access is no longer needed\&. " .ti -1c .RI "virtual void \fBrelease_writeonly\fP (void *data, \fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "This is called when write access is no longer needed\&. " .ti -1c .RI "virtual void \fBrelease_readwrite\fP (void *data, \fBdistsize_t\fP \fBoffset\fP, int \fBsize\fP)=0" .br .RI "This is called when read/write access is no longer needed\&. " .ti -1c .RI "virtual void \fBsum_reduction\fP (double *data, \fBdistsize_t\fP doffset, int dsize)" .br .ti -1c .RI "virtual void \fBsum_reduction_on_node\fP (double *data, size_t doffset, int dsize, int node=\-1)" .br .ti -1c .RI "virtual void \fBsync\fP ()=0" .br .RI "Synchronizes all the nodes\&. " .ti -1c .RI "virtual void \fBcatchup\fP ()" .br .RI "Processes outstanding requests\&. " .ti -1c .RI "virtual void \fBprint\fP (std::ostream &o=\fBExEnv::out0\fP()) const" .br .RI "Prints out information about the object\&. " .ti -1c .RI "virtual \fBFileGrp\fP * \fBclone\fP ()=0" .br .RI "Clones the given \fBFileGrp\fP\&. The new \fBFileGrp\fP may need to be initialized additionally\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBFileGrp\fP * \fBinitial_filegrp\fP (int &argc, char **argv)" .br .RI "Create a file group\&. " .ti -1c .RI "static \fBFileGrp\fP * \fBinitial_filegrp\fP ()" .br .ti -1c .RI "static void \fBset_default_filegrp\fP (const \fBRef\fP< \fBFileGrp\fP > &)" .br .RI "The default file group contains the primary file group to be used by an application\&. " .ti -1c .RI "static \fBFileGrp\fP * \fBget_default_filegrp\fP ()" .br .RI "Returns the default file group\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void \fBobtain_local_lock\fP (size_t start, size_t fence)" .br .ti -1c .RI "void \fBrelease_local_lock\fP (size_t start, size_t fence)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "int \fBme_\fP" .br .ti -1c .RI "int \fBn_\fP" .br .ti -1c .RI "\fBdistsize_t\fP * \fBoffsets_\fP" .br .ti -1c .RI "int \fBdebug_\fP" .br .in -1c .SH "Detailed Description" .PP The \fBFileGrp\fP abstract class provides a way of accessing distributed file in a parallel machine\&. Several specializations are available\&. For one processor, \fBProcFileGrp\fP provides a simple stub implementation\&. Otherwise, the specializations that should work are MPIIOIFileGrp and MTMPIFileGrp\&. .PP If a \fBFileGrp\fP is not given to the program, then one will be automatically chosen depending on which \fBMessageGrp\fP is used by default, the type of machine on which the code was compiled, and what options were given at configuration time\&. .SH "Member Function Documentation" .PP .SS "virtual void sc::FileGrp::catchup ()\fC [virtual]\fP" .PP 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\&. .SS "static \fBFileGrp\fP* sc::FileGrp::initial_filegrp (int & argc, char ** argv)\fC [static]\fP" .PP Create a file group\&. This routine looks for a -filegrp argument, then the environmental variable FILEGRP, and, finally, the default \fBMessageGrp\fP object to decide which specialization of \fBFileGrp\fP would be appropriate\&. The argument to -integralgrp should be either string for a \fBParsedKeyVal\fP constructor or a classname\&. The default \fBThreadGrp\fP and \fBMessageGrp\fP objects should be initialized before this is called\&. .PP References initial_filegrp()\&. .PP Referenced by initial_filegrp()\&. .SS "virtual void* sc::FileGrp::obtain_readwrite (\fBdistsize_t\fP offset, int size)\fC [pure virtual]\fP" .PP 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\&. .PP Implemented in \fBsc::ProcFileGrp\fP\&. .SS "virtual void sc::FileGrp::release_readwrite (void * data, \fBdistsize_t\fP offset, int size)\fC [pure virtual]\fP" .PP This is called when read/write access is no longer needed\&. The data will be unlocked\&. .PP Implemented in \fBsc::ProcFileGrp\fP\&. .SS "virtual void sc::FileGrp::set_localsize (size_t)\fC [pure virtual]\fP" .PP 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 \fBn()\fP - 1\&. .PP Implemented in \fBsc::ProcFileGrp\fP\&. .SS "virtual void sc::FileGrp::sync ()\fC [pure virtual]\fP" .PP Synchronizes all the nodes\&. Consider using this when the way you you access data changes\&. .PP Implemented in \fBsc::ProcFileGrp\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.