agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/model/scripts/SgeSubmitScript.java
/**
	 * Generate the queue and wayness values based on the system, queue, memory, and core count
	 * requested.
	 * 
	 * @param hostname
	 * @param requestedMemoryPerTask
	 * @param requestedCores
	 * @param queue
	 * @return
	 */
Generate the queue and wayness values based on the system, queue, memory, and core count
requested.


Generate the queue and wayness values based on the system queue memory and core count requested .
protected String adjustProcs(String hostname, double requestedMemoryPerTask, long requestedCores, String queue) 
	{
		double actualCores;
		Hashtable<String, Hashtable<String, QueueDescription>> systemQueueTable = loadSystemQueues();
		double totalRam = requestedMemoryPerTask * requestedCores;
		Hashtable<String, QueueDescription> systemQueues = systemQueueTable.get(hostname);
		if (systemQueues == null || systemQueues.isEmpty()) return null;
		double procsNeededPerTask = Math.ceil(totalRam / requestedMemoryPerTask);
		double wayness = Math.floor(systemQueues.get("normal").getMemoryTotal() / requestedMemoryPerTask);
		if (wayness > systemQueues.get("normal").getCoresPerNode())
		{
			wayness = systemQueues.get("normal").getCoresPerNode();
		}
		actualCores = Math.ceil(procsNeededPerTask / systemQueues.get("normal").coresPerNode) * systemQueues.get("normal").getCoresPerNode();
		if (wayness < 1) 
		{
			wayness = Math.floor(systemQueues.get("largemem").getMemoryTotal() / requestedMemoryPerTask);
			if (wayness > systemQueues.get("largemem").getCoresPerNode()) 
			{
				wayness = systemQueues.get("largemem").getCoresPerNode();
			}
			queue = "largemem";
			actualCores = Math.ceil(procsNeededPerTask / systemQueues.get("largemem").getCoresPerNode()) * systemQueues.get("largemem").getCoresPerNode();
			if (wayness == 0) wayness = 1;
			wayness = waynessInterval(wayness, systemQueues.get("largemem").getWayness());
		} 
		else 
		{
			wayness = waynessInterval(wayness, systemQueues.get("normal").getWayness());
		}
		return DIRECTIVE_PREFIX + "-pe " + (int)wayness + "way " + (int)actualCores + "\n" +
			DIRECTIVE_PREFIX + "-q " + queue + "\n";
	}
protected String adjustProcs ( String hostname , double requestedMemoryPerTask , long requestedCores , String queue ) { double actualCores ; Hashtable < String , Hashtable < String , QueueDescription > > systemQueueTable = loadSystemQueues ( ) ; double totalRam = requestedMemoryPerTask * requestedCores ; Hashtable < String , QueueDescription > systemQueues = systemQueueTable . get ( hostname ) ; if ( systemQueues == null || systemQueues . isEmpty ( ) ) return null ; double procsNeededPerTask = Math . ceil ( totalRam / requestedMemoryPerTask ) ; double wayness = Math . floor ( systemQueues . get ( "normal" ) . getMemoryTotal ( ) / requestedMemoryPerTask ) ; if ( wayness > systemQueues . get ( "normal" ) . getCoresPerNode ( ) ) { wayness = systemQueues . get ( "normal" ) . getCoresPerNode ( ) ; } actualCores = Math . ceil ( procsNeededPerTask / systemQueues . get ( "normal" ) . coresPerNode ) * systemQueues . get ( "normal" ) . getCoresPerNode ( ) ; if ( wayness < 1 ) { wayness = Math . floor ( systemQueues . get ( "largemem" ) . getMemoryTotal ( ) / requestedMemoryPerTask ) ; if ( wayness > systemQueues . get ( "largemem" ) . getCoresPerNode ( ) ) { wayness = systemQueues . get ( "largemem" ) . getCoresPerNode ( ) ; } queue = "largemem" ; actualCores = Math . ceil ( procsNeededPerTask / systemQueues . get ( "largemem" ) . getCoresPerNode ( ) ) * systemQueues . get ( "largemem" ) . getCoresPerNode ( ) ; if ( wayness == 0 ) wayness = 1 ; wayness = waynessInterval ( wayness , systemQueues . get ( "largemem" ) . getWayness ( ) ) ; } else { wayness = waynessInterval ( wayness , systemQueues . get ( "normal" ) . getWayness ( ) ) ; } return DIRECTIVE_PREFIX + "-pe " + ( int ) wayness + "way " + ( int ) actualCores + "\n" + DIRECTIVE_PREFIX + "-q " + queue + "\n" ; }
Generate the queue and wayness values based on the system, queue, memory, and core count
 requested.
Generate the queue and wayness values based on the system queue memory and core count requested .
//System.out.println("Request: " + totalRam + " GB : " + procsNeededPerTask); //		System.out.println("Host: " + hostname); //		System.out.println("Cores requested: " + requestedCores); //		System.out.println("RAM per core: " + requestedMemoryPerTask + " GB"); //		System.out.println("==========================================="); //		System.out.println("-pe " + (int)wayness + "way " + (int)actualCores ); //		System.out.println("-q " + queue + "\n\n"); //		