Skip to content

Instantly share code, notes, and snippets.


hkalexling/Makefile Secret

Last active Oct 8, 2019
What would you like to do?
starting factorization
=== PARDISO is running in In-Core mode, because iparam(60)=0 ===
Percentage of computed non-zeros for LL^T factorization
33 % 66 % 100 %
=== PARDISO: solving a real structurally symmetric system ===
Matrix checker is turned ON
0-based array is turned ON
PARDISO double precision computation is turned ON
METIS algorithm at reorder step is turned ON
Single-level factorization algorithm is turned ON
Summary: ( starting phase is reordering, ending phase is factorization )
Time spent in calculations of symmetric matrix portrait (fulladj): 0.000031 s
Time spent in reordering of the initial matrix (reorder) : 0.000001 s
Time spent in symbolic factorization (symbfct) : 0.000835 s
Time spent in data preparations for factorization (parlist) : 0.000001 s
Time spent in copying matrix to internal data structure (A to LU): 0.000000 s
Time spent in factorization step (numfct) : 0.000164 s
Time spent in allocation of internal data structures (malloc) : 0.000233 s
Time spent in additional calculations : 0.000059 s
Total time spent : 0.001324 s
Parallel Direct Factorization is running on 6 OpenMP
< Linear system Ax = b >
number of equations: 3
number of non-zeros in A: 3
number of non-zeros in A (%): 33.333333
number of right-hand sides: 1
< Factors L and U >
number of columns for each panel: 128
number of independent subgraphs: 0
< Preprocessing with state of the art partitioning metis>
number of supernodes: 3
size of largest supernode: 1
number of non-zeros in L: 3
number of non-zeros in U: 1
number of non-zeros in L+U: 4
gflop for the numerical factorization: 0.000000
gflop/s for the numerical factorization: 0.000000
saving factorization to file
Segmentation fault (core dumped)
#include <mkl.h>
#include <mkl_spblas.h>
#include <mkl_pardiso.h>
#include <mkl_types.h>
#include <stdio.h>
int main(int argc, char** argv) {
int k = 3;
double vals[3] = {1, 1, 1};
int cols[3] = {0, 1, 2};
int rows[4] = {0, 1, 2, 3};
int pt[64];
int mtype = 1;
int iparm[64];
pardisoinit(pt, &mtype, iparm);
iparm[26] = 1; // validate input sparse matrix
iparm[34] = 1; // 0-base indexing
int maxfct = 1;
int mnum = 1;
int phase = 12;
int perm[k];
int msglvl = 1;
int err = 0;
int idum;
double ddum;
printf("starting factorization\n");
pardiso(pt, &maxfct, &mnum, &mtype, &phase, &k, vals, rows, cols, perm, &idum, iparm, &msglvl, &ddum, &ddum, &err);
if (err) {
printf("factorization failed. Code: %d\n", err);
printf("saving factorization to file\n");
pardiso_handle_store(pt, "", &err);
if (err) {
printf("failed to save the factorization to file. Code; %d\n", err);
CXX = g++-7
MKL = /home/alex_ling/intel/mkl
IDIR = -I$(MKLROOT)/include
LIBS = -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl -m64
CXXFLAGS = -Wall -Ofast -std=gnu++14 -fopenmp -march=native
$(CXX) $(IDIR) $(CXXFLAGS) main.cpp -o main $(LDIR) $(LIBS)
rm main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment