function [OK, serKey, serWarnings] = remoteStore( serVal, arrayHolderToClear )
%

% Copyright 2008-2018 The MathWorks, Inc.

    wc = parallel.internal.general.WarningsCollector();
    pClearIfNecessary( arrayHolderToClear );

    try
        deserVal = parallel.internal.pool.deserialize( serVal );
        serKey   = parallel.internal.pool.serialize( spmdlang.ValueStore.store( deserVal ) );
        OK       = true;
    catch E
        OK       = false;
        serKey   = parallel.internal.pool.serialize( E );
    end
    serWarnings = parallel.internal.pool.serialize( wc.Warnings );
end
