def test_implementation_specific_attr():
    implementation_specific = {}
    keys = JobTemplate.get_implementation_specific_keys()
    for k in keys:
        v = generate_random_string()
        implementation_specific[k] = v
    jt = JobTemplate()
    jt.implementation_specific = implementation_specific
    assert (jt.implementation_specific == implementation_specific)
    print('\nJob template object with implementation_specific: %s' %
          (implementation_specific))
Esempio n. 2
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__

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)
Esempio n. 3
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'))