edu.rit.pj
Class PJProperties

java.lang.Object
  extended by edu.rit.pj.PJProperties

public class PJProperties
extends Object

Class PJProperties provides static methods for reading Java system properties that control the behavior of Parallel Java. The PJ properties are:

You can specify a PJ property on the Java command line like this:

    java -Dpj.nt=4 . . .


Method Summary
static String getPjHost()
          Determine the host name of the Job Scheduler Daemon to use when running a cluster parallel program.
static int getPjJobTime()
          Determine the maximum amount of time (seconds) the job is allowed to run when running a cluster parallel program.
static String getPjJvmFlags()
          Determine the JVM flags to include on the Java command line when running a backend process in a cluster parallel program.
static int getPjNn()
          Determine the number of backend nodes in a parallel program.
static int getPjNp()
          Determine the number of processes in a parallel program.
static int getPjNt()
          Determine the number of CPUs per process in a parallel program.
static int getPjPort()
          Determine the port number of the Job Scheduler Daemon to use when running a cluster parallel program.
static String getPjPrng()
          Determine the fully-qualified class name of the default pseudorandom number generator (PRNG) class.
static String getPjSchedule()
          Determine the schedule for a parallel loop in an SMP parallel program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPjNn

public static int getPjNn()
Determine the number of backend nodes in a parallel program.

If the "pj.nn" Java system property is specified, it must be an integer greater than or equal to 1.

Returns:
Number of backend nodes for a parallel program.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if the "pj.nn" property value is not an integer greater than or equal to 1.

getPjNp

public static int getPjNp()
Determine the number of processes in a parallel program. This is the number of backend processes set up when the Comm.init() method is executed (see class Comm). This is also the size of the world communicator.

If the "pj.np" Java system property is specified, it must be an integer greater than or equal to 1.

Returns:
Number of processes for a parallel program.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if the "pj.np" property value is not an integer greater than or equal to 1.

getPjNt

public static int getPjNt()
Determine the number of CPUs per process in a parallel program. This is the number of threads a ParallelTeam will have if the number of threads is not specified as a constructor argument.

If the "pj.nt" Java system property is specified, it must be an integer greater than or equal to 1.

If the "pj.nt" Java system property is not specified, this method returns 0 to signify that all available CPUs should be used.

Returns:
Number of CPUs per process for a parallel program, or 0 if not specified.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if the "pj.nt" property value is not an integer greater than or equal to 1.

getPjSchedule

public static String getPjSchedule()
Determine the schedule for a parallel loop in an SMP parallel program. This is the schedule that will be used if the parallel for loop has a runtime schedule. For further information, see class IntegerSchedule and class LongSchedule.

If the "pj.schedule" Java property is specified, that value gives the type of schedule, which must be one of the following:

If the "pj.schedule" Java property is not specified, the default schedule for a runtime schedule is used. Normally this is a fixed schedule, but a program can specify a different default.

Returns:
Schedule for a parallel for loop (one of the above strings), or null if the "pj.schedule" Java property is not specified.

getPjHost

public static String getPjHost()
Determine the host name of the Job Scheduler Daemon to use when running a cluster parallel program. The program contacts the Job Scheduler Daemon when the Comm.init() method is executed (see class Comm). For further information, see package edu.rit.pj.cluster and class JobScheduler.

If the "pj.host" Java system property is specified, it gives the Job Scheduler Daemon's host name (or IP address).

If the "pj.host" Java system property is not specified, a host name of "localhost" is returned.

Returns:
Job Scheduler Daemon host name.

getPjPort

public static int getPjPort()
Determine the port number of the Job Scheduler Daemon to use when running a cluster parallel program. The program contacts the Job Scheduler Daemon when the Comm.init() method is executed (see class Comm). For further information, see package edu.rit.pj.cluster and class JobScheduler.

If the "pj.port" Java system property is specified, it gives the Job Scheduler Daemon's port number.

If the "pj.port" Java system property is not specified, the well-known Parallel Java port number (20617) is returned.

Returns:
Job Scheduler Daemon port number.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if the "pj.port" property value is not an integer.

getPjJobTime

public static int getPjJobTime()
Determine the maximum amount of time (seconds) the job is allowed to run when running a cluster parallel program. If a program running in the Parallel Java job queue has not finished in the given amount of time, the job frontend process automatically termintes the job when the given number of seconds have elapsed since the job started executing. If a program is not running in the Parallel Java job queue (if there is no Job Scheduler Daemon present), then the job time setting is ignored and the program will not time out.

If the "pj.jobtime" Java system property is specified, it must be an integer greater than or equal to 1, and that gives the the maximum job timeout in seconds.

If the "pj.jobtime" Java system property is not specified, a value of 0 is returned to signify that there is no job timeout.

Returns:
Job timeout (seconds), or 0 if no job timeout.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if the "pj.jobtime" property value is not an integer greater than or equal to 1.

getPjJvmFlags

public static String getPjJvmFlags()
Determine the JVM flags to include on the Java command line when running a backend process in a cluster parallel program. When a job backend process is started, the JVM flags are included on the command line immediately after the "java" command. These flags then control the job backend process's JVM. For further information, see package edu.rit.pj.cluster.

If the "pj.jvmflags" Java system property is specified, it gives the JVM flags exactly as they are to appear on the Java command line. If there are multiple flags separated by whitespace, the "pj.jvmflags" Java system property must be enclosed in quotation marks.

If the "pj.jvmflags" Java system property is not specified, there are no JVM flags, and an empty string is returned.

Example. To cause the job backend processes' JVMs to use an initial heap size of 4 MB and a maximum heap size of 128 MB, specify the "pj.jvmflags" property as follows when running the program:

    java -Dpj.jvmflags="-Xms4m -Xmx128m" . . .

Note that quotation marks are needed around the property value because of the embedded whitespace. This property value causes the Job Launcher Daemon to launch each job backend process's JVM with this command:

    java -Xms4m -Xmx128m . . .

which in turn tells each job backend process's JVM to use initial and maximum heap sizes of 4 MB and 128 MB.

Returns:
JVM flags.

getPjPrng

public static String getPjPrng()
Determine the fully-qualified class name of the default pseudorandom number generator (PRNG) class.

If the "pj.prng" Java system property is specified, it gives the fully-qualified class name of the PRNG class that the static getInstance(long) method in class Random will construct. Specifying the "pj.prng" property will substitute a different PRNG algorithm into a program without needing to recompile. See class Random for further information.

If the "pj.prng" Java system property is not specified, a PRNG class name of "edu.rit.util.DefaultRandom" is returned. See class DefaultRandom for further information.

Returns:
Default PRNG class name.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.