Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| charm [2012/01/05 16:30] – [Exemple : HelloWorld] admin | charm [2012/01/05 16:36] (Version actuelle) – [Exemple : HelloWorld] admin | ||
|---|---|---|---|
| Ligne 15: | Ligne 15: | ||
| ======Exemple : HelloWorld ====== | ======Exemple : HelloWorld ====== | ||
| - | ** Interface**\\ | + | {{: |
| - | <file C hello.c> | + | |
| - | module hello { | + | |
| - | + | ||
| - | array [1D] Hello { | + | |
| - | entry Hello(); | + | |
| - | entry void sayHi(int); | + | |
| - | | + | |
| - | + | ||
| - | }; | + | |
| - | </ | + | |
| - | + | ||
| - | **Header file**\\ | + | |
| - | <file C hello.h> | + | |
| - | + | ||
| - | #ifndef __HELLO_H__ | + | |
| - | #define __HELLO_H__ | + | |
| - | + | ||
| - | class Hello : public CBase_Hello { | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| - | /// Constructors /// | + | |
| - | Hello(); | + | |
| - | Hello(CkMigrateMessage *msg); | + | |
| - | + | ||
| - | /// Entry Methods /// | + | |
| - | void sayHi(int from); | + | |
| - | }; | + | |
| - | + | ||
| - | #endif // | + | |
| - | </ | + | |
| + | ===== Exemple d'une exécution ===== | ||
| + | <code bash> | ||
| + | $ charmrun +p3 ./hello 10 | ||
| + | Running "Hello World" with 10 elements using 3 processors. | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | </ | ||
| ======Liens | ======Liens | ||
| http:// | http:// | ||