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