Skip to content
Permalink
Browse files

initial commit for public gpu df-cc plugin

  • Loading branch information...
edeprince3 committed Aug 25, 2014
1 parent 2d7448a commit bc649f95e48c98483d22e984b49de4231e7ef9d2
Showing with 5,374 additions and 4 deletions.
  1. +76 −0 Makefile.template
  2. +0 −4 README.md
  3. +27 −0 README.txt
  4. +16 −0 __init__.py
  5. +2,210 −0 ccsd.cu
  6. +122 −0 ccsd.h
  7. +20 −0 configure
  8. +25 −0 doc.rst
  9. +134 −0 gpu_dfcc.cu
  10. +2,000 −0 gpuhelper.cu
  11. +112 −0 gpuhelper.h
  12. +116 −0 gpuhelper_driver.cc
  13. +7 −0 gpuonly.h
  14. +29 −0 input.dat
  15. +81 −0 pymodule.py
  16. +399 −0 triples.cu
@@ -0,0 +1,76 @@
#
# Plugin Makefile generated by Psi4.
#
# You shouldn't need to modify anything in this file.
#
# Location of your PSI4 source
top_srcdir = MY_TOP_SRCDIR
# Location of your PSI4 install, by default as listed
top_objdir = MY_TOP_OBJDIR

# Start by figuring out whether we're on Linux or Mac (sorry, Mr. Gates)
UNAME := $(shell uname)

include $(top_objdir)/src/bin/MakeVars

# Reset these values, MakeVars changes them to valud only valid in Psi4's objdir
# Location of your PSI4 source
top_srcdir = MY_TOP_SRCDIR
# Location of your PSI4 install, by default as listed
top_objdir = MY_TOP_OBJDIR

PSITARGET = $(shell basename `pwd`).so
PSILIBS = -L$(top_objdir)/lib -lPSI_plugin

CXXSRC = $(notdir $(wildcard *.cc))
CUDASRC = $(notdir $(wildcard *.cu))
DEPENDINCLUDE = $(notdir $(wildcard *.h))

CUDALIBS=MY_CUDALIBS
NVCCFLAGS = -arch sm_13 -Xcompiler -fopenmp --compiler-options '-fPIC' -O2
NVCCINCLUDE=-I$(top_srcdir)/include -I$(top_objdir)/include -I$(top_srcdir)/src/lib -I$(top_objdir)/src/lib -DINSTALLEDPSIDATADIR=\"$(pkgdatadir)\" $(PYTHON_INCLUDE)

BINOBJ = $(CXXSRC:%.cc=%.o)
CUDAOBJ = $(CUDASRC:%.cu=%.o)

default:: $(PSITARGET)

# Add the flags needed for shared library creation
ifeq ($(UNAME), Linux)
LDFLAGS = -shared $(CUDALIBS)

endif
ifeq ($(UNAME), Darwin)
LDFLAGS = -shared -undefined dynamic_lookup $(CUDALIBS)
CXXOTH += -fno-common
endif

NVCC=MY_NVCC

# The object files
%.o: %.cc
$(CXX) $(CXXFLAGS) $(CXXINCLUDE) -c $< $(OUTPUT_OPTION)
%.o: %.cu
$(NVCC) $(NVCCFLAGS) $(NVCCINCLUDE) -c $< $(OUTPUT_OPTION)

$(PSITARGET): $(BINOBJ) $(CUDAOBJ)
$(NVCC) $(LDFLAGS) -o $@ $^ $(CXXDBG) $(PSILIBS)


# Erase all compiled intermediate files
clean:
rm -f $(BINOBJ) $(CUDAOBJ) $(PSITARGET) *.d *.pyc *.test output.dat psi.timer.dat

# Dependency handling
%.d: %.cc
$(CXXDEPEND) $(CXXDEPENDFLAGS) $(CXXFLAGS) $(CXXINCLUDE) $< | sed 's/^$*.o/$*.o $*.d/g' > $(@F)
%.d: %.cu
$(NVCC) $(CXXDEPEND) $(CXXDEPENDFLAGS) $(CXXFLAGS) $(CXXINCLUDE) $< | sed 's/^$*.o/$*.o $*.d/g' > $(@F)

ifneq ($(DODEPEND),no)
$(BINOBJ:%.o=%.d): $(DEPENDINCLUDE)
include $(BINOBJ:%.o=%.d)
$(CUDAOBJ:%.o=%.d): $(DEPENDINCLUDE)
include $(CUDAOBJ:%.o=%.d)
endif

This file was deleted.

@@ -0,0 +1,27 @@
To run the psi4 plugin gpu_dfcc:

1. Download and install psi4public from github.com:
https://github.com/psi4/psi4public. You can obtain the source using git:

> git clone git@github.com:psi4/psi4public.git

Install psi4 as described on http://www.psicode.org/.


2. Configure gpu_dfcc by editing the configure file in this directory.
Specify the location of psi4 and your cublas library.

> ./configure

Make sure that your LD_LIBRARY_PATH contains the location of your
cublas library.

3. Compile the plugin.

> make

4. Make sure the test included in this directory passes.

> psi4 input.dat -n 2

Note that plugin gpu_dfcc requires psi4 be run with at least two threads.
@@ -0,0 +1,16 @@
"""Plugin docstring.
"""
__version__ = '0.1'
__author__ = 'Psi4 Developer'

# Load Python modules
from pymodule import *

# Load C++ plugin
import os
import psi4
plugdir = os.path.split(os.path.abspath(__file__))[0]
sofile = plugdir + '/' + os.path.split(plugdir)[1] + '.so'
psi4.plugin_load(sofile)

0 comments on commit bc649f9

Please sign in to comment.
You can’t perform that action at this time.