--- branches/mmeineke/mdtools/BASS_parse/interface.c 2002/07/09 18:40:59 10 +++ trunk/mdtools/BASS_parse/interface.c 2002/10/16 21:07:02 138 @@ -1,8 +1,12 @@ #include #include +#include #include "interface.h" #include "../headers/BASS_interface.h" +#ifdef IS_MPI +#include "../headers/mpiBASS.h" +#endif void interface_error( event* the_event ); @@ -16,7 +20,10 @@ void init_component( int comp_index ){ the_event->evt.blk_index = comp_index; if( !event_handler( the_event ) ) interface_error( the_event ); - +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif + free( the_event ); } @@ -30,6 +37,9 @@ void init_molecule( int mol_index ){ the_event->evt.blk_index = mol_index; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -44,6 +54,9 @@ void init_atom( int atom_index ){ the_event->evt.blk_index = atom_index; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -58,6 +71,9 @@ void init_bond( int bond_index ){ the_event->evt.blk_index = bond_index; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -72,6 +88,9 @@ void init_bend( int bend_index ){ the_event->evt.blk_index = bend_index; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -86,6 +105,9 @@ void init_torsion( int torsion_index ){ the_event->evt.blk_index = torsion_index; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -109,6 +131,9 @@ void init_members( struct node_tag* the_node, the_event->evt.mbr.d = the_node->the_data.mbr.d; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -124,6 +149,9 @@ void init_constraint( struct node_tag* the_node, the_event->evt.cnstr = the_node->the_data.cnstr.constraint_val; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -158,6 +186,9 @@ void init_assignment( struct node_tag* the_node, } if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -175,6 +206,9 @@ void init_position( struct node_tag* the_node, the_event->evt.pos.z = the_node->the_data.pos.z; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } @@ -192,52 +226,14 @@ void init_orientation( struct node_tag* the_node, the_event->evt.ornt.z = the_node->the_data.ort.z; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); } -void init_start_index( struct node_tag* the_node, - struct namespc the_namespc ){ - event* the_event; - int* si_array; - int n_elements = 0; - int index = 0; - struct integer_list_tag* head; - struct integer_list_tag* current; - - the_event = (event* )malloc( sizeof( event ) ); - - the_event->event_type = ORIENTATION; - the_event->err_msg = NULL; - - head = the_node->the_data.il_head; - n_elements++; - - current = head->next; - while( current != NULL ){ - n_elements++; - current = current->next; - } - - the_event->evt.si.n_elements = n_elements; - si_array = ( int* ) calloc( n_elements, sizeof( int ) ); - - si_array[index] = head->the_int; - - current = head->next; - while( current != NULL ){ - index++; - si_array[index] = current->the_int; - current = current->next; - } - the_event->evt.si.array = si_array; - - if( !event_handler( the_event ) ) interface_error( the_event ); - - free( the_event ); -} - void end_of_block( void ){ event* the_event; @@ -247,6 +243,9 @@ void end_of_block( void ){ the_event->err_msg = NULL; if( !event_handler( the_event ) ) interface_error( the_event ); +#ifdef IS_MPI + throwMPIEvent(the_event); +#endif free( the_event ); }