--- trunk/mdtools/BASS_parse/interface.c 2002/09/25 22:51:14 118 +++ trunk/mdtools/BASS_parse/interface.c 2002/11/11 17:25:08 172 @@ -4,6 +4,10 @@ #include "interface.h" #include "../headers/BASS_interface.h" +#include "../headers/simError.h" +#ifdef IS_MPI +#include "../headers/mpiBASS.h" +#endif void interface_error( event* the_event ); @@ -17,7 +21,7 @@ void init_component( int comp_index ){ the_event->evt.blk_index = comp_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -34,7 +38,7 @@ void init_molecule( int mol_index ){ the_event->evt.blk_index = mol_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -51,7 +55,7 @@ void init_atom( int atom_index ){ the_event->evt.blk_index = atom_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -68,7 +72,7 @@ void init_bond( int bond_index ){ the_event->evt.blk_index = bond_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -85,7 +89,7 @@ void init_bend( int bend_index ){ the_event->evt.blk_index = bend_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -102,7 +106,7 @@ void init_torsion( int torsion_index ){ the_event->evt.blk_index = torsion_index; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -128,7 +132,7 @@ 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 MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -146,7 +150,7 @@ 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 MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -183,7 +187,7 @@ void init_assignment( struct node_tag* the_node, } if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -203,7 +207,7 @@ 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 MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -223,7 +227,7 @@ 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 MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -240,7 +244,7 @@ void end_of_block( void ){ the_event->err_msg = NULL; if( !event_handler( the_event ) ) interface_error( the_event ); -#ifdef MPI +#ifdef IS_MPI throwMPIEvent(the_event); #endif @@ -249,9 +253,13 @@ void interface_error( event* the_event ){ void interface_error( event* the_event ){ - fprintf( stderr, + sprintf( painCave.errMsg, "**Interface event error**\n" "%s\n", the_event->err_msg ); - exit(1); + painCave.isFatal = 1; + simError(); +#ifdef IS_MPI + mpiInterfaceExit(); +#endif //IS_MPI }