It is best to have a piece of code that's complicated (uses arrays), yet
authorChee Wai Lee <cheelee@illinois.edu>
Sat, 13 Sep 2008 20:59:26 +0000 (20:59 +0000)
committerChee Wai Lee <cheelee@illinois.edu>
Sat, 13 Sep 2008 20:59:26 +0000 (20:59 +0000)
completely trivial (imho, simpler than our parallel hello world program).

The need has come up when we're trying to get people to use or modify our
framework.

examples/charm++/nothing_doing/Makefile [new file with mode: 0644]
examples/charm++/nothing_doing/NothingDoing.C [new file with mode: 0644]
examples/charm++/nothing_doing/NothingDoing.ci [new file with mode: 0644]

diff --git a/examples/charm++/nothing_doing/Makefile b/examples/charm++/nothing_doing/Makefile
new file mode 100644 (file)
index 0000000..85a564b
--- /dev/null
@@ -0,0 +1,18 @@
+CHARMC=../../../bin/charmc $(OPTS)
+
+OBJS = NothingDoing.o
+PROJ= -tracemode projections -tracemode summary
+
+all: NothingDoing 
+
+NothingDoing: $(OBJS)
+       $(CHARMC) -language charm++ -o NothingDoing $(OBJS)
+
+NothingDoing.decl.h: NothingDoing.ci
+       $(CHARMC)  NothingDoing.ci
+
+clean:
+       rm -f *.decl.h *.def.h conv-host *.o NothingDoing charmrun *~ *.core 
+
+NothingDoing.o: NothingDoing.C NothingDoing.decl.h
+       $(CHARMC) -c NothingDoing.C
diff --git a/examples/charm++/nothing_doing/NothingDoing.C b/examples/charm++/nothing_doing/NothingDoing.C
new file mode 100644 (file)
index 0000000..0699ad8
--- /dev/null
@@ -0,0 +1,46 @@
+#include "NothingDoing.decl.h"
+
+#define ARR_SIZE 24
+
+CProxy_Main mainChare;  /* readonly */
+
+class Main : public CBase_Main
+{
+public:
+  CProxy_NothingDoing arrayProxy;
+  int count;
+
+  Main(CkArgMsg* m) {
+    count = 0;
+    mainChare = thisProxy;
+
+        arrayProxy = CProxy_NothingDoing::ckNew(ARR_SIZE);  
+        arrayProxy.doNothing();
+    //  CkExit();
+  }
+
+  void done(void) {
+    count++;
+    if (count == ARR_SIZE) {
+      CkExit();
+    }
+  }
+};
+
+class NothingDoing: public CBase_NothingDoing {
+public:
+  NothingDoing() {
+    CkPrintf("Invoking Constructor\n");
+  }
+  NothingDoing(CkMigrateMessage* m) {
+    CkPrintf("Invoking Migrate Constructor\n");
+  }
+  ~NothingDoing() {
+  }
+  void doNothing(void) {
+    CkPrintf("Invoking doNothing\n");
+    mainChare.done();
+  }
+};
+
+#include "NothingDoing.def.h"
diff --git a/examples/charm++/nothing_doing/NothingDoing.ci b/examples/charm++/nothing_doing/NothingDoing.ci
new file mode 100644 (file)
index 0000000..e32580f
--- /dev/null
@@ -0,0 +1,13 @@
+mainmodule NothingDoing {
+
+  readonly CProxy_Main mainChare;
+
+  mainchare Main {
+    entry Main(CkArgMsg *m);
+    entry void done(void);
+  };
+  array [1D] NothingDoing {
+    entry NothingDoing(void);
+    entry void doNothing(void);
+  };
+};