Skip to content
Snippets Groups Projects
Commit a044d9b8 authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Added flag to prevent use storage of large vectors of derivatives in multicolvar.

Prior to this change a misuse of the LOWMEM keyword could cause segfaults.
Now these cases crash with an error.
parent a65bd739
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,9 @@ void StoreDataVessel::resize(){ ...@@ -52,6 +52,9 @@ void StoreDataVessel::resize(){
nspace = 1; nspace = 1;
active_der.resize( max_lowmem_stash * ( 1 + getAction()->getNumberOfDerivatives() ) ); active_der.resize( max_lowmem_stash * ( 1 + getAction()->getNumberOfDerivatives() ) );
} else { } else {
if( getAction()->getNumberOfDerivatives()>getAction()->maxderivatives ){
error("not enough memory to store derivatives for action " + getAction()->getLabel() + " use LOWMEM option");
}
nspace = 1 + getAction()->maxderivatives; nspace = 1 + getAction()->maxderivatives;
active_der.resize( getNumberOfStoredValues() * ( 1 + getAction()->maxderivatives ) ); active_der.resize( getNumberOfStoredValues() * ( 1 + getAction()->maxderivatives ) );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment