print qsub_args os.system(qsub_args) sys.exit(1) partsize = int(os.environ['COBALT_PARTSIZE']) partition = os.environ['COBALT_PARTNAME'] jobid = int(os.environ['COBALT_JOBID']) print 'Nodes per job: %d' % npj print 'MPI tasks per node: %d' % ppn print 'Number of sub-block jobs: %d' % njobs print 'Number of nodes: %d' % nodes blocks = get_bootable_blocks(partition, nodes) print 'Available blocks: %s' % blocks boot_blocks(blocks) # start sub-block jobs with background runjob helper processes jobs = [] logs = [] # Lets make each job a tuple struct like # (jobdir, bxv, v, rc). for job, (block, corner, shape) in zip(jobdirs, block_corner_iter(blocks, npj)): print job, (block, corner, shape) os.chdir(os.path.join(scratch, job[0])) log = open('gbrelax.out', 'a') locargs = '--block %s --corner %s --shape %s' % (block, corner, shape) # runjob_args = ('python %s -n %d -p %d %s' % (locargs, npj*ppn, ppn, envargs)).split() pyargs = 'python /home/lambert/pymodules/imeall/imeall/run_dyn.py -rc {rc} -i_v {i_v} -i_bxv {i_bxv} '.format( rc=job[1], i_v=job[2], i_bxv=job[3])
njobs = 1 nodes = npj*njobs job_xyz = glob.glob('feb*.xyz')[0] bulk = Atoms(job_xyz) line=[] for at in bulk: line.append( FixedLine(at.index, (0,0,1)) ) bulk.set_constraint(line) hostname, ip = get_hostname_ip() partsize, partition, job_name = get_cobalt_info() blocks = get_bootable_blocks(partition, nodes) print('Available blocks: %s' % blocks) boot_blocks(blocks) block, corner, shape = list(block_corner_iter(blocks, npj))[0] print block, corner, shape vasp_client = VaspClient(client_id=0, kpts =[16,16,1], amix = 0.01, amin = 0.001, bmix = 0.001, amix_mag = 0.01, bmix_mag = 0.001, npj=npj, ppn=ppn, block=block, corner=corner,
exe = '/home/avazquez/public/install/bin/cp2k.psmp' # '/soft/applications/cp2k/cp2k.psmp-2.5' envargs = '--envs OMP_NUM_THREADS=%d BG_SMP_FAST_WAKEUP=YES BG_THREADLAYOUT=1 OMP_WAIT_POLICY=ACTIVE' % threads # ACTUAL CODE if 'COBALT_PARTSIZE' not in os.environ: print('Not running under control of cobalt. Launching qsub...') qsub_args = 'qsub -A %s -n %d -t %d -q %s --mode script --disable_preboot %s' % (acct, nodes, time, queue, sys.argv[0]) print(qsub_args) os.system(qsub_args) sys.exit(1) partsize = int(os.environ['COBALT_PARTSIZE']) partition = os.environ['COBALT_PARTNAME'] jobid = int(os.environ['COBALT_JOBID']) # blocks = get_bootable_blocks(partition, nodes) boot_blocks([partition]) print("partition: %s" % partition) if os.path.exists('%s-1.restart' % jobstem): # use restart as input input_file = '%s-1.restart' % jobstem else: # files needed: inp and xyz input_file = jobstem + '.inp' # locargs = '--block %s' % blocks[0] runjob_args = ('runjob --np %d -p %d --block %s %s : %s %s' % (nodes*ppn, ppn, partition, envargs, exe, input_file)).split() print(' '.join(runjob_args)) job = subprocess.Popen(runjob_args) # wait for all background jobs to finish job.wait()