Beispiel #1
0
        )


# create an instance of GdemoSimpleApp
app = GdemoSimpleApp()

# create an instance of Core. Read configuration from your default
# configuration file
cfg = gc3libs.config.Configuration(*gc3libs.defaults.CONFIG_FILE_LOCATIONS,
                                   **{'auto_enable_auth': True})
core = gc3libs.core.Core(cfg)

# in case you want to select a specific resource, call
# `Core.select_resource(...)`
if len(sys.argv) > 1:
    core.select_resource(sys.argv[1])

# Submit your application.
core.submit(app)

# After submssion, you have to check the application for its state:
print("Job id: %s" % app.execution.lrms_jobid)

# Periodically check the status of your application.
while app.execution.state in [
        gc3libs.Run.State.SUBMITTED,
        gc3libs.Run.State.RUNNING,
]:
    try:
        print("Job in status %s " % app.execution.state)
        time.sleep(5)
Beispiel #2
0
                break
        fd.close()

# create an instance of GdemoSimpleApp
app = GdemoSimpleApp()

# create an instance of Core. Read configuration from your default
# configuration file
cfg = gc3libs.config.Configuration(*gc3libs.Default.CONFIG_FILE_LOCATIONS,
                                   **{'auto_enable_auth': True})
core = gc3libs.core.Core(cfg)

# in case you want to select a specific resource, call
# `Core.select_resource(...)`
if len(sys.argv)>1:
    core.select_resource(sys.argv[1])

# Submit your application.
core.submit(app)

# After submssion, you have to check the application for its state:
print  "Job id: %s" % app.execution.lrms_jobid

# Periodically check the status of your application.
while app.execution.state in [ gc3libs.Run.State.SUBMITTED,
                               gc3libs.Run.State.RUNNING,
                               ]:
    try:
        print "Job in status %s " % app.execution.state
        time.sleep(5)
        # This call will contact the resource(s) and get the current