Resource Management and Accounting Notebook - page 126 of 150

EditDeleteAnnotateNotarize
First PagePrevious PageNext PageLast PageTable of ContentsSearch

Date and Author(s)

Sample conversion of PM XML to SSSRMAP

All,
Included below is an attempt to straightforwardly convert the current Process-Manager XML from the restriction syntax to he SSSRMAP syntax. Beyond the basic structural differences the conversion includes changing the XML element/attribute names to follow the conventions in SSSRMAP (ie element names are Upper Camel Case, attributes are Lower Camel Case, no dashes, etc). In addition if there is a matching element already defined in the SSSRMAP Job object its syntax was used here as well.

NOTE: This is intended to be only a reference point. It is understood that there may be good reasons not to match up some element names and some existing SSSRMAP names might also need changing. Hopefully this will provide a a reasonable comparison of the two styles as well.

Here is a sample create process group request, note the range and host-spec aren't needed here, but are included as an example.

 
 
<create-process-group submitter="bob" totalprocs="4" output="single" pgid="1234"> 
	<process-spec range="0-3" user="bob" co-process="gdb" exec="foo" cwd="/home/bob" 
		path="/bin:/usr/bin"> 
		<arg idx="0" value="foo"> 
		<arg idx="2" value="bar"> 
		<env name="VAR1" value="true"> 
		<env name="VAR2" value="0"> 
		<host-spec>node1 
			node2 
			node3 
			node4 
		</host-spec> 
	</process-spec> 
	<host-spec>node1 
		node2 
		node3 
		node4 
	</host-spec> 
</create-process-group> 
 

Here is the same request in SSSRMAP.
Comment: I think output needs a better name, maybe OutputMerge?

 
 
<Request action="Create" actor="root"> 
	<Object>ProcessGroup</Object> 
	<Data type="xml"> 
		<ProcessGroup> 
			<Submitter>bob</Submitter> 
			<TotalProcesses>4</TotalProcesses> 
			<ProcessGroupId>1234</ProcessGroupId> 
			<Output>single</Output> 
			<ProcessSpecification range="0-3"> 
				<User>bob</User> 
				<Coprocess>gdb</Coprocess> 
				<Executable>foo</Executable> 
				<Arguement>foo</Arguement> 
				<Arguement>bar</Arguement> 
				<Enviroment> 
					<Variable name="VAR1">true</Variable> 
					<Variable name="VAR2">0</Variable> 
				</Environment> 
				<InitialWorkingDirectory>/home/bob</InitialWorkingDirectory> 
				<NodeList> 
					<Node>node1</Node> 
					<Node>node2</Node> 
					<Node>node3</Node> 
					<Node>node4</Node> 
				</NodeList> 
			</ProcessSpecification> 
			<NodeList> 
				<Node>node1</Node> 
				<Node>node2</Node> 
				<Node>node3</Node> 
				<Node>node4</Node> 
			</NodeList> 
		</ProcessGroup> 
	</Data> 
</Request> 
 
<get-process-group-info> 
	<process-group pgid="1234" submitter="bob" totalprocs="4" 
		state="finished"> 
		<exit-status> 
			<exit-code rank="*" status="*" host="*" pid="*"/> 
		</exit-status> 
	</process-group> 
</get-process-group-info> 
 

Now a Query:

 
 
<Request action="Query"> 
	<Object>ProcessGroup</Object> 
	<Get name="ProcessGroupId"/> 
	<Get name="Submitter"/> 
	<Get name="TotalProcesses"/> 
	<Get name="State"/> 
	<Get name="ExitStatus/ExitCode"/> 
	<Where name="ProcessGroupId">1234</Where> 
	<Where name="User">bob</Where> 
	<Where name="TotalProcesses">4</Where> 
	<Where name="State">finished</Where> 
</Request> 
 

Response:

 
 
<process-groups> 
	<process-group pgid="1234" submitter="bob" totalprocs="4" 
		state="finished"> 
		<exit-status> 
			<exit-code rank="0" status="0" host="node0" pid="123"/> 
			<exit-code rank="1" status="0" host="node1" pid="123"/> 
			<exit-code rank="2" status="0" host="node2" pid="123"/> 
			<exit-code rank="3" status="0" host="node3" pid="123"/> 
		</exit-status> 
	</process-group> 
</process-groups> 
 
<Response> 
	<Status> 
		<Code>000</Code> 
		<Value>Success</Value> 
	</Status> 
	<Data> 
		<ProcessGroup> 
			<ProcessGroupId>1234</ProcessGroupId> 
			<User>bob</User> 
			<TotalProcesses>4</TotalProcesses> 
			<State>finished</State> 
			<ExitStatus> 
				<ExitCode> 
					<Rank>0</Rank> 
					<Status>0</Status> 
					<Node>node0</Node> 
					<ProcessId>123</ProcessId> 
				</ExitCode> 
				<ExitCode> 
					<Rank>1</Rank> 
					<Status>0</Status> 
					<Node>node1</Node> 
					<ProcessId>123</ProcessId> 
				</ExitCode> 
				<ExitCode> 
					<Rank>2</Rank> 
					<Status>0</Status> 
					<Node>node2</Node> 
					<ProcessId>123</ProcessId> 
				</ExitCode> 
				<ExitCode> 
					<Rank>3</Rank> 
					<Status>0</Status> 
					<Node>node3</Node> 
					<ProcessId>123</ProcessId> 
				</ExitCode> 
			</ExitStatus 
		</ProcessGroup> 
	</Data> 
</Response> 
 

A sample signal:

 
 
 
<signal-process-group signal="SIGTERM"> 
	<process-group pgid="1234"> 
	</process-group> 
</signal-process-group> 
 
 
<Request action="Signal"> 
	<Object>ProcessGroup</Object> 
	<Option name="signal">SIGTERM</Option> 
	<Get name="ProcessGroupId"/> 
	<Where name="ProcessGroupId">1234</Where> 
</Request> 
 

Response:

 
 
 
<process-groups> 
	<process-group pgid="1234"/> 
</process-groups> 
 
<Response> 
	<Status> 
		<Code>000</Code> 
		<Value>Success</Value> 
		<Message>1 job signaled</Message> 
	</Status> 
	<Count>1</Count> 
	<Data> 
		<ProcessGroup> 
			<ProcessGroupId>1234</ProcessGroupId> 
		</ProcessGroup> 
	</Data> 
</Response> 
 
<kill-process-group> 
	<process-group pgid="1234"/> 
	<process-group submitter="bob" /> 
</kill-process-group> 
 
<Request action="Kill"> 
	<Object>ProcessGroup</Object> 
	<Get name="ProcessGroupId"/> 
	<Get name="Submitter"/> 
	<Where name="ProcessGroupId">1234</Where> 
	<Where name="Submitter" conj="or">bob</Where> 
</Request> 
 

Response:
Hmm... Actually I am not positive on the first response assuming there is 1 job matched??

 
 
<process-groups> 
	<process-group pgid="1234"/> 
	<process-group submitter="bob"/> 
</process-groups> 
 
<Response> 
	<Status> 
		<Code>000</Code> 
		<Value>Success</Value> 
		<Message>1 job killed</Message> 
	</Status> 
	<Count>1</Count> 
	<Data> 
		<ProcessGroup> 
			<ProcessGroupId>1234</ProcessGroupId> 
			<Submitter>bob</Submitter> 
		</ProcessGroup> 
	</Data> 
</Response>