|
[Sponsors] |
How to write data from output window to text-file continuously in batch mode |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 10, 2019, 09:52 |
How to write data from output window to text-file continuously in batch mode
|
#1 |
New Member
Jonas Abeken
Join Date: Apr 2018
Location: Zurich
Posts: 10
Rep Power: 8 |
Hi all,
I'm running simulations on a cluster in batch-mode and am trying to write the data that is normally shown in the output-window into a text-file. If a simulation aborts I currently get only an error-file from the cluster with the final error-output from Star. Sometimes this is enough for debugging, sometimes it isn't. From my old job, I'm used to getting the whole output written continuously in a log-file and would like to implement this in my new job as well (also as it is very useful to check into the current proceedings of a running simulation). Any input or suggestion is appreciated! Thanks and regards Jonas |
|
April 10, 2019, 18:00 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
This is more a question to ask your cluster admin.
But at the very least, you can tell us what is your cluster environment? How do you submit jobs to the cluster? |
|
April 11, 2019, 04:49 |
|
#3 | |
New Member
Jonas Abeken
Join Date: Apr 2018
Location: Zurich
Posts: 10
Rep Power: 8 |
Quote:
Thanks for the advice, I'm already trying to reach the cluster support, however without any success so far. It's an IBM cluster, I submit the jobs via the "bsub"-command. I tried the "-o" output option but with that the logfile is only created after the whole job is finished. I was hoping for an in-Star option to write out the output continuously (which is why I posted here) but am of course open to other solutions. |
||
April 11, 2019, 05:05 |
Solution found
|
#4 |
New Member
Jonas Abeken
Join Date: Apr 2018
Location: Zurich
Posts: 10
Rep Power: 8 |
So, I found a possible solution through the command "bpeek" (for IBM clusters).
For future references here is my current solution: bpeek - f job_ID > logfile.log & writes the output of the job continuously to logfile.log. |
|
April 12, 2019, 17:19 |
|
#5 |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 567
Rep Power: 21 |
Hi Jonas,
redirecting the standard output into a file is a very basic task in most operating systems. Assuming you are not running a windows cluster (which would be wasteful for running starccm), your submission script for your cluster should contain a line such as: Code:
starccm+ -batch ..... -np .... -power ... At the end of the command add "> arbitraryOutputfile.txt" so that have a command line, such as: Code:
starccm+ -batch run -np .... -power ... > arbitraryOutputfile.txt Code:
starccm+ -batch run -np .... -power ... > arbitraryOutputfile.txt 2>&1 Such redirection even works in bat scripts of windows systems. The program bpeek is probably specific program for your cluster software. Redirection to other channels, such as files, works in allmost all cases. You might do some tutorials on linux environments to understand your cluster system better. Redirection is one of the most basic concepts to be learned. Best regards, Sebastian |
|
April 15, 2019, 07:42 |
|
#6 |
New Member
Jonas Abeken
Join Date: Apr 2018
Location: Zurich
Posts: 10
Rep Power: 8 |
Hi Sebastian,
thanks for your input. I am aware of the general Linux redirection of output via ">". The issue I faced was simply that I don't execute the starccm+ directly. So instead of Code:
starccm+ -batch ... Code:
bsub -n ... starccm+ -power ... -batch batch.java simfile.sim As mentioned the bpeek command allows me to circumvent that by actually returning the output of starccm+ instead of bsub. |
|
April 15, 2019, 11:28 |
|
#7 |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 567
Rep Power: 21 |
Although i am not familiar with the LSF job manager, i am sure, that there is a way to tell bsub where to write an output file. You may have look into the manual of bsub.
The first info on google yields: Code:
bsub -o myjob.out -e myjob.err ./myjob.sh Edit: Reading the manual, it revealed, that by design the LSF manager does not continously write out an output; depending on the file system design, other systems do. So, i guess, using bpeek is the simplest solution for you. Another solution would be packing the full starccm command into a shell script which would contain the output redirection as described in my first post. I assumed you would do so - because of it's convenience. |
|
Tags |
batch mode, hpc, log file, output |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |