MATLAB: How to reset the ‘default’ RemoteClusterAccess object

2014aclusterinfocredentialsMATLAB Parallel ServerParallel Computing Toolboxssh

I have created a cluster object 'cluster' and job object 'j'. I accidentally selected the wrong key during my submission. Now when I try to resubmit an identical job, it remembers my past key. This happens when I have 1) created a new job, and 2) cleared the cluster object and created a new cluster object, and 3) restarted matlab, and 4) restated the client computer.
I finally moved the erroneously selected key to another location, only to get the following error when trying to submit the job:
>> submit(j)
Error using parallel.Job/submit (line 304)
Job submission failed because the user supplied IndependentSubmitFcn (independentSubmitFcn)
errored.
Caused by:
Error using parallel.cluster.RemoteClusterAccess.getConnectedAccessWithMirror (line 238)
The supplied identity file 'C:\this\is\a\fake\path\key.ppk' does
not exist.
How do I clear these credentials from being used by MATLAB (I'm using 2014a on Windows 8.1)?
I've also tried manually creating a new RemoteClusterAccess object and setting the job to use it (using the same procedure from this example), but the same problem happens.

Best Answer

I thought that was where this might be going :) There should be a function, ClusterInfo. Call
>> ClusterInfo.state
Displayed, you should see PrivateKeyFile. To clear it, type
>> ClusterInfo.setPrivateKeyFile('')
The next time you submit a job, you'll be prompted for the new key file. Alternatively, you could just set it above to the new location and you won't be prompted.
The SLURM scripts are well outdated for R2012a+. I have the updated version in my sandbox, it's just making the time to publish them.