Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MPIBPool_ConvergenceCheck.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 #ifndef INCLUDED_protocols_canonical_sampling_mc_convergence_checks_MPIBPool_ConvergenceCheck_hh
11 #define INCLUDED_protocols_canonical_sampling_mc_convergence_checks_MPIBPool_ConvergenceCheck_hh
15 // AUTO-REMOVED #include <core/io/silent/SilentFileData.hh>
16 #include <ObjexxFCL/FArray3D.hh>
17 #include <ObjexxFCL/FArray2D.hh>
18 #include <core/pose/Pose.hh>
19 
20 #include <utility/vector1.hh>
21 
22 //Auto Headers
23 
24 
25 
26 #ifdef USEMPI
27 #include <mpi.h>
28 #endif
29 
30 
31 namespace protocols {
32 namespace canonical_sampling {
33 namespace mc_convergence_checks {
34 
35 typedef ObjexxFCL::FArray2D<double> FArray2D_double;
36 typedef ObjexxFCL::FArray3D<double> FArray3D_double;
37 
39 public:
41  TransferBuffer( core::Size num_slave_nodes );
42 
43  void set_size( int num_slave_nodes );
44 
46  //option1:
49  int* int_buf1_;
54  core::Size size_; // num-structures reported, to broadcast
56 };
57 
58 
59 class MPIBPool_RMSD : public Pool_RMSD {
60 
61 public:
62 
65 
66 
67 
68 MPIBPool_RMSD( std::string const& silent_file );
69 
70 
71 void create_comm( int ranks_to_include[], int new_size );
72 
73 void update_ranks( int const active_nodes[], int new_size );
74 
75 void set_discovered_out( std::string const& newout);
76 
78 
79 bool is_active_node();
80 
82  double const received_array[],
83  int const size_per_coord[],
84  core::Size num_received,
86  );
87 
88 void farray_to_array( core::Size index );
89 
90 void farray_to_array( core::Size index, core::Size num_to_add );
91 
92 void array_to_farray( core::Size index );
93 
94 void array_to_farray( core::Size index, core::Size num_to_add );
95 
97  core::Real threshold
98 );
99 
100 void set_nresidues(
101  core::Size nres
102 );
103 
104 void get_nresidues();
105 
106 bool workers_finished();
107 
108  /**
109 void add_pose_to_pool(
110  FArray2D_double const& coords_to_add,
111  std::string& tag
112 );
113  **/
114 
115 void add_pose_to_pool();
116 
117 void finalize();
118 
119 void master_go();
120 
121 bool is_master_node();
122 
123 
125  core::pose::Pose const& pose,
126  std::string& best_decoy,
127  core::Real& best_rmsd,
128  core::Real transition_threshold
129 );
130 
131 private:
132 
133 void initialize();
134 
135 void increment_pool_size( core::Size new_structures );
136 
137 void reformat( core::pose::Pose const& pose, std::string& new_tag );
138 
139 void assign_tag( std::string& new_tag, core::Size optional_id_num );
140 
141 
142 void broadcast_newest_coords( int num_to_send );
144  //void master_gather_new_coords( utility::vector1<FArray2D_double> & coords, utility::vector1<int> & winning_ranks );
146 
149 
150 
151 
152 private:
164  //
165 #ifdef USEMPI
166  static MPI_Comm MPI_COMM_POOL;
167 #endif
168 
170 
171 };
172 
173 
174 
175 } //mc_convergence_checks
176 } //moves
177 } //protocols
178 
179 #endif