mpiSettings

Configure options for MPI communication

Syntax

mpiSettings('DeadlockDetection','on')
mpiSettings('MessageLogging','on')
mpiSettings('MessageLoggingDestination','CommandWindow')
mpiSettings('MessageLoggingDestination','stdout')
mpiSettings('MessageLoggingDestination','File','filename')

Description

mpiSettings('DeadlockDetection','on') turns on deadlock detection during calls to labSend and labReceive. If deadlock is detected, a call to labReceive might cause an error. Although it is not necessary to enable deadlock detection on all workers, this is the most useful option. The default value is 'off' for communicating jobs, and 'on' inside spmd statements. Once the setting has been changed within an spmd statement, the setting stays in effect until the parallel pool is closed.

If you are using a large number of workers, you might experience a performance increase by disabling deadlock detection.

If some workers do not call labSend or labReceive for long periods of times, deadlock detection can cause communication errors. If you encounter errors, try disabling deadlock detection.

mpiSettings('MessageLogging','on') turns on MPI message logging. The default is 'off'. The default destination is the MATLAB® Command Window.

mpiSettings('MessageLoggingDestination','CommandWindow') sends MPI logging information to the MATLAB Command Window. If the task within a communicating job is set to capture Command Window output, the MPI logging information will be present in the task's CommandWindowOutput property.

mpiSettings('MessageLoggingDestination','stdout') sends MPI logging information to the standard output for the MATLAB process. If you are using a MATLAB Job Scheduler, this is the mjs service log file.

mpiSettings('MessageLoggingDestination','File','filename') sends MPI logging information to the specified file.

Examples

Set deadlock detection for a communicating job inside the jobStartup.m file for that job:

    % Inside jobStartup.m for the communicating job
    mpiSettings('DeadlockDetection','on');
    myLogFname = sprintf('%s_%d.log',tempname,labindex);
    mpiSettings('MessageLoggingDestination','File',myLogFname);
    mpiSettings('MessageLogging','on');

Turn off deadlock detection for all subsequent spmd statements that use the same parallel pool:

spmd;mpiSettings('DeadlockDetection','off');end

Tips

Setting the MessageLoggingDestination does not automatically enable message logging. A separate call is required to enable message logging.

mpiSettings has to be called on the worker, not the client. That is, it should be called within the task function, within jobStartup.m, or within taskStartup.m.

Introduced before R2006a