Skip to content

Commit

Permalink
Merge pull request #4 from bogdanoff/molcas_again
Browse files Browse the repository at this point in the history
Update Molcas interface
  • Loading branch information
bogdanoff authored May 25, 2020
2 parents dad1a74 + e0f362e commit f95317b
Show file tree
Hide file tree
Showing 11 changed files with 241 additions and 120 deletions.
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ ifeq ($(MOLPRO), yes)

endif

ifeq ($(MOLCAS), yes)
MOLCAS_BLOCK= -DMOLCAS -fPIC
endif

FLAGS = -I${MKLFLAGS} -I$(INCLUDE1) -I$(INCLUDE2) -I$(NEWMATINCLUDE) -I$(BOOSTINCLUDE) -I$(MOLPROINCLUDE) \
-I$(HOME)/modules/generate_blocks/ -I$(HOME)/modules/onepdm -I$(HOME)/modules/twopdm/ \
-I$(HOME)/modules/npdm -I$(HOME)/modules/two_index_ops -I$(HOME)/modules/three_index_ops -I$(HOME)/modules/four_index_ops -std=c++0x \
Expand All @@ -117,15 +121,17 @@ MPI_OPT = -DSERIAL

ifeq (icpc, $(CXX))
ifeq ($(OPENMP), yes)
OPENMP_FLAGS= -openmp
OPENMP_FLAGS= -qopenmp
#ifeq ($(USE_MPI), yes)
#OPENMP_FLAGS += -lmpi_mt
#endif
endif
# Intel compiler
OPT = -DNDEBUG -O2 -g -funroll-loops #-ipo
# OPT = -g
ifeq ($(USE_MPI), no)
# OPT = -g
# # Useful option to define a newer g++ binary if the default g++ is too old
# OPT += -gxx-name=g++-4.7
ifeq ($(USE_MPI), no)
CXX = icpc
endif
endif
Expand Down Expand Up @@ -162,7 +168,7 @@ ifeq ($(USE_MPI), yes)
endif


OPT += $(OPENMP_FLAGS) -DBLAS -DUSELAPACK $(MPI_OPT) $(I8) $(B56) $(MOLPRO_BLOCK) -DFAST_MTP -D_HAS_CBLAS ${MKLOPT} ${UNITTEST}
OPT += $(OPENMP_FLAGS) -DBLAS -DUSELAPACK $(MPI_OPT) $(I8) $(B56) $(MOLPRO_BLOCK) $(MOLCAS_BLOCK) -DFAST_MTP -D_HAS_CBLAS ${MKLOPT} ${UNITTEST}

SRC_genetic = genetic/CrossOver.C genetic/Evaluate.C genetic/GAInput.C genetic/GAOptimize.C genetic/Generation.C genetic/Mutation.C genetic/RandomGenerator.C genetic/ReadIntegral.C

Expand All @@ -186,19 +192,19 @@ OBJ_OH= OverlapHelement.o
SRC_Applycd = wrapper.C fciqmchelper.C saveBlock.C Stackspinblock.C operatorUtilities.C Stack_op_components.C stackguess_wavefunction.C Stackwavefunction.C Stackdensity.C stackopxop.C StackBaseOperator.C StackOperators.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C timer.C SpinQuantum.C Symmetry.C input.C hfOccGenerator.C Schedule.C orbstring.C slater.C csf.C StateInfo.C screen.C MatrixBLAS.C operatorfunctions.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C IrrepSpace.C modules/generate_blocks/sweep.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C modules/onepdm/sweep.C modules/onepdm/onepdm.C
OBJ_Applycd= ApplyExcitation.o

SRC_CSFOH = CSFOverlapHelement.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_CSFOH = CSFOverlapHelement.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)

SRC_DeterminantMPS = DeterminantMPS.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_DeterminantMPS = DeterminantMPS.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)

SRC_PTn = PTn.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_PTn = PTn.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)

SRC_RDM = RDM.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_RDM = RDM.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)


SRC_COEF= modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_COEF= modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C wrapper.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C Schedule.C input.C hfOccGenerator.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
OBJ_COEF= Coefficients.o

SRC_spin_library = modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C fciqmchelper.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_spinblock_components.C linear.C readinput.C save_load_block.C timer.C SpinQuantum.C Symmetry.C input.C hfOccGenerator.C Schedule.C orbstring.C slater.C csf.C StateInfo.C Operators.C BaseOperator.C screen.C MatrixBLAS.C operatorfunctions.C opxop.C wavefunction.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C guess_wavefunction.C density.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C spinblock.C op_components.C IrrepSpace.C modules/generate_blocks/sweep.C modules/onepdm/sweep.C modules/onepdm/onepdm.C modules/twopdm/sweep.C modules/twopdm/twopdm.C modules/twopdm/twopdm_2.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C $(SRC_npdm) $(SRC_nevpt2) $(SRC_mps_nevpt)
SRC_spin_library = saveBlock.C Stackspinblock.C operatorUtilities.C Stack_op_components.C stackguess_wavefunction.C Stackwavefunction.C Stackdensity.C stackopxop.C StackBaseOperator.C StackOperators.C modules/ResponseTheory/sweepResponse.C modules/ResponseTheory/sweepCompress.C pario.C dmrg.C fiedler.C least_squares.C sweep_mps.C set_stackspinblock_components.C linear.C readinput.C timer.C SpinQuantum.C Symmetry.C input.C hfOccGenerator.C Schedule.C orbstring.C slater.C csf.C StateInfo.C screen.C MatrixBLAS.C operatorfunctions.C solver.C davidson.C sweep_params.C sweep.C partial_sweep.C BlockAndDecimate.C initblocks.C rotationmat.C renormalise.C couplingCoeffs.C distribute.C new_anglib.C fci.C IrrepSpace.C modules/generate_blocks/sweep.C $(SRC_genetic) SpinSpace.C include/IntegralMatrix.C modules/onepdm/sweep.C modules/onepdm/onepdm.C $(SRC_npdm) $(SRC_mps_nevpt) fciqmchelper.C

SRC_nevpt2 = modules/nevpt2/nevpt2.C modules/nevpt2/nevpt2_info.C modules/nevpt2/nevpt2_mpi.C \
modules/nevpt2/nevpt2_opconstruct.C modules/nevpt2/nevpt2_operators.C \
Expand Down
52 changes: 26 additions & 26 deletions MatrixBLAS.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ namespace SpinAdapted{
T1& a = const_cast<T1&>(a_ref); // for BLAS calls
T2& b = const_cast<T2&>(b_ref);

int arows = a.Nrows();
int acols = a.Ncols();
FORTINT arows = a.Nrows();
FORTINT acols = a.Ncols();

// some specialisations
#ifdef FAST_MTP
Expand Down Expand Up @@ -131,10 +131,10 @@ namespace SpinAdapted{
if (conjA == 'n' && conjB == 'n')
{
#ifdef BLAS
int aRows = a.Nrows ();
int aCols = a.Ncols ();
int bRows = b.Nrows ();
int bCols = b.Ncols ();
FORTINT aRows = a.Nrows ();
FORTINT aCols = a.Ncols ();
FORTINT bRows = b.Nrows ();
FORTINT bCols = b.Ncols ();

for (int i = 0; i < aRows; ++i)
for (int j = 0; j < aCols; ++j)
Expand All @@ -152,10 +152,10 @@ namespace SpinAdapted{
else if (conjA == 't' && conjB == 'n')
{
#ifdef BLAS
int aRows = a.Ncols ();
int aCols = a.Nrows ();
int bRows = b.Nrows ();
int bCols = b.Ncols ();
FORTINT aRows = a.Ncols ();
FORTINT aCols = a.Nrows ();
FORTINT bRows = b.Nrows ();
FORTINT bCols = b.Ncols ();

for (int i = 0; i < aRows; ++i)
for (int j = 0; j < aCols; ++j)
Expand All @@ -173,10 +173,10 @@ namespace SpinAdapted{
else if (conjA == 'n' && conjB == 't')
{
#ifdef BLAS
int aRows = a.Nrows ();
int aCols = a.Ncols ();
int bRows = b.Ncols ();
int bCols = b.Nrows ();
FORTINT aRows = a.Nrows ();
FORTINT aCols = a.Ncols ();
FORTINT bRows = b.Ncols ();
FORTINT bCols = b.Nrows ();

for (int i = 0; i < aRows; ++i)
for (int j = 0; j < aCols; ++j)
Expand All @@ -194,10 +194,10 @@ namespace SpinAdapted{
else if (conjA == 't' && conjB == 't')
{
#ifdef BLAS
int aRows = a.Ncols ();
int aCols = a.Nrows ();
int bRows = b.Ncols ();
int bCols = b.Nrows ();
FORTINT aRows = a.Ncols ();
FORTINT aCols = a.Nrows ();
FORTINT bRows = b.Ncols ();
FORTINT bCols = b.Nrows ();

for (int i = 0; i < aRows; ++i)
for (int j = 0; j < aCols; ++j)
Expand Down Expand Up @@ -234,7 +234,7 @@ namespace SpinAdapted{
// b += d * a;
#ifdef BLAS
assert ((a.Nrows () == b.Nrows ()) && (a.Ncols () == b.Ncols ()));
int n = a.Nrows () * a.Ncols ();
FORTINT n = a.Nrows () * a.Ncols ();
DAXPY (n, d, a.Store (), 1, b.Store (), 1);
#else
b += d * a;
Expand All @@ -249,12 +249,12 @@ namespace SpinAdapted{
T2& b_ref = const_cast<T2&>(b);
try
{
int aRows = a_ref.Nrows ();
int aCols = a_ref.Ncols ();
int bRows = b_ref.Nrows ();
int bCols = b_ref.Ncols ();
int cRows = c.Nrows ();
int cCols = c.Ncols ();
FORTINT aRows = a_ref.Nrows ();
FORTINT aCols = a_ref.Ncols ();
FORTINT bRows = b_ref.Nrows ();
FORTINT bCols = b_ref.Ncols ();
FORTINT cRows = c.Nrows ();
FORTINT cCols = c.Ncols ();
dmrginp.matmultNum++;
if (conjA == 'n' && conjB == 'n')
{
Expand Down Expand Up @@ -342,7 +342,7 @@ template<class T> void MatrixDiagonalScale(double d, const T& a, double* b)
{
//assert (a.Nrows () == a.Ncols () && a.Nrows () == b.Ncols ());
#ifdef BLAS
int n = a.Nrows ();
FORTINT n = a.Nrows ();
DAXPY (n, d, a.Store (), n+1, b, 1);
#else
//b += d * a; Should add the non-blas analogue
Expand Down
3 changes: 3 additions & 0 deletions blas_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Sandeep Sharma and Garnet K.-L. Chan
#endif

#ifdef _HAS_INTEL_MKL
#ifdef _FORTINT_64
#define MKL_INT long
#endif
#include "mkl.h"
//#include "mkl_blacs.h"
#ifdef AIX
Expand Down
Loading

0 comments on commit f95317b

Please sign in to comment.