Analysis Manager > System Management > Starting the Queue/Remote Managers
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Starting the Queue/Remote Managers
The discussion pertains to Unix machines. See the end of this section for a discussion of Windows. The Queue and Remote Managers are the two daemon (or services on Windows) which run continuously. The Queue Manager runs on the master node, (QueMgr executable). The Remote Manager (RmtMgr executable) runs on all analysis hosts and it is recommended that it run on all submit host also. The programs are located in the following directory:
$P3_HOME/p3manager_files/bin/<arch>
where <arch> is one of the following:
 
HP700
-
Hewlett Packard HP-UX
RS6K
-
IBM RS/6000 AIX
SGI5
-
Silicon Graphics IRIX
SUNS
-
Sun SPARC Solaris
LX86
-
Linux (MSC or Red Hat)
WINNT
-
Windows 2000 or XP
QueMgr Usage:
The Queue Manager can be manually invoked by typing
$P3_HOME/bin/QueMgr <args>
with the arguments below:
QueMgr -path $P3_HOME -org <org> -log <logfile> -port <#>
where:
$P3_HOME is the installation directory.
<org>
Organization name for subgroup config files. Defaults to default.
<logfile>
A different log filename for QueMgr. If not specified, the QueMgr.log located in:
$P3_HOME/p3manager_files/<org> is used.
<#>
If the org.cfg file is to be used to allow users to interactively switch between organizational groups, then the QueMgr must be started with a unique port ID. The ID can be any number as long as it is unique and not being used by anything else and should match that listed in org.cfg if this file is used.
Only the -path is required unless the QueMgr is started with a full path. The QueMgr is recommended to be started as root although not a strict requirement. It is recommended to run the QueMgr as a separate user such as the administrator account.
 
Example:
If the Analysis Manager is installed in /msc/patran200x and the master node is an IBM RS/6000 computer, log into the master node (as root if you want) and do the following:
/msc/patran200x/bin/QueMgr -path /msc/patran200x
If the Analysis Manager is installed on a filesystem that is not local to the master node and the QueMgr is started as root, it is recommended that the -log option be used when starting the Queue Manager. The -log option should be used to specify a log file which should be on a filesystem local to the master node. Writing files as root onto network mounted filesystems is sometimes not possible. Starting the QueMgr as a normal user solves this problem.
You may want to put this command line somewhere in a script so the Queue Manager is started as root each time the master node is rebooted. See Starting Daemons at Boot Time.
Note:  
There are other arguments that can be used when starting up the Queue Manager for more flexibility. See Analysis Manager Program Startup Arguments.
RmtMgr Usage:
The Remote Manager can be manually invoked by typing
$P3_HOME/bin/RmtMgr
where:
$P3_HOME is the installation directory. No arguments are necessary unless you start from where it exists with a ./RmtMgr in which case you will need the -path $P3_HOME argument.
The RmtMgr should not be started as root.
Example:
If the Analysis Manager is installed in /msc/patran200x and the analysis node is an IBM RS/6000 computer, log into the analysis node as root and do the following:
/msc/patran200x/bin/RmtMgr -path /msc/patran200x
All other arguments not specified will be defaulted. You may want to put this command line somewhere in a script so the Queue Manager is started as root each time the master node is rebooted. See Starting Daemons at Boot Time.
 
Note:  
There are other arguments that can be used when starting up the Remote Manager for more flexibility. See Analysis Manager Program Startup Arguments.
Starting Daemons at Boot Time
To restart the QueMgr (or RmtMgr) daemon when the master host workstation is rebooted there are a number of things that can be done. Two are listed here for Unix platforms. The first is recommended via the /etc/rc2 method as opposed to the inittab method. These methods can vary from Unix machine to Unix machine. If you have trouble, consult your system administrator.
Windows uses services. Manually installing and configuring these services is also described below.
Unix Method: rc
As root the following done in general terms:
Create a file in /etc/rc2.d called Sxxz_p3am where xx is a number as high as possible (say 99) and the name z_p3am is simply a name. (The higher number indicates that it will be executed last of all the scripts in this directory during startup.) In this file you place the script commands to start the QueMgr and RmtMgr. You can also add the su command to start up the daemons as a user.
 
Note:  
The location of the rc2.d directory may vary from computer to computer. Check /etc and /sbin.
Below is an example of a file called S99z_p3am:
#! /sbin/sh

# This script starts up the QueMgr and RmtMgr
# of the Patran Analysis Manager application.

# starts QueMgr as am_admin
su - am_admin -c "/etc/p3am_que start"

# starts the RmtMgr as am_admin
su - am_admin -c "/etc/p3am_rmt start"
What this script actually does is call another script (or two) that actually starts or stops the QueMgr and RmtMgr, but it could have been done directly in the above script. The contents of the p3am_que script are:
#! /usr/bin/csh -f

# This service starts/stops the QueMgr used with
# the Analysis Manager application.
if ( $#argv != 1 ) then
  echo "Usage: $0 { start | stop }"
exit 1
endif
if ( $status != 0 ) then
echo "Cannot determine platform. Exiting..."
exit 1
endif
set P3_HOME = ”/msc/patran200x”
switch ( $argv[1] )
case start:
if ( -x ${P3_HOME}/p3manager_files/bin/SGI5/QueMgr ) then
${P3_HOME}/p3manager_files/bin/SGI5/QueMgr
endif
breaksw
case stop:
set quepid = `ps -eo comm,user,pid | \
                  egrep "QueMgr[ ]*[am_admin]" | awk '{print $3}'`
foreach Qproc ( $quepid )
kill -9 $Qproc
end
breaksw
default:
echo "Usage: $0 { start | stop }"
exit 1
breaksw
endsw
The p3am_rmt script would be identical except that RmtMgr replaces QueMgr. This could be done with a single script where another argument is the daemon type, RmtMgr or QueMgr and thus another variable is set to start or stop the one specified in the argument list.
 
Note:  
The script above is specific to starting the QueMgr on SGI machines. For other machines, replace the SGI5 with the appropriate <arch> as described in Directory Structure.
The above script can be used to stop the daemons also. This would be done if the machine were brought down when rebooting. In this case you use a script in the rc0.d directory with a name of Kxx_p3am where xx is the lowest number such as 01 to force it to be executed first among all the scripts in this directory. The argument to the above script would then be stop instead of start. This is used to do a clean and proper exit of the daemons when the machine is shut down. The example of a script called K01_p3am is:
#! /sbin/sh

# This script stops the QueMgr and RmtMgr
# of the Patran Analysis Manager application.

# stop QueMgr
/etc/p3am_que stop

# stop the RmtMgr
/etc/p3am_rmt stop
Unix Method: inittab:
As root do the following:
Edit the file, /etc/inittab, and add the following line at the end:
p3am:2:once:/bin/sh /etc/p3am >/dev/null 2>&1 # MSC.AM QueMgr daemon 
Note:  
The number following the p3am in the above lines must match the init default # in the inittab file. Check this number to make sure you are using the correct one. Otherwise it will not start on reboot.
Now create the file, /etc/p3am and add the following lines:
#!/bin/sh
QueMgr=$P3_HOME/bin/QueMgr
RmtMgr=$P3_HOME/bin/RmtMgr
if [ -x $QueMgr ]
then
$QueMgr -path $P3_HOME
fi
if [ -x $RmtMgr ]
then
$RmtMgr
fi
where $P3_HOME is the Analysis Manager installation directory commonly referred to as $P3_HOME throughout this manual. You must replace it with the exact path in the above example. Make sure that this file’s protection allows for execution:
chmod 755 /etc/p3am
For Window machines:
The Queue and Remote Managers are installed as services. Once the service is installed, no further action needs to be taken. In general the installation from the media installs these services. You will have to start and stop them to reconfigure if you change the configuration files. If for some reason you must install the Analysis Manager manually and assuming that the following directory exists:
$P3_HOME\p3manager_files
follow these steps,
1. Edit the files install_server.bat and install_client.bat in
$P3_HOME\p3manager_files\bin\WINNT
and make sure that the path points to
$P3_HOME\\p3manager_files\\bin\\WINNT\\QueMgr.exe and RmtMgt.exe, 
respectively. Make sure there are two back slashes between each entry.
2. Double-click the install_server.bat and install_client.bat files. This will install the services.
3. Edit the gui_install.reg file and make sure the path is correct also with two back slashes between each entry in the “Path”= field, e.g.,
 “Path”=“C:\\MSC.Software\\MSC.Patran\\2004\\p3manager_files\\bin
\\WINNT\\AnalysisMgrB.dll”
4. Right mouse click the gui_install.reg file and select merge. This will merge it into the registry. This is not necessary if you’ve installed from the CD. If you get a message saying, No doctemplate is loaded. Cannot create new document. this is because you have not merged this file into the registry, or the path was incorrect.
5. Optional: You may want the Queue and Remote Manager services to startup as different users other than Administrator. To do this right mouse click My Computer and select Manage. Then open the Services tree tab and find MSCQueMgr (or MSCRmtMgr) and select it and view Properties from the Action pulldown menu. Under the Log On tab you can change to This Account or select another account for the services to start up as.
6. You can start and stop the Queue Manager and/or Remote Managers from the Services form from the previous step. However you can also use the small command files in
$P3_HOME\p3manager_files\bin\WINNT
called:
start_server.bat
start_client.bat
stop_server.bat
stop_client.bat
query_server.bat
query_client.bat
remove_server.bat
remove_client.bat
to do exactly as the file describes for starting, stopping, querying, and removing the Queue Manager (server) service or the Remote Manager (client) service.
If you follow the above steps, manually installation should be successful. You will still have to edit your configuration files and the reconfigure (or stop and start) the Queue Manager to read the configuration before you will be able to successfully use the Analysis Manager. See Configuration Management Interface.