SciCoDE Remote: Difference between revisions

From Sccswiki
Jump to navigation Jump to search
(Created page with '=Remote components in sciCoDE= In many cases the user want to execute his code on remote machines (e.g. run a simulation on a supercomputer). sciCoDE provides a way to create rem…')
 
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Remote components in sciCoDE=
=Remote components in sciCoDE=
In many cases the user want to execute his code on remote machines (e.g. run a simulation on a supercomputer). sciCoDE provides a way to create remote components capable to run remotely.
In many cases the user want to execute his code on remote machines (e.g. run a simulation on a supercomputer). sciCoDE provides a way to create remote components.
=The C++ remote code=
=The C++ remote code=
If you want to use your C++ application inside sciCoDE as remote component you should generate some stubs needed to establish the connection between the core of sciCoDE and your component. One of the communication methods provided by sciCoDE is a file-based protocol, which can be used on arbitrary systems connected through SSH and SFTP.  
If you want to use your C++ application inside sciCoDE as remote component you should generate some stubs needed to establish the connection between the core of sciCoDE and your component. One of the communication methods provided by sciCoDE is a file-based protocol, which can be used on arbitrary systems connected through SSH and SFTP. The SSH implementation is based on the [http://sourceforge.net/projects/sshtools/|j2SSH library].  


The following steps are needed to prepare you C++ code:
As previously described the components in sciCoDE are specified through a simplified version of SIDL. Only four data types are allowed : strings, doubles, longs and booleans. This types can be used as in, inout and array parameters. This simplification makes the implementation of communication protocols much more easier. The most important part of the SIDL specification are the interfaces ,which are mapped to ports. In the file-based protocol each port is represented through folder on the file system. Consider the following SIDL-code:
<pre>
package example{
  interface YourInterface{
    foo(in int in0,out int[] out0);
  }
  class A implements-all example.YourInterface{
  }
  class B uses example.YourInterface as p0{
  }
}
</pre>
In this simple SIDL-File we have two components A and B. The A component provides YourInterface to other components. The B component uses this interface. The interface consists of one function foo with one input parameter (integer) and one output parameter(int array). We want to compile the component A as remote c++-component.
 
The following steps are needed to prepare(instrument) your C++ code:
* Generate the c++ implentation classes:<br/><pre>java -jar sciCoDECompiler.jar -L c++-plain [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file></pre>
 
* Generate the c++ proxy classes:<br/><pre>java -jar sciCoDECompiler.jar -L c++-proxy [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file></pre>
* Generate the c++ ports:<br/><pre>java -jar sciCoDECompiler.jar -L c++-ports [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file></pre>
 
=sciCoDE execution types=
sciCoDE supports three types of executions:
* Execution as standalone process on the local system.
* Remote execution through SSH.
* Remote execution through SSH combined with Job scheduling.
==Local execution mode (default)==
The local execution mode starts sciCoDE-ready application(cca instrumentation) on the local system as separate process. By default the [[cca-compiler]] will create proxies for this execution mode. The newly created component can be connected to all kind of components inside of sciCoDE. 
==Remote execution through SSH==
==Remote execution through SSH combined with Job scheduling==
=Generating private/public key pair for the SSH connection=
There are different authentication methods through ssh. One method, which could enable password-less connection is through public/private-key pairs. Here the authentication is done through the private  key of the user. The server checks if the user is authorized to communicate with him. The steps to
generate this pair are the following:
*Login on the remote computer (GSISSH in Deisa, normal ssh with pwd).
*Run ssh-keygen -t rsa - here type an empty password when asked,
*append the content of the file ~/.ssh/authorized_keys with the content of public key <name>.pub 
*copy the private key on your local machine
*To test the key pair run your ssh/scp/slogin commands with -i <your-private-key>

Latest revision as of 12:08, 1 September 2011

Remote components in sciCoDE

In many cases the user want to execute his code on remote machines (e.g. run a simulation on a supercomputer). sciCoDE provides a way to create remote components.

The C++ remote code

If you want to use your C++ application inside sciCoDE as remote component you should generate some stubs needed to establish the connection between the core of sciCoDE and your component. One of the communication methods provided by sciCoDE is a file-based protocol, which can be used on arbitrary systems connected through SSH and SFTP. The SSH implementation is based on the library.

As previously described the components in sciCoDE are specified through a simplified version of SIDL. Only four data types are allowed : strings, doubles, longs and booleans. This types can be used as in, inout and array parameters. This simplification makes the implementation of communication protocols much more easier. The most important part of the SIDL specification are the interfaces ,which are mapped to ports. In the file-based protocol each port is represented through folder on the file system. Consider the following SIDL-code:

package example{
  interface YourInterface{
    foo(in int in0,out int[] out0);
  }
  class A implements-all example.YourInterface{
  }
  class B uses example.YourInterface as p0{
  }
}

In this simple SIDL-File we have two components A and B. The A component provides YourInterface to other components. The B component uses this interface. The interface consists of one function foo with one input parameter (integer) and one output parameter(int array). We want to compile the component A as remote c++-component.

The following steps are needed to prepare(instrument) your C++ code:

  • Generate the c++ implentation classes:
    java -jar sciCoDECompiler.jar -L c++-plain [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file>
  • Generate the c++ proxy classes:
    java -jar sciCoDECompiler.jar -L c++-proxy [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file>
  • Generate the c++ ports:
    java -jar sciCoDECompiler.jar -L c++-ports [-I <included sidls> ..] [--naming <naming schema>] -o <output folder> <path to sidl file>

sciCoDE execution types

sciCoDE supports three types of executions:

  • Execution as standalone process on the local system.
  • Remote execution through SSH.
  • Remote execution through SSH combined with Job scheduling.

Local execution mode (default)

The local execution mode starts sciCoDE-ready application(cca instrumentation) on the local system as separate process. By default the cca-compiler will create proxies for this execution mode. The newly created component can be connected to all kind of components inside of sciCoDE.

Remote execution through SSH

Remote execution through SSH combined with Job scheduling

Generating private/public key pair for the SSH connection

There are different authentication methods through ssh. One method, which could enable password-less connection is through public/private-key pairs. Here the authentication is done through the private key of the user. The server checks if the user is authorized to communicate with him. The steps to generate this pair are the following:

  • Login on the remote computer (GSISSH in Deisa, normal ssh with pwd).
  • Run ssh-keygen -t rsa - here type an empty password when asked,
  • append the content of the file ~/.ssh/authorized_keys with the content of public key <name>.pub
  • copy the private key on your local machine
  • To test the key pair run your ssh/scp/slogin commands with -i <your-private-key>