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
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 class R12IntsAcc_Node0File: public R12IntsAcc {
00055
00056 Ref<MemoryGrp> mem_;
00057 int icounter_;
00058 char *filename_;
00059 int datafile_;
00060
00061 struct PairBlkInfo {
00062 double* ints_[max_num_te_types_];
00063 int refcount_[max_num_te_types_];
00064 off_t offset_;
00065 } *pairblk_;
00066
00067 public:
00068 R12IntsAcc_Node0File(Ref<MemoryGrp>& mem, const char *filename, int num_te_types, int nbasis1, int nbasis2,
00069 int nocc, int nfzc, bool restart);
00070 ~R12IntsAcc_Node0File();
00071
00077 void store_memorygrp(Ref<MemoryGrp>& mem, int ni);
00079 void store_pair_block(int i, int j, double *ints);
00082 void commit();
00085 void deactivate();
00087 double* retrieve_pair_block(int i, int j, tbint_type oper_type);
00089 void release_pair_block(int i, int j, tbint_type oper_type);
00091 bool is_local(int i, int j) const { return (mem_->me() == 0);};
00093 bool is_avail(int i, int j) const { return (mem_->me() == 0);};
00095 bool has_access(int proc) const { return (proc == 0);};
00097 bool can_restart() const { return true; };
00098
00099
00100 int ij_index(int i, int j) const { return i*nocc_act_ + j; };
00101 int ij_proc(int i, int j) const { return 0;};
00102 };
00103
00104 }
00105
00106 #endif
00107
00108
00109
00110
00111