Cerius2 Modeling Environment



13       Scripts and Licensing

All Cerius2 applications, including the Visualizer, are command driven. The graphical interface takes your input (mouse clicks and drags, etc.), continuously translates it into commands, records the commands into logs, and passes the commands to the programs themselves.

Although many users generally need to know nothing about this process, you may want to learn about creating and using Cerius2 commands, to facilitate performing a series of related or identical tasks in an automated way.

You may also want to know about Cerius2's facilities for running application modules on remote machines and for managing licenses.

This section explains

This section contains information on:

Command logging and scripting

Controlling Cerius2 from scripts

Managing licenses

Running application modules externally

Table 25. Finding information about scripts and licensing

If you want to know about: Read:
Initialization (startup) scripts.   Starting Cerius2 with a command script file.  
Performing repetitive or routine tasks.   Playing back scripts and log files, Starting Cerius2 with a command script file.  
Recording aall or part of a Cerius2 session.   Recording commands.  
Starting and saving Cerius2 sessions.   Working with Cerius2 sessions.  
Other ways of setting preferences and customizations.   Using saved sessions as preferences settings, Customizing the Interface.  
Running Cerius2 without its graphics.   Starting Cerius2 with a command script file.  

You should already know...

The basics of starting Cerius2 and using its interface are demonstrated in Introducing Cerius2 and described in The Cerius2 Interface.


Command logging and scripting

Command logging and scripting utilities enable you to record Cerius2 commands into script files and play them back (Playing back scripts and log files) at a later time.

Finding information

This section includes information on:

Recording commands

Command tracing

Recording commands

If you want to understand the course of all or part of a Cerius2 session, you can examine files containing logged commands. These files form basic command scripts.

Command scripts can be played back later (Playing back scripts and log files) unmodified, to repeat a previous session. Alternatively, you can supplement a command script with Tool Command Language (Tcl) statements to produce responsive, program-like scripts that can be used to drive Cerius2 and its applications.

Related information

To learn more about using Tcl to enhance script files, see Cerius2 Command Script Guide, as well as information in the documentation and support areas of our website

http://www.msi.com/doc/

http://www.msi.com/support/

How it works

During every Cerius2 session, generated commands are continuously logged to a file named RUN.LOG. This continuous log file provides a record of the modeling activity that took place in a Cerius2 session.

The RUN.LOG file is normally overwritten when a new Cerius2 session is started; however, the contents of the current RUN.LOG file (that is, the session log) can be saved under another filename at any time. Such files provide a snapshot of the session at a particular time.

You can also open a supplementary log file, called a segment log file, into which all generated commands are logged until this file is closed. A segment log file enables you to create a log of only part of a session (for example, only that part of a session from which you want to create a command script). Command logging to RUN.LOG also continues, regardless of whether a segment log file is open.

Accessing the tools

Select the Utilities/Record Commands... menu item in the main Visualizer control panel to access the Record Commands control panel.

Recording commands

To copy all the current contents of the RUN.LOG file to a file with a different name, change the filename in the entry box near the top of the Record Commands control panel (if desired) and click the Dump current Log contents action button.

To start copying commands into a supplementary log file, check the Echo commands into file check box. All subsequent commands appear in both the RUN.LOG file and the segment log file.

To discontinue copying commands into the supplementary log file, uncheck the Echo commands into file check box. If you want to record more commands into the same file later in your session, simply check the Echo commands into file check box again.

To enter a comment in the current RUN.LOG file (and the current segment log file, if one is open), enter the desired text into the Enter Comment into Log File entry box.

Managing command logs

To empty and restart the current RUN.LOG file from the current point in your Cerius2 session, click the Empty Log File contents action button in the Record Commands control panel. This action does not reinitialize the Cerius2 session (Starting a new session), it merely restarts the log file.

Additional information

Please see the on-screen help for details on the functioning of each control in the Record Commands control panel.

Command tracing

Command tracing enables you to view and store various levels of Cerius2 command output. You can also display the commands in the text window as they are generated. This output can be useful for monitoring the commands generated during a Cerius2 session, especially if you are logging commands for use in a script.

Levels of commands

Three levels of commands are generated by the graphical interface and application modules:

Accessing the tools

Select the Utilities/Command Tracing... menu item in the main Visualizer control panel to access the Command Tracing control panel.

What level of commands to trace

To specify the level (see Levels of commands) of commands to trace, check one or more of the Activate Command Tracing check boxes.

Tip

To turn on or off tracing of primary commands, you can also check the Activate command tracing check box in the Customize Environment control panel (Accessing the tools). The commands are sent to the text window and/or a file, as specified in the Command Tracing control panel (see Where to send the commands).  

Where to send the commands

To display the traced commands in the text window, check the Text Window check box.

To log the traced commands in a file, check the Trace File check box and (if desired) enter a filename in the Trace File entry box.

Changing command tracing

To stop command tracing or change the level of commands to trace, uncheck the relevant check boxes in the Command Tracing control panel.

Examining most recent commands

To print the most recent primary and utility commands in the text window, enter the command history in the text window.

Additional information

Please see the on-screen help for details on the functioning of each control in the Command Tracing control panel.

Some additional control over command logging and history is accessible via the Customize Environment control panel (Accessing the tools).


Controlling Cerius2 from scripts

Cerius2 enables you to play back command scripts containing command strings, control syntax, and, optionally, additional Tcl commands. The commands in the script are processed as though they were being generated in real time by the Cerius2 interface, triggering the appropriate actions.

Command logging and scripting utilities enable you to record Cerius2 commands (Recording commands) into script files and play them back at a later time.

Command scripts are often based on Cerius2 log files, which can be used unmodified, to repeat a previous session. Alternatively, you can supplement a log file with Tool Command Language (Tcl) statements to produce responsive, program-like command scripts that can be used to drive Cerius2 and its applications. In addition, you can write command scripts completely from scratch.

Finding information

This section includes information on:

Playing back scripts and log files

Starting Cerius2 with a command script file

Related information

To learn more about using Tcl to enhance script files, see Cerius2 Command Script Guide.

You should already know...

Recording commands is discussed under Command logging and scripting.

Playing back scripts and log files

If you have certain tasks that you nearly always perform during a Cerius2 session, you can record them in a command script file, and then have Cerius2 automatically perform these tasks from the script, either immediately (Starting Cerius2 with a command script file) or when you request it (this section). Then you can proceed with additional tasks using the graphical interface.

Accessing the tools

Select the Utilities/Playback Script... menu item in the main Visualizer control panel to access the Playback Script control panel.

Finding the script file

Use the file browser and selector tools to find and choose the desired script file. How to use these tools is detailed under Finding model file(s). (All file browsers work similarly.)

Playing back Cerius2 scripts

You can play back the script file in several ways:

Additional information

Please see the on-screen help for details on the functioning of each control in the Playback Script control panel.

Starting Cerius2 with a command script file

Ordinarily, the cerius2 script (Starting Cerius2) starts a regular Cerius2 session that takes its input by means of your interaction with the graphical interface.

Cerius2 can also be run from a recorded script, either with or without the graphical interface. You can manually specify the script when you start Cerius2 or have Cerius2 always process a certain script automatically without your needing to specify it.

Ways of automating Cerius2

You can run Cerius2 from a command script in several ways:

Uses of start-up command scripts

If you have certain tasks that you always or often perform when you start a Cerius2 session, you can record them in a command script file, and then have Cerius2 automatically perform these tasks from the script, either immediately (this section) or when you request it (Playing back scripts and log files). Then you can proceed with additional tasks using the graphical interface.

If you have repetitive, routine calculations or other tasks that can be performed without the graphical interface, you can record these tasks in a command script file. Then you can run Cerius2 in a completely automated way, in either the foreground or background, without your interacting with the graphical interface at all.

Starting Cerius2 with an automatic script

To run Cerius2 from a command script with the graphical interface and have it immediately and automatically process a certain command script, move (cd) to a directory containing an initialization script, then simply start Cerius2 as usual.

An initialization script is simply an ordinary command script file that you have saved with the filename cerius2.ini (see Recording commands).

To set up different initialization scripts for use when you run Cerius2 for different purposes or projects, simply create separate directories, each containing a different cerius2.ini file. If Cerius2 does not find a cerius2.ini file in the directory in which you start it, it looks for a cerius2.ini file in your home directory.

After the initialization file's command script terminates, Cerius2 enters interactive mode, awaiting your input.

Starting Cerius2 with a specified script

To run Cerius2 from a command script with the graphical interface and have it immediately process a specified command script, start Cerius2 by entering at the system prompt:


>	cerius2 scriptfile 
where scriptfile is the name of your command script file. Any text output is sent (as usual) to the text window.

To run Cerius2 from a command script with the graphical interface, have it immediately process a specified command script, and have it send any text output to a file instead of to the text window, start Cerius2 by entering at the system prompt:


>	cerius2 -o outputfile scriptfile 
where outputfile is the name of the file that you want to send any text output to, and scriptfile is the name of your command script file.

In either case, graphics are displayed in normal fashion in the model window. After the command script terminates, Cerius2 enters interactive mode, awaiting your input.

Running Cerius2 without the graphical interface

To run Cerius2 without the graphical interface in background mode, enter at the system prompt:


>	cerius2 -b outputfile scriptfile 
where outputfile is the name of the file that you want to send any text output to, and scriptfile is the name of your command script file.

To run Cerius2 without the graphical interface in foreground mode, enter at the system prompt:


>	cerius2 -n -o outputfile scriptfile 
where outputfile is the name of the file that you want to send any text output to, and scriptfile is the name of your command script file.

To run Cerius2 without the graphical interface in foreground mode and send any text output to the shell window rather than to a file, enter at the system prompt:


>	cerius2 -n scriptfile 
where scriptfile is the name of your command script file.


Managing licenses

As an end user, you rarely need to be concerned about license management, since it is handled automatically after the Cerius2 software has been installed.

When to manage licenses

Some situations exist in which you may want to manage licenses interactively, for example:

Important

If you want to run Cerius2 applications in parallel, please see the Cerius2 Installation and Administration Guide.  

Accessing the tools

Select the Utilities/Application Licensing... menu item in the main Visualizer control panel to access the License Management control panel.

For all of the functions below, select the name of the desired module in the Available Licenses list box. This list box shows the names of modules that require licenses and for which you have purchased licenses.

What licenses are available?

The Available Licenses list box shows the names of modules that require licenses and for which you have purchased licenses.

The total number of supported floating licenses (i.e., module-specific licenses that your site has purchased) for a selected module appears near the bottom of the License Management control panel.

The total number of people currently using floating licenses for that module is listed in the line below the total number supported.

Who are using other licenses?

The login name(s) of the people using floating licenses for the selected module are shown in the Checked out to list box.

For token licenses, this user list appears only if you currently have the selected feature checked out via token licensing. This list of users includes the total number of tokens each person has checked out (in parentheses after their name). However, it does not indicate which people have a particular feature checked out. When you check out a feature, the indicated total number of tokens by your name is increased.

Reserving licenses

To manually reserve (check out) one floating licence for the selected module, click the name of the selected module in the Available Licenses list box or click the CHECK OUT pushbutton.

To manually reserve several token licenses for a specific feature, user, or machine, please see the Cerius2 Installation and Administration Guide on using an options file.

Releasing licenses

To return (check in) a license that you have checked out manually for a selected module but are finished using, click the name of the selected module in the Available Licenses list box or click the CHECK IN pushbutton.

Additional information

Please see the on-screen help for details on the functioning of each control in the License Management control panel.

For additional information about a particular license (i.e., when it expires and what machine is serving it), click the License pushbutton.

For more information about licensing (including the differences between token and floating licenses and between features and modules) and license management, please refer to the Cerius2 Installation and Administration Guide.


Running application modules externally

External application facilities enable you to manage Cerius2 application modules running on external servers.

Cerius2 applications are implemented as modules that plug into the modeling environment provided by the Visualizer. Most Cerius2 application modules function (either individually or grouped with related modules) as independent processes. As a result, these application modules can be run on your local machine or externally on a remote host (of the same or different type) anywhere on your network.

Uses of remote servers

This implementation method has several advantages, including:

How it works

To run application modules externally, you use the controls on the Process Management control panel to select the appropriate application module, process, remote host, and executable program, to modify any of your selections (if necessary), and to specify that the module should be started either immediately or when the module is accessed from a menu card. Once you have started an application module on a remote host, you can also use the Process Management control panel to stop that module's process.

Tip

To always run an application module externally under the conditions you set with the Process Management control panel, you need to save the current session (Saving the current session). Otherwise, your settings are saved only for the current Cerius2 session.  

Cerius2 and independent processes

Some application modules (for example, those on the QUANTUM cards) are actually used only to set up and act as interfaces to calculations that are run by essentially separate programs that are independent of the Cerius2 interface. Such modules offer their own job-control options that affect the separate (usually computationally intensive) program. These controls are accessed from the application module itself and are documented in the user guide for the relevant module.

The Process Management control panel affects only those processes that are under the direct control of the Cerius2 interface, not independent processes that are spawned by applications such as the quantum modules.

For example, the MOPAC interface application (control panels, etc.) is controlled by the Process Management control panel, but the MOPAC program itself (the calculation job) is managed by MOPAC Job Control control panel.

Accessing the tools

Select the Utilities/External Processes... menu item in the main Visualizer control panel to access the Process Management control panel.

Specifying processing conditions

To specify what process you want to start or stop, select its name from the Application list box in the Process Management control panel. The name of the relevant process appears in the Process list box.

Tip

If you are unsure of the application name assigned to a module, go to the module, open any of its control panels, and use the right mouse button to request help. The first line of the help window that appears contains the application name.  

The names of machines on your network appear in the Host list box. Select the one that you want to send the process to. (The machine you are running Cerius2 on is called localhost.) If a machine's name is not on that list but you know it is accessible from your machine, you can enter its name in the Remote Host entry box.

If you need a password in order to use the specified machine, enter it in the Password entry box.

Tip

To determine whether you must enter a password, enter the command rsh hostname in a separate shell window. If you are not prompted for a password to log on to the specified remote host, a password is not required here.  

To specify your working directory on the specified host, if it does not appear automatically, enter the name of your working directory in the Working Directory entry box. This directory must already exist.

If more than one executable can run on the chosen machine, select the name of the desired executable in the Executable list box. You can also enter the complete path and file name of the executable in the Executable entry box.

(The registry information contained the list boxes in this control panel can become outdated if changes are made after Cerius2 was installed at your site. To update this information, your installation administrator needs to edit the applcomm.db file. For additional information on this file, please see the Cerius2 Installation and Administration Guide.)

Starting an external process

You can start the specified Cerius2 process on an external host in two ways:

Ending an external process

To stop running the selected Cerius2 process on the specified host, click the Kill action button. You would typically use this button if you want to restart the selected process on another host.

Additional information

Please see the on-screen help for details on the functioning of each control in the Process Management control panel.

Related information

Executing Cerius2 on one machine while displaying its interface on another is discussed in the Cerius2 Installation and Administration Guide.




Last updated April 08, 1999 at 05:11PM Pacific Daylight Time.
Copyright © 1999, Molecular Simulations Inc. All rights reserved.