Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

distsh.h

00001 //
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 
00042 class DistShellPair {
00043   private:
00044     Ref<MessageGrp> msg_;
00045     int nthread_;
00046     Ref<ThreadLock> lock_;
00047     Ref<GaussianBasisSet> basis_;
00048     int dynamic_;
00049     int debug_;
00050     int print_percent_;
00051 
00052     // for dynamic load balancing
00053     int req_type_;
00054     int ans_type_;
00055     int ncpu_less_0_;
00056     void serve_tasks();
00057 
00058     // for static load balancing
00059     int S_, R_;
00060     int ncpu_;
00061     int mythread_;
00062     int ntask_;
00063     int print_interval_;
00064     int print_index_;
00065   public:
00066     DistShellPair(const Ref<MessageGrp> &, int nthread, int mythread,
00067                   const Ref<ThreadLock> &,
00068                   const Ref<GaussianBasisSet> &);
00069     ~DistShellPair();
00071     void init();
00073     void set_dynamic(int d);
00075     void set_debug(int d) { debug_ = d; }
00077     void set_print_percent(int p) { print_percent_ = p; }
00082     int get_task(int &P, int &Q);
00083 };
00084 
00085 #endif
00086 
00087 // //////////////////////////////////////////////////////////////////////////
00088 
00089 // Local Variables:
00090 // mode: c++
00091 // c-file-style: "CLJ-CONDENSED"
00092 // End:

Generated at Thu Oct 4 18:08:43 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.