예제 #1
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 datetime
from drmaa2 import JobInfo

if __name__ == '__main__':
    import datetime

    print('Impl. spec. keys: %s' % JobInfo.get_implementation_specific_keys())
    ji = JobInfo({'queue_name': 'all.q'})
    print('Initial job info: %s' % ji)
    ji.job_id = '113'
    ji.job_name = 'job-01'
    ji.slots = 10
    ji.job_owner = 'a.user'
    ji.submission_time = datetime.datetime.now()
    ji.cpu_time = 77
    ji.set_impl_spec_key_value('uge_ji_priority', '23')
    print('Impl. spec. key uge_ji_priority is set to: %s' %
          ji.get_impl_spec_key_value('uge_ji_priority'))
    print('Impl. spec dictionary: %s' % ji.implementation_specific)
    print('Final job info: %s' % ji)
예제 #2
0
def test_slots_attr():
    ji = JobInfo()
    slots = generate_random_int(lower_bound=0, upper_bound=1024)
    ji.slots = slots
    assert (ji.slots == slots)
    print('\nJob info with slots: %s' % (slots))