Loading src/cluster/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ $(BUILDDIR_CLU)/edfb_clu: $(OBJDIR) $(OBJDIR)/edfb_clu.o $(BUILDDIR_CLU) # We put $(LIBNPTM) as an object to link in directly, so that it will be found at runtime even if it is a shared object library. May change in the future when we have an install: target $(BUILDDIR_CLU)/np_cluster: $(OBJDIR) $(CXX_CLU_OBJS) $(BUILDDIR_CLU) $(LIBNPTM) $(CXX) $(CXXFLAGS) -o $(BUILDDIR_CLU)/np_cluster $(CXX_CLU_OBJS) $(LIBNPTM) $(CXXLDFLAGS) -llapacke $(CXX) $(CXXFLAGS) -o $(BUILDDIR_CLU)/np_cluster $(CXX_CLU_OBJS) $(LIBNPTM) $(CXXLDFLAGS) clean: rm -f $(F_CLU_OBJS) $(CXX_CLU_OBJS) $(CXX_CLU_DEBUG) Loading src/cluster/cluster.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif Loading Loading @@ -340,7 +341,7 @@ void cluster(string config_file, string data_file, string output_path) { } // i132 loop cms(am, c1, c1ao, c4, c6); //cms(tam, c1, c1ao, c4, c6); int ndit = 2 * nsph * c4->nlim; lapack_int ndit = 2 * nsph * c4->nlim; //lucin(am, mxndm, ndit, jer); zinvert(am, ndit, jer); if (jer != 0) break; // jxi488 loop: goes to memory clean Loading src/include/lapack_calls.h +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,6 @@ * \param n: `int` The number of rows and columns of the [n x n] matrix. * \param jer: `int &` Reference to an integer return flag. */ void zinvert(std::complex<double> **mat, int n, int &jer); void zinvert(std::complex<double> **mat, lapack_int n, int &jer); #endif src/libnptm/lapack_calls.cpp +9 −9 Original line number Diff line number Diff line #include <complex> #include <cstdlib> #include "lapacke.h" #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif using namespace std; void zinvert(std::complex<double> **mat, int n, int &jer) { void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { jer = 0; __complex__ double *arr = new __complex__ double[n * n]; const __complex__ double uim = 1.0di; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int idx = i + n * j; for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; arr[idx] = mat[j][i].real() + uim * mat[j][i].imag(); } } int* IPIV = new int[n]; int* IPIV = new int[n](); LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int idx = i + n * j; for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; mat[j][i] = complex<double>(__real__ arr[idx], __imag__ arr[idx]); } } Loading src/make.inc +2 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ endif # CXXFLAGS defines the default compilation options for the C++ compiler ifndef CXXFLAGS override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) -DLAPACK_ILP64 #override CXXFLAGS=-O3 -I$(HDF5_INCLUDE) endif Loading @@ -50,7 +50,7 @@ ifndef CXXLDFLAGS ifndef HDF5_LIB override HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial endif override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(LDFLAGS) override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 -llapacke $(LDFLAGS) #else #override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(CXXLDFLAGS) endif Loading Loading
src/cluster/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ $(BUILDDIR_CLU)/edfb_clu: $(OBJDIR) $(OBJDIR)/edfb_clu.o $(BUILDDIR_CLU) # We put $(LIBNPTM) as an object to link in directly, so that it will be found at runtime even if it is a shared object library. May change in the future when we have an install: target $(BUILDDIR_CLU)/np_cluster: $(OBJDIR) $(CXX_CLU_OBJS) $(BUILDDIR_CLU) $(LIBNPTM) $(CXX) $(CXXFLAGS) -o $(BUILDDIR_CLU)/np_cluster $(CXX_CLU_OBJS) $(LIBNPTM) $(CXXLDFLAGS) -llapacke $(CXX) $(CXXFLAGS) -o $(BUILDDIR_CLU)/np_cluster $(CXX_CLU_OBJS) $(LIBNPTM) $(CXXLDFLAGS) clean: rm -f $(F_CLU_OBJS) $(CXX_CLU_OBJS) $(CXX_CLU_DEBUG) Loading
src/cluster/cluster.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif Loading Loading @@ -340,7 +341,7 @@ void cluster(string config_file, string data_file, string output_path) { } // i132 loop cms(am, c1, c1ao, c4, c6); //cms(tam, c1, c1ao, c4, c6); int ndit = 2 * nsph * c4->nlim; lapack_int ndit = 2 * nsph * c4->nlim; //lucin(am, mxndm, ndit, jer); zinvert(am, ndit, jer); if (jer != 0) break; // jxi488 loop: goes to memory clean Loading
src/include/lapack_calls.h +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,6 @@ * \param n: `int` The number of rows and columns of the [n x n] matrix. * \param jer: `int &` Reference to an integer return flag. */ void zinvert(std::complex<double> **mat, int n, int &jer); void zinvert(std::complex<double> **mat, lapack_int n, int &jer); #endif
src/libnptm/lapack_calls.cpp +9 −9 Original line number Diff line number Diff line #include <complex> #include <cstdlib> #include "lapacke.h" #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif using namespace std; void zinvert(std::complex<double> **mat, int n, int &jer) { void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { jer = 0; __complex__ double *arr = new __complex__ double[n * n]; const __complex__ double uim = 1.0di; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int idx = i + n * j; for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; arr[idx] = mat[j][i].real() + uim * mat[j][i].imag(); } } int* IPIV = new int[n]; int* IPIV = new int[n](); LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int idx = i + n * j; for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; mat[j][i] = complex<double>(__real__ arr[idx], __imag__ arr[idx]); } } Loading
src/make.inc +2 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ endif # CXXFLAGS defines the default compilation options for the C++ compiler ifndef CXXFLAGS override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) -DLAPACK_ILP64 #override CXXFLAGS=-O3 -I$(HDF5_INCLUDE) endif Loading @@ -50,7 +50,7 @@ ifndef CXXLDFLAGS ifndef HDF5_LIB override HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial endif override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(LDFLAGS) override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 -llapacke $(LDFLAGS) #else #override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(CXXLDFLAGS) endif Loading