from Pegasus.DAX3 import *
import sys
import os

dax = ADAG("pegasustest")

files = ["1H6.fam", "1H6.bim", "1H6.bed", "1H6.fampheno.txt"]
testoutput = File("testoutput.txt")

fast = Job(name="fast")
fast.addArguments("-T", "60", "-i")
fast.addArguments(*files)
fast.addArguments("-o", testoutput)
fast.setStdout(testoutput)
for f in files:
    fast.uses(f, link=Link.INPUT)
fast.uses(testoutput, link=Link.OUTPUT, transfer=True, register=False)
dax.addJob(fast)

dax.writeXML(sys.stdout)

<?xml version="1.0" encoding="UTF-8"?>
<!-- generated: 2016-06-18 17:54:01.708318 -->
<!-- generated by: ksierrac -->
<!-- generator: python -->
<adag xmlns="http://pegasus.isi.edu/schema/DAX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pegasus.isi.edu/schema/DAX http://pegasus.isi.edu/schema/dax-3.6.xsd" version="3.6" name="pegasustest">
        <job id="ID0000001" name="fast">
                <argument>-T 60 -i 1H6.fam 1H6.bim 1H6.bed 1H6.fampheno.txt -o <file name="testoutput.txt"/></argument>
                <stdout name="testoutput.txt" link="output"/>
                <uses name="1H6.bed" link="input"/>
                <uses name="1H6.bim" link="input"/>
                <uses name="1H6.fampheno.txt" link="input"/>
                <uses name="1H6.fam" link="input"/>
                <uses name="testoutput.txt" link="output" register="false" transfer="true"/>
        </job>
</adag>


tr fastlmm { 
  site tacc-stampede {
    pfn "$HOME/Validate-Master-0.9/CurrentReleaseStable/GWAS_09/fastlmmc"
    arch "x86_64"
    os "linux"
    type "INSTALLED"
  }
}

pegasus.catalog.site=XML3
pegasus.catalog.site.file=sites.xml

pegasus.catalog.replica=SimpleFile
pegasus.catalog.replica.file=rc

pegasus.catalog.transformation=Text
pegasus.catalog.transformation.file=tc

pegasus.condor.logs.symlink=false
pegasus.dir.useTimestamp=true
pegasus.dir.storage.deep=false


/home1/04109/ksierrac/pegasus-4.6.1/share/pegasus/examples/xsede-multi-site-example

1H6.bed /home1/04109/ksierrac/pegasus2test/StampedeExample/one/1H6.bed site="local"
1H6.bim /home1/04109/ksierrac/pegasus2test/StampedeExample/one/1H6.bim site="local"
1H6.fam /home1/04109/ksierrac/pegasus2test/StampedeExample/one/1H6.fam site="local"
1H6.fampheno.txt /home1/04109/ksierrac/pegasus2test/StampedeExample/one/1H6.fampheno.txt site="local"

<?xml version="1.0" encoding="UTF-8"?>
<sitecatalog xmlns="http://pegasus.isi.edu/schema/sitecatalog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pegasus.isi.edu/schema/sitecatalog http://pegasus.isi.edu/schema/sc-4.0.xsd" version="4.0">
    <site  handle="local" arch="x86" os="LINUX">
        <!-- the base directory where workflow jobs will execute for local site -->
        <directory type="shared-scratch" path="/home1/04109/ksierrac/pegasustest/work/scratch">
            <file-server operation="all" url="file:///home1/04109/ksierrac/pegasus2test/work/scratch"/>
        </directory>
        <!-- the directory where outputs will be placed  -->
        <directory type="local-storage" path="/home1/04109/ksierrac/pegasus2test/outputs">
            <file-server operation="all" url="file:///home1/04109/ksierrac/pegasus2test/outputs"/>
        </directory>
    </site>

    <site  handle="tacc-stampede" arch="x86_64" os="LINUX">
        <grid  type="gt5" contact="login5.stampede.tacc.utexas.edu:2119/jobmanager-fork" scheduler="Fork" jobtype="auxillary"/>
        <grid  type="gt5" contact="login5.stampede.tacc.utexas.edu:2119/jobmanager-slurm" scheduler="unknown" jobtype="compute"/>
        <directory type="shared-scratch" path="/scratch/04109/ksierrac/workflow-runs">
            <file-server operation="all" url="gsiftp://gridftp.stampede.tacc.xsede.org:2811/scratch/04109/ksierrac/workflow-runs"/>
        </directory>
        <profile namespace="globus" key="project">iPlant-Collabs</profile>
        <profile namespace="env" key="PEGASUS_HOME">/home1/04109/ksierrac/software/pegasus/4.6.1</profile>
    </site>
</sitecatalog>