OPENFAM MULTI-THREADED & CONTEXT MODEL
OpenFAM 2.0 provides a basic threading and context framework for invoking the data path APIs. All the data path APIs use a single communication context there by restricting the grouping of I/O operation to a single context group. Hence fam_quiet invoked by the application will enforce completion of all the operations invoked from the fam object. Though application may be multi-threaded and share the fam object across multiple threads, it is the applications responsibility to serialize all the OpenFAM APIs from different threads. This thread model does not allow application to optimally utilize cpu and network resources available on the compute node. In order to address these issues to an extent, a concept of user-specific thread model has been added in OpenFAM 3.0.Now OpenFAM supports following threading models:
- Program may be multi-threaded
- No concurrent invocation of OpenFAM APIs by multiple threads
- Quiet will enforce completion of all the operations invoked from all the threads.
- Program may be multi-threaded
- Any thread may invoke OpenFAM APIs
- Quiet will enforce completion of all the operations invoked from all thread.
To open and close of user specific contexts two new API’s - fam_context_open and fam_context_close has been added.
- fam_ctx* fam->fam_context_open()
- void fam->fam_context_close(fam_ctx*)