Nastran launch commands

The Nastran solver is executed usually by command line like „nastran“. Generally it could be with different name,  due to the needs to specify the version of solver. The format nastran command is:

  nastran2012  input_file  keyword1 = value1  keyword2 = value2  …

where the „input_file” is the name of the job to run, the keywordi=valuei is one or more optional keyword assignment arguments. For exemple to run a job with name exemple.dat, it can be done by this command line:

  nastran2012  job

Usually in the home directory (or login) where the jobs are run, is present a RC (Runtime Configuration) file to pre setting all the parameters applied to all the jobs. There are two type of RC files, one is in the home directory, and another one can be sited in the local folder (generally if you use nastran 2012, its name is .nast2012rc). This file should be used to define the parameters that are applied to all jobs contained in the input data file directory.

To skip this RC file it is enough to add the keyword “rcf”. For further information about the managing of RC file should be viewed the “msc_nastran_2007_install_guide”. Hereafter the most important command are listed and explained.

 

  • Scratch

One of the basic keyword is “scratch”:

  nastran2012  job.dat  scratch=yes

The keyword “scratch” can be wrote also as “scr”. It useful to preventing cluttering of the directory with unwanted files (that nastran writes for eventually restart the job). If instead of yes is specified “mini” a reduced database will be created.

 

  • Memory

This keyword is used to specify the amount of memory to allocate. If this parameter is not specified, than the default amount is used (pre-setting in the RC file for exemple). The memory amount can be specified in terms of  number of “words” or byte (sometimes can be specified in the .dat or .bdf file by BUFFSIZE as well) contained in the phisical record.

Exempes:

  nastran2012  job.dat  memory=25mw

The job is run using an open core memory size of 25 megawords, or 25600 kilowords (25×1024, 25600kw), or 26 214 400 words (25x1024x1024). Instead of “mw” can be used “m” as well.

  nastran2012  job.dat  memory=25mb

The job is run using an open core memory size of 25 megabytes, or 25600 kilobytes (25×1024, 25600kb), or 26 214 400 bytes (25x1024x1024). The number of bytes is 8 for operative system like Unix (CRAY UNICOS, NEC), and 4 on all others.

  nastran2012  job.dat  memory=25gb

The job is run using an open core memory size of 25 gigabytes, or 25600 megabytes (25×1024, 25600mb), or 26 214 400 kilobytes (25x1024x1024). With “w” it is possible to use the memory size as is.

 

  • Parallel

By this keyword can be specifies the maximum number of CPUs selected for shared-memory parallel (SMP) processing in several numeric modules. SMP processing reduces the elapsed time at the expense of increased CPU time (the amount of time for which a  CPU was used for processing). The default is 0, which specifies no SMP processing. If “parallel=1″, the parallel algorithms are used on one processor.

  Example: nastran2012  job.dat   parallel=4

The job is run in SMP mode on a maximum of four CPUs. If you need to vary the number of SMP CPUs during a job, you must set either the “parallel” keyword or SYSTEM(107) on a NASTRAN statement to the maximum number of SMP CPUs that will be requested.

 

  • Delete

This keyword allow to delete specific files when the nastran run is completed.  Specifying “delete=yes” will delete the F04, F06 and LOG files when the job completes; “delete=all” will delete the F04, F06, LOG, NDB, OP2, PCH, PLT and XDB files when the job completes.  You can also specify a list of file types, e.g., “delete=f04,log,plt” will only delete the F04, LOG and PLT files. Note that, on UNIX systems, this list of file types is case-sensitive.  That’s means, “delete=master” will delete files with an extension of “master” but not files with an extension of “MASTER” and “delete=MASTER” will delete files with an extension of “MASTER” but not files with an extension of “master”.

 

  • Old

Saves previous copies of the F04, F06, LOG, OP2, OUT, PCH, and PLT output files using sequence numbers (additional user-specified file types can be versioned with the “oldtypes” keyword). Sequence numbers are appended to the keyword filename and are separated by a period.

  Example: nastran2012  job.dat  old=yes

For example, assume your current working directory contains the following files: v2401.datv2401.f04.1v2401.f06v2401.logv2401.log.1; v2401.f04v2401.f04.2v2401.f06.1v2401.log.1v2401.log.3.  Apparently, the user ran the job four times, but deleted some of the files, e.g., v2401.f04.3, v2401.f06.2, and v2401.f06.3. When the job is run again with “old=yes”, the files are renamed as follows: v2401.f04 is renamed to v2401.f04.4, v2401.f06 is renamed to v2401.f06.4, and v2401.log is renamed to v2401.log.4. The sequence number 4 is used because it is one greater than the highest sequence number of all of the selected files (the highest being v2401.log.3).

 

  • After

Holds the job’s execution until the time specified by time. Seethe description of the “at” command in your system documentation for the format of time

  Example: nastran  job.dat  after=9:00

The job is held until 9:00 AM. Only for UNIX systems.

 

  • Batch

Indicates how the job is to be run. If “yes” is specified, the job is run as a background process. If “no” is specified, the job is run in the foreground. If the “aft” or “queue” keywords are specified the batch keyword is ignored. Only for UNIX systems.

  Example: nastran  job.dat  batch=no

The job is run in the foreground.

 

  • Append

Combines the F04, F06, and LOG files into a single file after the run completes. If “no” is specified, the files are not combined. If “yes” is specified, the files are combined into one file with the suffix “.out”.

  Example: nastran  job.dat  append=yes

The F04, F06, and LOG files are combined into a file named example.out. It can be useful for make some envelope with data results.

 

  • Out

Saves the output files using a different file prefix or in a different directory.

Example: nastran  job.dat out=myfile

Output files are created in the current directory with the name “myfile”, e.g., ./myfile.f06 on UNIX and .\myfile.f06 on Windows.

  Example: nastran job.dat  out=mydir

Output files are created in the mydir directory with the name “example”, e.g., ./mydir/example.f06 on UNIX and .\mydir\example.f06 on Windows.

  Example: nastran  job.dat  out=mydir/myfile

Output files are created in the mydir directory with the name “myfile”, e.g., ./mydir/myfile.f06 on UNIX and .\mydir\myfile.f06 on Windows.

 

  • Rcf

Specifies the name of the local RC file.

  Example: nastran  job.dat   rcf=nast.rc

 

  • Sdirectory

Specifies the directory to use for temporary scratch files created during the run. MSC Nastran can create very large scratch files, the scratch directory should contain sufficient space to store any scratch files created during a run. The privileges of directory has to be checked.

  UNIX Example: nastran  job.dat  sdir=/scratch

  Scratch files are created in the directory /scratch. 

  Windows example: nastran  job.dat  sdir=d:\scratch.

  Scratch files are created in the d:\scratch directory

 

  • Smemory

Specifies the amount of space in open core to reserve for scratch memory. The size is specified as the number of blocks (BUFFSIZE word slong) or the number of words or bytes follwed by one of the modifiers: “G”, “GW”, “GB”, “M”, “MW”, “MB”, “K”, “KW”, “KB”, “W”, “B”.

  Example: nastran  job.dat  smem=4mw

This example reserves 4.194.304 words for scratch memory.

 

  • Cputime

Specifies the maximum amount of CPU time that the complete job is permittedto use when the “queue” keyword is used. This time includes the execution ofthe driver program, the MSC Nastran executable, plus any commands specified by the “pre” and “post” keywords. The value can be specified as either “hours:minutes:seconds”:

Example:

        nastran  job.dat queue=small cpu=1:20:0

        nastran  job.dat queue=small cpu=80:0

        nastran  job.dat queue=small cpu=4800

These examples all define the maximum CPU time for the complete job as two hours.

 





 

This entry was posted in FEM - Analysis and tagged , , . Bookmark the permalink.

2 Responses to Nastran launch commands

  1. reynierhdez says:

    Hi! Do you know how can i disable the messages appearing in the terminal output when running NASTRAN:

    MSC Nastran V2014.0 (Intel Windows 10 Pro 6.2 9200) Wed Mar 16 15:58:41 2016
    MSC Nastran beginning job twodoftr.
    MSC Nastran started Wed Mar 16 15:58:42 HodB 2016
    MSC Nastran finished Wed Mar 16 15:58:43 HodB 2016
    MSC Nastran job twodoftr completed.

    I am running nastran several times, and it generates many unnecessary messages that fill the terminal, and i think that it also consumes more time.

    • aerospacengineering says:

      Hello! You must use bach=yes for windows or -bg if you are in UNIX / Linux,
      Examples: 1) nastran job.dat batch=yes 2) nastran -bg job.dat

Leave a Reply