| 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/mpiInterface.h" |
| 9 |
+ |
#endif |
| 10 |
|
|
| 11 |
|
void interface_error( event* the_event ); |
| 12 |
|
|
| 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 |
|
|
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
} |
| 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 |
|
|
| 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 |
|
} |