Edit detail for Running Fluent on the servers revision 5 of 5

1 2 3 4 5
Editor: elizabeth.e.gray.1
Time: 2017/08/03 09:26:27 GMT-4
Note:


        

How to Run Fluent on the servers

This document pertains to Serial Runs only at the moment.

To run Fluent on the servers you will need a few files.

  • Fluent Case file
  • Fluent Command Input file for serial run
  • shell script
  1. Fluent Case File

    This document does not cover any details concerning the Fluent Case file at this moment. This is part of the pre-processing that must be done before the solve.

  2. Fluent Command Input File for Serial Run
    • All of the text commands are in Fluent's help.
      • Unix: man fluent
      • Windows: Start->Programs->ECN Software->Fluent->Fluent->Fluent Documentation
        • Select Text Command List, in your desired format

    The input file is a series of command performed by fluent to do the solve. An example of on input file is:

        Listing for sample_input
        ================================
        =1= file/read-case GR10_05krpm
        =2= solve/init/init
        =3= it 10000
        =4= file/write-data GR10_05krpm
        =5= exit
        ================================
    

    The numbers =X= is the line number, NOT part of the script.

    Line 1: This reads in the case file named

    Line 2: Initialize the solve.

    Line 3: Run the specified number of iterations.

    Line 4: Write the data out to the file name specified.

  3. Shell Script

    The shell script orchestrates everything.

    • Decide where you want to have the wrapper (or script). For this example I will have it in my home directory (or N: drive on windows)
    • Create the script, I will name it run.sh.
    • You can use whatever editor you like (emacs, vi, pico, whatever).
    • Let's take a look at a sample wrapper:
          Listing for run.sh
          ========================================================
          =1= #!/usr/bin/sh
          =2= cd /home/roger/n/hrach/fluent_lsf
          =3= /usr/opt/bin/fluent -g -v2d < input_GR10_05krpm > output_GR10_05krpm
          ========================================================
      

    The numbers =X= is the line number, NOT part of the script.

    Line 1: The shebang line, just letting the OS know where to find the interpreter for the script.

    Line 2: I'm explicitly changing to the directory where the script I want to run in. I am giving the full path so that there is no doubt that I will be in the proper directory.

    Line 3: This is what we have been building up to. This is the command that will start the solve. There are 4 main parts to it.

    1. Path to fluent

      It is best to use the full paths so there is no confusion about application is being used.

    2. Run Flags

      -g tells fluent to run without a GUI or graphics.

      -v2d Start the 2 dimensional, single precision solver.

      Other options are:

      -v2ddp starts two dimensional, double precision solver

      -v3d starts three dimensional, single precision solver

      -v3ddp starts three dimensional, double precision solver

      From the command line, running fluent -help will give other run flags.

    3. Input File

      This is the input file mentioned above.

    4. Output File

      Any output normally printed to the screen will get saved in this file.

We need to make this script executable:

'chmod +x run.sh'

Now we can send this off to a server and forget about it while it chews on the CPU. To do this we use the -f flag for ssh. The syntax is:

'ssh -f server_name file_to_run'

For example:

'ssh -f yuri /home/roger/h/gizmo/run.sh'

You will be prompted for your password. Once you enter it the program runs. Check on the output file(s) to see if the program finishes, the tail command is excellent for this. It is a good idea to output some indication the your script has finished like: "End of Program".

This page lists the department servers. The compute servers are the ones to use.

With this sort of work some post processing will need to be done but that is beyond the scope of this document at the moment.

Useful Commands

To check the load on the server you will run on use:

/usr/local/etc/top or /usr/bin/top

This will show the processes using the most CPU and memory.

/usr/bin/uptime

This returns one line simply summarizing the load on the server over the last 1 minute, 5 minutes, and 15 minutes. A load of 1.0 is a single cpu being used 100%.

Killing Jobs

In the event you need to stop a job do the following:

  1. Get the process id

    Use the top command to list the jobs on the server. You should see your username next to any jobs you have on the server. The display looks something like this:

          PID   USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
          20509 kakoi     25   0 68348  12M 10700 R    36.5  0.3 131:51   0 MATLAB
          20852 kakoi     25   0 80236  58M 11252 R    30.6  1.4 123:13   0 MATLAB
          21112 kakoi     25   0 76088  54M 11212 R    29.6  1.4 119:36   0 MATLAB
          21920 jfrommer  25   0 81904  74M 15676 R    19.7  1.9 101:33   0 MATLAB
          1     root      15   0   512  464   440 S     0.0  0.0   0:05   0 init
          2     root      15   0     0    0     0 SW    0.0  0.0   0:00   0 keventd
          

    The left hand column lists the process id (PID) number for the jobs.

    Say you are jfrommer and would like to kill your job because the data it is dumping is wrong and the run is useless. The PID for it is 21920.

  2. Kill the job

    Now that you have the pid for the job now it's time to stop it. This rather straightforward. Run the command kill -15 21920. This will "politely" stop the job. If that doesn't work after once or twice we need to get mean.

    Run the command kill -9 21920. This should do the trick.

Things to be careful of

  • Creating/Edit documents with Windows editors

    Windows text files are a little different in that they have an extra character at the end of each line. So, unless you edit the files on Linux/Unix you will need to run the the dos2unix command to strip out those extra characters.

  • Unix vs. Windows paths

    Make sure that you use unix paths when running on the servers.

Most of this information is from CSC, the Finnish IT center for science