From e0666cfbd46efd55ed202c269e579cc37f163b55 Mon Sep 17 00:00:00 2001 From: TApplencourt Date: Tue, 1 Nov 2016 16:19:44 -0500 Subject: [PATCH 1/9] Add config for knl --- config/ifort_knl.cfg | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 config/ifort_knl.cfg diff --git a/config/ifort_knl.cfg b/config/ifort_knl.cfg new file mode 100644 index 00000000..c2bf49a6 --- /dev/null +++ b/config/ifort_knl.cfg @@ -0,0 +1,64 @@ +# Common flags +############## +# +# -mkl=[parallel|sequential] : Use the MKL library +# --ninja : Allow the utilisation of ninja. It is mandatory ! +# --align=32 : Align all provided arrays on a 32-byte boundary +# +[COMMON] +FC : ifort +LAPACK_LIB : -mkl=parallel +IRPF90 : irpf90 +IRPF90_FLAGS : --ninja --align=64 + +# Global options +################ +# +# 1 : Activate +# 0 : Deactivate +# +[OPTION] +MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below +CACHE : 1 ; Enable cache_compile.py +OPENMP : 1 ; Append OpenMP flags + +# Optimization flags +#################### +# +# -xHost : Compile a binary optimized for the current architecture +# -O2 : O3 not better than O2. +# -ip : Inter-procedural optimizations +# -ftz : Flushes denormal results to zero +# +[OPT] +FC : -traceback +FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g + +# Profiling flags +################# +# +[PROFILE] +FC : -p -g -traceback +FCFLAGS : -xSSE4.2 -O2 -ip -ftz + +# Debugging flags +################# +# +# -traceback : Activate backtrace on runtime +# -fpe0 : All floating point exaceptions +# -C : Checks uninitialized variables, array subscripts, etc... +# -g : Extra debugging information +# -xSSE2 : Valgrind needs a very simple x86 executable +# +[DEBUG] +FC : -g -traceback +FCFLAGS : -xSSE2 -C -fpe0 +IRPF90_FLAGS : --openmp + +# OpenMP flags +################# +# +[OPENMP] +FC : -qopenmp +IRPF90_FLAGS : --openmp + From b377e442a67c13bd4c647ac3e462b989d758e8fd Mon Sep 17 00:00:00 2001 From: TApplencourt Date: Tue, 1 Nov 2016 16:20:26 -0500 Subject: [PATCH 2/9] Add mising readme --- plugins/Full_CI_ZMQ/README.rst | 461 +++++++++++++++++++++++++++++++++ src/Davidson/README.rst | 322 +++++++++++++++++++++++ 2 files changed, 783 insertions(+) create mode 100644 plugins/Full_CI_ZMQ/README.rst create mode 100644 src/Davidson/README.rst diff --git a/plugins/Full_CI_ZMQ/README.rst b/plugins/Full_CI_ZMQ/README.rst new file mode 100644 index 00000000..d1677a7d --- /dev/null +++ b/plugins/Full_CI_ZMQ/README.rst @@ -0,0 +1,461 @@ +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Perturbation `_ +* `Selectors_full `_ +* `Generators_full `_ +* `ZMQ `_ +* `Full_CI `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`add_task_to_taskserver `_ + Get a task from the task server + + +`add_to_selection_buffer `_ + Undocumented + + +`assert `_ + Undocumented + + +`connect_to_taskserver `_ + Connect to the task server and obtain the worker ID + + +`create_selection_buffer `_ + Undocumented + + +`disconnect_from_taskserver `_ + Disconnect from the task server + + +`end_parallel_job `_ + End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + +`end_zmq_pair_socket `_ + Terminate socket on which the results are sent. + + +`end_zmq_pull_socket `_ + Terminate socket on which the results are sent. + + +`end_zmq_push_socket `_ + Terminate socket on which the results are sent. + + +`end_zmq_sub_socket `_ + Terminate socket on which the results are sent. + + +`end_zmq_to_qp_run_socket `_ + Terminate the socket from the application to qp_run + + +`fci_zmq `_ + Undocumented + + +`fill_buffer_double `_ + Undocumented + + +`fill_buffer_single `_ + Undocumented + + +`full_ci `_ + Undocumented + + +`get_d0 `_ + Undocumented + + +`get_d1 `_ + Undocumented + + +`get_d2 `_ + Undocumented + + +`get_m0 `_ + Undocumented + + +`get_m1 `_ + Undocumented + + +`get_m2 `_ + Undocumented + + +`get_mask_phase `_ + Undocumented + + +`get_phase_bi `_ + Undocumented + + +`get_task_from_taskserver `_ + Get a task from the task server + + +h_apply_fci + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_diexc + Undocumented + + +h_apply_fci_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_diexcp + Undocumented + + +h_apply_fci_mono + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_mono_diexc + Undocumented + + +h_apply_fci_mono_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_mono_diexcp + Undocumented + + +h_apply_fci_mono_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_no_selection + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_no_selection_diexc + Undocumented + + +h_apply_fci_no_selection_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_no_selection_diexcp + Undocumented + + +h_apply_fci_no_selection_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_no_skip + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_no_skip_diexc + Undocumented + + +h_apply_fci_no_skip_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_no_skip_diexcp + Undocumented + + +h_apply_fci_no_skip_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_pt2 + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_pt2_collector + Collects results from the selection in an array of generators + + +h_apply_fci_pt2_diexc + Undocumented + + +h_apply_fci_pt2_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_pt2_diexcp + Undocumented + + +h_apply_fci_pt2_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_fci_pt2_slave + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_fci_pt2_slave_inproc + Computes a buffer using threads + + +h_apply_fci_pt2_slave_tcp + Computes a buffer over the network + + +`integral8 `_ + Undocumented + + +`new_parallel_job `_ + Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + +`new_zmq_pair_socket `_ + Socket on which the collector and the main communicate + + +`new_zmq_pull_socket `_ + Socket on which the results are sent. If thread is 1, use inproc + + +`new_zmq_push_socket `_ + Socket on which the results are sent. If thread is 1, use inproc + + +`new_zmq_sub_socket `_ + Socket to read the state published by the Task server + + +`new_zmq_to_qp_run_socket `_ + Socket on which the qp_run process replies + + +`past_d1 `_ + Undocumented + + +`past_d2 `_ + Undocumented + + +`provide_everything `_ + Undocumented + + +`psi_phasemask `_ + Undocumented + + +`pull_selection_results `_ + Undocumented + + +`push_selection_results `_ + Undocumented + + +`qp_run_address `_ + Address of the qp_run socket + Example : tcp://130.120.229.139:12345 + + +`reset_zmq_addresses `_ + Socket which pulls the results (2) + + +`run_selection_slave `_ + Undocumented + + +`run_wf `_ + Undocumented + + +`select_connected `_ + Undocumented + + +`select_doubles `_ + Undocumented + + +`select_singles `_ + Select determinants connected to i_det by H + + +`selection_collector `_ + Undocumented + + +`selection_slave `_ + Helper program to compute the PT2 in distributed mode. + + +`selection_slave_inproc `_ + Undocumented + + +`selection_slave_tcp `_ + Undocumented + + +`sort_selection_buffer `_ + Undocumented + + +`splash_p `_ + Undocumented + + +`splash_pq `_ + Undocumented + + +`spot_hasbeen `_ + Undocumented + + +`spot_isinwf `_ + Undocumented + + +`switch_qp_run_to_master `_ + Address of the master qp_run socket + Example : tcp://130.120.229.139:12345 + + +`task_done_to_taskserver `_ + Get a task from the task server + + +`update_energy `_ + Update energy when it is received from ZMQ + + +`var_pt2_ratio_run `_ + Undocumented + + +`wait_for_next_state `_ + Undocumented + + +`wait_for_state `_ + Wait for the ZMQ state to be ready + + +`wait_for_states `_ + Wait for the ZMQ state to be ready + + +`zmq_context `_ + Context for the ZeroMQ library + + +`zmq_delete_task `_ + When a task is done, it has to be removed from the list of tasks on the qp_run + queue. This guarantees that the results have been received in the pull. + + +`zmq_port `_ + Return the value of the ZMQ port from the corresponding integer + + +`zmq_port_start `_ + Address of the qp_run socket + Example : tcp://130.120.229.139:12345 + + +`zmq_selection `_ + Undocumented + + +`zmq_set_running `_ + Set the job to Running in QP-run + + +`zmq_socket_pair_inproc_address `_ + Socket which pulls the results (2) + + +`zmq_socket_pull_inproc_address `_ + Socket which pulls the results (2) + + +`zmq_socket_pull_tcp_address `_ + Socket which pulls the results (2) + + +`zmq_socket_push_inproc_address `_ + Socket which pulls the results (2) + + +`zmq_socket_push_tcp_address `_ + Socket which pulls the results (2) + + +`zmq_socket_sub_tcp_address `_ + Socket which pulls the results (2) + + +`zmq_state `_ + Threads executing work through the ZeroMQ interface + diff --git a/src/Davidson/README.rst b/src/Davidson/README.rst new file mode 100644 index 00000000..15e9b46a --- /dev/null +++ b/src/Davidson/README.rst @@ -0,0 +1,322 @@ +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Determinants `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`ci_eigenvectors `_ + Eigenvectors/values of the CI matrix + + +`ci_eigenvectors_mono `_ + Eigenvectors/values of the CI matrix + + +`ci_eigenvectors_s2 `_ + Eigenvectors/values of the CI matrix + + +`ci_eigenvectors_s2_mono `_ + Eigenvectors/values of the CI matrix + + +`ci_electronic_energy `_ + Eigenvectors/values of the CI matrix + + +`ci_electronic_energy_mono `_ + Eigenvectors/values of the CI matrix + + +`ci_energy `_ + N_states lowest eigenvalues of the CI matrix + + +`dav_det `_ + Temporary arrays for parallel davidson + .br + Touched in davidson_miniserver_get + + +`dav_size `_ + Size of the arrays for Davidson + .br + Touched in davidson_miniserver_get + + +`dav_ut `_ + Temporary arrays for parallel davidson + .br + Touched in davidson_miniserver_get + + +`davidson_add_task `_ + Undocumented + + +`davidson_collect `_ + Undocumented + + +`davidson_collector `_ + Undocumented + + +`davidson_converged `_ + True if the Davidson algorithm is converged + + +`davidson_criterion `_ + Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] + + +`davidson_diag `_ + Davidson diagonalization. + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit number for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_diag_hjj `_ + Davidson diagonalization with specific diagonal elements of the H matrix + .br + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + N_st_diag : Number of states in which H is diagonalized + .br + iunit : Unit for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_diag_hjj_sjj `_ + Davidson diagonalization with specific diagonal elements of the H matrix + .br + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + .br + S2_jj : specific diagonal S^2 matrix elements + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + N_st_diag : Number of states in which H is diagonalized. Assumed > sze + .br + iunit : Unit for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_diag_hs2 `_ + Davidson diagonalization. + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit number for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_init `_ + Undocumented + + +`davidson_iter_max `_ + Max number of Davidson iterations + + +`davidson_miniserver_end `_ + Undocumented + + +`davidson_miniserver_get `_ + Undocumented + + +`davidson_miniserver_run `_ + Undocumented + + +`davidson_process `_ + Undocumented + + +`davidson_pull_results `_ + Undocumented + + +`davidson_push_results `_ + Undocumented + + +`davidson_run `_ + Undocumented + + +`davidson_run_slave `_ + Undocumented + + +`davidson_slave `_ + Undocumented + + +`davidson_slave_inproc `_ + Undocumented + + +`davidson_slave_tcp `_ + Undocumented + + +`davidson_slave_work `_ + Undocumented + + +`davidson_sze_max `_ + Max number of Davidson sizes + + +`det_inf `_ + Ordering function for determinants + + +`diagonalize_ci `_ + Replace the coefficients of the CI states by the coefficients of the + eigenstates of the CI matrix + + +`diagonalize_ci_mono `_ + Replace the coefficients of the CI states by the coefficients of the + eigenstates of the CI matrix + + +`first_guess `_ + Select all the determinants with the lowest energy as a starting point. + + +`h_s2_u_0_nstates `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + n : number of determinants + .br + H_jj : array of + .br + S2_jj : array of + + +`h_u_0_nstates `_ + Computes v_0 = H|u_0> + .br + n : number of determinants + .br + H_jj : array of + + +`max_blocksize `_ + Undocumented + + +`n_states_diag `_ + n_states_diag + + +`provide_everything `_ + Undocumented + + +`psi_energy `_ + Energy of the current wave function + + +`shortcut_ `_ + Undocumented + + +`sort_dets_ab `_ + Uncodumented : TODO + + +`sort_dets_ab_v `_ + Uncodumented : TODO + + +`sort_dets_ba_v `_ + Uncodumented : TODO + + +`sort_idx_ `_ + Undocumented + + +`sorted_ `_ + Undocumented + + +`tamiser `_ + Uncodumented : TODO + + +`threshold_davidson `_ + Thresholds of Davidson's algorithm + + +`u_0_h_u_0 `_ + Computes e_0 = / + .br + n : number of determinants + .br + + +`version_ `_ + Undocumented + From b207c0ed457f49862d63ef4640f1f6175bc70ca6 Mon Sep 17 00:00:00 2001 From: TApplencourt Date: Tue, 1 Nov 2016 16:35:26 -0500 Subject: [PATCH 3/9] Add .gitignore --- plugins/All_singles/.gitignore | 5 +++++ plugins/Full_CI_ZMQ/.gitignore | 5 +++++ plugins/mrcepa0/.gitignore | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 plugins/All_singles/.gitignore create mode 100644 plugins/Full_CI_ZMQ/.gitignore create mode 100644 plugins/mrcepa0/.gitignore diff --git a/plugins/All_singles/.gitignore b/plugins/All_singles/.gitignore new file mode 100644 index 00000000..7ac9fbf6 --- /dev/null +++ b/plugins/All_singles/.gitignore @@ -0,0 +1,5 @@ +IRPF90_temp/ +IRPF90_man/ +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/Full_CI_ZMQ/.gitignore b/plugins/Full_CI_ZMQ/.gitignore new file mode 100644 index 00000000..7ac9fbf6 --- /dev/null +++ b/plugins/Full_CI_ZMQ/.gitignore @@ -0,0 +1,5 @@ +IRPF90_temp/ +IRPF90_man/ +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/mrcepa0/.gitignore b/plugins/mrcepa0/.gitignore new file mode 100644 index 00000000..7ac9fbf6 --- /dev/null +++ b/plugins/mrcepa0/.gitignore @@ -0,0 +1,5 @@ +IRPF90_temp/ +IRPF90_man/ +irpf90.make +irpf90_entities +tags \ No newline at end of file From be6cef694c2658d457019d80281565198c230684 Mon Sep 17 00:00:00 2001 From: TApplencourt Date: Tue, 8 Nov 2016 11:40:55 -0600 Subject: [PATCH 4/9] Add pseudo to qp_convert --- .../qp_convert_output_to_ezfio.py | 120 +++++++++++++++++- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py index ff7ad225..87743686 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -273,8 +273,126 @@ def write_ezfio(res, filename): # \_| |___/\___|\__,_|\__,_|\___/ # - ezfio.set_pseudo_do_pseudo(False) + # INPUT + # {% for lanel,zcore, l_block in l_atom $} + # #local l_block l=0} + # {label} GEN {zcore} {len(l_block)-1 #lmax_block} + # {% for l_param in l_block%} + # {len(l_param) # list of parameter aka n_max_bock_max(n)} + # {% for coef,n,zeta for l_param} + # {coef,n, zeta} + + # OUTPUT + + # Local are 1 array padded by max(n_max_block) when l == 0 (output:k_loc_max) + # v_k[n-2][atom] = value + + #No Local are 2 array padded with max of lmax_block when l!=0 (output:lmax+1) and max(n_max_block)whem l !=0 (kmax) + # v_kl[l][n-2][atom] = value + + def pad(array, size, value=0): + new_array= array + for add in xrange(len(array), size): + new_array.append(value) + + return new_array + + def parse_str(pseudo_str): + '''Return 4d array atom,l,n, attribute (attribute is coef, n, zeta)''' + matrix = [] + array_l_max_block = [] + array_z_remove = [] + + for block in [b for b in pseudo_str.split('\n\n') if b]: + #First element is header, the rest are l_param + array_party = [i for i in re.split(r"\n\d+\n",block) if i] + + z_remove, l_max_block = map(int,array_party[0].split()[-2:]) + array_l_max_block.append(l_max_block) + array_z_remove.append(z_remove) + + matrix_3d.append([ [coef_n_zeta.split()[1:] for coef_n_zeta in l.split('\n')] for l in array_party[1:] ]) + + return (matrix, array_l_max_block, array_z_remove) + + def get_local_stuff(matrix): + + matrix_local_unpad = [atom[0] for atom in matrix] + k_loc_max = max(len(i) for i in matrix_local_unpad) + + matrix_local = [pad(ll,k_loc_max,[0.,0,0.]) for ll in matrix_local_unpad] + + m_coef =[ [float(i[0]) for i in atom] for atom in matrix_local] + m_n = [ [int(i[1])-2 for i in atom] for atom in matrix_local] + m_zeta = [ [float(i[2]) for i in atom] for atom in matrix_local] + + return (k_loc_max, m_coef,m_n,m_zeta) + + def get_non_local_stuff(matrix): + + matrix_unlocal_unpad = [atom[1:] for atom in matrix] + l_max_block = max(len(i) for i in matrix_unlocal_unpad) + k_max = max( [len(item) for row in matrix_unlocal_unpad for item in row ] ) + + matrix_unlocal_semipaded =[ [pad(item,k_max,[0.,0,0.]) for item in row] for row in matrix_unlocal_unpad] + + empty_row = [ [0.,0,0.] for k in range(l_max_block)] + matrix_unlocal = [pad(ll,l_max_block,empty_row) for ll in matrix_unlocal_semipaded] + + m_coef_noloc = [ [ [ float(k[0]) for k in j ] for j in i ] for i in matrix_local ] + m_n_noloc = [ [ [ int(k[1])-2 for k in j ] for j in i ] for i in matrix_local ] + m_zeta_noloc = [ [ [ float(k[2]) for k in j ] for j in i ] for i in matrix_local ] + + return (l_max_block,k_max, m_coef_noloc,m_n_noloc,m_zeta_noloc) + + try: + pseudo_str = res_file.get_pseudo() + except: + ezfio.set_pseudo_do_pseudo(False) + else: + ezfio.set_pseudo_do_pseudo(True) + matrix, array_l_max_block, array_z_remove = parse(pseudo_str) + + # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # + # Z _ e f f , a l p h a / b e t a _ e l e c # + # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # + + ezfio.pseudo_charge_remove = array_z_remove + ezfio.nuclei_nucl_charge = ezfio.nuclei_nucl_charge - array_z_remove + + import math + num_elec = sum(ezfio.nuclei_nucl_charge) + + ezfio.electrons_elec_alpha_num = int(math.ceil(num_elec / 2.)) + ezfio.electrons_elec_beta_num = int(math.floor(num_beta / 2.)) + + # Change all the array 'cause EZFIO + # v_kl (v, l) => v_kl(l,v) + # v_kl => zip(*_v_kl) + # [[7.0, 79.74474797, -49.45159098], [1.0, 5.41040609, -4.60151975]] + # [(7.0, 1.0), (79.74474797, 5.41040609), (-49.45159098, -4.60151975)] + + # ~#~#~#~#~ # + # L o c a l # + # ~#~#~#~#~ # + + klocmax, m_coef,m_n,m_zeta = get_local_stuff(matrix) + ezfio.pseudo_pseudo_klocmax = klocmax + + ezfio.pseudo_pseudo_v_k = zip(*m_coef) + ezfio.pseudo_pseudo_n_k = zip(*m_n) + ezfio.pseudo_pseudo_dz_k = zip(*m_zeta) + + # ~#~#~#~#~#~#~#~#~ # + # N o n _ L o c a l # + # ~#~#~#~#~#~#~#~#~ # + + l_max_block,k_max, m_coef_noloc,m_n_noloc,m_zeta_noloc = get_non_local_stuff(matrix) + + ezfio.pseudo_pseudo_v_kl = zip(*m_coef_noloc) + ezfio.pseudo_pseudo_n_kl = zip(*m_n_noloc) + ezfio.pseudo_pseudo_dz_kl = zip(*m_zeta_noloc) def get_full_path(file_path): file_path = os.path.expanduser(file_path) From 90418ec72899d0771a5ac8aeb4287daf5f210f49 Mon Sep 17 00:00:00 2001 From: TApplencourt Date: Tue, 8 Nov 2016 15:29:35 -0600 Subject: [PATCH 5/9] Working pseudo --- configure | 2 +- .../qp_convert_output_to_ezfio.py | 105 +++++++++--------- scripts/module/module_handler.py | 1 + .../pot_ao_pseudo_ints.irp.f | 21 +--- src/Pseudo/EZFIO.cfg | 12 ++ src/Utils/map_module.f90 | 28 +++-- tests/input/h2o.xyz | 2 +- 7 files changed, 93 insertions(+), 78 deletions(-) diff --git a/configure b/configure index 8cb02608..bb27fffe 100755 --- a/configure +++ b/configure @@ -122,7 +122,7 @@ docopt = Info( default_path=join(QP_ROOT_INSTALL, "docopt")) resultsFile = Info( - url='{head}/LCPQ/resultsFile/{tail}'.format(**path_github), + url='{head}/TApplencourt/resultsFile/{tail}'.format(**path_github), description=' resultsFile', default_path=join(QP_ROOT_INSTALL, "resultsFile")) diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py index 87743686..dbe686c6 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -12,26 +12,24 @@ Option: """ - import sys import os from functools import reduce - # ~#~#~#~#~#~#~#~ # # Add to the path # # ~#~#~#~#~#~#~#~ # - try: QP_ROOT = os.environ["QP_ROOT"] except: print "Error: QP_ROOT environment variable not found." sys.exit(1) else: - sys.path = [QP_ROOT + "/install/EZFIO/Python", - QP_ROOT + "/resultsFile", - QP_ROOT + "/scripts"] + sys.path + sys.path = [ + QP_ROOT + "/install/EZFIO/Python", QP_ROOT + "/resultsFile", QP_ROOT + + "/scripts" + ] + sys.path # ~#~#~#~#~#~ # # I m p o r t # @@ -39,7 +37,6 @@ else: from ezfio import ezfio - try: from resultsFile import * except: @@ -254,7 +251,7 @@ def write_ezfio(res, filename): for coef in m.vector: MoMatrix.append(coef) - while len(MoMatrix) < len(MOs[0].vector) ** 2: + while len(MoMatrix) < len(MOs[0].vector)**2: MoMatrix.append(0.) # ~#~#~#~#~ # @@ -273,7 +270,6 @@ def write_ezfio(res, filename): # \_| |___/\___|\__,_|\__,_|\___/ # - # INPUT # {% for lanel,zcore, l_block in l_atom $} # #local l_block l=0} @@ -292,80 +288,81 @@ def write_ezfio(res, filename): # v_kl[l][n-2][atom] = value def pad(array, size, value=0): - new_array= array - for add in xrange(len(array), size): - new_array.append(value) + new_array = array + for add in xrange(len(array), size): + new_array.append(value) - return new_array + return new_array def parse_str(pseudo_str): - '''Return 4d array atom,l,n, attribute (attribute is coef, n, zeta)''' - matrix = [] - array_l_max_block = [] - array_z_remove = [] + '''Return 4d array atom,l,n, attribute (attribute is coef, n, zeta)''' + matrix = [] + array_l_max_block = [] + array_z_remove = [] - for block in [b for b in pseudo_str.split('\n\n') if b]: - #First element is header, the rest are l_param - array_party = [i for i in re.split(r"\n\d+\n",block) if i] + for block in [b for b in pseudo_str.split('\n\n') if b]: + #First element is header, the rest are l_param + array_party = [i for i in re.split(r"\n\d+\n", block) if i] - z_remove, l_max_block = map(int,array_party[0].split()[-2:]) - array_l_max_block.append(l_max_block) - array_z_remove.append(z_remove) + z_remove, l_max_block = map(int, array_party[0].split()[-2:]) + array_l_max_block.append(l_max_block) + array_z_remove.append(z_remove) - matrix_3d.append([ [coef_n_zeta.split()[1:] for coef_n_zeta in l.split('\n')] for l in array_party[1:] ]) + matrix.append([[coef_n_zeta.split()[1:] for coef_n_zeta in l.split('\n')] for l in array_party[1:]]) - return (matrix, array_l_max_block, array_z_remove) + return (matrix, array_l_max_block, array_z_remove) def get_local_stuff(matrix): - - matrix_local_unpad = [atom[0] for atom in matrix] - k_loc_max = max(len(i) for i in matrix_local_unpad) - matrix_local = [pad(ll,k_loc_max,[0.,0,0.]) for ll in matrix_local_unpad] + matrix_local_unpad = [atom[0] for atom in matrix] + k_loc_max = max(len(i) for i in matrix_local_unpad) - m_coef =[ [float(i[0]) for i in atom] for atom in matrix_local] - m_n = [ [int(i[1])-2 for i in atom] for atom in matrix_local] - m_zeta = [ [float(i[2]) for i in atom] for atom in matrix_local] + matrix_local = [ pad(ll, k_loc_max, [0., 2, 0.]) for ll in matrix_local_unpad] - return (k_loc_max, m_coef,m_n,m_zeta) + m_coef = [[float(i[0]) for i in atom] for atom in matrix_local] + m_n = [[int(i[1]) - 2 for i in atom] for atom in matrix_local] + m_zeta = [[float(i[2]) for i in atom] for atom in matrix_local] + return (k_loc_max, m_coef, m_n, m_zeta) def get_non_local_stuff(matrix): matrix_unlocal_unpad = [atom[1:] for atom in matrix] l_max_block = max(len(i) for i in matrix_unlocal_unpad) - k_max = max( [len(item) for row in matrix_unlocal_unpad for item in row ] ) + k_max = max([len(item) for row in matrix_unlocal_unpad for item in row]) - matrix_unlocal_semipaded =[ [pad(item,k_max,[0.,0,0.]) for item in row] for row in matrix_unlocal_unpad] + matrix_unlocal_semipaded = [[pad(item, k_max, [0., 2, 0.]) for item in row] for row in matrix_unlocal_unpad] - empty_row = [ [0.,0,0.] for k in range(l_max_block)] - matrix_unlocal = [pad(ll,l_max_block,empty_row) for ll in matrix_unlocal_semipaded] + empty_row = [[0., 2, 0.] for k in range(l_max_block)] + matrix_unlocal = [ pad(ll, l_max_block, empty_row) for ll in matrix_unlocal_semipaded ] - m_coef_noloc = [ [ [ float(k[0]) for k in j ] for j in i ] for i in matrix_local ] - m_n_noloc = [ [ [ int(k[1])-2 for k in j ] for j in i ] for i in matrix_local ] - m_zeta_noloc = [ [ [ float(k[2]) for k in j ] for j in i ] for i in matrix_local ] - - return (l_max_block,k_max, m_coef_noloc,m_n_noloc,m_zeta_noloc) + m_coef_noloc = [[[float(k[0]) for k in j] for j in i] for i in matrix_unlocal] + m_n_noloc = [[[int(k[1]) - 2 for k in j] for j in i] for i in matrix_unlocal] + m_zeta_noloc = [[[float(k[2]) for k in j] for j in i] for i in matrix_unlocal] + + return (l_max_block, k_max, m_coef_noloc, m_n_noloc, m_zeta_noloc) try: - pseudo_str = res_file.get_pseudo() + pseudo_str = res_file.get_pseudo() except: - ezfio.set_pseudo_do_pseudo(False) + ezfio.set_pseudo_do_pseudo(False) else: - ezfio.set_pseudo_do_pseudo(True) - matrix, array_l_max_block, array_z_remove = parse(pseudo_str) + ezfio.set_pseudo_do_pseudo(True) + matrix, array_l_max_block, array_z_remove = parse_str(pseudo_str) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # # Z _ e f f , a l p h a / b e t a _ e l e c # # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # ezfio.pseudo_charge_remove = array_z_remove - ezfio.nuclei_nucl_charge = ezfio.nuclei_nucl_charge - array_z_remove + ezfio.nuclei_nucl_charge = [ + i - j for i, j in zip(ezfio.nuclei_nucl_charge, array_z_remove) + ] import math num_elec = sum(ezfio.nuclei_nucl_charge) ezfio.electrons_elec_alpha_num = int(math.ceil(num_elec / 2.)) - ezfio.electrons_elec_beta_num = int(math.floor(num_beta / 2.)) + ezfio.electrons_elec_beta_num = int(math.floor(num_elec / 2.)) # Change all the array 'cause EZFIO # v_kl (v, l) => v_kl(l,v) @@ -377,29 +374,35 @@ def write_ezfio(res, filename): # L o c a l # # ~#~#~#~#~ # - klocmax, m_coef,m_n,m_zeta = get_local_stuff(matrix) + klocmax, m_coef, m_n, m_zeta = get_local_stuff(matrix) ezfio.pseudo_pseudo_klocmax = klocmax ezfio.pseudo_pseudo_v_k = zip(*m_coef) ezfio.pseudo_pseudo_n_k = zip(*m_n) ezfio.pseudo_pseudo_dz_k = zip(*m_zeta) - + # ~#~#~#~#~#~#~#~#~ # # N o n _ L o c a l # # ~#~#~#~#~#~#~#~#~ # - l_max_block,k_max, m_coef_noloc,m_n_noloc,m_zeta_noloc = get_non_local_stuff(matrix) + l_max_block, k_max, m_coef_noloc, m_n_noloc, m_zeta_noloc = get_non_local_stuff( + matrix) + + ezfio.pseudo_pseudo_lmax = l_max_block - 1 + ezfio.pseudo_pseudo_kmax = k_max ezfio.pseudo_pseudo_v_kl = zip(*m_coef_noloc) ezfio.pseudo_pseudo_n_kl = zip(*m_n_noloc) ezfio.pseudo_pseudo_dz_kl = zip(*m_zeta_noloc) + def get_full_path(file_path): file_path = os.path.expanduser(file_path) file_path = os.path.expandvars(file_path) file_path = os.path.abspath(file_path) return file_path + if __name__ == '__main__': arguments = docopt(__doc__) diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 0667c376..e2c596d1 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -298,6 +298,7 @@ if __name__ == '__main__': # Don't update if we are not in the main repository from is_master_repository import is_master_repository if not is_master_repository: + print 'Not in the master repo' sys.exit() path = os.path.join(module_abs, ".gitignore") diff --git a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f b/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f index b34b201e..c6737dac 100644 --- a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f +++ b/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f @@ -3,7 +3,11 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num_align,ao_num)] BEGIN_DOC ! Pseudo-potential integrals END_DOC - + + + print*, 'Hi from ao_pseudo_integral' + print*, read_ao_one_integrals + if (read_ao_one_integrals) then call read_one_e_integrals('ao_pseudo_integral', ao_pseudo_integral,& size(ao_pseudo_integral,1), size(ao_pseudo_integral,2)) @@ -53,13 +57,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num_align,ao_nu call wall_time(wall_1) call cpu_time(cpu_1) -!write(33,*) 'xxxLOCxxx' -!write(33,*) 'pseudo_klocmax', pseudo_klocmax -!write(33,*) 'pseudo_v_k_transp ', pseudo_v_k_transp -!write(33,*) 'pseudo_n_k_transp ', pseudo_n_k_transp -!write(33,*) 'pseudo_dz_k_transp', pseudo_dz_k_transp -!write(33,*) 'xxxLOCxxx' - thread_num = 0 !$OMP PARALLEL & !$OMP DEFAULT (NONE) & @@ -109,14 +106,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral_local, (ao_num_align,ao_nu pseudo_n_k_transp (1,k), & pseudo_dz_k_transp(1,k), & A_center,power_A,alpha,B_center,power_B,beta,C_center) -! write(33,*) i,j,k -! write(33,*) A_center,power_A,alpha,B_center,power_B,beta,C_center, & -! Vloc(pseudo_klocmax, & -! pseudo_v_k_transp (1,k), & -! pseudo_n_k_transp (1,k), & -! pseudo_dz_k_transp(1,k), & -! A_center,power_A,alpha,B_center,power_B,beta,C_center) -! write(33,*) enddo ao_pseudo_integral_local(i,j) = ao_pseudo_integral_local(i,j) +& diff --git a/src/Pseudo/EZFIO.cfg b/src/Pseudo/EZFIO.cfg index fc23b678..04eea7c6 100644 --- a/src/Pseudo/EZFIO.cfg +++ b/src/Pseudo/EZFIO.cfg @@ -86,4 +86,16 @@ doc: QMC grid interface: ezfio size: (ao_basis.ao_num,-pseudo.pseudo_lmax:pseudo.pseudo_lmax,0:pseudo.pseudo_lmax,nuclei.nucl_num,pseudo.pseudo_grid_size) +[disk_access_pseudo_local_integrals] +type: Disk_access +doc: Read/Write the local ntegrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + +[disk_access_pseudo_no_local_integrals] +type: Disk_access +doc: Read/Write the no-local ntegrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + diff --git a/src/Utils/map_module.f90 b/src/Utils/map_module.f90 index c2a5cbf1..1d09e4e0 100644 --- a/src/Utils/map_module.f90 +++ b/src/Utils/map_module.f90 @@ -17,17 +17,22 @@ module map_module ! should be called before getting data from the map. use omp_lib + use iso_fortran_env - integer, parameter :: integral_kind = 8 + integer, parameter :: integral_kind = 16 ! 8 - integer, parameter :: cache_key_kind = 2 - integer, parameter :: cache_map_size_kind = 4 + integer, parameter :: cache_key_kind = 4 ! 2 + integer, parameter :: cache_map_size_kind = 8 ! 4 - integer, parameter :: key_kind = 8 - integer, parameter :: map_size_kind = 8 + integer, parameter :: key_kind = 16 !8 + integer, parameter :: map_size_kind =16 ! 8 - integer, parameter :: map_shift = -15 - integer*8, parameter :: map_mask = ibset(0_8,15)-1_8 + integer, parameter :: map_shift = -31 !-15 +!integer*8, parameter :: map_mask = ibset(0_8,15)-1_8 + + integer(kind=int16), parameter :: z_kind = 0 + integer(kind=int16), parameter :: o_kind = 1 + integer(kind=int16), parameter :: map_mask = ibset(z_kind,15)-o_kind type cache_map_type real(integral_kind), pointer :: value(:) @@ -45,8 +50,13 @@ module map_module integer*8, pointer :: consolidated_idx(:) logical :: sorted logical :: consolidated - integer(map_size_kind) :: map_size - integer(map_size_kind) :: n_elements +! integer(kind=map_size_kind) :: map_size +! integer(kind=map_size_kind) :: n_elements + + integer(kind=int16) :: map_size + integer(kind=int16) :: n_elements + + integer(omp_lock_kind) :: lock end type map_type diff --git a/tests/input/h2o.xyz b/tests/input/h2o.xyz index e8cd039b..99268e5d 100644 --- a/tests/input/h2o.xyz +++ b/tests/input/h2o.xyz @@ -1,6 +1,6 @@ 3 XYZ file: coordinates in Angstrom -H 0.7510000000 0.1940000000 0.0000000000 O 0.0000000000 -0.3880000000 0.0000000000 +H 0.7510000000 0.1940000000 0.0000000000 H -0.7510000000 0.1940000000 0.0000000000 From 9d66d26b8d445178ced9438ac625e871d26aee5e Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 19 Jan 2017 16:01:38 -0600 Subject: [PATCH 6/9] Delete ifort_knl.cfg --- config/ifort_knl.cfg | 64 -------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 config/ifort_knl.cfg diff --git a/config/ifort_knl.cfg b/config/ifort_knl.cfg deleted file mode 100644 index c2bf49a6..00000000 --- a/config/ifort_knl.cfg +++ /dev/null @@ -1,64 +0,0 @@ -# Common flags -############## -# -# -mkl=[parallel|sequential] : Use the MKL library -# --ninja : Allow the utilisation of ninja. It is mandatory ! -# --align=32 : Align all provided arrays on a 32-byte boundary -# -[COMMON] -FC : ifort -LAPACK_LIB : -mkl=parallel -IRPF90 : irpf90 -IRPF90_FLAGS : --ninja --align=64 - -# Global options -################ -# -# 1 : Activate -# 0 : Deactivate -# -[OPTION] -MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below -CACHE : 1 ; Enable cache_compile.py -OPENMP : 1 ; Append OpenMP flags - -# Optimization flags -#################### -# -# -xHost : Compile a binary optimized for the current architecture -# -O2 : O3 not better than O2. -# -ip : Inter-procedural optimizations -# -ftz : Flushes denormal results to zero -# -[OPT] -FC : -traceback -FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g - -# Profiling flags -################# -# -[PROFILE] -FC : -p -g -traceback -FCFLAGS : -xSSE4.2 -O2 -ip -ftz - -# Debugging flags -################# -# -# -traceback : Activate backtrace on runtime -# -fpe0 : All floating point exaceptions -# -C : Checks uninitialized variables, array subscripts, etc... -# -g : Extra debugging information -# -xSSE2 : Valgrind needs a very simple x86 executable -# -[DEBUG] -FC : -g -traceback -FCFLAGS : -xSSE2 -C -fpe0 -IRPF90_FLAGS : --openmp - -# OpenMP flags -################# -# -[OPENMP] -FC : -qopenmp -IRPF90_FLAGS : --openmp - From f69d458ab68d7424c31dbff85df1de4d01dc96b8 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 19 Jan 2017 16:03:57 -0600 Subject: [PATCH 7/9] Update module_handler.py --- scripts/module/module_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index e2c596d1..b49609b3 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -298,7 +298,7 @@ if __name__ == '__main__': # Don't update if we are not in the main repository from is_master_repository import is_master_repository if not is_master_repository: - print 'Not in the master repo' + print >> sys.stderr, 'Not in the master repo' sys.exit() path = os.path.join(module_abs, ".gitignore") From 06413b9b597dab718466ae502650ffe6808ea1e2 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 19 Jan 2017 16:05:15 -0600 Subject: [PATCH 8/9] Update pot_ao_pseudo_ints.irp.f --- src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f b/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f index c6737dac..6f1fd905 100644 --- a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f +++ b/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f @@ -4,10 +4,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num_align,ao_num)] ! Pseudo-potential integrals END_DOC - - print*, 'Hi from ao_pseudo_integral' - print*, read_ao_one_integrals - if (read_ao_one_integrals) then call read_one_e_integrals('ao_pseudo_integral', ao_pseudo_integral,& size(ao_pseudo_integral,1), size(ao_pseudo_integral,2)) From 6d37f3202d16e7d6ef6f5130ec8d6b72dbf72bad Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 19 Jan 2017 16:06:54 -0600 Subject: [PATCH 9/9] Update map_module.f90 --- src/Utils/map_module.f90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Utils/map_module.f90 b/src/Utils/map_module.f90 index 1d09e4e0..6a27ee9e 100644 --- a/src/Utils/map_module.f90 +++ b/src/Utils/map_module.f90 @@ -19,16 +19,16 @@ module map_module use omp_lib use iso_fortran_env - integer, parameter :: integral_kind = 16 ! 8 + integer, parameter :: integral_kind = 8 - integer, parameter :: cache_key_kind = 4 ! 2 - integer, parameter :: cache_map_size_kind = 8 ! 4 + integer, parameter :: cache_key_kind = 2 + integer, parameter :: cache_map_size_kind = 4 - integer, parameter :: key_kind = 16 !8 - integer, parameter :: map_size_kind =16 ! 8 + integer, parameter :: key_kind = 8 + integer, parameter :: map_size_kind = 8 - integer, parameter :: map_shift = -31 !-15 -!integer*8, parameter :: map_mask = ibset(0_8,15)-1_8 + integer, parameter :: map_shift = -15 +integer*8, parameter :: map_mask = ibset(0_8,15)-1_8 integer(kind=int16), parameter :: z_kind = 0 integer(kind=int16), parameter :: o_kind = 1 @@ -50,8 +50,8 @@ module map_module integer*8, pointer :: consolidated_idx(:) logical :: sorted logical :: consolidated -! integer(kind=map_size_kind) :: map_size -! integer(kind=map_size_kind) :: n_elements + integer(kind=map_size_kind) :: map_size + integer(kind=map_size_kind) :: n_elements integer(kind=int16) :: map_size integer(kind=int16) :: n_elements