CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

Batch Processing and auto-save log file

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree6Likes
  • 1 Post By stuart23
  • 1 Post By blackmask
  • 2 Post By blackmask
  • 1 Post By blackmask
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Display Modes
Old   April 19, 2013, 17:16
Default Batch Processing and auto-save log file
  #1
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hi!

I am trying to run an steady case with FLUENT using the batch processing. Until the end of calculation nothing written to the log file, so I cannot check the residuals. Is there any command which I should add in .jou and/or .sh file, so I can write the log during the calculation?

Here is my .jou file:

---------------------
file/ read-case-data xx.cas.gz
file autosave data-frequency 5000
file autosave root-name xx
solve/iterate 16000
file/write-data Final.dat.gz
exit yes
---------------------

Moreover I want to know:
what does the following command do in the .jou file?
file autosave root-name xx

The data-frequency command save the .dat file in a format .dat. Is it possible to save the data-frequency file in format dat.gz instead of dat?
Thanks.
asal is offline   Reply With Quote

Old   April 19, 2013, 18:07
Default
  #2
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 16
stuart23 will become famous soon enough
Hi Astio, the auto save function will save a file every 5000 iterations with the name "xx" followed by the iteration number.

To log your run, you need to pipe the output to another file from the command line. This is done using the ">" symbol. Eg. fluent -g 3ddp -i ajournalfile.jou > log file.text

Stu
asal likes this.
__________________
http://bc247.wordpress.com
stuart23 is offline   Reply With Quote

Old   April 20, 2013, 04:06
Default
  #3
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hello and thanks for your reply.

"file autosave data-frequency 5000" will save the sata file every 5000 iterations with the name "xx", but I ask about the next line:
"file autosave root-name xx"?
which file will autosaved by this command? what is root-name?

About the jou file, I cannot follow you! would you please give me more details about the approach? this should be added somewhere is the .sh file or .jou file? or in the esubmit command where should have ">"?

I use this command to submit:
esubmit -n 3 -t 1200 ./fluent-pdc.sh 8 3ddp ./test.jou

Thanks in advance for your help.
asal is offline   Reply With Quote

Old   April 21, 2013, 00:18
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
The names of auto-saved files composed of two parts, 'root-name' and 'time step'/'flow time'. For example, for steady case, when you set 'root-name' as './save/my-case-name.gz', then after 5000 iterations, the auto-saved data with be named './save/my-case-name-05000.dat.gz'. Note that for that to work, you have to ensure that a directory named 'save' in the same directory as your journal file. If you don't want you data file to be compressed, then you can set the 'root-name' to './save/my-case-name' instead.
asal likes this.
blackmask is offline   Reply With Quote

Old   April 21, 2013, 05:30
Default
  #5
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hello and thanks for your reply.
Any solution for the log auto-save log file?
Is it possible to save the log file every several iteration?
I am looking for an approach to save the log file over the batch Processing and/or direct from the fluent, but I cannot find any thing.
Is there any solution?
asal is offline   Reply With Quote

Old   April 21, 2013, 09:38
Default
  #6
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
You can ask the one who created the file named 'fluent-pdc.sh' for a solution, or you can try this command if he is not nearby at the moment:
esubmit -n 3 -t 1200 fluent 3ddp -t8 -i ./test.jou > run.log 2>&1
asal and Tarantino like this.
blackmask is offline   Reply With Quote

Old   April 22, 2013, 03:04
Default
  #7
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hello!

I try your command and I got this line in the run.log file

esubmit: warning: `fluent' don't seem to be in PATH.

How should I change the .sh file? I ask the provider people and they don't know how it functioned!
asal is offline   Reply With Quote

Old   April 22, 2013, 04:04
Default
  #8
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
You need to view the content of 'fluent-pdc.sh'. It sets the environment variables for FLUENT and process the arguments. You should be able to find a line which looks like

fluent -g -t $1 $2 -i $3

You need to modify this line to redirect the output, which results in

fluent -g -t $1 $2 -i $3 > run.log 2>&1

After that you can submit your job with the command you told before, i.e.,
esubmit -n 3 -t 1200 ./fluent-pdc.sh 8 3ddp ./test.jou
and you will find the output in 'run.log'
blackmask is offline   Reply With Quote

Old   April 22, 2013, 06:43
Default
  #9
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hi!

I think you become a bit misunderstood about my issue!
I have the run.log file at the end of simulation. For instance I run the case over 1000 iteration, then when the simulation is done, then the log file is written in the run.log.
But the problem is, this file doen't fill until the end of simulation, so I cannot check anything until the end. I want to have the log simultaneously or after several iterations.
asal is offline   Reply With Quote

Old   April 22, 2013, 09:26
Default
  #10
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
The default behavior is to send the output to STDOUT, which is usually connected to your terminal. But when the program is run via a job manager, the job manager will take care of the STDOUT. Usually it will redirect STDOUT to a temporally created file and put that file to your working directory after the job is done. That's how you see the output at the end of your simulation. The solution is simple. If you redirect the STDOUT to some file (i.e., > run.log) then you will see the content during the simulation. It will be updated almost simultaneously except for some latency caused by file buffering.
asal likes this.
blackmask is offline   Reply With Quote

Old   April 22, 2013, 10:06
Default
  #11
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hello.

I know what you mean. here is a part of my .sh file:

Code:
if [ $SP_PROCS -gt 1 ]; then
# use SP_HOSTFILE to create the correct format and rename it
i=0
while [ $i -lt $PPN ]; do
       cat $SP_HOSTFILE > $SP_JID.hosts
       i=$((i+1))
done
echo "CNF file is: ">>$LOGFILE
cat $SP_JID.hosts >>$LOGFILE
FLUENTARGS="-t`expr $PPN \* $SP_PROCS` -cnf=$SP_JID.hosts -pethernet -mpi=openmpi"
elif [ $PPN -gt 1 ]; then
# use shared memory MPI only
FLUENTARGS="-t$PPN"
fi
echo "Executing fluent in directory `pwd`">>$LOGFILE
echo "fluent $SOL -g $FLUENTARGS -i $JOU" >>$LOGFILE
fluent $SOL -g $FLUENTARGS -i "$JOU"   > run.log 2>&1
echo "Finished running Fluent" >>$LOGFILE
Could you please let me know how should I change it to have the mentioned file?
As you can see I have this command:
Code:
fluent $SOL -g $FLUENTARGS -i "$JOU"   > run.log 2>&1
But as I said I have the run.log file at the end of simulation.
By the way, many thanks for your help.
asal is offline   Reply With Quote

Old   April 22, 2013, 21:30
Default
  #12
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
I see. Maybe you can try
fluent $SOL -g $FLUENTARGS -i "$JOU" 2>run.log 1>&2
instead. If it does not make any difference, I have no clue either.
asal likes this.
blackmask is offline   Reply With Quote

Old   April 23, 2013, 03:59
Default
  #13
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Thanks.
I try but it doesn't work.
asal is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 16:42.