Exemplo n.º 1
0
int main(int argc, char* argv[]) {

    // Initialize the runtime
    chpl_rt_init(argc, argv);

    // Run the main function for this node.
    chpl_task_callMain(chpl_executable_init);

    // have everyone exit, returning the value returned by the user written main
    // or 0 if it didn't return anything
    chpl_rt_finalize(chpl_gen_main_arg.return_value);

    return 0; // should never get here
}
Exemplo n.º 2
0
//
// A program using Chapel as a library might look like:
//
// int main(int argc, char* argv) {
//
//   chpl_library_init(...)
//   chpl__init_MODULE_1(LINE, FILENAME)
//   ...
//   chpl__init_MODULE_N(LINE, FILENAME)
//
//   call_chapel_function_from_MODULE_1()
//   ...
//   call_chapel_function_from_MODULE_N()
//
//   chpl_library_finalize()
//
// }
//
void chpl_library_init(int argc, char* argv[]) {
    chpl_rt_init(argc, argv);                   // Initialize the runtime
  chpl_task_callMain(chpl_std_module_init);     // Initialize std modules
}