<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Jens-S. Vöckler (University of Chicago) -->
<xs:schema targetNamespace="http://www.griphyn.org/chimera/Invocation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.griphyn.org/chimera/Invocation" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1" xml:lang="en">
	<xs:simpleType name="DottedQuad">
		<xs:annotation>
			<xs:documentation>dotted quad notation of a IPv4 host address.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:minLength value="7"/>
			<xs:maxLength value="15"/>
			<xs:whiteSpace value="collapse"/>
			<xs:pattern value="(\d{1,3}\.){3}\d{1,3}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PositiveDecimal">
		<xs:annotation>
			<xs:documentation>restricted version of the 'decimal' type.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:minInclusive value="0"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="RUsageType" mixed="true">
		<xs:annotation>
			<xs:documentation>Information from the rusage record.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="utime" type="xs:decimal" use="required">
			<xs:annotation>
				<xs:documentation>Total amount of user time used, in seconds with millisecond fraction.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="stime" type="xs:decimal" use="required">
			<xs:annotation>
				<xs:documentation>Total amount of system time used, in seconds with millisecond fraction.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="minflt" type="xs:unsignedLong" use="required">
			<xs:annotation>
				<xs:documentation>Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="majflt" type="xs:unsignedLong" use="required">
			<xs:annotation>
				<xs:documentation>Number of hard page faults (i.e. those that required I/O). </xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nswap" type="xs:unsignedLong" use="required">
			<xs:annotation>
				<xs:documentation>Number of times a process was swapped out of physical memory.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nsignals" type="xs:unsignedLong" use="required">
			<xs:annotation>
				<xs:documentation>Number of signals delivered.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nvcsw" type="xs:unsignedLong" use="optional">
			<xs:annotation>
				<xs:documentation>Number of voluntary context switches, i.e. because the process gave up the process before it had to (usually to wait for some resource to be available).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nivcsw" type="xs:unsignedLong" use="optional">
			<xs:annotation>
				<xs:documentation>Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="StatCallType">
		<xs:annotation>
			<xs:documentation>Information about a named file or descriptor.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:choice>
				<xs:element name="file">
					<xs:annotation>
						<xs:documentation>Named file in filesystem.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:hexBinary">
								<xs:attribute name="name" type="xs:string" use="required">
									<xs:annotation>
										<xs:documentation>A named file may be a regular file like a shell script or executable, or it may be a device file like /dev/null. Only regular files may incur element content. </xs:documentation>
									</xs:annotation>
								</xs:attribute>
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="descriptor">
					<xs:annotation>
						<xs:documentation>Pre-opened descriptor.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:attribute name="number" type="xs:nonNegativeInteger" use="required"/>
					</xs:complexType>
				</xs:element>
				<xs:element name="temporary">
					<xs:annotation>
						<xs:documentation>Created temporary file.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:attribute name="name" type="xs:string" use="required"/>
						<xs:attribute name="descriptor" type="xs:integer" use="required"/>
					</xs:complexType>
				</xs:element>
			</xs:choice>
			<xs:element name="statinfo" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Kernel inode information.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:attribute name="size" type="xs:integer" use="required"/>
					<xs:attribute name="mode" type="xs:token" use="optional">
						<xs:annotation>
							<xs:documentation>file protection in octal number with leading zero.</xs:documentation>
						</xs:annotation>
					</xs:attribute>
					<xs:attribute name="inode" type="xs:integer" use="optional"/>
					<xs:attribute name="nlink" type="xs:integer" use="optional"/>
					<xs:attribute name="blksize" type="xs:integer" use="optional"/>
					<xs:attribute name="atime" type="xs:dateTime" use="optional"/>
					<xs:attribute name="mtime" type="xs:dateTime" use="optional"/>
					<xs:attribute name="ctime" type="xs:dateTime" use="optional"/>
					<xs:attribute name="uid" type="xs:integer" use="optional"/>
					<xs:attribute name="gid" type="xs:integer" use="optional"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="data" minOccurs="0">
				<xs:annotation>
					<xs:documentation>One page of content from temporary files.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="truncated" type="xs:boolean" use="optional">
								<xs:annotation>
									<xs:documentation>This flag will be true, if there is more information than included in the data tag. </xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="error" type="xs:int" use="required">
			<xs:annotation>
				<xs:documentation>result from the stat call on a named file or descriptor.
</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="JobType">
		<xs:annotation>
			<xs:documentation>Information about a specific job that ran as part of the invocation.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="usage" type="RUsageType">
				<xs:annotation>
					<xs:documentation>Excerpt of the struct rusage returned for the application.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="status">
				<xs:annotation>
					<xs:documentation>Exit status of application, which may be a signal with core dump.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:choice>
						<xs:element name="failure">
							<xs:annotation>
								<xs:documentation>Failure to start application. This is an error by gridstart.</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:string">
										<xs:attribute name="error" type="xs:byte" use="required"/>
									</xs:extension>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
						<xs:element name="regular">
							<xs:annotation>
								<xs:documentation>Controlled application exit, may indicate error.</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:attribute name="exitcode" type="xs:byte" use="required"/>
							</xs:complexType>
						</xs:element>
						<xs:element name="signalled">
							<xs:annotation>
								<xs:documentation>Application died on signal.</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:string">
										<xs:attribute name="signal" type="xs:byte" use="required"/>
										<xs:attribute name="corefile" type="xs:boolean" use="optional"/>
									</xs:extension>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
						<xs:element name="suspended">
							<xs:annotation>
								<xs:documentation>This should not happen.</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:string">
										<xs:attribute name="signal" type="xs:byte" use="required"/>
									</xs:extension>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
					</xs:choice>
					<xs:attribute name="raw" type="xs:int" use="required"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="statcall" type="StatCallType">
				<xs:annotation>
					<xs:documentation>Inode information about the application that was run.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="command-line">
				<xs:annotation>
					<xs:documentation>Name and arguments of the executable of application.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="executable" type="xs:string" use="required"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="cwd" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Record the current working directory at time of execution.</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="4095"/>
						<xs:whiteSpace value="preserve"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="start" type="xs:dateTime" use="required"/>
		<xs:attribute name="duration" type="PositiveDecimal" use="required"/>
		<xs:attribute name="pid" type="xs:decimal" use="optional"/>
	</xs:complexType>
	<xs:element name="invocation">
		<xs:annotation>
			<xs:documentation>record of an application run for a given TR and DV.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="prejob" type="JobType" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Optional job to run before invoking the application.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="mainjob" type="JobType">
					<xs:annotation>
						<xs:documentation>The application itself.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="postjob" type="JobType" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Optional job to run after invoking the application.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="usage" type="RUsageType">
					<xs:annotation>
						<xs:documentation>Resource usage recorded of gridstart itself.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:sequence maxOccurs="5">
					<xs:element name="statcall">
						<xs:annotation>
							<xs:documentation>Inode info on shared and outside apps and streams.</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:extension base="StatCallType">
									<xs:attribute name="id" use="required">
										<xs:simpleType>
											<xs:restriction base="xs:NMTOKEN">
												<xs:enumeration value="gridstart"/>
												<xs:enumeration value="stdin"/>
												<xs:enumeration value="stdout"/>
												<xs:enumeration value="stderr"/>
												<xs:enumeration value="logfile"/>
											</xs:restriction>
										</xs:simpleType>
									</xs:attribute>
								</xs:extension>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>
				</xs:sequence>
			</xs:sequence>
			<xs:attribute name="version" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:NMTOKEN">
						<xs:pattern value="[0-9]+\.[0-9]+"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="start" type="xs:dateTime" use="required">
				<xs:annotation>
					<xs:documentation>Start of application according to host clock.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="duration" type="PositiveDecimal" use="required">
				<xs:annotation>
					<xs:documentation>Duration of application run in seconds with microsecond fraction, according to host clock.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="transformation" type="xs:string" use="optional" default="null"/>
			<xs:attribute name="derivation" type="xs:string" use="optional" default="null"/>
			<xs:attribute name="host" type="DottedQuad" use="optional" default="0.0.0.0">
				<xs:annotation>
					<xs:documentation>Host address of the primary interface, as far as discernable.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="pid" type="xs:decimal" use="optional">
				<xs:annotation>
					<xs:documentation>process number of the gridlaunch application itself.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="uid" type="xs:integer" use="optional">
				<xs:annotation>
					<xs:documentation>real user id on the compute node that started grid launch.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="gid" type="xs:integer" use="optional">
				<xs:annotation>
					<xs:documentation>real group id of the user that started gridlaunch</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema>
