Hi,
I have a code which compromises of making an input file and submitting it to an executable using subprocess.check_all. Unfortunately the process is too slow. The input file size usually tends to be larger than few hundred megabytes.
I was wondering if its useful to write the input file in binary and run the subprocess in parallel.
The input is a set of xyzzy files with a header which is the number of inputs
I have a code which compromises of making an input file and submitting it to an executable using subprocess.check_all. Unfortunately the process is too slow. The input file size usually tends to be larger than few hundred megabytes.
I was wondering if its useful to write the input file in binary and run the subprocess in parallel.
1 2 3 4 5 6 7 8 9 10 |
input_xyz = open (initial + "_xyz.inp" , "w" ) input_xyz.write( "{0:d}\n" . format (length * * 3 )) for ix in np.linspace(xmin, xmax, length, True ): for iy in np.linspace(ymin, ymax, length, True ): for iz in np.linspace(zmin, zmax, length, True ): input_xyz.write( "{0:12.6f} {1:12.6f} {2:12.6f}\n" . format (ix, iy, iz)) input_xyz.close() subprocess.check_call([ "elec_pot_calc" , initial + ".tvb" , initial + ".csx" , initial + "_xyz.inp" , initial + "_xyz.out" ]) |
Quote:1000and output will be the same with an added number calculated in the executable
-10.403406 -12.484424 -16.060428
Quote:1000
-10.4034060000000004 -12.4844240000000006 -16.0604280000000017 0.0008508183029086