// MPQueue, version 4 // copyright by John Neuberger, Nandor Sieben and James Swift // Northern Arizona University #undef SEEK_SET #undef SEEK_END #undef SEEK_CUR #include #include #include #include "serialize.h" using namespace std; extern int MPIrank, MPIsize; struct Tjob { Tjob() {} template Tjob(int type1, T data1) { type=type1; data=to_string(data1); } int type; string data; }; typedef queue < Tjob > Tjobqueue; void MPQsubmit (const Tjob & job); void MPQtask (Tjob & job); void MPQinfo (int &queuesize, int &sent); void MPQreleaseworkers (); void MPQsharedata (const Tjob & job); template < class T > void inline MPQsharedata (int function, const T & datain) { MPQsharedata (function, to_string (datain)); } void MPQrunjobs (Tjobqueue & inqueue, Tjobqueue & outqueue); void MPQswitch (Tjob & job); void MPQstart (int argc, char *argv[]); void MPQstop (); void MPQinit (int argc, char *argv[]); void MPQstart ();