# | Line 1 | Line 1 | |
---|---|---|
1 | #include <stdio.h> | |
2 | #include <stdlib.h> | |
3 | + | #include <string.h> |
4 | ||
5 | #include "interface.h" | |
6 | #include "../headers/BASS_interface.h" | |
# | Line 16 | Line 17 | void init_component( int comp_index ){ | |
17 | the_event->evt.blk_index = comp_index; | |
18 | ||
19 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
20 | < | |
20 | > | #ifdef MPI |
21 | > | throwMPIEvent(the_event); |
22 | > | #endif |
23 | > | |
24 | free( the_event ); | |
25 | } | |
26 | ||
# | Line 30 | Line 34 | void init_molecule( int mol_index ){ | |
34 | the_event->evt.blk_index = mol_index; | |
35 | ||
36 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
37 | + | #ifdef MPI |
38 | + | throwMPIEvent(the_event); |
39 | + | #endif |
40 | ||
41 | free( the_event ); | |
42 | } | |
# | Line 44 | Line 51 | void init_atom( int atom_index ){ | |
51 | the_event->evt.blk_index = atom_index; | |
52 | ||
53 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
54 | + | #ifdef MPI |
55 | + | throwMPIEvent(the_event); |
56 | + | #endif |
57 | ||
58 | free( the_event ); | |
59 | } | |
# | Line 58 | Line 68 | void init_bond( int bond_index ){ | |
68 | the_event->evt.blk_index = bond_index; | |
69 | ||
70 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
71 | + | #ifdef MPI |
72 | + | throwMPIEvent(the_event); |
73 | + | #endif |
74 | ||
75 | free( the_event ); | |
76 | } | |
# | Line 72 | Line 85 | void init_bend( int bend_index ){ | |
85 | the_event->evt.blk_index = bend_index; | |
86 | ||
87 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
88 | + | #ifdef MPI |
89 | + | throwMPIEvent(the_event); |
90 | + | #endif |
91 | ||
92 | free( the_event ); | |
93 | } | |
# | Line 86 | Line 102 | void init_torsion( int torsion_index ){ | |
102 | the_event->evt.blk_index = torsion_index; | |
103 | ||
104 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
105 | + | #ifdef MPI |
106 | + | throwMPIEvent(the_event); |
107 | + | #endif |
108 | ||
109 | free( the_event ); | |
110 | } | |
# | Line 109 | Line 128 | void init_members( struct node_tag* the_node, | |
128 | the_event->evt.mbr.d = the_node->the_data.mbr.d; | |
129 | ||
130 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
131 | + | #ifdef MPI |
132 | + | throwMPIEvent(the_event); |
133 | + | #endif |
134 | ||
135 | free( the_event ); | |
136 | } | |
# | Line 124 | Line 146 | void init_constraint( struct node_tag* the_node, | |
146 | the_event->evt.cnstr = the_node->the_data.cnstr.constraint_val; | |
147 | ||
148 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
149 | + | #ifdef MPI |
150 | + | throwMPIEvent(the_event); |
151 | + | #endif |
152 | ||
153 | free( the_event ); | |
154 | } | |
# | Line 158 | Line 183 | void init_assignment( struct node_tag* the_node, | |
183 | } | |
184 | ||
185 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
186 | + | #ifdef MPI |
187 | + | throwMPIEvent(the_event); |
188 | + | #endif |
189 | ||
190 | free( the_event ); | |
191 | } | |
# | Line 175 | Line 203 | void init_position( struct node_tag* the_node, | |
203 | the_event->evt.pos.z = the_node->the_data.pos.z; | |
204 | ||
205 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
206 | + | #ifdef MPI |
207 | + | throwMPIEvent(the_event); |
208 | + | #endif |
209 | ||
210 | free( the_event ); | |
211 | } | |
# | Line 192 | Line 223 | void init_orientation( struct node_tag* the_node, | |
223 | the_event->evt.ornt.z = the_node->the_data.ort.z; | |
224 | ||
225 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
226 | + | #ifdef MPI |
227 | + | throwMPIEvent(the_event); |
228 | + | #endif |
229 | ||
230 | free( the_event ); | |
231 | } | |
198 | – | |
199 | – | void init_start_index( struct node_tag* the_node, |
200 | – | struct namespc the_namespc ){ |
201 | – | event* the_event; |
202 | – | int* si_array; |
203 | – | int n_elements = 0; |
204 | – | int index = 0; |
232 | ||
206 | – | struct integer_list_tag* head; |
207 | – | struct integer_list_tag* current; |
208 | – | |
209 | – | the_event = (event* )malloc( sizeof( event ) ); |
210 | – | |
211 | – | the_event->event_type = ORIENTATION; |
212 | – | the_event->err_msg = NULL; |
233 | ||
214 | – | head = the_node->the_data.il_head; |
215 | – | n_elements++; |
216 | – | |
217 | – | current = head->next; |
218 | – | while( current != NULL ){ |
219 | – | n_elements++; |
220 | – | current = current->next; |
221 | – | } |
222 | – | |
223 | – | the_event->evt.si.n_elements = n_elements; |
224 | – | si_array = ( int* ) calloc( n_elements, sizeof( int ) ); |
225 | – | |
226 | – | si_array[index] = head->the_int; |
227 | – | |
228 | – | current = head->next; |
229 | – | while( current != NULL ){ |
230 | – | index++; |
231 | – | si_array[index] = current->the_int; |
232 | – | current = current->next; |
233 | – | } |
234 | – | the_event->evt.si.array = si_array; |
235 | – | |
236 | – | if( !event_handler( the_event ) ) interface_error( the_event ); |
237 | – | |
238 | – | free( the_event ); |
239 | – | } |
240 | – | |
234 | void end_of_block( void ){ | |
235 | event* the_event; | |
236 | ||
# | Line 247 | Line 240 | void end_of_block( void ){ | |
240 | the_event->err_msg = NULL; | |
241 | ||
242 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
243 | + | #ifdef MPI |
244 | + | throwMPIEvent(the_event); |
245 | + | #endif |
246 | ||
247 | free( the_event ); | |
248 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |