00001 /* 00002 Threaded Charm++ "Framework Framework" Startup: 00003 This file controls the startup process when writing 00004 to a tcharm-based language, like AMPI or the FEM framework. 00005 00006 Note that you could also start a bunch of AMPI threads 00007 from a regular Charm program, which would use its own 00008 main instead of this one. 00009 00010 Orion Sky Lawlor, olawlor@acm.org, 2003/6/20 00011 */ 00012 #include "tcharm_impl.h" 00013 #include "tcharm.h" 00014 #include "tcharmmain.decl.h" 00015 00016 //Tiny simple main chare 00017 class TCharmMain : public Chare { 00018 public: 00019 static void nodeInit(void) { 00020 TCHARM_User_node_setup(); 00021 FTN_NAME(TCHARM_USER_NODE_SETUP,tcharm_user_node_setup)(); 00022 _registerCommandLineOpt("+tcharm_nomig"); 00023 _registerCommandLineOpt("+tcharm_nothread"); 00024 _registerCommandLineOpt("+tcharm_nothreads"); 00025 _registerCommandLineOpt("+tcharm_trace"); 00026 _registerCommandLineOpt("+tcharm_stacksize"); 00027 _registerCommandLineOpt("-vp"); 00028 _registerCommandLineOpt("+vp"); 00029 _registerCommandLineOpt("+tcharm_getarg"); 00030 } 00031 00032 TCharmMain(CkArgMsg *msg) { 00033 delete msg; 00034 00035 TCHARM_Set_exit(); // Exit when done running these threads. 00036 00037 /*Call user-overridable Fortran setup. 00038 If not overridden, this will call the overridable C setup, 00039 which unless overridden will call the library "fallback" setup, 00040 which usually starts a bunch of TCharm threads running 00041 something like "MPI_Main" (AMPI) or "driver" (FEM). 00042 */ 00043 FTN_NAME(TCHARM_USER_SETUP,tcharm_user_setup)(); 00044 } 00045 }; 00046 00047 #include "tcharmmain.def.h"