Go to the source code of this file.
OS Threads
This version of converse is for multiple-processor workstations, and we assume that the OS provides threads to gain access to those multiple processors. This section contains an interface layer for the OS specific threads package. It contains routines to start the threads, routines to access their thread-specific state, and routines to control mutual exclusion between them.
In addition, we wish to support nonthreaded operation. To do this, we provide a version of these functions that uses the main/only thread as a single PE, and simulates a communication thread using interrupts.
Allocates one CmiState structure per PE. Initializes all of the CmiState structures using the function CmiStateInit. Starts processor threads 1..N (not 0, that's the one that calls CmiStartThreads), as well as the communication thread. Each processor thread (other than 0) must call ConverseInitPE followed by Cmi_startfn. The communication thread must be an infinite loop that calls the function CommunicationServer over and over.
When called by a PE-thread, returns the processor-specific state structure for that PE.
CmiGetStateN(int n)
returns processor-specific state structure for the PE of rank n.
CmiMemLock() and CmiMemUnlock()
The memory module calls these functions to obtain mutual exclusion in the memory routines, and to keep interrupts from reentering malloc.
CmiCommLock() and CmiCommUnlock()
These functions lock a mutex that insures mutual exclusion in the communication routines.
CmiMyPe() and CmiMyRank()
The usual. Implemented here, since a highly-optimized version is possible in the nonthreaded case.
FIXME: There is horrible duplication of code (e.g. locking code) both here and in converse.h. It could be much shorter. OSL 9/9/2000
Definition in file machine-smp.c.
1.5.1