the initial stage since the pressure is not yet calculated """ parser = argparse.ArgumentParser( description='Make snapshot of blood vessel network creation') parser.add_argument('filename', type=argparse.FileType('r'), default=sys.stdin) parser.add_argument('debug_filename', type=argparse.FileType('r'), default=sys.stdin) parser.add_argument('-g', '--grp_pattern', default='*/vessels') parser.add_argument('--noPov', default=False, action='store_true') parser.add_argument('-v', '--movie', default=False, action='store_true') goodArguments, otherArguments = parser.parse_known_args() qsub.parse_args(otherArguments) dbg_fn = goodArguments.debug_filename.name options = getattr(krebs.povrayRenderSettings, 'dbg_vessels') f = h5py.File(dbg_fn, 'r') if not goodArguments.noPov: jobs = [] a = jobs.append #for fn in filenames: with h5files.open(dbg_fn, 'r') as f: paths = myutils.walkh5(f, '*/vessels') for path in paths: j = RenderJob(f, path, '', options) a(j) for job in jobs:
import os, sys from os.path import join, dirname sys.path.append(join(dirname(__file__), '.')) import stat import qsub def ClientWorker(*args, **kwargs): print("hello, i'm running on the cluster. my args are %s and %s" % (str(args), str(kwargs))) print("my cwd is: %s" % os.getcwd()) if not qsub.is_client and __name__ == '__main__': argv = qsub.parse_args(sys.argv) qsub.submit(qsub.func(ClientWorker, 'Test Argument', a_kw_arg=9001), name='qsub-script-python-test', num_cpus=1, days=0, hours=0.1, mem='100MB', change_cwd=True) test_program_name = 'client-test-script.sh' with open(test_program_name, 'w') as f: f.write('''#! /bin/sh\n''') f.write('''echo "hello, i'm running on the cluster"\n''') f.write('''echo "my cwd is:"\n''') f.write('''pwd\n''')