Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
e43865d7
There was an error fetching the commit references. Please try again later.
Commit
e43865d7
authored
12 years ago
by
Gareth Tribello
Browse files
Options
Downloads
Patches
Plain Diff
Some small tidy ups in ActionWithDistribution class.
parent
d312719b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ActionWithDistribution.cpp
+9
-13
9 additions, 13 deletions
src/ActionWithDistribution.cpp
src/ActionWithDistribution.h
+2
-2
2 additions, 2 deletions
src/ActionWithDistribution.h
with
11 additions
and
15 deletions
src/ActionWithDistribution.cpp
+
9
−
13
View file @
e43865d7
...
@@ -38,7 +38,6 @@ void ActionWithDistribution::autoParallelize(Keywords& keys){
...
@@ -38,7 +38,6 @@ void ActionWithDistribution::autoParallelize(Keywords& keys){
ActionWithDistribution
::
ActionWithDistribution
(
const
ActionOptions
&
ao
)
:
ActionWithDistribution
::
ActionWithDistribution
(
const
ActionOptions
&
ao
)
:
Action
(
ao
),
Action
(
ao
),
read
(
false
),
read
(
false
),
all_values
(
true
),
serial
(
false
),
serial
(
false
),
updateFreq
(
0
),
updateFreq
(
0
),
lastUpdate
(
0
),
lastUpdate
(
0
),
...
@@ -64,9 +63,12 @@ ActionWithDistribution::~ActionWithDistribution(){
...
@@ -64,9 +63,12 @@ ActionWithDistribution::~ActionWithDistribution(){
for
(
unsigned
i
=
0
;
i
<
functions
.
size
();
++
i
)
delete
functions
[
i
];
for
(
unsigned
i
=
0
;
i
<
functions
.
size
();
++
i
)
delete
functions
[
i
];
}
}
void
ActionWithDistribution
::
requestDistribution
(){
void
ActionWithDistribution
::
addVessel
(
const
std
::
string
&
name
,
const
std
::
string
&
input
){
read
=
true
;
read
=
true
;
VesselOptions
da
(
name
,
input
,
this
);
functions
.
push_back
(
vesselRegister
().
create
(
name
,
da
)
);
}
void
ActionWithDistribution
::
requestDistribution
(){
// Loop over all keywords find the vessels and create appropriate functions
// Loop over all keywords find the vessels and create appropriate functions
for
(
unsigned
i
=
0
;
i
<
keywords
.
size
();
++
i
){
for
(
unsigned
i
=
0
;
i
<
keywords
.
size
();
++
i
){
std
::
string
thiskey
,
input
;
thiskey
=
keywords
.
getKeyword
(
i
);
std
::
string
thiskey
,
input
;
thiskey
=
keywords
.
getKeyword
(
i
);
...
@@ -75,35 +77,29 @@ void ActionWithDistribution::requestDistribution(){
...
@@ -75,35 +77,29 @@ void ActionWithDistribution::requestDistribution(){
// If the keyword is a flag read it in as a flag
// If the keyword is a flag read it in as a flag
if
(
keywords
.
style
(
thiskey
,
"flag"
)
){
if
(
keywords
.
style
(
thiskey
,
"flag"
)
){
bool
dothis
;
parseFlag
(
thiskey
,
dothis
);
bool
dothis
;
parseFlag
(
thiskey
,
dothis
);
VesselOptions
da
(
thiskey
,
input
,
this
);
if
(
dothis
)
addVessel
(
thiskey
,
input
);
if
(
dothis
)
functions
.
push_back
(
vesselRegister
().
create
(
thiskey
,
da
)
);
// If it is numbered read it in as a numbered thing
// If it is numbered read it in as a numbered thing
}
else
if
(
keywords
.
numbered
(
thiskey
)
)
{
}
else
if
(
keywords
.
numbered
(
thiskey
)
)
{
parse
(
thiskey
,
input
);
parse
(
thiskey
,
input
);
if
(
input
.
size
()
!=
0
){
if
(
input
.
size
()
!=
0
){
VesselOptions
da
(
thiskey
,
input
,
this
);
addVessel
(
thiskey
,
input
);
functions
.
push_back
(
vesselRegister
().
create
(
thiskey
,
da
)
);
}
else
{
}
else
{
for
(
unsigned
i
=
1
;;
++
i
){
for
(
unsigned
i
=
1
;;
++
i
){
if
(
!
parseNumbered
(
thiskey
,
i
,
input
)
)
break
;
if
(
!
parseNumbered
(
thiskey
,
i
,
input
)
)
break
;
std
::
string
ss
;
Tools
::
convert
(
i
,
ss
);
std
::
string
ss
;
Tools
::
convert
(
i
,
ss
);
VesselOptions
da
(
thiskey
,
input
,
this
);
addVessel
(
thiskey
,
input
);
functions
.
push_back
(
vesselRegister
().
create
(
thiskey
,
da
)
);
input
.
clear
();
input
.
clear
();
}
}
}
}
// Otherwise read in the keyword the normal way
// Otherwise read in the keyword the normal way
}
else
{
}
else
{
parse
(
thiskey
,
input
);
parse
(
thiskey
,
input
);
VesselOptions
da
(
thiskey
,
input
,
this
);
if
(
input
.
size
()
!=
0
)
addVessel
(
thiskey
,
input
);
if
(
input
.
size
()
!=
0
)
functions
.
push_back
(
vesselRegister
().
create
(
thiskey
,
da
)
);
}
}
input
.
clear
();
input
.
clear
();
}
}
}
}
if
(
functions
.
size
()
>
0
)
all_values
=
false
;
if
(
all_values
)
error
(
"No function has been specified"
);
// This sets up the dynamic list that holds what we are calculating
// This sets up the dynamic list that holds what we are calculating
for
(
unsigned
i
=
0
;
i
<
getNumberOfFunctionsInAction
();
++
i
){
members
.
addIndexToList
(
i
);
}
for
(
unsigned
i
=
0
;
i
<
getNumberOfFunctionsInAction
();
++
i
){
members
.
addIndexToList
(
i
);
}
activateAll
();
resizeFunctions
();
activateAll
();
resizeFunctions
();
...
...
This diff is collapsed.
Click to expand it.
src/ActionWithDistribution.h
+
2
−
2
View file @
e43865d7
...
@@ -45,8 +45,6 @@ friend class FieldVessel;
...
@@ -45,8 +45,6 @@ friend class FieldVessel;
private:
private:
/// This is used to ensure that we have properly read the action
/// This is used to ensure that we have properly read the action
bool
read
;
bool
read
;
/// This tells us we are calculating all values (not doing anything to the distribution)
bool
all_values
;
/// Do all calculations in serial
/// Do all calculations in serial
bool
serial
;
bool
serial
;
/// Everything for controlling the updating of neighbor lists
/// Everything for controlling the updating of neighbor lists
...
@@ -66,6 +64,8 @@ private:
...
@@ -66,6 +64,8 @@ private:
/// Activate all the values in the list
/// Activate all the values in the list
void
activateAll
();
void
activateAll
();
protected:
protected:
/// Add a vessel to the list of vessels
void
addVessel
(
const
std
::
string
&
name
,
const
std
::
string
&
input
);
/// Complete the setup of this object (this routine must be called after construction of ActionWithValue)
/// Complete the setup of this object (this routine must be called after construction of ActionWithValue)
void
requestDistribution
();
void
requestDistribution
();
/// Return the value of the tolerance
/// Return the value of the tolerance
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment