diff --git a/bin/qp_tunnel b/bin/qp_tunnel new file mode 100755 index 00000000..554c28ae --- /dev/null +++ b/bin/qp_tunnel @@ -0,0 +1,71 @@ +#!/usr/bin/env python2 + + +""" +Creates an ssh tunnel for using slaves on another network. +Launch a server on the front-end node of the cluster on which the master +process runs. Then start a client ont the front-end node of the distant +cluster. + +Usage: + qp_tunnel server EZFIO_DIR + qp_tunnel client
EZFIO_DIR + +Options: + -h --help + +""" + +import os +import sys +import zmq + +try: + import qp_path +except ImportError: + print "source .quantum_package.rc" + raise + +from docopt import docopt +from ezfio import ezfio + + +def get_address(filename): + with open(os.path.join(filename,'work','qp_run_address'),'r') as f: + a = f.readlines()[0].strip() + return a + + +def set_address(filename,address): + with open(os.path.join(filename,'work','qp_run_address'),'r') as f: + backup = f.readlines() + + with open(os.path.join(filename,'work','qp_run_address'),'w') as f: + f.write('\n'.join([address]+backup)) + + +def main_server(arguments,filename): + destination = get_address(filename) + print destination + + +def main_client(arguments,filename): + destination = arguments["
"] + print destination + + +def main(arguments): + """Main function""" + + print arguments + filename = arguments["EZFIO_DIR"] + + if arguments["server"]: + return main_server(arguments, filename) + if arguments["client"]: + return main_client(arguments, filename) + + +if __name__ == '__main__': + ARGUMENTS = docopt(__doc__) + main(ARGUMENTS) diff --git a/src/cipsi/pt2_stoch_routines.irp.f b/src/cipsi/pt2_stoch_routines.irp.f index a8f34e03..0e143a9c 100644 --- a/src/cipsi/pt2_stoch_routines.irp.f +++ b/src/cipsi/pt2_stoch_routines.irp.f @@ -135,7 +135,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in) PROVIDE psi_occ_pattern_hii det_to_occ_pattern endif - if (N_det < max(10,N_states)) then + if (N_det < max(1000,N_states)) then pt2=0.d0 variance=0.d0 norm=0.d0 diff --git a/src/determinants/EZFIO.cfg b/src/determinants/EZFIO.cfg index 0b289e99..b8fc7406 100644 --- a/src/determinants/EZFIO.cfg +++ b/src/determinants/EZFIO.cfg @@ -38,7 +38,7 @@ default: 1 type: Threshold doc: Thresholds on generators (fraction of the square of the norm) interface: ezfio,provider,ocaml -default: 0.99 +default: 0.999 [n_int] interface: ezfio