function tf = canUseMsmpi()
% canUseMsmpi - is this computer compatible with MSMPI.

% Copyright 2014 The MathWorks, Inc.

% Currently MSMPI is only functional on win64. 
if strcmp(dct_arch(), 'win64')
    % Need to check Vista or greater.
    verStr = system_dependent('getwinsys');
    % verStr is in the form: 'Version major.minor (Build ...)'
    majorVerNumStr = regexprep(verStr, '^Version ([0-9]+)\..*', '$1');
    majorVerNum = str2double(majorVerNumStr);
    % Vista/Server 2008 is the first Windows version supported by MSMPI, and according to
    % http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724832(v=vs.85).aspx
    % this is also the first version with major version number 6.
    tf = majorVerNum >= 6;
else
    tf = false;
end

end
