Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Temporary mat files at the end of run_SINGE_GLG_test.sh #61

Open
atuldeshpande opened this issue Jan 19, 2021 · 4 comments
Open

Comments

@atuldeshpande
Copy link
Collaborator

atuldeshpande commented Jan 19, 2021

Issue: Depending on the data size, large TempMat*.mat files are created during SINGE_GLG_Test, which could overrun user's storage budget leading to subsequent jobs being held.
Fix: We should include the line
eval "rm Temp*.mat"
near the end of run_SINGE_GLG_Test.sh

EDIT: The rm should be more targeted, especially if the storage is shared, with only Temp_<ID>.mat to be deleted.

@agitter
Copy link
Member

agitter commented Jan 22, 2021

The end of currently has SINGE_GLG_Test.m

delete(['TempMat' '_' num2str(params.ID) '.mat']);

Is that line not working?

@atuldeshpande
Copy link
Collaborator Author

I think there's a case to be made to clean up if for any reason a job fails, not reaching this point in MATLAB.

@agitter
Copy link
Member

agitter commented Jan 22, 2021

I agree that we should still delete temporary files even if a job fails. However, is it possible to do that in a way that also cleans up the temporary files if the job fails when run through MATLAB instead of the shell script? For example, can we catch errors in this function and delete the temporary file if there is an error?

@agitter
Copy link
Member

agitter commented Jan 23, 2021

Do we also need to delete the file TempMat.mat that is created here?

SINGE/code/parseParams.m

Lines 76 to 86 in 9c59a1e

function y = isfilecomp(x)
if (exist([x '.mat'], 'file') == 2)
y = 1;
copyfile([x '.mat'],'TempMat.mat');
elseif (exist(x, 'file') == 2)
y = 1;
copyfile(x,'TempMat.mat');
else
y = 0;
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants