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_memgrp_h
00029 #define _chemistry_qc_mbptr12_r12ia_memgrp_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <util/ref/ref.h>
00036 #include <util/group/memory.h>
00037 #include <chemistry/qc/mbptr12/r12ia.h>
00038
00039 namespace sc {
00040
00042
00050 class R12IntsAcc_MemoryGrp: public R12IntsAcc {
00051
00052 Ref<MemoryGrp> mem_;
00053
00054 size_t blksize_memgrp_;
00055
00058 struct PairBlkInfo {
00059 const double *ints_[max_num_te_types_];
00060 mutable int refcount_[max_num_te_types_];
00061 distsize_t offset_;
00062 } *pairblk_;
00063
00065 void init();
00066
00067 int ij_proc(int i, int j) const { return ij_index(i,j)%ntasks();};
00068
00069 public:
00070 R12IntsAcc_MemoryGrp(const Ref<MemoryGrp>&, int num_te_types,
00071 int ni, int nj, int nx, int ny,
00072 size_t memorygrp_blksize);
00073 R12IntsAcc_MemoryGrp(StateIn&);
00074 ~R12IntsAcc_MemoryGrp();
00075 void save_data_state(StateOut&);
00076
00077
00078 void deactivate();
00080 bool data_persistent() const { return false; }
00082 void store_pair_block(int i, int j, tbint_type oper_type, const double *ints);
00084 const double* retrieve_pair_block(int i, int j, tbint_type oper_type) const;
00086 void release_pair_block(int i, int j, tbint_type oper_type) const;
00087
00089 bool is_local(int i, int j) const { return (ij_proc(i,j) == mem_->me());};
00091 bool is_avail(int i, int j) const { return true;};
00093 bool has_access(int proc) const { return true;};
00094
00095 };
00096
00097 }
00098
00099 #endif
00100
00101
00102
00103
00104