# STDout and STDerr for array job

**URL:** https://community.openpbs.org/t/stdout-and-stderr-for-array-job/2729
**Category:** Users/Site Administrators
**Created:** [August 4, 2021, 4:39am UTC](https://community.openpbs.org/t/stdout-and-stderr-for-array-job/2729 "2021-08-04T04:39:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jxdn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/jxdn/32/167_2.png) [@jxdn](https://community.openpbs.org/u/jxdn)
#### Post date: [August 4, 2021, 4:39am UTC](https://community.openpbs.org/t/stdout-and-stderr-for-array-job/2729/1 "2021-08-04T04:39:04Z")

</div>

Hi Expert,

Env:  
OS : Centos 7.7  
Kernel: 3.10.0-1062  
PBS Version: 19.1.3

question:

1. I’ve submitted an array job, but the stdout and stderr come after all of the jobs are finished. how to make the stdout and stderr come after sub-jobs are finished?
2. If there is an error in one of the sub-jobs, there is not much information on qstat -tf jobid[index], is there any good way to debug one of the sub-jobs ?

---

<div class="post-metadata">

### Author: ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)
#### Post date: [August 4, 2021, 8:30pm UTC](https://community.openpbs.org/t/stdout-and-stderr-for-array-job/2729/2 "2021-08-04T20:30:37Z")

</div>

> [@jxdn](#):
>
> I’ve submitted an array job, but the stdout and stderr come after all of the jobs are finished. how to make the stdout and stderr come after sub-jobs are finished?

Please look into :

> [@PBS -k, qpeek and output](https://community.openpbs.org/t/pbs-k-qpeek-and-output/1868/2):
>
> I’ve been using PBS variants for about a decade and never heard of qpeek but I did google it and it appears you are on the right track. First I’ll attempt to directly answer your question. PBSpro, by default, spooks output and error logs into a directory on the node where the job is running. At the end of the job the output is returned to the the submission host via scp in the directory where the user ran the qsub command. The -o and -e options allows the user to specify an alternate directo…

Refer:  
[https://www.altair.com/pdfs/pbsworks/PBSUserGuide2021.1.pdf](https://www.altair.com/pdfs/pbsworks/PBSUserGuide2021.1.pdf) and section  
3.3.6 Writing Files Directly to Final Destination

[https://www.altair.com/pdfs/pbsworks/PBSAdminGuide2021.1.pdf](https://www.altair.com/pdfs/pbsworks/PBSAdminGuide2021.1.pdf) and section  
15.6.2.1 Configuring the $usecp MoM Parameter

> [@jxdn](#):
>
> If there is an error in one of the sub-jobs, there is not much information on qstat -tf jobid[index], is there any good way to debug one of the sub-jobs ?

Please try these commands:  
tracejob jobid[index[# tracejob 111[1]  
$PBS\_EXEC/unsupported/pbs\_dtj jobid[index] # $PBS\_EXEC/unsupported/pbs\_dtj 111[1]

Hope this helps
