예제 #1
0
def test_submit_as_hold_attr():
    submit_as_hold = generate_random_int(lower_bound=0, upper_bound=1)
    jt = JobTemplate()
    jt.submit_as_hold = submit_as_hold
    assert (jt.submit_as_hold == Bool(submit_as_hold).name)
    print('\nJob template object with submit_as_hold: %s' % (submit_as_hold))
예제 #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__

from drmaa2 import JobTemplate

if __name__ == '__main__':
    import datetime

    print('Impl. spec. keys: %s' % JobTemplate.get_implementation_specific_keys())
    jt = JobTemplate({'remote_command': '/bin/sleep'})
    print('Initial job template: %s' % jt)
    jt.args = ['200']
    jt.job_environment = {'MY_ENV': 'xyz', 'MY_ENV2': 'xyz2'}
    jt.rerunnable = True
    jt.submit_as_hold = True
    jt.queue_name = 'all.q'
    jt.min_slots = 2
    jt.machine_os = 'LINUX'
    jt.start_time = datetime.datetime.now()
    jt.working_directory = '/tmp'
    print('Current job template: %s' % jt)
    jt.set_impl_spec_key_value('uge_jt_pe', 'xxx')
    print('Impl. spec. key uge_jt_pe is set to: %s' % jt.get_impl_spec_key_value('uge_jt_pe'))
    print('Impl. spec dictionary: %s' % jt.implementation_specific)
    print('Final job template: %s' % jt)