#!/usr/bin/env python

#
# This file is part of phantom_scheduler.
#
# phantom_scheduler is free software: you can redistribute it and/or modify
# it under the terms of the LGNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# phantom_scheduler is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# LGNU Lesser General Public License for more details.
#
# You should have received a copy of the LGNU Lesser General Public License
# along with phantom_scheduler.  If not, see <http://www.gnu.org/licenses/>.
#
# DTU UQ Library
# Copyright (C) 2014 The Technical University of Denmark
# Scientific Computing Section
# Department of Applied Mathematics and Computer Science
#
# Author: Daniele Bigoni
#


import sys
import time
import os
import getopt

def main(argv):
    # Get arguments
    try:
        opts, args = getopt.getopt(argv,"t:r:j:",["test=","rank=","job="])
    except getopt.GetoptError:
        print 'job.py -t <testnum> -r <rank> -j <job>'
        sys.exit(2)
    for opt, arg in opts:
        if opt in ('-t','--test'):
            testn = int(arg)
        if opt in ('-r','--rank'):
            rank = int(arg)
        elif opt in ("-j", "--job"):
            job = int(arg)
    
    open( "jfile-%d-%d-%d.pkl" % (testn,rank,job), 'a' ).close()
    start = time.clock()
    while time.clock()-start < .4: pass

if __name__ == "__main__":
    main(sys.argv[1:])
