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
943f499e
There was an error fetching the commit references. Please try again later.
Commit
943f499e
authored
12 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed flushing
PlumedFile's were not flushed correctly
parent
9811caa3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/GenericFlush.cpp
+1
-0
1 addition, 0 deletions
src/GenericFlush.cpp
src/PlumedFile.cpp
+1
-0
1 addition, 0 deletions
src/PlumedFile.cpp
src/PlumedMain.cpp
+16
-0
16 additions, 0 deletions
src/PlumedMain.cpp
src/PlumedMain.h
+12
-0
12 additions, 0 deletions
src/PlumedMain.h
with
30 additions
and
0 deletions
src/GenericFlush.cpp
+
1
−
0
View file @
943f499e
...
...
@@ -55,6 +55,7 @@ public:
static
void
registerKeywords
(
Keywords
&
keys
);
void
calculate
(){};
void
apply
(){
plumed
.
fflush
();
log
.
flush
();
const
ActionSet
&
actionSet
(
plumed
.
getActionSet
());
for
(
ActionSet
::
const_iterator
p
=
actionSet
.
begin
();
p
!=
actionSet
.
end
();
++
p
)
...
...
This diff is collapsed.
Click to expand it.
src/PlumedFile.cpp
+
1
−
0
View file @
943f499e
...
...
@@ -116,6 +116,7 @@ PlumedFileBase& PlumedFileBase::open(const std::string& path,const std::string&
const
std
::
string
pathsuf
=
path
+
plumed
->
getSuffix
();
fp
=
std
::
fopen
(
const_cast
<
char
*>
(
pathsuf
.
c_str
()),
const_cast
<
char
*>
(
mode
.
c_str
()));
}
if
(
plumed
)
plumed
->
insertFile
(
*
this
);
if
(
!
fp
)
fp
=
std
::
fopen
(
const_cast
<
char
*>
(
path
.
c_str
()),
const_cast
<
char
*>
(
mode
.
c_str
()));
plumed_massert
(
fp
,
"file "
+
path
+
"cannot be found"
);
return
*
this
;
...
...
This diff is collapsed.
Click to expand it.
src/PlumedMain.cpp
+
16
−
0
View file @
943f499e
...
...
@@ -595,6 +595,22 @@ std::string PlumedMain::cite(const std::string&item){
return
citations
.
cite
(
item
);
}
void
PlumedMain
::
fflush
(){
for
(
files_iterator
p
=
files
.
begin
();
p
!=
files
.
end
();
++
p
){
(
*
p
)
->
flush
();
}
}
void
PlumedMain
::
insertFile
(
PlumedFileBase
&
f
){
files
.
insert
(
&
f
);
}
void
PlumedMain
::
eraseFile
(
PlumedFileBase
&
f
){
files
.
erase
(
&
f
);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
src/PlumedMain.h
+
12
−
0
View file @
943f499e
...
...
@@ -27,6 +27,7 @@
#include
<cstdio>
#include
<string>
#include
<vector>
#include
<set>
// !!!!!!!!!!!!!!!!!!!!!! DANGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
...
...
@@ -59,6 +60,7 @@ class PlumedCommunicator;
class
Stopwatch
;
class
Citations
;
class
ExchangePatterns
;
class
PlumedFileBase
;
/**
Main plumed object.
...
...
@@ -119,6 +121,10 @@ private:
/// Class of possible exchange patterns, used for BIASEXCHANGE but also for future parallel tempering
ExchangePatterns
exchangepatterns
;
std
::
set
<
PlumedFileBase
*>
files
;
typedef
std
::
set
<
PlumedFileBase
*>::
iterator
files_iterator
;
public:
/// Flag to switch off virial calculation (for debug)
bool
novirial
;
...
...
@@ -219,6 +225,12 @@ public:
FILE
*
fopen
(
const
char
*
path
,
const
char
*
mode
);
/// Closes a file opened with PlumedMain::fopen()
int
fclose
(
FILE
*
fp
);
/// Insert a file
void
insertFile
(
PlumedFileBase
&
);
/// Erase a file
void
eraseFile
(
PlumedFileBase
&
);
/// Flush all files
void
fflush
();
};
/////
...
...
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