mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 12:23:43 +01:00
Deterministic PT2 for < 1000 dets
This commit is contained in:
parent
c376dec776
commit
7ddc21ee5b
71
bin/qp_tunnel
Executable file
71
bin/qp_tunnel
Executable file
@ -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 <address> 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["<address>"]
|
||||
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)
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user