libs/ck-libs/tcharm/tcharm.C File Reference

Go to the source code of this file.

Data Structures

class  TCharmTraceLibList

Functions

 CtvDeclare (TCharm *, _curTCharm)
 CkpvDeclare (int, mapCreated)
void TCHARM_Api_trace (const char *routineName, const char *libraryName)
CDECL void AMPI_threadstart (void *data)
static void startTCharmThread (TCharmInitMsg *msg)
void checkPupMismatch (PUP::er &p, int expected, const char *where)
CkArrayID TCHARM_Get_threads (void)
void TCHARM_Set_fallback_setup (TCHARM_Fallback_setup_fn f)
void TCHARM_Call_fallback_setup (void)
CDECL int TCHARM_Get_num_chunks (void)
FDECL int FTN_NAME (TCHARM_GET_NUM_CHUNKS, tcharm_get_num_chunks)
CDECL void TCHARM_Set_stack_size (int newStackSize)
FDECL void FTN_NAME (TCHARM_SET_STACK_SIZE, tcharm_set_stack_size)
CDECL void TCHARM_Set_exit (void)
CDECL void TCHARM_Create (int nThreads, TCHARM_Thread_start_fn threadFn)
FDECL void FTN_NAME (TCHARM_CREATE, tcharm_create)
static CProxy_TCharm TCHARM_Build_threads (TCharmInitMsg *msg)
CDECL void TCHARM_Create_data (int nThreads, TCHARM_Thread_data_start_fn threadFn, void *threadData, int threadDataLen)
FDECL void FTN_NAME (TCHARM_CREATE_DATA, tcharm_create_data)
CkGroupID CkCreatePropMap (void)
CkArrayOptions TCHARM_Attach_start (CkArrayID *retTCharmArray, int *retNumElts)
void TCHARM_Suspend (void)
 Suspend the current thread. Resume by calling thread->resume().
CDECL int TCHARM_Element (void)
CDECL int TCHARM_Num_elements (void)
FDECL int FTN_NAME (TCHARM_ELEMENT, tcharm_element)
FDECL int FTN_NAME (TCHARM_NUM_ELEMENTS, tcharm_num_elements)
static void checkAddress (void *data)
CDECL int TCHARM_Register (void *data, TCHARM_Pup_fn pfn)
FDECL int FTN_NAME (TCHARM_REGISTER, tcharm_register)
CDECL void * TCHARM_Get_userdata (int id)
FDECL void * FTN_NAME (TCHARM_GET_USERDATA, tcharm_get_userdata)
CDECL void TCHARM_Set_global (int globalID, void *new_value, TCHARM_Pup_global_fn pup_or_NULL)
CDECL void * TCHARM_Get_global (int globalID)
CDECL void TCHARM_Migrate (void)
 FORTRAN_AS_C (TCHARM_MIGRATE, TCHARM_Migrate, tcharm_migrate,(void),())
 FORTRAN_AS_C (TCHARM_ASYNC_MIGRATE, TCHARM_Async_Migrate, tcharm_async_migrate,(void),())
 FORTRAN_AS_C (TCHARM_ALLOW_MIGRATE, TCHARM_Allow_Migrate, tcharm_allow_migrate,(void),())
CDECL void TCHARM_Evacuate ()
 FORTRAN_AS_C (TCHARM_MIGRATE_TO, TCHARM_Migrate_to, tcharm_migrate_to,(int *destPE),(*destPE)) CDECL void TCHARM_Yield(void)
 FORTRAN_AS_C (TCHARM_YIELD, TCHARM_Yield, tcharm_yield,(void),())
 FORTRAN_AS_C (TCHARM_BARRIER, TCHARM_Barrier, tcharm_barrier,(void),())
 FORTRAN_AS_C (TCHARM_DONE, TCHARM_Done, tcharm_done,(void),())
FDECL int FTN_NAME (TCHARM_IARGC, tcharm_iargc)
FDECL void FTN_NAME (TCHARM_GETARG, tcharm_getarg)
void _initCharm (int argc, char **argv)
 This is the main charm setup routine.
CDECL void TCHARM_Init (int *argc, char ***argv)
FDECL void FTN_NAME (TCHARM_INIT, tcharm_init)
CDECL int TCHARM_System (const char *shell_command)

Variables

static int lastNumChunks = 0
static TCharmTraceLibList tcharm_tracelibs
static int tcharm_nomig = 0
static int tcharm_nothreads = 0
static int tcharm_stacksize = 1*1024*1024
static int tcharm_initted = 0
static CkGroupID mapID
static char * mapping = NULL
int vals [2] = {0,1}
static TCHARM_Fallback_setup_fn g_fallbackSetup = NULL
TCHARM_Thread_options g_tcharmOptions (1)


Function Documentation

CtvDeclare ( TCharm ,
_curTCharm   
)

CkpvDeclare ( int  ,
mapCreated   
)

void TCHARM_Api_trace ( const char *  routineName,
const char *  libraryName 
)

Definition at line 101 of file tcharm.C.

References Converse::CkMyPe(), CmiPrintf(), CmiPrintStackTrace(), TCharm::getElement(), TCharmTraceLibList::isTracing(), and tcharm_tracelibs.

CDECL void AMPI_threadstart ( void *  data  ) 

Definition at line 526 of file ampi.C.

References pupFromBuf(), and MPI_threadstart_t::start().

Referenced by ampiCreateMain(), and startTCharmThread().

static void startTCharmThread ( TCharmInitMsg msg  )  [static]

Definition at line 117 of file tcharm.C.

References TCharm::activateThread(), AMPI_threadstart(), TCharmInitMsg::data, TCharm::deactivateThread(), and TCharmInitMsg::threadFn.

Referenced by TCharm::run(), and TCharm::TCharm().

void checkPupMismatch ( PUP::er p,
int  expected,
const char *  where 
)

Definition at line 182 of file tcharm.C.

References p.

Referenced by TCharm::pup(), and TCharm::pupThread().

CkArrayID TCHARM_Get_threads ( void   ) 

Definition at line 506 of file tcharm.C.

References TCharm::get(), and TCharm::getProxy().

void TCHARM_Set_fallback_setup ( TCHARM_Fallback_setup_fn  f  ) 

Definition at line 561 of file tcharm.C.

References g_fallbackSetup.

Referenced by ampiNodeInit(), armciProcInit(), and MBlockProcInit().

void TCHARM_Call_fallback_setup ( void   ) 

Definition at line 565 of file tcharm.C.

References g_fallbackSetup.

Referenced by TCHARM_User_setup().

CDECL int TCHARM_Get_num_chunks ( void   ) 

Definition at line 578 of file tcharm.C.

References CkGetArgv(), Converse::CkMyPe(), Converse::CkNumPes(), CmiGetArgIntDesc(), and lastNumChunks.

Referenced by ampiCreateMain(), ArmciDefaultSetup(), FTN_NAME(), and MBlockFallbackSetup().

FDECL int FTN_NAME ( TCHARM_GET_NUM_CHUNKS  ,
tcharm_get_num_chunks   
)

Definition at line 589 of file tcharm.C.

References TCHARM_Get_num_chunks().

CDECL void TCHARM_Set_stack_size ( int  newStackSize  ) 

Definition at line 608 of file tcharm.C.

References g_tcharmOptions, and TCHARM_Thread_options::stackSize.

Referenced by FTN_NAME().

FDECL void FTN_NAME ( TCHARM_SET_STACK_SIZE  ,
tcharm_set_stack_size   
)

Definition at line 613 of file tcharm.C.

References TCHARM_Set_stack_size().

CDECL void TCHARM_Set_exit ( void   ) 

Definition at line 617 of file tcharm.C.

References TCHARM_Thread_options::exitWhenDone, and g_tcharmOptions.

Referenced by TCharmMain::TCharmMain().

CDECL void TCHARM_Create ( int  nThreads,
TCHARM_Thread_start_fn  threadFn 
)

Definition at line 620 of file tcharm.C.

References TCHARM_Create_data().

Referenced by ArmciDefaultSetup(), FTN_NAME(), and MBlockFallbackSetup().

FDECL void FTN_NAME ( TCHARM_CREATE  ,
tcharm_create   
)

Definition at line 627 of file tcharm.C.

References TCHARM_Create().

static CProxy_TCharm TCHARM_Build_threads ( TCharmInitMsg msg  )  [static]

Definition at line 657 of file tcharm.C.

References CkCreatePropMap(), mapID, mapping, TCharmInitMsg::numElements, and opts.

Referenced by TCHARM_Create_data().

CDECL void TCHARM_Create_data ( int  nThreads,
TCHARM_Thread_data_start_fn  threadFn,
void *  threadData,
int  threadDataLen 
)

Definition at line 634 of file tcharm.C.

References TCharmInitMsg::data, g_tcharmOptions, TCharmInitMsg::numElements, and TCHARM_Build_threads().

Referenced by ampiCreateMain(), FTN_NAME(), and TCHARM_Create().

FDECL void FTN_NAME ( TCHARM_CREATE_DATA  ,
tcharm_create_data   
)

Definition at line 649 of file tcharm.C.

References TCHARM_Create_data().

CkGroupID CkCreatePropMap ( void   ) 

CkArrayOptions TCHARM_Attach_start ( CkArrayID *  retTCharmArray,
int retNumElts 
)

Definition at line 676 of file tcharm.C.

References TCharm::get(), TCharm::getNumElements(), TCharm::getProxy(), and opts.

Referenced by ampiInit(), ARMCI_Init(), and MBLK_Init().

void TCHARM_Suspend ( void   ) 

Suspend the current thread. Resume by calling thread->resume().

Definition at line 689 of file tcharm.C.

References TCharm::get(), and TCharm::suspend().

CDECL int TCHARM_Element ( void   ) 

Definition at line 697 of file tcharm.C.

References TCharm::get(), and TCharm::getElement().

Referenced by AMPI_Register_main(), ampiInit(), ARMCI_Init(), ARMCI_Myid(), FEM_My_partition(), FEM_Print(), FTN_NAME(), MBLK_Get_myblock(), MBLK_Init(), and MBLK_Print().

CDECL int TCHARM_Num_elements ( void   ) 

Definition at line 702 of file tcharm.C.

References TCharm::get(), and TCharm::getNumElements().

Referenced by ARMCI_Procs(), FEM_Num_partitions(), FTN_NAME(), and MBLK_Get_nblocks().

FDECL int FTN_NAME ( TCHARM_ELEMENT  ,
tcharm_element   
)

Definition at line 708 of file tcharm.C.

References TCHARM_Element().

FDECL int FTN_NAME ( TCHARM_NUM_ELEMENTS  ,
tcharm_num_elements   
)

Definition at line 710 of file tcharm.C.

References TCHARM_Num_elements().

static void checkAddress ( void *  data  )  [static]

Definition at line 714 of file tcharm.C.

References CmiIsomallocInRange(), CmiThreadIs(), tcharm_nomig, and tcharm_nothreads.

Referenced by FTN_NAME(), and TCHARM_Register().

CDECL int TCHARM_Register ( void *  data,
TCHARM_Pup_fn  pfn 
)

Definition at line 723 of file tcharm.C.

Referenced by AMPI_Register(), FEM_Register(), and MBLK_Register().

FDECL int FTN_NAME ( TCHARM_REGISTER  ,
tcharm_register   
)

Definition at line 729 of file tcharm.C.

References TCharm::add(), checkAddress(), data, and TCharm::get().

CDECL void* TCHARM_Get_userdata ( int  id  ) 

Definition at line 737 of file tcharm.C.

References TCharm::get(), and TCharm::lookupUserData().

Referenced by FEM_Get_userdata(), FTN_NAME(), MBLK_Get_registered(), and MPI_Get_userdata().

FDECL void* FTN_NAME ( TCHARM_GET_USERDATA  ,
tcharm_get_userdata   
)

Definition at line 742 of file tcharm.C.

References TCHARM_Get_userdata().

CDECL void TCHARM_Set_global ( int  globalID,
void *  new_value,
TCHARM_Pup_global_fn  pup_or_NULL 
)

Definition at line 746 of file tcharm.C.

Referenced by FEM_Init(), IDXL_Init(), pupFEM_Chunk(), and pupIDXL_Chunk().

CDECL void* TCHARM_Get_global ( int  globalID  ) 

Definition at line 757 of file tcharm.C.

Referenced by FEM_Init(), FEM_chunk::get(), FEMchunk::get(), IDXL_Chunk::getNULL(), IDXL_Init(), pupFEM_Chunk(), and pupIDXL_Chunk().

CDECL void TCHARM_Migrate ( void   ) 

Definition at line 766 of file tcharm.C.

Referenced by AMPI_Migrate(), ARMCI_Migrate(), and FEM_Migrate().

FORTRAN_AS_C ( TCHARM_MIGRATE  ,
TCHARM_Migrate  ,
tcharm_migrate  ,
(void)  ,
()   
)

Definition at line 771 of file tcharm.C.

References TCharm::async_migrate(), and TCharm::get().

FORTRAN_AS_C ( TCHARM_ASYNC_MIGRATE  ,
TCHARM_Async_Migrate  ,
tcharm_async_migrate  ,
(void)  ,
()   
)

Definition at line 778 of file tcharm.C.

References TCharm::allow_migrate(), and TCharm::get().

FORTRAN_AS_C ( TCHARM_ALLOW_MIGRATE  ,
TCHARM_Allow_Migrate  ,
tcharm_allow_migrate  ,
(void)  ,
()   
)

Definition at line 785 of file tcharm.C.

References TCharm::get(), and TCharm::migrateTo().

CDECL void TCHARM_Evacuate (  ) 

Definition at line 793 of file tcharm.C.

References TCharm::evacuate(), and TCharm::get().

Referenced by AMPI_Evacuate().

FORTRAN_AS_C ( TCHARM_MIGRATE_TO  ,
TCHARM_Migrate_to  ,
tcharm_migrate_to  ,
(int *destPE)  ,
destPE 
)

Definition at line 799 of file tcharm.C.

References TCharm::get(), and TCharm::schedule().

FORTRAN_AS_C ( TCHARM_YIELD  ,
TCHARM_Yield  ,
tcharm_yield  ,
(void)  ,
()   
)

Definition at line 807 of file tcharm.C.

References TCharm::barrier(), and TCharm::get().

FORTRAN_AS_C ( TCHARM_BARRIER  ,
TCHARM_Barrier  ,
tcharm_barrier  ,
(void)  ,
()   
)

Definition at line 814 of file tcharm.C.

References c, CkExit(), and TCharm::getNULL().

FORTRAN_AS_C ( TCHARM_DONE  ,
TCHARM_Done  ,
tcharm_done  ,
(void)  ,
()   
)

Definition at line 823 of file tcharm.C.

References c, and TCharm::getNULL().

FDECL int FTN_NAME ( TCHARM_IARGC  ,
tcharm_iargc   
)

Definition at line 840 of file tcharm.C.

References CkGetArgc().

FDECL void FTN_NAME ( TCHARM_GETARG  ,
tcharm_getarg   
)

Definition at line 845 of file tcharm.C.

References CkGetArgc(), and CkGetArgv().

CDECL void TCHARM_Init ( int argc,
char ***  argv 
)

Definition at line 861 of file tcharm.C.

References _initCharm(), ConverseInit(), and tcharm_initted.

Referenced by FTN_NAME().

FDECL void FTN_NAME ( TCHARM_INIT  ,
tcharm_init   
)

Definition at line 868 of file tcharm.C.

References TCHARM_Init().

CDECL int TCHARM_System ( const char *  shell_command  ) 

Definition at line 968 of file tcharm.C.

References TCharm::get(), and TCharm::system().

Referenced by AMPI_System().


Variable Documentation

int lastNumChunks = 0 [static]

Definition at line 22 of file tcharm.C.

Referenced by TCHARM_Get_num_chunks().

TCharmTraceLibList tcharm_tracelibs [static]

Definition at line 54 of file tcharm.C.

Referenced by TCharm::procInit(), and TCHARM_Api_trace().

int tcharm_nomig = 0 [static]

Definition at line 55 of file tcharm.C.

Referenced by checkAddress(), TCharm::procInit(), TCharm::pup(), and TCharm::TCharm().

int tcharm_nothreads = 0 [static]

Definition at line 55 of file tcharm.C.

Referenced by checkAddress(), TCharm::procInit(), TCharm::run(), TCharm::stop(), and TCharm::TCharm().

int tcharm_stacksize = 1*1024*1024 [static]

Definition at line 56 of file tcharm.C.

Referenced by TCharm::procInit(), and TCHARM_Thread_options::sanityCheck().

int tcharm_initted = 0 [static]

Definition at line 57 of file tcharm.C.

Referenced by TCharm::procInit(), and TCHARM_Init().

CkGroupID mapID [static]

Definition at line 59 of file tcharm.C.

Referenced by TCHARM_Build_threads().

char* mapping = NULL [static]

Definition at line 60 of file tcharm.C.

Referenced by TCharm::procInit(), and TCHARM_Build_threads().

int vals[2] = {0,1}

Definition at line 514 of file tcharm.C.

Referenced by TCharm::barrier(), and TCharm::done().

TCHARM_Fallback_setup_fn g_fallbackSetup = NULL [static]

Definition at line 560 of file tcharm.C.

Referenced by TCHARM_Call_fallback_setup(), and TCHARM_Set_fallback_setup().

TCHARM_Thread_options g_tcharmOptions(1)

Referenced by TCHARM_Create_data(), TCHARM_Set_exit(), and TCHARM_Set_stack_size().


Generated on Sun Jun 29 13:29:36 2008 for Charm++ by  doxygen 1.5.1