# | 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" | |
7 | + | #ifdef IS_MPI |
8 | + | #include "../headers/mpiBASS.h" |
9 | + | #endif |
10 | ||
11 | void interface_error( event* the_event ); | |
12 | ||
# | Line 16 | Line 20 | void init_component( int comp_index ){ | |
20 | the_event->evt.blk_index = comp_index; | |
21 | ||
22 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
23 | < | |
23 | > | #ifdef IS_MPI |
24 | > | throwMPIEvent(the_event); |
25 | > | #endif |
26 | > | |
27 | free( the_event ); | |
28 | } | |
29 | ||
# | Line 30 | Line 37 | void init_molecule( int mol_index ){ | |
37 | the_event->evt.blk_index = mol_index; | |
38 | ||
39 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
40 | + | #ifdef IS_MPI |
41 | + | throwMPIEvent(the_event); |
42 | + | #endif |
43 | ||
44 | free( the_event ); | |
45 | } | |
# | Line 44 | Line 54 | void init_atom( int atom_index ){ | |
54 | the_event->evt.blk_index = atom_index; | |
55 | ||
56 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
57 | + | #ifdef IS_MPI |
58 | + | throwMPIEvent(the_event); |
59 | + | #endif |
60 | ||
61 | free( the_event ); | |
62 | } | |
# | Line 58 | Line 71 | void init_bond( int bond_index ){ | |
71 | the_event->evt.blk_index = bond_index; | |
72 | ||
73 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
74 | + | #ifdef IS_MPI |
75 | + | throwMPIEvent(the_event); |
76 | + | #endif |
77 | ||
78 | free( the_event ); | |
79 | } | |
# | Line 72 | Line 88 | void init_bend( int bend_index ){ | |
88 | the_event->evt.blk_index = bend_index; | |
89 | ||
90 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
91 | + | #ifdef IS_MPI |
92 | + | throwMPIEvent(the_event); |
93 | + | #endif |
94 | ||
95 | free( the_event ); | |
96 | } | |
# | Line 86 | Line 105 | void init_torsion( int torsion_index ){ | |
105 | the_event->evt.blk_index = torsion_index; | |
106 | ||
107 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
108 | + | #ifdef IS_MPI |
109 | + | throwMPIEvent(the_event); |
110 | + | #endif |
111 | ||
112 | free( the_event ); | |
113 | } | |
# | Line 109 | Line 131 | void init_members( struct node_tag* the_node, | |
131 | the_event->evt.mbr.d = the_node->the_data.mbr.d; | |
132 | ||
133 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
134 | + | #ifdef IS_MPI |
135 | + | throwMPIEvent(the_event); |
136 | + | #endif |
137 | ||
138 | free( the_event ); | |
139 | } | |
# | Line 124 | Line 149 | void init_constraint( struct node_tag* the_node, | |
149 | the_event->evt.cnstr = the_node->the_data.cnstr.constraint_val; | |
150 | ||
151 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
152 | + | #ifdef IS_MPI |
153 | + | throwMPIEvent(the_event); |
154 | + | #endif |
155 | ||
156 | free( the_event ); | |
157 | } | |
# | Line 158 | Line 186 | void init_assignment( struct node_tag* the_node, | |
186 | } | |
187 | ||
188 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
189 | + | #ifdef IS_MPI |
190 | + | throwMPIEvent(the_event); |
191 | + | #endif |
192 | ||
193 | free( the_event ); | |
194 | } | |
# | Line 175 | Line 206 | void init_position( struct node_tag* the_node, | |
206 | the_event->evt.pos.z = the_node->the_data.pos.z; | |
207 | ||
208 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
209 | + | #ifdef IS_MPI |
210 | + | throwMPIEvent(the_event); |
211 | + | #endif |
212 | ||
213 | free( the_event ); | |
214 | } | |
# | Line 192 | Line 226 | void init_orientation( struct node_tag* the_node, | |
226 | the_event->evt.ornt.z = the_node->the_data.ort.z; | |
227 | ||
228 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
229 | + | #ifdef IS_MPI |
230 | + | throwMPIEvent(the_event); |
231 | + | #endif |
232 | ||
233 | free( the_event ); | |
234 | } | |
235 | ||
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; |
236 | ||
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; |
213 | – | |
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 | – | |
237 | void end_of_block( void ){ | |
238 | event* the_event; | |
239 | ||
# | Line 247 | Line 243 | void end_of_block( void ){ | |
243 | the_event->err_msg = NULL; | |
244 | ||
245 | if( !event_handler( the_event ) ) interface_error( the_event ); | |
246 | + | #ifdef IS_MPI |
247 | + | throwMPIEvent(the_event); |
248 | + | #endif |
249 | ||
250 | free( the_event ); | |
251 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |