2 Basic TCHARM Programming

Any routine in a TCHARM program runs in one of two contexts:

Serial Context
Routines that run on only one processor and with only one set of data. There are absolutely no limitations on what a serial context routine can do--it is as if the code were running in an ordinary serial program. Startup and shutdown routines usually run in the serial context.

Parallel Context
Routines that run on several processors, and may run with several different sets of data on a single processor. This kind of routine must obey certain restrictions. The program's main computation routines always run in the parallel context.

Parallel context routines run in a migratable, user-level thread maintained by TCHARM. Since there are normally several of these threads per processor, any code that runs in the parallel context has to be thread-safe. However, TCHARM is non-preemptive, so it will only switch threads when you make a blocking call, like ``MPI_Recv" or ``FEM_Update_field".



Subsections

June 29, 2008
Charm Homepage