90 likes | 214 Views
An SCT User Interface using DAQ-1 Status of Preliminary Investigations Dave Robinson. Matt Palmer UK ROD DAQ Meeting 20/11/2002. Overview IDL and IPC issues Working Demonstration Performance Tests Future Plans. The working model developed so far.
E N D
An SCT User Interface using DAQ-1 Status of Preliminary Investigations Dave Robinson. Matt Palmer UK ROD DAQ Meeting 20/11/2002 • Overview • IDL and IPC issues • Working Demonstration • Performance Tests • Future Plans
The working model developed so far. Each server can run on any machine, with all communication via OH or IS (DAQ-1) or directly via IPC. • sct_api_server • publishes sctapi • stores raw data and/or ROOT histos in IS using OH SCT API IPC OH IS User Interface Information Service • is_server • stores histos/info Java GUI or C++ prog or interactive ROOT IPC OH • sct_analysis_server • publishes analysis api • retrieves/displays histos from IS using OH • performs further analysis SCT Analysis
Summary of IDL Development Process • Write some IDL that describes the interface to the object(s) • Compile the IDL to produce the ‘stub’ and ‘skeleton’ code • Identify the classes generated by the IDL compiler that we need to use in our own implementations • Compile all generated code, together with our application code Eg Example C++ SCTAPI class SCTAPI interface in IDL - ‘sct_api.idl’ class SCTAPI { public: SCTAPI() {} ~SCTAPI() {} void initialise() {} long configure(char* configname) {..} char* getConfigName() { ..} void publishRawData() {..} void publishRootData(char* option) {..} }; module sct { interface sctapi : ipc::freeable { void initialise(); long configure(in string configname); string getConfigName(); oneway void publishRawData(); oneway void publishRootData(in string option); }; };
Compile the IDL: sct.hh sct.cc sct-server-stubs.cc sct_api.idl Compilation sct-server-stubs.cc: c++-stubber ./sct_api.idl sct.cc: sct_api.idl c++-stubber ./sct_api.idl Extra code generated by IDL compilation process: ‘Converts the object reference into a network connection to a remote server and then marshal the arguments we provide to an operation on the object reference, convey them to the correct method in the object denoted by our object reference, execute the method, and return the results’
include “sct.hh” class SCTAPI : public IPCObject, public virtual sct_T_sctapi { public: SCTAPI(const char* oid, IPCServer* server, IPCPartition* thepartition) : IPCObject(oid, server){ // class initialisation} virtual ~SCTAPI() {} virtual void initialise(sctStatus* status) { status->returnCode = sctReply_Success; } virtual long configure(sctStatus* status, char* newconfigname) { // ..configuration code here } virtual void publishRawData(sctStatus* status) { // code to publish raw data in IS using OH } virtual void publishRootData(sctStatus* status, char* option) { // code to publish ROOT histogram(s) } }; int main(int argc, char** argv) { IPCCore::init(false); IPCPartition p(Partition_Name); IPCServer* server = new IPCServer(API_Server_Name, p); SCTAPI* h = new SCTAPI(API_Object_Name, server, &p); if (!h->publish()) cout << "Failed to publish " << API_Object_Name << endl; server->run(); cout << "Run over" << endl; h->withdraw(); delete h; delete server; } Implementation of SCTAPI class Publish sctapi object and start server
Basic IDL Data Types • [unsigned] short • [unsigned] long • float • double • char • boolean • string • octet • enum • ‘any’ Some notes on writing IDL Object Orientation Encapsulation: IDL only concerned with publicly available operations Method overloading: Not permitted Inheritance : Yes Exceptions: Datatypes (like structures)
Performance Tests • 3 small programs to test data transfer speed of pipes, IPC and IS • Code available on website • ISSpeedTest shows how to use IS (stream objects) • IPCSpeedTest shows how to use IDL sequences
Test Servers Producer Receiver Speed Pipes N/A Pccu Pccu 15 Mb/s IPC Pccu Pccu Pccu 5.4 Mb/s IPC Pccu Pccu Pcda 5.0 Mb/s IS Pccu Pccu Pccu 344 kb/s IS Pccu Pccu Pcda 564 kb/s Results • Machines: • Pccu: 1.8 Ghz P4, 256 Mb • Pcda: 1.9 Ghz P4, 256 Mb • Many other processes on these machines – results are indicative.
Future Plans • Implement ‘realistic’ SCTAPI definitions (from Peter/Bruce) • Incorporate some SCTDAQ analysis code into analysis API • Integrate more fully into DAQ-1 (use IGUI subpanel?) • ...