#include #include "thing.h" /* G L O B A L S */ static int Nodes= 0; static int Myid= -1; volatile static int Termn8= 0; /* set to 1 to kill message handler */ #define THING_API #include "mpi.h" /*_________________________________________________________________ * */ int start_thing( char *rootDir, int **argc, char ***argv ) { MPI_Initialize( argc, argv ); MPI_Comm_rank( &Myid ); MPI_Comm_size( &Nodes ); /* Enter mpi idle loop which does not exit until stop_thing() * Note we may have to spawn the 'rest' of the program... not as nice * for the user. */ ispawn( mpi_thing_loop ); } /*_________________________________________________________________ * */ int igetid_thing(void) { return Myid; } /*_________________________________________________________________ * */ int create_thing( char *name, thing_t itype ) { } /*_________________________________________________________________ * */ int destroy_thing( char *name ) { } /*_________________________________________________________________ * */ int read_thing( char *name, int offset, void *data, int nbytes, status_thing_t status ) { } /*_________________________________________________________________ * */ int write_thing( char *name, int offset, void *data, int nbytes, status_thing_t status ) { } /*_________________________________________________________________ * */ int itest_thing(void) { } /*_________________________________________________________________ * */ int iwait_thing(void) { } /*_________________________________________________________________ * */ int stop_thing(void) { Termn8= 1; /* Wait for handler to notice and reset. */ while ( Termn8 ) { sleep(1); } } /*_________________________________________________________________ * * This loop is the heart of the remote I/O, messaging layer. * */ void mpi_thing_loop(void) { }