Java Commodity Grid Java Cog Kit Java Cog

  • Slides: 10
Download presentation
Java Commodity Grid (Java Cog. Kit) • Java Cog. Kits allow developers to use

Java Commodity Grid (Java Cog. Kit) • Java Cog. Kits allow developers to use commodity technologies such as Java or Python in programming the Grid based on Globus. The Java Cog. Kit provides a mapping between Java and the Globus Toolkit. However, it is not a wrapper of the Globus Toolkit. Java Cog. Kit provides the following basic services: – – – Security Remote job submission and monitoring Remote data access Information service access Certificate store

Java Commodity Grid (Java Cog. Kit) • Aim: To download a file using Grid.

Java Commodity Grid (Java Cog. Kit) • Aim: To download a file using Grid. FTP. • Create a directory under /grid/users/<your_name>/samples/ called ‘resourcemanagement. ’. – – cd grid/users/tugba mkdir samples cd samples mkdir resourcemanagement • Create a test file called “Test. Grid. File” then write something to the file. Save it under /grid/users/<your_name>/samples/resourcemanagement. • Open another terminal and create the same directory structure as above. Then, download “My. Grid. FTP. java” and “Gram. Example. Multi. java” files to newly created directory. Then compile the files.

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Grid. FTP)

Java Commodity Grid (Java Cog. Kit) • Create a new Java file called “Test.

Java Commodity Grid (Java Cog. Kit) • Create a new Java file called “Test. Grid. FTP. java”. Then write the following lines to that file: import org. apache. log 4 j. Logger; import org. apache. log 4 j. Level; import org. globus. ftp. *; public class Test. Grid. FTP { public static void main(String [] args){ Logger. get. Root(). set. Level(Level. INFO); // remote files String rf 1 = "/grid/users/tugba/samples/resourcemanagement/Test. Grid. File"; String host = "concorde 01. mcs. surrey. ac. uk"; // local files String lf 1 = "/grid/users/tugba/samples/resourcemanagement/Test. Grid. File"; int TRANSFER_TYPE = Grid. FTPSession. TYPE_ASCII; My. Grid. FTP my. Grid. FTP 1 = new My. Grid. FTP(host, My. Grid. FTP. GRIDFTP_PORT, "/tmp/x 509 up_u 28008", true); my. Grid. FTP 1. parallel. Download(rf 1, lf 1); my. Grid. FTP 1. close(); } } • Run the “Test. Grid. FTP. java”. java Test. Grid. FTP • Exercise: Look at the Java implementation of My. Grid. FTP and transfer a local file to a remote computer.

Java Commodity Grid (GRAM)

Java Commodity Grid (GRAM)

Java Commodity Grid (GRAM)

Java Commodity Grid (GRAM)

Java Commodity Grid (Java Cog. Kit) • Create a Java file called “Test. Gram.

Java Commodity Grid (Java Cog. Kit) • Create a Java file called “Test. Gram. java” under the same directory. Write the following lines to the file. public class Test. Gram { public static void main(String [] args){ String [] contact = new String[1]; contact[0] = “concorde 02. mcs. surrey. ac. uk”; Gram. Example. Multi gramm = new Gram. Example. Multi(contact, false); String [] rsl_command = new String[1]; rsl_command[0] = new String("&(executable=/opt/SUNWjava/j 2 sdk 1. 4. 1_01/bin/java)(directory =/grid/users/tugba/samples/resourcemanagement)(arguments= Hello. World)"); String job. Out = gramm. Globus. Run(rsl_command); System. out. println("Output: " + job. Out); } } • Compile and run the program.

Java Commodity Grid (Java Cog. Kit) • Exercise: • Implement the following tasks: –

Java Commodity Grid (Java Cog. Kit) • Exercise: • Implement the following tasks: – You want to count from 1 to a number x (such as 10000). The number x and the number of machines y to be used for counting process will be submitted to the service provider. – The service that received the request will parallelise the process by executing the query on y number of machines. – The service provider will send the output back to the client machine.