MPQC  3.0.0-alpha
fileproc.h
1 //
2 // fileproc.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _util_group_fileproc_h
29 #define _util_group_fileproc_h
30 
31 #include <sys/types.h>
32 
33 #include <util/group/memmsg.h>
34 
35 namespace sc {
36 
39 class ProcFileGrp: public FileGrp {
40  private:
41  int datafile_;
42  public:
43  ProcFileGrp();
44  ProcFileGrp(const Ref<KeyVal>&);
45  ~ProcFileGrp();
46 
47  ProcFileGrp* clone();
48 
49  void set_localsize(size_t);
50  void *localdata();
51 
52  void *obtain_readwrite(distsize_t offset, int size);
53  void *obtain_readonly(distsize_t offset, int size);
54  void *obtain_writeonly(distsize_t offset, int size);
55  void release_readonly(void *data, distsize_t offset, int size);
56  void release_writeonly(void *data, distsize_t offset, int size);
57  void release_readwrite(void *data, distsize_t offset, int size);
58 
59  void sync();
60 };
61 
62 }
63 
64 #endif
65 
66 // Local Variables:
67 // mode: c++
68 // c-file-style: "CLJ"
69 // End:
sc::FileGrp::offset
distsize_t offset(int node)
Returns the global offset to node's data.
Definition: file.h:106
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::FileGrp::size
int size(int node)
Returns the amount of data residing on node.
Definition: file.h:103
sc::ProcFileGrp::sync
void sync()
Synchronizes all the nodes.
sc::ProcFileGrp::clone
ProcFileGrp * clone()
Clones the given FileGrp. The new FileGrp may need to be initialized additionally.
sc::FileGrp
The FileGrp abstract class provides a way of accessing distributed file in a parallel machine.
Definition: file.h:51
sc::ProcFileGrp::release_readonly
void release_readonly(void *data, distsize_t offset, int size)
This is called when read access is no longer needed.
sc::ProcFileGrp::release_readwrite
void release_readwrite(void *data, distsize_t offset, int size)
This is called when read/write access is no longer needed.
sc::ProcFileGrp::obtain_readwrite
void * obtain_readwrite(distsize_t offset, int size)
Only one thread can have an unreleased obtain_readwrite at a time.
sc::ProcFileGrp::release_writeonly
void release_writeonly(void *data, distsize_t offset, int size)
This is called when write access is no longer needed.
sc::ProcFileGrp::obtain_readonly
void * obtain_readonly(distsize_t offset, int size)
This gives read access to the file location. No locking is done.
sc::ProcFileGrp::obtain_writeonly
void * obtain_writeonly(distsize_t offset, int size)
This gives write access to the data location. No locking is done.
sc::ProcFileGrp
The ProcFileGrp concrete class provides an implementation of FileGrp for a single processor.
Definition: fileproc.h:39
sc::ProcFileGrp::set_localsize
void set_localsize(size_t)
Set the size of locally held data.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:24:01 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.