Changeset 3243
- Timestamp:
- 1/6/2009 3:52:00 AM (11 months ago)
- Files:
-
- saga/trunk/examples/misc/aws.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
saga/trunk/examples/misc/aws.cpp
r3242 r3243 6 6 7 7 #include <saga/saga.hpp> 8 9 #define COUNT 10010 8 11 9 void print_io (saga::job::job j) … … 40 38 std::string instance = "") 41 39 { 40 42 41 saga::url js_url (type + "://" + instance); 43 42 44 std::cout << " ----------------------- 0 (" << type<< ") \n";43 std::cout << " ----------------------- (" << type << " - " << js_url << ") \n"; 45 44 46 saga::session s1;47 45 48 std::cout << " ----------------------- 1 (" << type << ") \n"; 46 // create a context for that cloud type 47 saga::context c (type); 48 c.set_defaults (); 49 49 50 saga::context c1 (type); 50 // attach it to the session 51 saga::session s; 52 s.add_context (c); 51 53 52 std::cout << " ----------------------- 2 (" << type << ") \n"; 54 // create a job service in that session 55 saga::job::service js (s, js_url); 53 56 54 c1.set_defaults (); 57 // create and run a job on that job service (i.e. on that VM) 58 saga::job::job j = js.create_job (jd); 59 j.run (); 55 60 56 std::cout << " ----------------------- 3 (" << type << ") \n"; 57 58 s1.add_context (c1); 59 60 std::cout << " ----------------------- 4 (" << type << " - " << js_url << ") \n"; 61 62 saga::job::service js1 (s1, js_url); 63 64 std::cout << " ----------------------- 5 (" << type << ") \n"; 65 66 saga::job::job j1 = js1.create_job (jd); 67 68 std::cout << " ----------------------- 6 (" << type << ") \n"; 69 70 j1.run (); 71 72 std::cout << " ----------------------- 7 (" << type << ") \n"; 73 74 print_io (j1); 75 76 std::cout << " ----------------------- 8 (" << type << ") \n"; 61 // print job output 62 print_io (j); 77 63 } 78 64 … … 97 83 jd.set_vector_attribute (saga::job::attributes::description_arguments, args); 98 84 99 saga::url t ("file://localhost//Users/merzky/links/saga/projects/applications/MapReduce/samples/file.txt");100 85 101 86 // FIXME: the job service contact should point to the ec2 service instance. 102 87 // Problem: what protocol to use? We need to denotify the context type (do 103 // we?), _and_ the ec2 service protocol (http/https). 88 // we?), _and_ the ec2 service protocol (http/https). Anyway, this needs to 89 // be fixed in the adaptor. 104 90 // 105 91 // "https://ec2.amazonaws.com/" … … 107 93 // "https://tp-vm1.ci.uchicago.edu:8445/wsrf/services/ElasticNimbusService" 108 94 // "https://vm02.cct.lsu.edu:8443/" 109 110 // test_cloud (jd, "ec2"); 111 test_cloud (jd, "ec2", "i-d642c7bf"); 95 96 // create a new instance on ec2, and run a test job 97 test_cloud (jd, "ec2"); 98 99 // access a running VM instance on ec2, and run a test job 100 // test_cloud (jd, "ec2", "i-d642c7bf"); 101 102 // samoe for eucalyptus 103 // test_cloud (jd, "eucalyptus"); 112 104 // test_cloud (jd, "eucalyptus", "i-417E085F"); 105 106 // samoe for nimbus 113 107 // test_cloud (jd, "nimbus"); 108 // test_cloud (jd, "nimbus", "i-3247A527"); 114 109 115 110 }
