Project

General

Profile

Transferring standard output/error files

Added by Balint Tunde about 15 years ago

I wanted to test if I can redirect the standard output of a non-interactive command and then retrieve the output with the -FileTransfer option.
With the CREAM_CE :

$ jsaga-job-run.sh --batch -Output output.txt -WorkingDirectory /tmp -Error error.txt -FileTransfer 'output1.txt\</tmp/output.txt' \
-Executable /bin/date -r cream://creamce.gina.sara.nl:8443/cream-pbs-short
[2010-03-01 14:32:56,925]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Output' because job is interactive
[2010-03-01 14:32:56,925]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Error' because job is interactive
[cream://creamce.gina.sara.nl:8443/cream-pbs-short]-[CREAM834203402]

Why is the job interactive, if I specified --batch?
If I tried to see the submitted job description, I got:

$ jsaga-job-run.sh --batch --description -Output output.txt -WorkingDirectory /tmp -Error error.txt \
-FileTransfer 'output1.txt\</tmp/output.txt' \
-Executable /bin/date -r cream://creamce.gina.sara.nl:8443/cream-pbs-short
[2010-03-01 14:18:02,741]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Output' because job is interactive
[2010-03-01 14:18:02,741]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Error' because job is interactive
[
  Type = "Job";
  BatchSystem   = "pbs";
  QueueName     = "short";
  Executable = "/bin/sh";
  StdOutput = "1267449482333-output.txt";
  StdError = "1267449482333-error.txt";
  OutputSandbox = {"1267449482333-output.txt","1267449482333-error.txt"};
  OutputSandboxBaseDestURI = "gsiftp://creamce.gina.sara.nl/tmp/";
  Requirements = true ;
  Rank = -other.GlueCEStateEstimatedResponseTime ;
  RetryCount = 0;
]

Why did the executable change to /bin/sh?
How can I get the StdOutput and StdError for a running job, because then maybe the output can be obtained with jsaga-cp.sh, if also the OutputSandboxBaseDestURI is known. But if -FileTransfer is specified, then I get a random number in the standard output/error file name, and if the -FileTransfer attribute isn't specified then I get the random number as a directory...
$jsaga-job-run.sh -d -Output output.txt -WorkingDirectory /tmp -b -Executable /bin/date \
-r cream://creamce.gina.sara.nl:8443/cream-pbs-short 
[
  Type = "Job";
  BatchSystem   = "pbs";
  QueueName     = "short";
  Executable = "/bin/date";
  StdOutput = "output.txt";
  OutputSandbox = {"output.txt"};
  OutputSandboxBaseDestURI = "gsiftp://creamce.gina.sara.nl/tmp/1267451742864/";
  Requirements = true ;
  Rank = -other.GlueCEStateEstimatedResponseTime ;
  RetryCount = 0;
]

LCG_CE (trying to submit a Globus job) - with the gatekeeper adaptor:
$ jsaga-job-run.sh -b -d -Output output.txt -WorkingDirectory /tmp -Executable /bin/date \
-FileTransfer 'output.txt\<output.txt' -r gatekeeper://tbn14.nikhef.nl:2119
[2010-03-01 15:02:51,653]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Output' because job is interactive
&
(executable = /bin/sh)
(two_phase=300)
(stdout = stdout.txt)
(stderr = stderr.txt)
(directory = /tmp)

Same problem as with Cream CE? I can't specify input files either, because I can't specify the transfer with the FileTransfer attribute.
jsaga-job-run.sh -b -d -WorkingDirectory /tmp -Executable /bin/echo -Arguments input.txt -Input input.txt \
-FileTransfer 'input.txt\>input.txt' -r gatekeeper://tbn14.nikhef.nl:2119
[2010-03-01 15:20:11,848]  INFO fr.in2p3.jsaga.helpers.xslt.XSLLogger : Ignoring attribute 'Input' because job is interactive
&
(executable = /bin/sh)
(two_phase=300)
(stdout = stdout.txt)
(stderr = stderr.txt)
(directory = /tmp)

WMS:
If I try to submit something similar to the WMS, the job description is:
$jsaga-job-run.sh --batch --description -Output output.txt -FileTransfer 'output1.txt\</tmp/output.txt' \
-Executable /bin/date -r  wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server
Type = "Job";
Executable = "/bin/date";
Requirements = true
&& (other.GlueCEStateStatus=="Production");
Rank = (-other.GlueCEStateEstimatedResponseTime);
StdOutput = "output.txt";
OutputSandbox = {"output.txt", "/tmp/output.txt"};
OutputSandboxDestURI = {"output.txt", "output1.txt"};
OutputStorage = "/tmp";

And the job is submitted, it runs, but then I can obtain the output only with jsaga-job-get-output_WMS.sh, and the file is transferred to /tmp/output.txt, so the FileTransfer attribute isn't used?

Regards,
Tünde
P.s. I've tried these with the newest snapshot - 2010.02.24


Replies (6)

RE: Transferring standard output/error files - Added by Reynaud Sylvain about 15 years ago

Hi Tünde,

Thank you for this detailled description, it contains all the information I needed to reproduce and understand your problems with FileTransfer.

Answer to your questions about CREAM and LCG-CE:
When the FileTransfer attribute is not supported by the middleware (LCG-CE) or not yet implemented by the adaptor (CREAM), JSAGA tries to transfer files through the job input/output streams, which are available only in interactive mode...
I think that this is better than just throwing a NotImplemented exception as it should, but this mechanism still needs to be improved. I will try to think about a better solution and let you know on this thread if I find one...

Answer to your questions about WMS:
Output is obtained only with jsaga-job-get-output_WMS.sh => that's the expected behavior for batch mode.
File is transferred to /tmp/output.txt => I have opened a bug for this:
https://forge.in2p3.fr/issues/show/454

Regards,
Sylvain

RE: Transferring standard output/error files - Added by Balint Tunde about 15 years ago

Hi Sylvain,
Thank you for your reply.
Now I have another question about submitting to WMS.
If I submit a batch job, but don't specify the Output argument, then after the job is done, I get a message that the output is retrieved, but there is actually nothing to retrieve. Shouldn't there be a default 'stdout' file to retrieve or state that there is nothing to retrieve?

$ jsaga-job-run.sh  -b -Executable /bin/hostname -Queue trekker.nikhef.nl:2119/jobmanager-pbs-short 
-r wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server

$jsaga-job-run.sh -d -b -Executable /bin/hostname -Queue trekker.nikhef.nl:2119/jobmanager-pbs-short \
-r wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server 
Type = "Job";
Executable = "/bin/hostname"; 
Requirements = true
&& (other.GlueCEStateStatus=="Production")
&& other.GlueCEUniqueID == "trekker.nikhef.nl:2119/jobmanager-pbs-short" ;
Rank = (-other.GlueCEStateEstimatedResponseTime);
OutputStorage = "/tmp";

$ jsaga-job-get-output_WMS.sh [wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server]
    -[https://grasveld.nikhef.nl:9000/q48jIWM9q53cKsuS5ZiElA]  
Job output have been retrieved successfully 

If Output is specified, it works.
Best regards,
Tünde

RE: Transferring standard output/error files - Added by Reynaud Sylvain about 15 years ago

Hi Tünde,

We can not add a default 'stdout' file to retrieve because it would not be conform to the SAGA specification.

We could add a state to specify that there is nothing to retrieve since our cleanup method is not standard anyway, but when such a method will be added to the SAGA specification it will probably not have this state.

The proper way to do this would be to query the job description, but retrieving the job description of a job from a JVM different than the JVM that submitted the job is not yet supported by JSAGA. Until this will be supported, we can replace the message with "Job output have been retrieved successfully (if it exists)" and let the user remember what he asked for.

RE: Transferring standard output/error files - Added by Reynaud Sylvain about 15 years ago

Hi Tünde,

Management of attributes FileTransfer, Input, Output and Error has been improved in JSAGA core engine, in order to be homogeneous for all the plug-ins and more conform to the SAGA specification.
Support for FileTransfer has also been implemented in CREAM plug-in, and rewritten in WMS plug-in (I have closed bug https://forge.in2p3.fr/issues/show/454).
Finally, the behavior of jsaga-job-run command has been modified in order to enable to submit jobs that are neither batch jobs (i.e. no --batch option), nor interactive jobs (i.e. add -Input, -Output or -Error option).

These modifications should solve all the problems you mentioned in this thread, except the last one (jsaga-job-output command still returns message "Job output have been retrieved successfully (if it exists)").

Please let me know if you still have problems with this new version.

RE: Transferring standard output/error files - Added by Balint Tunde about 15 years ago

Hi,
I know that the following command shouldn't work, but I accidentally forgot to redirect the standard output and I still tried to get the output then I got something like this:

$ jsaga-job-run.sh -d -b -Output output.txt -Executable /bin/date \
-r wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server
Type = "Job";
Executable = "/bin/date";
Requirements = true
&& (other.GlueCEStateStatus=="Production");
Rank = (-other.GlueCEStateEstimatedResponseTime);
  StdOutput = "output.txt";
OutputStorage = "/tmp";

$ jsaga-job-run.sh -b -Executable /bin/date -Output output.txt \
-r wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server
[wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server]-[https://grasveld.nikhef.nl:9000/qhATthRoLX0kMAyTgIZ29Q]

$ jsaga-job-get-output.sh [wms://graszode.nikhef.nl:7443/glite_wms_wmproxy_server]-[https://grasveld.nikhef.nl:9000/qhATthRoLX0kMAyTgIZ29Q]
Exception in thread "main" java.lang.NullPointerException
        at fr.in2p3.jsaga.impl.job.instance.AbstractSyncJobImpl.doPostStagingAndCleanup(AbstractSyncJobImpl.java:305)
        at fr.in2p3.jsaga.impl.job.instance.AbstractSyncJobImpl.postStagingAndCleanup(AbstractSyncJobImpl.java:294)
        at fr.in2p3.jsaga.command.JobGetOutput.main(JobGetOutput.java:62)

I got the same behavior if I didn't specify the -Output argument, but I tried to retrieve the job output.

Best,
Tünde

RE: Transferring standard output/error files - Added by Reynaud Sylvain about 15 years ago

Hi Tünde,

Please note that according to the SAGA specification, jsaga-job-get-output should (and will) retrieve nothing.

However, the bug you found also occurred when using the FileTransfer attribute.

It is now fixed in the new snapshot.

Best regards,
Sylvain

    (1-6/6)