[petsc-dev] Sun Grid Engine problem for PETSC_VIEWER_BINARY_MATLAB and workaround

Richard Katz richard.katz at earth.ox.ac.uk
Mon Mar 30 01:21:06 CDT 2015


Hi,

I’m running PETSc code on a cluster that uses the Sun Grid Engine batch submission system.  In this system, the working directory is set as the directory where the job script is submitted (with -cwd flag) or the user’s home directory (without the -cwd flag).

In my job scripts on other clusters, I usually create a new directory using the PBS_JOBID and put the output of my petsc code into that directory.  With the Sun Grid Engine, I cannot figure out how to get output to go to this directory — it always ends up in one of the two directories mentioned above.

(If anyone knows how to fix this problem in the SGE job script, please inform me!)

My current approach is to give petsc output filenames with the full path, e.g. 
/work/katz/ss3093/ss3093_0001

Unfortunately this causes a different problem.

With PETSC_VIEWER_BINARY_MATLAB, this full path is written into the  .info file.  If the output directory then gets moved to have a different path, PetscReadBinaryMatlab.m then chokes because it looks for the binary file down the incorrect path.

As a workaround, I have added these lines into PetscReadBinaryMatlab.m immediately after line 35 (though I’m sure there is a better way to do this).

         % check for incorrect path specified in .info file
         if (~isempty(strfind(str,'PetscOpenFile')) && ~exist(Set.filename,'file'))
             dirsep = strfind(Set.filename,'/');
             if dirsep; Set.filename = Set.filename(dirsep(end)+1:end); end
         end

Cheers,
Rich


More information about the petsc-dev mailing list