Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
protocols
canonical_sampling
mc_convergence_checks
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
12
#include <
protocols/moves/MonteCarloExceptionConverge.hh
>
13
#include <
protocols/canonical_sampling/mc_convergence_checks/Pool_ConvergenceCheck.hh
>
14
#include <
protocols/canonical_sampling/mc_convergence_checks/MPIBPool_ConvergenceCheck.fwd.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
38
struct
TransferBuffer
{
39
public
:
40
TransferBuffer
();
41
TransferBuffer
(
core::Size
num_slave_nodes );
42
43
void
set_size
(
int
num_slave_nodes );
44
45
~TransferBuffer
();
46
//option1:
47
int
*
memory_offset_
;
48
int
*
size_per_coords_
;
49
int
*
int_buf1_
;
50
int
*
winning_ranks_
;
51
double
*
farray_coord_ptr_
;
52
FArray2D_double
temp_coord_for_evaluation_
;
53
FArray3D_double
coords_
;
54
core::Size
size_
;
// num-structures reported, to broadcast
55
core::Size
nresidues_
;
56
};
57
58
59
class
MPIBPool_RMSD
:
public
Pool_RMSD
{
60
61
public
:
62
63
static
core::Size
master_node_
;
64
static
core::Size
pool_master_node_
;
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
77
std::string
const
&
get_discovered_out
();
78
79
bool
is_active_node
();
80
81
void
partition_into_coordinates
(
82
double
const
received_array[],
83
int
const
size_per_coord[],
84
core::Size
num_received,
85
utility::vector1<FArray2D_double>
&
coords
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
96
void
set_transition_threshold
(
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
124
core::Size
evaluate_and_add
(
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 );
143
void
broadcast_coords
(
FArray2D_double
&
coords
);
144
//void master_gather_new_coords( utility::vector1<FArray2D_double> & coords, utility::vector1<int> & winning_ranks );
145
void
master_gather_new_coords
();
146
147
void
slave_gather_new_coords
();
148
void
slave_report_no_new_coords
();
149
150
151
152
private
:
153
core::Size
workers_finished_
;
154
utility::vector1< bool >
nodes_finished_
;
155
core::Size
pool_size_
;
156
core::Size
new_structures_
;
157
core::Size
rank_
;
158
core::Size
pool_rank_
;
159
core::Size
npes_
;
160
core::Size
pool_npes_
;
161
core::Real
transition_threshold_
;
162
std::string
new_decoys_out_
;
163
bool
tracer_visible_
;
164
//
165
#ifdef USEMPI
166
static
MPI_Comm MPI_COMM_POOL;
167
#endif
168
169
TransferBuffer
transfer_buf_
;
170
171
};
172
173
174
175
}
//mc_convergence_checks
176
}
//moves
177
}
//protocols
178
179
#endif
Generated on Sat Jun 1 2013 11:44:07 for Rosetta 3.5 by
1.8.4