00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _chemistry_qc_mbptr12_r12ia_node0file_h
00029 #define _chemistry_qc_mbptr12_r12ia_node0file_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <unistd.h>
00036 #include <util/ref/ref.h>
00037 #include <util/group/memory.h>
00038 #include <chemistry/qc/mbptr12/r12ia.h>
00039
00040 namespace sc {
00041
00043
00055 class R12IntsAcc_Node0File: public R12IntsAcc {
00056
00057 char *filename_;
00058 int datafile_;
00059
00060 struct PairBlkInfo {
00061
00062 mutable double* ints_[max_num_te_types_];
00063 mutable int refcount_[max_num_te_types_];
00064 off_t offset_;
00065 };
00066 PairBlkInfo* pairblk_;
00067
00069 void init(bool restart);
00070
00071 void check_filedescr_();
00072
00073 int ij_proc(int i, int j) const { return 0;};
00074
00075 public:
00076 R12IntsAcc_Node0File(const char *filename, int num_te_types, int ni, int nj, int nx, int ny);
00077 R12IntsAcc_Node0File(StateIn&);
00078 ~R12IntsAcc_Node0File();
00079 void save_data_state(StateOut&);
00080
00082 void activate();
00084 void deactivate();
00086 bool data_persistent() const { return true; }
00088 void store_pair_block(int i, int j, tbint_type oper_type, const double* ints);
00090 const double* retrieve_pair_block(int i, int j, tbint_type oper_type) const;
00092 void release_pair_block(int i, int j, tbint_type oper_type) const;
00093
00095 bool is_local(int i, int j) const { return (me() == 0);};
00097 bool is_avail(int i, int j) const { return (me() == 0);};
00099 bool has_access(int proc) const { return (proc == 0);};
00100 };
00101
00102 }
00103
00104 #endif
00105
00106
00107
00108
00109