Simple charm example illustrating molecular dynamics
authorKumaresh P <kpattab2@uiuc.edu>
Mon, 21 Apr 2008 01:13:11 +0000 (01:13 +0000)
committerKumaresh P <kpattab2@uiuc.edu>
Mon, 21 Apr 2008 01:13:11 +0000 (01:13 +0000)
examples/charm++/Molecular/Makefile [new file with mode: 0644]
examples/charm++/Molecular/main.C [new file with mode: 0644]
examples/charm++/Molecular/main.ci [new file with mode: 0644]

diff --git a/examples/charm++/Molecular/Makefile b/examples/charm++/Molecular/Makefile
new file mode 100644 (file)
index 0000000..32ed975
--- /dev/null
@@ -0,0 +1,21 @@
+CHARMDIR = /expand/home/kpattab2/charm
+CHARMC = $(CHARMDIR)/bin/charmc $(OPTS)
+
+
+default: all
+all: molecular
+
+
+molecular : main.o
+  $(CHARMC) -language charm++ -o molecular main.o
+
+main.o : main.C main.decl.h main.def.h
+  $(CHARMC) -o main.o main.C
+
+main.decl.h main.def.h : main.ci
+       $(CHARMC) main.ci
+
+
+clean:
+  rm -f main.decl.h main.def.h main.o molecular charmrun
+
diff --git a/examples/charm++/Molecular/main.C b/examples/charm++/Molecular/main.C
new file mode 100644 (file)
index 0000000..4ef2b5c
--- /dev/null
@@ -0,0 +1 @@
+#include "
diff --git a/examples/charm++/Molecular/main.ci b/examples/charm++/Molecular/main.ci
new file mode 100644 (file)
index 0000000..656e698
--- /dev/null
@@ -0,0 +1,38 @@
+module cell {
+
+  array [2D] Cell {
+    entry Cell();
+    entry start();
+    entry forces(CkVec<CkArrayIndex1D> particles);
+  };
+
+};
+
+module interaction {
+
+  array [4D] Interaction {
+    entry Interaction(int i, int j, int k, int l);
+    entry interact(CkVec<CkArrayIndex1D> particles, int i, int j);
+  };
+
+};
+
+
+mainmodule main {
+
+       readonly CProxy_Main mainProxy;
+       readonly int particles;                                 // total number of particles
+       readonly int n;                                         // total number of rows in the grid
+       readonly int m;                                         // total number of columns in the grid
+       readonly double radius;                                 // maximum distance between two interacting particles
+
+       module cell;
+       module interaction;
+
+       mainchare Main {
+               entry Main(CkArgMsg* msg);
+         // entry void stepDone(CkReductionMsg *m);
+               entry void done();
+       };
+
+};