28 #ifndef _util_group_file_h
29 #define _util_group_file_h
33 #include <mpqc_config.h>
34 #include <util/class/class.h>
35 #include <util/group/thread.h>
36 #include <util/group/memory.h>
73 void obtain_local_lock(
size_t start,
size_t fence);
74 void release_local_lock(
size_t start,
size_t fence);
90 int me()
const {
return me_; }
92 int n()
const {
return n_; }
99 size_t localsize() {
return distsize_to_size(offsets_[me_+1]-offsets_[me_]); }
104 {
return distsize_to_size(offsets_[node+1] - offsets_[node]); }
106 distsize_t
offset(
int node) {
return offsets_[node]; }
133 virtual void sum_reduction(
double *data, distsize_t doffset,
int dsize);
134 virtual void sum_reduction_on_node(
double *data,
size_t doffset,
int dsize,
139 virtual void sync() = 0;
159 static FileGrp* initial_filegrp(
int &argc,
char** argv);
160 static FileGrp* initial_filegrp();
void set_filename(char *name)
Sets the filename for the FileGrp.
distsize_t offset(int node)
Returns the global offset to node's data.
Definition: file.h:106
void open()
Opens the files.
A template class that maintains references counts.
Definition: ref.h:361
int size(int node)
Returns the amount of data residing on node.
Definition: file.h:103
virtual void release_readonly(void *data, distsize_t offset, int size)=0
This is called when read access is no longer needed.
virtual void set_localsize(size_t)=0
Set the size of locally held data.
virtual FileGrp * clone()=0
Clones the given FileGrp. The new FileGrp may need to be initialized additionally.
int n() const
Returns how many nodes there are.
Definition: file.h:92
The FileGrp abstract class provides a way of accessing distributed file in a parallel machine.
Definition: file.h:51
virtual void activate()
Activate is called before the data is to be used.
static FileGrp * get_default_filegrp()
Returns the default file group.
virtual void print(std::ostream &o=ExEnv::out0()) const
Prints out information about the object.
virtual void * obtain_readonly(distsize_t offset, int size)=0
This gives read access to the file location. No locking is done.
void close()
Closes the files.
virtual void catchup()
Processes outstanding requests.
static void set_default_filegrp(const Ref< FileGrp > &)
The default file group contains the primary file group to be used by an application.
distsize_t localoffset()
Returns the global offset to this node's data.
Definition: file.h:101
virtual void * obtain_writeonly(distsize_t offset, int size)=0
This gives write access to the data location. No locking is done.
virtual void deactivate()
Deactivate is called after the data has been used.
virtual void sync()=0
Synchronizes all the nodes.
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition: class.h:233
static std::ostream & out0()
Return an ostream that writes from node 0.
int me() const
Returns who I am.
Definition: file.h:90
virtual void * obtain_readwrite(distsize_t offset, int size)=0
Only one thread can have an unreleased obtain_readwrite at a time.
distsize_t totalsize()
Returns the sum of all data allocated on all nodes.
Definition: file.h:108
virtual void release_writeonly(void *data, distsize_t offset, int size)=0
This is called when write access is no longer needed.
virtual void release_readwrite(void *data, distsize_t offset, int size)=0
This is called when read/write access is no longer needed.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
size_t localsize()
Returns the amount of data residing locally on me().
Definition: file.h:99
const char * get_filename() const
Returns the filename for the FileGrp.
Definition: file.h:87
Generated at Sun Jan 26 2020 23:24:01 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.