![]()
|
distsh.h00001 //
00002 // distsh.h
00003 // based on csgrade12.h
00004 //
00005 // Copyright (C) 1996 Limit Point Systems, Inc.
00006 //
00007 // Author: Ida Nielsen <ida@kemi.aau.dk>
00008 // Maintainer: LPS
00009 //
00010 // This file is part of the SC Toolkit.
00011 //
00012 // The SC Toolkit is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Library General Public License as published by
00014 // the Free Software Foundation; either version 2, or (at your option)
00015 // any later version.
00016 //
00017 // The SC Toolkit is distributed in the hope that it will be useful,
00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 // GNU Library General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Library General Public License
00023 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
00024 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00025 //
00026 // The U.S. Government is granted a limited license as per AL 91-7.
00027 //
00028
00029 #ifndef _chemistry_qc_mbpt_distsh_h
00030 #define _chemistry_qc_mbpt_distsh_h
00031
00032 #ifdef __GNUC__
00033 #pragma interface
00034 #endif
00035
00036 #include <util/misc/regtime.h>
00037 #include <util/group/message.h>
00038 #include <util/group/thread.h>
00039 #include <chemistry/qc/basis/basis.h>
00040
00041 namespace sc {
00042
00044 class DistShellPair {
00045 private:
00046 Ref<MessageGrp> msg_;
00047 int nthread_;
00048 Ref<ThreadLock> lock_;
00049 Ref<GaussianBasisSet> basis_;
00050 int dynamic_;
00051 int debug_;
00052 int print_percent_;
00053
00054 // for dynamic load balancing
00055 int req_type_;
00056 int ans_type_;
00057 int ncpu_less_0_;
00058 void serve_tasks();
00059
00060 // for static load balancing
00061 int S_, R_;
00062 int ncpu_;
00063 int mythread_;
00064 int ntask_;
00065 int print_interval_;
00066 int print_index_;
00067 public:
00068 DistShellPair(const Ref<MessageGrp> &, int nthread, int mythread,
00069 const Ref<ThreadLock> &,
00070 const Ref<GaussianBasisSet> &);
00071 ~DistShellPair();
00073 void init();
00075 void set_dynamic(int d);
00077 void set_debug(int d) { debug_ = d; }
00079 void set_print_percent(int p) { print_percent_ = p; }
00084 int get_task(int &P, int &Q);
00085 };
00086
00087 }
00088
00089 #endif
00090
00091 // //////////////////////////////////////////////////////////////////////////
00092
00093 // Local Variables:
00094 // mode: c++
00095 // c-file-style: "CLJ-CONDENSED"
00096 // End:
Generated at Fri Jan 10 08:14:08 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14. |