def test_get_jobs():
    js = JobSession('js-01')
    j_name = 'drmaa2python-%s' % int(random.uniform(0, 1000))
    j = js.run_job({'remote_command': '/bin/sleep', 'args': ['10'], 'job_name': j_name})
    print('\nSubmitted job: %s' % j)
    ji = j.get_info()
    print('Retrieving jobs matching job info %s' % ji)
    j_list = js.get_jobs(ji)
    print('Got jobs: %s' % j_list)
    assert (len(j_list) >= 1)
示例#2
0
def test_get_jobs():
    js = JobSession('js-01')
    j_name = 'drmaa2python-%s' % int(random.uniform(0, 1000))
    d = {
        'remote_command': '/bin/sleep',
        'args': ['10'],
        'job_name': j_name,
        'output_path': '/dev/null',
        'join_files': True
    }
    j = js.run_job(d)
    print('\nSubmitted job: %s' % j)
    ji = j.get_info()
    print('Retrieving jobs matching job info %s' % ji)
    ji2 = JobInfo({'job_id': ji.job_id})
    j_list = js.get_jobs(ji2)
    print('Got jobs: %s' % j_list)
    assert (len(j_list) >= 1)
示例#3
0
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################
# ___INFO__MARK_END__

import random
from drmaa2 import JobSession
from drmaa2 import JobInfo

if __name__ == '__main__':
    js = JobSession('js-01')
    print('Created job session: %s' % js.name)
    j_name = 'job-%s' % int(random.uniform(0, 1000))
    j = js.run_job({
        'remote_command': '/bin/sleep',
        'args': ['10'],
        'job_name': j_name
    })
    print('Submitted job: %s' % j)
    # ji = j.get_info()
    ji = JobInfo({'job_name': j_name})
    print('Retrieving jobs matching job info %s' % ji)
    j_list = js.get_jobs(ji)
    print('Got jobs: %s' % j_list)