We coded the binary image compression algorithm in pC++ by representing each pixel as an object and the image as a collection of objects distributed on a set a of processors. pC++ provided parallel method invocation that allowed the compression function to be invoked in parallel.
We noticed that the program newbic ran to completion but often generated images that were too small. So, we set out to investigate the behavior of the program in Ariadne.
The source code was modified by adding user level ariadne events for Merge and NoMerge. We also traced other element id, level and the element no for each merge. Part of the source code for the bic program is given below.const int MERGE_EVENT = 3; class imageElement { // represents a portion of an image public: char myColor; // WHITE, BLACK, or TREE Treeptr myTree; // if (myColor == TREE), myTree points to structure of tree char myStatus; // ACTIVE, WAITING, or DISABLED }; #include "kernel.h" Collection imageCollection : public SuperKernel { // represents an entire image, with imageElements public: imageCollection(Distribution *T, Align *A); void findWork(int totalLevels); MethodOfElement: virtual char myColor; virtual Treeptr myTree; virtual char myStatus; void getInitialData(); void merge(int oid, int level); void nomerge(int oid, int level); void doWork(const int totalLevels); }; void imageCollection::merge(int oid, int level) { // This could be expanded (set new level value in tree), but not necessary. pcxx_AriadneRecordUserEvent(MERGE_EVENT, 3, oid, level, index1); printf("Elt %d merged elt %d at level %d\n", index1, oid, level); ...Here, three variables index1 - the element id, oid - the element id of the other element participating in the merge and, level - level at which the merge takes place are traced along with every MERGE_EVENT . Here, MERGE_EVENT is a constant with the value 3. This results in a trace record to be generated for U_PCXX_user_event3 . The function
pcxx_AriadneRecordUserEvent(int event_id, int no_of_vars_traced, char var1, char var2, char var3);