ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/BASS_parse/interface.c
(Generate patch)

Comparing trunk/mdtools/BASS_parse/interface.c (file contents):
Revision 117 by mmeineke, Tue Sep 24 22:10:55 2002 UTC vs.
Revision 138 by chuckv, Wed Oct 16 21:07:02 2002 UTC

# Line 4 | Line 4
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 17 | 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 31 | 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 45 | 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 59 | 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 73 | 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 87 | 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 110 | 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 125 | 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 159 | 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 176 | 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 193 | 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   }
199
200 void init_start_index( struct node_tag* the_node,
201                       struct namespc the_namespc ){
202  event* the_event;
203  int* si_array;
204  int n_elements = 0;
205  int index = 0;
235  
207  struct integer_list_tag* head;
208  struct integer_list_tag* current;
209  
210  the_event = (event* )malloc( sizeof( event ) );
211  
212  the_event->event_type = ORIENTATION;
213  the_event->err_msg = NULL;
236  
215  head = the_node->the_data.il_head;
216  n_elements++;
217
218  current = head->next;
219  while( current != NULL ){
220    n_elements++;
221    current = current->next;
222  }
223
224  the_event->evt.si.n_elements = n_elements;
225  si_array = ( int* ) calloc( n_elements, sizeof( int ) );
226  
227  si_array[index] = head->the_int;
228  
229  current = head->next;
230  while( current != NULL ){
231    index++;
232    si_array[index] = current->the_int;
233    current = current->next;
234  }
235  the_event->evt.si.array = si_array;
236  
237  if( !event_handler( the_event ) ) interface_error( the_event );
238  
239  free( the_event );
240 }
241
237   void end_of_block( void ){
238    event* the_event;
239    
# Line 248 | 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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines