ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/MakeStamps.cpp
(Generate patch)

Comparing trunk/mdtools/interface_implementation/MakeStamps.cpp (file contents):
Revision 11 by mmeineke, Tue Jul 9 18:40:59 2002 UTC vs.
Revision 178 by mmeineke, Mon Nov 18 21:24:02 2002 UTC

# Line 3 | Line 3
3  
4   #include "MakeStamps.hpp"
5   #include "MoleculeStamp.hpp"
6 + #include "simError.h"
7 + #ifdef IS_MPI
8 + #include "mpiBASS.h"
9 + #endif // is_mpi
10  
11   LinkedMolStamp::~LinkedMolStamp(){
12    if( mol_stamp != NULL ) delete mol_stamp;
# Line 58 | Line 62 | int MakeStamps::hash( char* text ){
62  
63      // if the key is less than zero, we've had an overflow error
64  
65 <    fprintf( stderr,
66 <             "There has been an overflow error in the hash key.");
67 <    exit(0);
65 >    sprintf( painCave.errMsg,
66 >             "There has been an overflow error in the MakeStamps hash key.");
67 >    painCave.isFatal = 1;
68 >    simError();
69 > #ifdef IS_MPI
70 >    if( painCave.isEventLoop ){
71 >      if( worldRank == 0 ) mpiInterfaceExit();
72 >    }
73 > #endif //is_mpi
74    }
75    
76    return key;
# Line 103 | Line 113 | int MakeStamps::moleculeAssign( event* the_event ){
113    switch( the_event->evt.asmt.asmt_type ){
114      
115    case STRING:
116 <    current_mol->assignString( the_event->evt.asmt.lhs,
117 <                               the_event->evt.asmt.rhs.sval );
108 <    return 1;
116 >    the_event->err_msg = current_mol->assignString( the_event->evt.asmt.lhs,
117 >                                      the_event->evt.asmt.rhs.sval );
118      break;
119  
120    case DOUBLE:
121 <    current_mol->assignDouble( the_event->evt.asmt.lhs,
122 <                               the_event->evt.asmt.rhs.dval );
114 <    return 1;
121 >    the_event->err_msg = current_mol->assignDouble( the_event->evt.asmt.lhs,
122 >                                      the_event->evt.asmt.rhs.dval );
123      break;
124 <
124 >    
125    case INT:
126 <    current_mol->assignInt( the_event->evt.asmt.lhs,
127 <                            the_event->evt.asmt.rhs.ival );
120 <    return 1;
126 >    the_event->err_msg = current_mol->assignInt( the_event->evt.asmt.lhs,
127 >                                   the_event->evt.asmt.rhs.ival );
128      break;
129  
130    default:
# Line 126 | Line 133 | int MakeStamps::moleculeAssign( event* the_event ){
133      return 0;
134      break;
135    }
136 <  return 0;
136 >  if( the_event->err_msg != NULL ) return 0;
137 >  return 1;
138   }
139  
140   int MakeStamps::moleculeEnd( event* the_event ){
# Line 146 | Line 154 | int MakeStamps::newAtom( event* the_event ){
154    the_event->err_msg = current_mol->addAtom( current_atom,
155                                               the_event->evt.blk_index );
156    if( the_event->err_msg != NULL ) return 0;
149
157    return 1;
158   }
159  
# Line 172 | Line 179 | int MakeStamps::atomAssign( event* the_event ){
179    switch( the_event->evt.asmt.asmt_type ){
180      
181    case STRING:
182 <    current_atom->assignString( the_event->evt.asmt.lhs,
183 <                               the_event->evt.asmt.rhs.sval );
182 >    the_event->err_msg =
183 >      current_atom->assignString( the_event->evt.asmt.lhs,
184 >                                  the_event->evt.asmt.rhs.sval );
185 >    if( the_event->err_msg != NULL ) return 0;
186      return 1;
187      break;
188  
189    case DOUBLE:
190 <    current_atom->assignDouble( the_event->evt.asmt.lhs,
191 <                               the_event->evt.asmt.rhs.dval );
192 <    return 1;
190 >    the_event->err_msg =
191 >      current_atom->assignDouble( the_event->evt.asmt.lhs,
192 >                                  the_event->evt.asmt.rhs.dval );
193 >    if( the_event->err_msg != NULL ) return 0;
194 >    return 1;    
195      break;
196  
197    case INT:
198 <    current_atom->assignInt( the_event->evt.asmt.lhs,
199 <                            the_event->evt.asmt.rhs.ival );
198 >    the_event->err_msg =
199 >      current_atom->assignInt( the_event->evt.asmt.lhs,
200 >                               the_event->evt.asmt.rhs.ival );
201 >    if( the_event->err_msg != NULL ) return 0;
202      return 1;
203      break;
204  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines