CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Batch Processing and auto-save log file (https://www.cfd-online.com/Forums/fluent/116470-batch-processing-auto-save-log-file.html)

asal April 19, 2013 17:16

Batch Processing and auto-save log file
 
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? :confused:
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.

stuart23 April 19, 2013 18:07

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 April 20, 2013 04:06

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.

blackmask April 21, 2013 00:18

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 April 21, 2013 05:30

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?

blackmask April 21, 2013 09:38

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 April 22, 2013 03:04

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!

blackmask April 22, 2013 04:04

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'

asal April 22, 2013 06:43

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.

blackmask April 22, 2013 09:26

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 April 22, 2013 10:06

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.

blackmask April 22, 2013 21:30

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 April 23, 2013 03:59

Thanks.
I try but it doesn't work.:(


All times are GMT -4. The time now is 09:14.