Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MPIWorkPartitionJobDistributor.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/jd2/MPIWorkPartitionJobDistributor.hh
11 /// @brief header for MPIWorkPartitionJobDistributor - intended for MPI jobs on small numbers of nodes where the load can be balanced equally by the user
12 /// @author P. Douglas Renfrew (renfrew@unc.edu)
13 
14 #ifndef INCLUDED_protocols_jd2_MPIWorkPartitionJobDistributor_hh
15 #define INCLUDED_protocols_jd2_MPIWorkPartitionJobDistributor_hh
16 
17 // Unit headers
19 
20 // Package headers
22 #include <protocols/jd2/Job.fwd.hh>
23 // AUTO-REMOVED #include <protocols/jd2/JobDistributorFactory.hh>
24 
26 
27 // Utility headers
28 #include <core/types.hh>
29 
30 // C++ headers
31 #include <string>
32 
33 #include <platform/types.hh>
34 #include <core/pose/Pose.fwd.hh>
36 #include <protocols/jd2/Job.hh>
41 #include <utility/down_cast.hh>
42 #include <utility/vector1.fwd.hh>
43 #include <utility/vector1.hh>
44 #include <utility/vector1_bool.hh>
45 #include <utility/vectorL.fwd.hh>
46 #include <utility/vectorL.hh>
47 #include <utility/vectorL_Selector.hh>
48 #include <utility/vectorL_bool.hh>
49 #include <utility/pointer/ReferenceCount.fwd.hh>
50 #include <utility/pointer/ReferenceCount.hh>
51 #include <utility/pointer/access_ptr.fwd.hh>
52 #include <utility/pointer/access_ptr.hh>
53 #include <utility/pointer/owning_ptr.functions.hh>
54 #include <utility/pointer/owning_ptr.fwd.hh>
55 #include <utility/pointer/owning_ptr.hh>
56 #include <numeric/xyzVector.fwd.hh>
57 #include <algorithm>
58 #include <cassert>
59 #include <cstddef>
60 #include <iosfwd>
61 #include <limits>
62 #include <list>
63 #include <map>
64 #include <vector>
65 
66 
67 namespace protocols {
68 namespace jd2 {
69 
70 ///@details This job distributor is meant for running jobs where the number of jobs is equal to the number of processors
71 ///(or, similarly, the jobs % processors calculation is very close to the number of processors and NOT a small number).
72 ///It will blindly divide up jobs across processors and then start running them; it will NOT attempt load-balancing by
73 ///giving more jobs to the processors that finished their original jobs. This is intended for use on smaller numbers of
74 ///processors, and/or where the jobs are known to be equal in runtime. (The WorkPool implementation is meant for when
75 ///runtimes are uncertain, or you have many many processors). It does not "waste" a processor as a master node, instead
76 ///all processors run jobs.
78 {
79 protected:
80  ///@brief ctor is protected; singleton pattern
82 
83  virtual void handle_interrupt() {}
84 
85 public:
86  ///WARNING WARNING! SINGLETONS' DESTRUCTORS ARE NEVER CALLED IN MINI! DO NOT TRY TO PUT THINGS IN THIS FUNCTION!
87  ///here's a nice link explaining why: http://www.research.ibm.com/designpatterns/pubs/ph-jun96.txt
89 
90  virtual
91  void
93 
94  virtual
97 
98  virtual
99  void
101 
102  virtual
103  void
105 
106  friend class JobDistributorFactory; //singleton management
107 
108 private:
109  ///@brief ctor helper function splits up job list
110  void
112 
113  ///@brief total number of processing elements
115 
116  ///@brief rank of the "local" instance
118 
119  //@brief start of Jobs vector slice
121 
122  //@brief end of Jobs vector slice
124 
126 };
127 
128 }//jd2
129 }//protocols
130 
131 #endif //INCLUDED_protocols_jd2_MPIWorkPartitionJobDistributor_HH