<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
	<head>
		<title>BEAST2 on ACCESS</title>
		<version>2.7.6</version>
		<description>Bayesian Evolutionary Analysis by Sampling Trees - run on XSEDE</description>
		<authors>Remco Boukaert, Alexei Drummond, Andrew Rambaut, and Marc A. Suchard</authors>
		<reference>Bouckaert R, Heled J, Kühnert D, Vaughan TG, Wu C-H, Xie D, Suchard MA, Rambaut A, Drummond AJ (2014) "BEAST2: A software platform for Bayesian evolutionary analysis". PLOS Computational Biogogy 10(4): e1003537, 2014. doi:10.1371/journal.pcbi.1003537</reference>
		<category>Phylogeny / Alignment</category>
	</head>
	
	<command>beast2_xsede</command>
<!--
*****************************************************************************************************************************************
Created by Mark Miller for CSG, 4/14/2014
*****************************************************************************************************************************************
-->

 <!-- Rules for running BEAST2 2.x.x on Expanse via the CIPRES gateway

The runs use varying numbers of cores and GPUs within a single node of Expanse
depending upon the type of analysis and the data set.1500

- Ask the user for the following:

  whether the analysis uses Path Sampling, SNAPP, or both
  whether the analysis needs extra memory
  whether the data set has amino acids (AAs)
  the number of partitions in the data set
  the total number of patterns in the data set 

- Specify the Slurm partition, threads, instances, cores, GPUs, and memory acccording
  to the following table. Also, use the additional BEAGLE parameters listed in the
  examples, including-beagle_scaling dynamic unless the user specifies otherwise.

   Data          Data     Extra    Slurm                                         Slurm 
partitions patterns  memory  partition  -threads -instances  cores   GPUs   memory

Any data with Path Sampling but without SNAPP

    any           any      	 no    		shared       		 6        		 1        		 6             			11G

Any data with SNAPP but without Path Sampling

    any           any      	 no    		shared      		 24      		 1       		 24             			46G     

Any data with SNAPP and Path Sampling

    any           any       	no    		shared       		25         	 1        		25             			77G 
    any           any      	yes    		shared       		25         	1        		40            		123G

DNA data without Path Sampling or SNAPP

  1 to 3        <5,000     no    		shared        	3         		3        		 3              			6G
  1 to 3   5,K-59999    no  	gpu-shared      	1         		1        		10       		1     		90G
  1 to 3       >=60K 	   	 no      		gpu         			4        		 4       		 40       	4    		360G

  4 to 17        <1,200     no   		 shared  		 	     1         1        			 1              				2G
  4 to 17   1,200-4,999     no    shared       			 3         3         			3              			5G
  4 to 17  5,000-19,999     no   shared        		6         6         			6             				11G
  4 to 17      >=20,000     no  	gpu-shared      	1         1        			10   	    1     			90G

   >=18          <6,000     no    shared        			2         1         2              2G
   >=18    6,000-15,999     no    shared        		3         1         3              6G
   >=18        >=16,000     no    shared        			6         1         6             12G

    any           any      yes    			shared 		      12         1        12             24G

AA data without Path Sampling or SNAPP

     1          <12,000     no  gpu-shared      1         1        10       1     90G
     1         >=12,000     no      gpu         4         4        40       4    360G

  2 to 39         any       no  gpu-shared      1         1        10       1     90G

   >=40           any       no    shared       24         1        24             46G

- For runs in the Slurm shared partion, include the following in the run script,
  where t, i, and c are the number of threads, instances, and cores in the table.

   -->
 <!-- 
TO allow us to select other options through the xml, specifically the use of A100 gpus; 
 
 markzhaung added the general feature of passthrough parameters on scheduler.conf; to wit:
I’ve modified submit script to support “passthrough” parameters.
In your xml file, whenever you want to have  #SBATCH -*res=path-testing   in the run script, you just need to write "-*res=path-testing” into scheduler.conf

Any parameters that begin with “-*“ will be considered as “passthrough” parameters, submit script will add “#SBATCH “ to the beginning and write them to the run script. 

 -->
 <!-- new rules to take advantage of A100s
 DNA data without Path Sampling or SNAPP
  1 to 3         <5,000     no    shared        3         3         3              6G
  1 to 3   5,000-37,999     no  gpu-shared      1         1        10    1 V100   90G
  1 to 3  38,000-99,999     no  gpu-shared      1         1        10    1 A100   90G
  1 to 3      >=100,000     no  gpu-shared      2         2        20    2 A100  180G
-->
<parameters>

<!--  ******WARNING ****on expanse two wrappers are required for 2.6+ ; but you dont need to arrange that here; the submit script will add .gpu to any wrapper call that requires a gpu. 
 ######################################################################### 	
   Begin wrapper v 2.6.6 
 ######################################################################### -->				
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast2_266_cpua</name>
						<attributes>
 							<precond>
								<language>perl</language>
								<code>$which_beast2 == 66 &amp;&amp; !$is_cloudeligible </code>
						</precond>
							<format> 
								<language>perl</language>		
								<code>"<![CDATA[beast2wrapper_2.6.6_expanse]]>"</code>
							</format>  
							<group>0</group>
						</attributes>
					</parameter>
													
<!-- ######################################################################### -->		
<!--  Start wrapper v 2.7.6 -->
<!--  ****WARNING**** : although there are actually two wrappers, the .gpu suffix is added automatically by the submit script  -->
<!-- ######################################################################### -->				
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast2_273_cpua</name>
						<attributes>
 							<precond>
								<language>perl</language>
								<code>$which_beast2 &gt; 69 &amp;&amp; !$is_cloudeligible</code>
						</precond>
							<format> 
								<language>perl</language>		
								<code>"<![CDATA[beast2wrapper_2.7.3_expanse]]>"</code>
							</format>  
							<group>0</group>
						</attributes>
					</parameter>

<!-- Wayne has done extensive testing of BEAST2 2.7.1 on Expanse, and it is ready to be made available via CIPRES :)

The wrappers are

  /expanse/projects/ngbt/home/cipres/ngbw/contrib/scripts/beast2wrapper_2.7.1_expanse and
  /expanse/projects/ngbt/home/cipres/ngbw/contrib/scripts/beast2wrapper_2.7.1_expanse.gpu .

The rules for cost-effective execution are thas confe same as those for 2.6.6. For both codes, however, I would like you to make the minor changes appended here that are highlighted in red. Also, please change the Slurm memory to 90G for 1-GPU runs and 360G for 4-GPU runs if that has not been done already.

A complete listing of the updated rules is at

  /expanse/projects/ngbt/opt/benchmarks/rules/BEAST2-2.x.x.Expanse.rules

* Please make 2.7.1 available via CIPRES, and let me know when that is done.

* You might also include the following notice and disclaimer on the CIPRES website.

"BEAST2 2.7.1 is now available with new features described at

  http://www.beast2.org/2022/09/01/what-is-new-in-v2.7.1.html

"Please note that input xml files for 2.6.x will not work with 2.7.1 and need to be regenerated with the latest version of BEAUti. Also, some packages have not been updated to work with 2.7.1."

   Data          Data     Extra    Slurm                                         Slurm 
partitions     patterns  memory  partition  -threads -instances  cores   GPUs   memory

...

DNA data without Path Sampling or SNAPP

  1 to 3           <750     no    shared        1         1         1              2G
  1 to 3         <5,000     no    shared        3         3         3              6G
  1 to 3   5,000-59,999     no  gpu-shared      1         1        10       1     90G

 -->
 
 <!-- ######################################################################### -->			
<!-- begin cloud eligible -->

<!--  this line is added for when a job might either go to the cloud, or to local resources.-->	
<!-- when the wrapper is listed as cloud_eligible=1 in the tool registry, this submission statement is activated -->
<!-- this is not actually a wrapper call, but rather, the submit.py script sees this string, and evaluates further. -->
<!-- if the scheduler.conf file says gpu=>=1, then the wrapper called will be beast2wrapper_2.x.x_expanse.gpu  -->
<!-- if the scheduler.conf file does no have a gpu line, the wrapper called will be  beast2wrapper_2.x.x_expanse-->				

					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast2_266_cloud</name>
						<attributes>
 							<precond>
								<language>perl</language>
								<code>$which_beast2 == 66 &amp;&amp; $is_cloudeligible</code>		
							</precond> 
							<format> 
								<language>perl</language>		
								<code>"<![CDATA[beast2wrapper_2.6.6_expanse_or_cloud]]>"</code>
							</format>  
							<group>0</group>
						</attributes>
					</parameter>	
						
  				<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast2_273_cloud</name>
						<attributes>
 							<precond>
								<language>perl</language>
								<code>$which_beast2 &gt; 69 &amp;&amp; $is_cloudeligible</code>		
							</precond> 
							<format> 
								<language>perl</language>		
								<code>"<![CDATA[beast2wrapper_2.7.3_expanse_or_cloud]]>"</code>
							</format>  
							<group>0</group>
						</attributes>
					</parameter>	
									
<!--  submission on comet: the invocation line and any needed thread specification  -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast2_252</name>
						<attributes>
 							<precond>
								<language>perl</language>
								<code>$which_beast2 == 52 </code>		
							</precond> 
							<format> 
								<language>perl</language>		
								<code>"<![CDATA[beast2wrapper_2.5.2_expanse]]>"</code>
							</format>  
							<group>0</group>
						</attributes>
					</parameter>

 <!-- BEAST2 2.4.5+ -->
 <!-- DNA data without Path Sampling or SNAPP
             
  1 to 3      < 4,999     shared          3         3         3              5G
  1 to 3   5,000-59,999   gpu-shared      1         1        10       1     92G
  1 to 3       >=60,000       gpu         4         4        40       4    368G

  4 to 17        <1,200     shared        1         1         1              1G
  4 to 17   1,200-4,999     shared        3         3         3              5G
  4 to 17  5,000-19,999     shared        6         6         6             11G
  4 to 17      >=20,000   gpu-shared      1         1        10       1

   >=18             any     shared        4         1         4              7G -->
		
<!--        1 to 3      <4999     shared        3         3         3              5G  -->
<!-- the beast2 command line depends upon partitions.  When number of partitions =1/patterns between 750 and 5000 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_145b</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 4  &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$no_beagle  &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 3 -instances 3 -beagle_SSE"</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
		
<!-- When number of partitions =1/patterns 750-4999 -->		
		<parameter type="String" ishidden="1" >
				<name>number_threads145b</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 4 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"cpus-per-task=3\\n" .
									"mem=6G\\n" .
									"threads_per_process=3\\n"
						</code>
					</format>
				</attributes>
		</parameter>	

<!-- the beast2 command line depends upon partitions.  When number of partitions =1-3; patterns between 5K and 38 K -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_145d</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 4  &amp;&amp; $nu_patterns &gt; 4999 &amp;&amp; $nu_patterns &lt; 38000  &amp;&amp; !$no_beagle  &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
				
<!--      1 to 3  5,000-37,999   gpu-shared      1         1        10       1    -->
		<parameter type="String" ishidden="1" >
				<name>number_threads145d</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 4  &amp;&amp; $nu_patterns &gt; 4999  &amp;&amp; $nu_patterns &lt; 38000  &amp;&amp; !$no_beagle   &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .								
									"node_exclusive=0\\n" .
									"mem=90G\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
				
<!--       1 to 3 38,000-99,999     no  gpu-shared      1         1        10    1  A100  -->
<!-- the beast2 command line depends upon partitions.  When number of partitions =1/patterns less than 750 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_145e</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 37999 &amp;&amp; $nu_patterns &lt; 100000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU" </code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
				
		<parameter type="String" ishidden="1" >
				<name>number_threads145e</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 37999 &amp;&amp; $nu_patterns &lt; 100000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=90G\\n" .
									<!--"-*res=path-testing\\n" .-->
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!--       99,999+      gpu-shared      1         1        10    1  A100  -->
<!-- the beast2 command line depends upon partitions.  When number of partitions =1/patterns less than 750 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_145f</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 99999 &amp;&amp; !$no_beagle &amp;&amp; !$datatype &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 2 -instances 2 -beagle_GPU -beagle_order 1,2" </code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
				
		<parameter type="String" ishidden="1" >
				<name>number_threads145f</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 99999 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=2\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=180G\\n" .
									<!--"-*res=path-testing\\n" .-->
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!--   4 to 17        <1,200     shared        1         1         1              1G
  4 to 17   1,200-4,999     shared        3         3         3              5G
  4 to 17  5,000-19,999     shared        6         6         6             11G
  4 to 17      >=20,000   gpu-shared      1         1        10       1 -->
<!--   4 to 17   1,200-4,999     no    shared        3         1         3              6G
  4 to 17  5,000-19,999     no    shared        6         2         6             12G
-->
<!--    4 to 17        <1,200     shared        1         1         1              1G       -beagle_SSE -->
<!-- When number of partitions >=4 < 18 patterns < 1200 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_445a</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &lt; 1200 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_SSE"</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
		
<!-- partitions >= 4 nu_patterns < 1200 -->
		<parameter type="String" ishidden="1" >
				<name>number_threads445a</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &lt; 1200 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"cpus-per-task=1\\n" .
									"mem=1G\\n" .
									"node_exclusive=0\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	

		
<!--    	   4 to 17   1,200-4,999     no    shared        3         1         3              6G-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_445b</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &gt; 1199 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 3 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads445b</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 1199 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"cpus-per-task=3\\n" .
									"mem=6G\\n" .
									"node_exclusive=0\\n" .
									"threads_per_process=3\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!--  	  4 to 17  5,000-19,999     no    shared        6         2         6             12G-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_445c</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 4999  &amp;&amp; $nu_patterns &lt; 20000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 6 -instances 2 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads445c</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &gt; 4999  &amp;&amp; $nu_patterns &lt; 20000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"cpus-per-task=6\\n" .
									"mem=12G\\n" .
									"threads_per_process=6\\n"
						</code>
					</format>
				</attributes>
		</parameter>
		
<!--    		 4 to 17      >=20,000   gpu-shared      1         1        10       1  -->	
<!-- When number of partitions >=4 and <20  patterns >=20000        1    1     1 beagle_gpu -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_445d</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 19999 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU"</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads445d</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 19999 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .								
									"node_exclusive=0\\n" .
									"mem=92G\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
			
<!--    	  

   Data          Data     Extra    Slurm                                         Slurm 
partitions     patterns  memory  partition  -threads -instances  cores   GPUs   memory

   >=18          <8,000     no    shared        2         1         2              4G
   >=18    8,000-13,999     no    shared        3         1         3              6G
   >=18   14,000-39,999     no    shared        6         2         6             12G-->

 
<!-- When number of partitions >=18          4  1 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_2045e</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 17 &amp;&amp; $nu_patterns &lt; 8000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 2 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
		
<!--   >=18          <8,000     no    shared        2         1         2              2G-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads2045e</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &lt; 8000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=4G\\n" .
									"cpus-per-task=1\\n" .
									"threads_per_process=2\\n"
						</code>
					</format>
				</attributes>
		</parameter>

<!-- 
   Data          Data     Extra    Slurm                                         Slurm 
partitions     patterns  memory  partition  -threads -instances  cores   GPUs   memory

   >=18          <8,000     no    shared        2         1         2              4G
   >=18    8,000-13,999     no    shared        3         1         3              6G
   >=18   14,000-39,999     no    shared        6         2         6             12G
 -->
<!--   >=18    6,000-13999     no    shared        3         1         3              6G -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_2045f</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 17 &amp;&amp; $nu_patterns &gt; 7999 &amp;&amp; $nu_patterns &lt; 14000  &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 3 -instances 1  -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	

<!-- when partitions > 18, patterns gt=16000	normal memory
 >=18    6,000-13,999     no    shared        3         1         3              6G  -->		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads2045f</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 7999 &amp;&amp; $nu_patterns &lt; 14000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=6G\\n" .
									"cpus-per-task=3\\n" .
									"threads_per_process=3\\n"
						</code>
					</format>
				</attributes>
		</parameter>

<!-- 
   >=18          <8,000     no    shared        2         1         2              4G
   >=18    8,000-13,999     no    shared        3         1         3              6G
   >=18   14,000-39,999     no    shared        6         2         6             12G
 -->						
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_2045g</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 17 &amp;&amp; $nu_patterns &gt; 13999 &amp;&amp; $nu_patterns &lt; 40000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 6 -instances 2 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads2045g</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 13999 &amp;&amp; $nu_patterns &lt; 40000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=12G\\n" .
									"cpus-per-task=6\\n" .
									"threads_per_process=6\\n"
						</code>
					</format>
				</attributes>		
		</parameter>
		
<!-- patterns 18+. patterns 40000+-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_2045h</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 17 &amp;&amp; $nu_patterns &gt; 39999 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU"</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>	
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads2045h</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 39999 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .								
									"node_exclusive=0\\n" .
									"mem=90G\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>		
		</parameter>
		
<!-- more memory for any partitions 
    any           any      yes    shared       12         1         12            24G-->
 						
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_2045g1</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>!$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; $more_memory2</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 12 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>		
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads2045e2</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>!$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; $more_memory2</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=24G\\n" .
									"cpus-per-task=12\\n" .
									"threads_per_process=12\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!--  AA data without Path Sampling or SNAPP

     1          <12,000   gpu-shared      1         1        10       1     92G
     1         >=12,000       gpu         4         4        40       4    368G


  2 to 39           any   gpu-shared      1         1        10       1

   >=40             and     shared       24         1        24             46G	-->
	
<!-- Proteins When number of partitions >=1         < 5000       -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_prot145a</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 2  &amp;&amp; $nu_patterns &lt; 12000  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
				
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads_prot145a</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 2 &amp;&amp; $nu_patterns &lt; 12000  &amp;&amp; !$no_beagle   &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=92G\\n"  .
									"threads_per_process=1\\n" 
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!-- Proteins: When number of partitions = 1   >=5000         4         4 
    1          >=12,000       gpu         4         4        40       4-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_prot145b</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &lt; 2  &amp;&amp; $nu_patterns &gt; 11999  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 4 -instances 4 -beagle_GPU -beagle_order 1,2,3,4 "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
				
<!--    protein 1 part, > 12000 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads_prot145b</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &lt; 2 &amp;&amp; $nu_patterns &gt; 11999  &amp;&amp; !$no_beagle   &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=4\\n" .
									"nodes=1\\n" .
									"node_exclusive=1\\n" .
									"mem=368G\\n" .
									"threads_per_process=4\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!-- Proteins: When number of partitions > 2 < 40    
 2 to 39           any   gpu-shared      1         1        10       1    -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_prot245a</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 1 &amp;&amp; $nu_partitions &lt; 40 &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 1 -instances 1 -beagle_GPU "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
				
<!-- partitions 2-39 -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads_prot245a</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 1 &amp;&amp; $nu_partitions &lt; 40  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"gpu=1\\n" .
									"nodes=1\\n" .
									"mem=92G\\n" .	  					
									"node_exclusive=0\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
				</attributes>
		</parameter>	

<!-- Proteins: When number of partitions > 40        -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>partitions_prot4045a</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$nu_partitions &gt; 39  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling </code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 24 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
				
<!--    >=40             and     shared       24         1        24             46G	-->
		<parameter issimple="1" ishidden="1" type="String">
			<name>number_threads_prot4045a</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$nu_partitions &gt; 39  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"cpus-per-task=24\\n" .
									"mem=46G\\n" .
									"node_exclusive=0\\n" .
									"threads_per_process=24\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!-- SNAPP and path sampling situations -->
<!-- 
 Data          Data        Slurm                                         Slurm 
partitions     patterns    partition  -threads -instances  cores   GPUs   memory

Any data with Path Sampling but without SNAPP

    any           any       shared       6          1         6             11G

Any data with SNAPP but without Path Sampling

    any           any       shared       24         1        24             46G     

Any data with SNAPP AND Path Sampling that needs only default memory (77 GB)

    any           any       shared       25         1        40             77G 

Any data with SNAPP and Path Sampling that needs extra memory (123 GB)

    any           any       shared       25         1        64            123G -->		
<!-- SNAPP analysis only; no path sampling  -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_notpath_threads</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$snapp_analysis &amp;&amp; !$path_sampling</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 24 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
<!-- Any data with SNAPP but without Path Sampling

  any           any       shared       24         1        24             46G     -->

		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_notpath_mem</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$snapp_analysis &amp;&amp; !$path_sampling</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"mem=46G\\n" .
									"cpus-per-task=24\\n" .
									"node_exclusive=0\\n" .
									"threads_per_process=24\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!-- SNAPP analysis AND path sampling std memory  

Any data with SNAPP and Path Sampling

    any           any       no    shared       25         1        25             50G 
    any           any      yes    shared       25         1        40             80G
  -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_path_threads</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; !$more_memory</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 25 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
<!-- Any data with SNAPP AND Path Sampling that needs only default memory (77 GB)

    any           any       shared       25         1        40             50G  -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_path_mem</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; !$more_memory</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"mem=50G\\n" .
									"node_exclusive=0\\n" .
									"cpus-per-task=25\\n" .
									"threads_per_process=25\\n"
						</code>
					</format>
				</attributes>
		</parameter>	
		
<!-- Any data with SNAPP and Path Sampling that needs extra memory (123 GB)

    any           any       shared       25         1        64            123G -->
<!-- SNAPP analysis AND path sampling std memory    -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_path_threads_moremem</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; $more_memory</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 25 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
<!-- Any data with SNAPP AND Path Sampling that needs only extra memory (123 GB)

    any           any       shared       25         1        80G             123G  -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>snapp_path_moremem</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; $more_memory</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"mem=80G\\n" .
									"node_exclusive=0\\n" .
									"cpus-per-task=25\\n" .
									"threads_per_process=25\\n"
						</code>
					</format>
				</attributes>
		</parameter>
				
<!-- path sampling analysis no snapp   std memory    
 Data          Data        Slurm                                         Slurm 
partitions     patterns    partition  -threads -instances  cores   GPUs   memory
Any data with Path Sampling but without SNAPP
    any           any       shared       6          1         6             11G
      -->
		<parameter issimple="1" ishidden="1" type="String">
			<name>path_notsnapp_threads</name>
			<attributes>
				<precond>
					<language>perl</language>
					<code>$path_sampling &amp;&amp; !$snapp_analysis</code>
				</precond>
				<format>
					<language>perl</language>
					<code>"-threads 6 -instances 1 -beagle_SSE "</code>
				</format>
				<group>3</group>
			</attributes>
		</parameter>
		
		<parameter issimple="1" ishidden="1" type="String">
			<name>path_notsnapp_mem</name>
				<attributes>
					<group>2</group>
					<paramfile>scheduler.conf</paramfile>
					<precond>
						<language>perl</language>
						<code>$path_sampling &amp;&amp; !$snapp_analysis</code>
					</precond>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"mem=11G\\n" .
									"node_exclusive=0\\n" .
									"cpus-per-task=6\\n" .
									"threads_per_process=6\\n"
						</code>
					</format>
				</attributes>
		</parameter>		
		
 <!-- end 2.4.5 -->
<!-- input file specification -->
<!-- the input file to be operated on ends the command line -->
		<parameter issimple="1" ismandatory="1" isinput="1" type="Sequence">
			<name>infile</name>
			<attributes>
				<prompt>Input File (must be in BEAST XML format)</prompt>
				<format>
					<language>perl</language>
					<code>"infile.xml"</code>
				</format>
				<group>99</group>
<!-- this file designator seems to come at the end of the command string, so we set if for 99 currently -->
				<filenames>infile.xml</filenames>
			</attributes>
		</parameter>
	
<!-- Results section. To start we return all results files available-->
		<parameter ishidden="1" type="Results">
			<name>all_results</name>
			<attributes>
				<filenames>*</filenames>
			</attributes>
		</parameter>

<!-- set the beagle scaling opton as default -->
		<parameter issimple="1" ismandatory="1" ishidden="1" type="String">
			<name>beagle_scaling</name>
			<attributes>
				<prompt>Set the Beagle Scaling Parameter (the choice can affect performance)</prompt>
				<precond>
					<language>perl</language>
					<code>!$no_beagle &amp;&amp; $which_beast2 &gt; 40 </code>
				</precond>
				<format>
					<language>perl</language>
					<code> " -beagle_scaling dynamic"</code>
				</format>
				<group>4</group>
			</attributes>
		</parameter> 
		
<!-- This section provides visible queries that help configure the interface  -->

<!-- this sets the run time -->
				<parameter type="Excl" issimple="1" ismandatory="1">
					<name>which_beast2</name> 
					<attributes>
						<group>1</group>
						<paramfile>scheduler.conf</paramfile>
						<prompt>Which BEAST2 Version?</prompt>
						<vlist>
							<value>70</value>
							<label>2.7.6</label>
							<value>66</value>
							<label>2.6.6</label>
						</vlist>
						<vdef>
							<value>70</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please choose a BEAST version</message>
								<language>perl</language>
								<code>!defined $value </code>
							</ctrl>
						</ctrls>
<!-- provide feedback on number of cpu hrs to be consumed; all runs are the same, but this must be keyed to a visible param, so here we make it conditional on a non-zero run time. -->
<!-- 
  1 to 3           <750     shared        1         1         1              1G             
  1 to 3      750-3,999     shared        3         3         3              5G
  1 to 3    4,000-9,999     shared        6         6         6             11G
  1 to 3  10,000-39,999   gpu-shared      1         1        10       1    
  1 to 3       >=40,000       gpu         4         4        40       4

  4 to 17        <1,200     shared        1         1         1              1G
  4 to 17   1,200-4,999     shared        3         3         3              5G
  4 to 17  5,000-19,000     shared        6         6         6             11G
  4 to 17      >=20,000   gpu-shared      1         1        10       1

   >=18             any     shared        4         1         4              7G

AA data without Path Sampling or SNAPP

     1           <5,000   gpu-shared      1         1        10       1
     1          >=5,000       gpu         4         4        40       4

  2 to 39           any   gpu-shared      1         1        10       1

   >=40             and     shared       24         1        24             46G -->						
						<warns>
							<warn>
								<message>Datasets prepared using BEAUTI below version 2.6.x will fail with 2.7.x; datasets are not forward compatible between major releases</message>
								<language>perl</language>
								<code>$which_beast2 &gt;= 70</code>
							</warn>
<!-- for v 2.4.5+  -->
<!-- dna: 1-3 partitions -->
							<warn>
								<message>The job will run on 3 processors as configured. If it runs for the entire configured time, it will consume 3 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt;= 1 &amp;&amp; $nu_partitions &lt; 4 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$no_beagle  &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
							</warn>
							<warn>
								<message>The job will run on 10 processors and 1 gpu as configured. If it runs for the entire configured time, it will consume 20 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt;= 1 &amp;&amp; $nu_partitions &lt; 4  &amp;&amp; $nu_patterns &gt; 4999  &amp;&amp; $nu_patterns &lt; 100000  &amp;&amp; !$no_beagle   &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn> 
							<warn>
								<message>The job will run on 20 processors and 2 gpu as configured. If it runs for the entire configured time, it will consume 40 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt;= 1 &amp;&amp; $nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 99999 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn> 
<!-- cases for 4-17 partitions   -->
							<warn>
								<message>The job will run on 1 processor as configured. If it runs for the entire configured time, it will consume 1 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &lt; 1200 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn>
							<warn>
								<message>The job will run on 3 processors as configured. If it runs for the entire configured time, it will consume 3 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 1199 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn> 
							<warn>
								<message>The job will run on 6 processors as configured. If it runs for the entire configured time, it will consume 6 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; $nu_patterns &gt; 4999  &amp;&amp; $nu_patterns &lt; 20000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn> 
							<warn>
								<message>The job will run on 10 processors and one gpu as configured. If it runs for the entire configured time, it will consume 23 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18  &amp;&amp; $nu_patterns &gt; 19999 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling  &amp;&amp; !$more_memory2</code>
							</warn> 
<!-- cases for > 17 partitions -->
<!-- when patterns < 8000 -->
							<warn>
								<message>The job will run on 2 processors as configured. If it runs for the entire configured time, it will consume 2 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 17 &amp;&amp; $nu_patterns &lt; 8000 &amp;&amp; !$no_beagle &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
							</warn>
<!-- when patterns 8,000 - 13,999 -->
							<warn>
								<message>The job will run on 3 processors as configured. If it runs for the entire configured time, it will consume 3 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 7999 &amp;&amp; $nu_patterns &lt; 14000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
							</warn>
<!-- when patterns > 14,000 and lt 40,000 -->	
							<warn>
								<message>The job will run on 6 processors as configured. If it runs for the entire configured time, it will consume 6 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 13999 &amp;&amp;  $nu_patterns &lt; 40000 &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
							</warn>
<!-- when patterns > 40,000 -->	
							<warn>
								<message>The job will run on 10 processors and 1 GPU as configured. If it runs for the entire configured time, it will consume 20 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 17  &amp;&amp; $nu_patterns &gt; 39999  &amp;&amp; !$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; !$more_memory2</code>
							</warn>
<!-- when more memory needed -->
							<warn>
								<message>The job will run on 12 processors as configured. If it runs for the entire configured time, it will consume 12 x $runtime cpu hours</message>
								<language>perl</language>
								<code>!$datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling &amp;&amp; $more_memory2</code>
							</warn>						
<!-- Protein cases-->
<!-- cases for 1 partition -->
							<warn>
								<message>The job will run on 10 processors and 1 gpu as configured. If it runs for the entire configured time, it will consume 23 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions == 1  &amp;&amp; $nu_patterns &lt; 12000  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
							</warn>
							<warn>
								<message>The job will run on 40 processors and four gpus as configured. If it runs for the entire configured time, it will consume 92 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions == 1  &amp;&amp; $nu_patterns &gt; 11999  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
							</warn>
<!-- cases for 2 - 39 partitions --> 
 							<warn>
								<message>The job will run on 10 processors and one gpu as configured. If it runs for the entire configured time, it will consume 23 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 1 &amp;&amp; $nu_partitions &lt; 40  &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis  &amp;&amp; !$path_sampling</code>
							</warn>
<!-- cases for 40+ partitions -->   
							<warn>
								<message>The job will run on 24 processors as configured. If it runs for the entire configured time, it will consume 24 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$nu_partitions &gt; 39 &amp;&amp; !$no_beagle  &amp;&amp; $datatype  &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</warn>	
<!-- 4 cases for snapp and path sampling -->
<!-- 
 Data          Data        Slurm                                         Slurm 
partitions     patterns    partition  -threads -instances  cores   GPUs   memory

Any data with Path Sampling but without SNAPP

    any           any       shared       6          1         6             11G


Any data with SNAPP but without Path Sampling

    any           any       shared       24         1        24             46G     

Any data with SNAPP AND Path Sampling that needs only default memory (77 GB)

    any           any       shared       25         1        40             77G 

Any data with SNAPP and Path Sampling that needs extra memory (123 GB)

    any           any       shared       25         1        64            123G -->		
							<warn>
								<message>The job will run on 25 processors as configured. If it runs for the entire configured time, it will consume 25 x $runtime cpu hours </message>
								<language>perl</language>
								<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; !$more_memory</code>
							</warn>
							<warn>
								<message>The job will run on 40 processors as configured. If it runs for the entire configured time, it will consume 40 x $runtime cpu hours </message>
								<language>perl</language>
								<code>$snapp_analysis &amp;&amp; $path_sampling &amp;&amp; $more_memory</code>
							</warn>
							<warn>
								<message>The job will run on 24 processors as configured. If it runs for the entire configured time, it will consume 24 x $runtime cpu hours </message>
								<language>perl</language>
								<code>$snapp_analysis &amp;&amp; !$path_sampling</code>
							</warn>
							<warn>
								<message>The job will run on 6 processors as configured. If it runs for the entire configured time, it will consume 6 x $runtime cpu hours </message>
								<language>perl</language>
								<code>!$snapp_analysis &amp;&amp; $path_sampling</code>
							</warn>
						</warns>
						<comment>
<value>Estimate the maximum time your job will need to run. We recommend testing initially with a &lt; 0.5hr test run because Jobs set for 0.5 h or less depedendably run immediately in the "debug" queue. 
Once you are sure the configuration is correct, you then increase the time. The reason is that jobs &gt; 0.5 h are submitted to the "normal" queue, where jobs configured for 1 or a few hours times may
	run sooner than jobs configured for the full 168 hours. 
</value>
						</comment>
					</attributes>
				</parameter>

				<parameter type="Float" issimple="1" ismandatory="1">
					<name>runtime</name> 
					<attributes>
						<group>1</group>
						<paramfile>scheduler.conf</paramfile>
						<prompt>Maximum Hours to Run (up to 168 hours)</prompt>
						<vdef>
							<value>0.5</value>
						</vdef>
						<ctrls>
<!-- all beast before 2.4.1 -->
							<ctrl>
								<message>The maximum runtime for a non-gpu job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $which_beast2 &lt; 42</code>
							</ctrl>
<!--  SNAPP -->
							<ctrl>
								<message>The maximum runtime for a non-gpu job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $snapp_analysis</code>
							</ctrl>
<!-- 1-3 partitions	  -->
<!--   1 to 3           <750     shared        1         1         1              1G             
  1 to 3      750-4,999     shared        3         3         3              5G
  1 to 3   5,000-59,999   gpu-shared      1         1        10       1     92G
  1 to 3       >=60,000       gpu         4         4        40       4    368G -->
 <!--  dna patterns lt 10000 cpu -->
							<ctrl>
								<message>The maximum runtime for a non-gpu job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $nu_partitions &gt;= 1 &amp;&amp; $nu_partitions &lt; 4 &amp;&amp; $nu_patterns &lt; 5000 &amp;&amp; !$datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>	
<!--  patterns gt= 10000 gpu -->
							<ctrl>
								<message>The maximum runtime for a gpu job must be less than 120 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 120.0 &amp;&amp; $nu_partitions &gt;= 1 &amp;&amp; $nu_partitions &lt; 4 &amp;&amp; $nu_patterns &gt; 4999 &amp;&amp; !$datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>
 <!-- 4,17 partitions -->
 <!--  patterns lt 20000 cpu -->
							<ctrl>
								<message>The maximum runtime for this job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $nu_patterns &lt; 20000 &amp;&amp; $nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; !$datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>	
<!--  patterns gt= 20000 gpu -->
							<ctrl>
								<message>The maximum runtime for a gpu job must be less than 120 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 120.0 &amp;&amp; $nu_patterns &gt; 19999 &amp;&amp; $nu_partitions &gt; 3 &amp;&amp; $nu_partitions &lt; 18 &amp;&amp; !$datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>
<!-- gt 17 partitions cpu -->
							<ctrl>
								<message>The maximum runtime for this job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $nu_partitions &gt; 17 &amp;&amp; !$datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>	
<!-- Amino acid data-->
<!--  partitions 1-39 -->
							<ctrl>
								<message>The maximum runtime for a gpu job must be less than 120 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 120.0 &amp;&amp; $nu_partitions &lt; 40  &amp;&amp; $datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>	
 <!--  partitions gt 40 -->
							<ctrl>
								<message>The maximum runtime for a non-gpu job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; $nu_partitions &gt; 39 &amp;&amp; $datatype   &amp;&amp; !$snapp_analysis &amp;&amp; !$path_sampling</code>
							</ctrl>

<!-- snapp or path sampling -->	
							<ctrl>
								<message>The maximum runtime for this job must be less than 168 hours</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0 &amp;&amp; ($snapp_analysis || $path_sampling)</code>
							</ctrl>								
							<ctrl>
								<message>The maximum hours to run must be greater than 0.05</message>
								<language>perl</language>
								<code>$runtime &lt; 0.05</code>
							</ctrl>
						</ctrls>
						<format>
							<language>perl</language>
							<code>"runhours=$value\\n"</code>
						</format>
						<comment>
<value>Estimate the maximum time your job will need to run. We recommend testimg initially with a &lt; 0.5hr test run because Jobs set for 0.5 h or less depedendably run immediately in the "debug" queue. 
Once you are sure the configuration is correct, you then increase the time. The reason is that jobs &gt; 0.5 h are submitted to the "normal" queue, where jobs configured for 1 or a few hours times may
	run sooner than jobs configured for the full 168 hours. 
</value>
						</comment>
					</attributes>
				</parameter>
				
<!-- user must specify how many patterns they have -->
				<parameter issimple="1" ismandatory="1" type="Integer">
					<name>nu_patterns</name>
					<attributes>
						<group>0</group>
						<prompt>How many patterns does your data have? (if you dont know, make a short run and find this in the output)</prompt>
						<ctrls>
							<ctrl>
								<message>Please enter an integer greater than 1 for the number of patterns in your data set.</message>
								<language>perl</language>
								<code>$nu_patterns &lt; 2 </code>
							</ctrl>
							<ctrl>
								<message>Please enter an integer greater than 1 for the number of patterns in your data set.</message>
								<language>perl</language>
								<code>!defined $nu_patterns</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>This option will help the application determine how to run the job. Approximate is fine. The number of patterns can be found in the Beauti file. You can make a quick pre-run, and the number of patterns and partitions will be obvious in the output, if you aren't sure</value>
						</comment>
					</attributes>
				</parameter> 

<!-- Determine whether the data set is partitioned, this will determine how the job is run. 
					<parameter issimple="1" ismandatory="1" type="Switch">
					<name>is_partitioned</name>
					<attributes>
						<group>0</group>
						<prompt>My data set is partitioned</prompt>
						<vdef>
							<value>0</value>
						</vdef>
						<comment>
							<value>This option will help the application determine how to run the job; you can determine the number of partitions from the output logs.</value>
						</comment>
					</attributes>
				</parameter> -->
				
<!-- user must specify how many partitions they have -->
				<parameter issimple="1" ismandatory="1" type="Integer" isMetadata="1">
					<name>nu_partitions</name>
					<attributes>
						<group>0</group>
						<prompt>How many partitions does your data set have?</prompt>
						<precond>
							<language>perl</language>
							<code>!$snapp_analysis &amp;&amp; !$path_sampling</code>
						</precond>
	    				<ctrls>
							<ctrl>
								<message>Please enter the number of partitions.</message>
								<language>perl</language>
								<code>!$snapp_analysis &amp;&amp; !$path_sampling &amp;&amp; !defined $nu_partitions </code>
							</ctrl>
							<ctrl>
								<message>The number of partitions must be greater than 0.</message>
								<language>perl</language>
								<code>!$snapp_analysis &amp;&amp; !$path_sampling &amp;&amp; $nu_partitions &lt; 1 </code>
							</ctrl>
						</ctrls> 
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter> 
				
<!--  I am running path sampling rootdir='./tmp/step'  
This could be modified in the xslt with Saxon, but we need someone with the skills to do it. -->	
				<parameter issimple="1" type="Switch" isMetadata="1">
					<name>path_sampling</name>
					<attributes>
						<group>0</group>
						<prompt>This is a Path Sampling analysis</prompt>		
						<warns>
							<warn>
								<message>For Path Sampling, your input data must specify: rootdir \= ./tmp/step, where the .\/ is required. The actual directory names given (tmp/step in this example) are arbitary, and can be anything linux accepts</message>
								<language>perl</language>
								<code>$path_sampling</code>
							</warn>
							<warn>
								<message>Because of the details of their data management, Path Sampling jobs cannot be restarted using the CIPRES restart mechanism.</message>
								<language>perl</language>
								<code>$path_sampling</code>
							</warn>
						</warns>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter issimple="1" type="Switch" isMetadata="1">
					<name>more_memory2</name>
					<attributes>
						<prompt>I need more memory for DNA run that doesn't use Path Sampling/SNAPP</prompt>	
						<precond>
							<language>perl</language>
							<code>!$snapp_analysis &amp;&amp; !$path_sampling &amp;&amp; !$datatype</code>
						</precond>	
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>  
				
				<parameter issimple="1" type="Switch" isMetadata="1">
					<name>more_memory</name>
					<attributes>
						<prompt>I need more memory for a Path Sampling/SNAPP analysis</prompt>	
						<precond>
							<language>perl</language>
							<code>$snapp_analysis || $path_sampling</code>
						</precond>	
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter> 
				
<!--  I am running path sampling rootdir='./tmp/step'  
This could be modified in the xslt with Saxon, but we need someone with the skills to do it. -->	
				<parameter issimple="1" type="Switch" isMetadata="1">
					<name>snapp_analysis</name>
					<attributes>
						<group>0</group>
						<prompt>This is a SNAPP (or SNAPPER) analysis</prompt>		
<!--  						<warns>
							<warn>
								<message>For Path Sampling, your input data must specify: rootdir \= ./tmp/step, where the .\/ is required. The actual directory names given (tmp/step in this example) are arbitary, and can be anything linux accepts</message>
								<language>perl</language>
								<code>$path_sampling</code>
							</warn>
						</warns> -->
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter> 
				
<!-- is the data protein -->
				<parameter issimple="1" ismandatory="1" type="Switch" isMetadata="1">
					<name>datatype</name>
					<attributes>
						<group>0</group>
						<prompt>The matrix contains amino acids</prompt>
						<comment>
							<value>Protein sequences require a slightly different configuration than DNA sequences.</value>
						</comment>
					</attributes>
				</parameter>

<!-- Dont use Beagle 
			<parameter issimple="1" ishidden="0" type="Switch">
			<name>no_beagle</name>
			<attributes>
				<prompt>Do not use Beagle</prompt>
				<vdef>
					<value>0</value>				
				</vdef>
				<warns>
					<warn>
						<message>The Do not use Beagle option is intended only for cases when runs with Beagle fail. Runs without Beagle are slower and less efficient.</message>
						<language>perl</language>
						<code>$no_beagle == 1</code>
					</warn>
				</warns>
				<group>4</group>
				<comment>
<value>This option is offered because sometimes a bug in the interface between BEAST and BEAGLE prevents a run from completing. Use this option if you wish to run a data set that 
has failed using the normal BEAST/BEAGLE implementation. Runs made this way are always slower, so use this option as a last resort.</value>
				</comment>
			</attributes>
		</parameter> -->
		
<!-- The user is permitted to specify a seed -->
		<parameter issimple="1" ishidden="0" type="Switch">
			<name>spec_seed</name>
			<attributes>
				<prompt>Specify a seed for this run (by default a random seed is used)</prompt>
				<vdef>
					<value>0</value>				
				</vdef>
				<group>4</group>
				<comment>
<value>This option allows the user to specify the random seed BEAST uses, so results can be compared between runs.</value>
				</comment>
			</attributes>
		</parameter>

		<parameter issimple="1" ishidden="0" type="String">
			<name>seed_val</name>
			<attributes>
				<prompt>Enter the seed value here</prompt>
				<precond>
					<language>perl</language>
					<code>$spec_seed</code>
				</precond>
				<format>
					<language>perl</language>
					<code> "-seed $value"</code>
				</format>
				<vdef>
					<value>12345</value>				
				</vdef>
				<group>4</group>
			</attributes>
		</parameter>
	
		<parameter issimple="1" ishidden="0" type="Switch">
			<name>overwrite_logs</name>
			<attributes>
				<prompt>Overwrite existing log files</prompt>
				<format>
					<language>perl</language>
					<code>$value ? "-overwrite":"" </code>
				</format>
				<vdef>
					<value>0</value>				
				</vdef>
				<group>4</group>
			</attributes>
		</parameter>

		<parameter ishidden="1" type="String">
			<name>restart</name>
			<attributes>
				<format>
					<language>perl</language>
					<code>($value) ? "-resume" : ""</code>
				</format>
				<group>4</group>
			</attributes>
		</parameter>



	        <parameter ishidden="1" type="Switch">
                        <name>is_cloudeligible</name>
                        <attributes>
                                <format>
                                        <language>perl</language>
                                        <code>""</code>
                                </format>
                                <vdef>
                                        <value>0</value>
                                </vdef>
                                <group>4</group>
                        </attributes>
                </parameter>

</parameters>
</pise>


