Skip to content

Commit

Permalink
Add a query function superlu_dist_GetVersionNumber.
Browse files Browse the repository at this point in the history
Update top-level Makefile to compile library first, then install.
  • Loading branch information
xiaoyeli committed Oct 25, 2017
1 parent 1b43071 commit dbda79c
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 28 deletions.
11 changes: 6 additions & 5 deletions EXAMPLE/pddrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
#ifdef __INTEL_COMPILER
printf("__INTEL_COMPILER is defined\n");
#endif
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pddrive1.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pddrive2.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int) grid.nprow, (int) grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pddrive3.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int) grid.nprow, (int) grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pzdrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pzdrive1.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pzdrive2.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int) grid.nprow, (int) grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
8 changes: 6 additions & 2 deletions EXAMPLE/pzdrive3.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ int main(int argc, char *argv[])
iam = grid.iam;
if ( iam >= nprow * npcol ) goto out;
if ( !iam ) {
printf("Input matrix file: %s\n", *cpp);
printf("\tProcess grid\t%d X %d\n", (int) grid.nprow, (int) grid.npcol);
int v_major, v_minor, v_bugfix;
superlu_dist_GetVersionNumber(&v_major, &v_minor, &v_bugfix);
printf("Library version:\t%d.%d.%d\n", v_major, v_minor, v_bugfix);

printf("Input matrix file:\t%s\n", *cpp);
printf("Process grid:\t\t%d X %d\n", (int)grid.nprow, (int)grid.npcol);
fflush(stdout);
}

Expand Down
4 changes: 2 additions & 2 deletions MAKE_INC/make.mac-x
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#
# The name of the libraries to be created/linked to
#
SuperLUroot = /Users/xsli/Dropbox/Codes/SuperLU/superlu_dist.git/xsli-build
DSUPERLULIB = $(SuperLUroot)/SRC/libsuperlu_dist.a
SuperLUroot = /Users/xsli/Dropbox/Codes/SuperLU/superlu_dist.git/
DSUPERLULIB = $(SuperLUroot)/lib/libsuperlu_dist.a

BLASLIB = $(SuperLUroot)/CBLAS/libblas.a

Expand Down
4 changes: 2 additions & 2 deletions MAKE_INC/make.ssg1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#
# The name of the libraries to be created/linked to
#
SuperLUroot = /home/xiaoye/Dropbox/Codes/SuperLU/superlu_dist.git/build
DSUPERLULIB = $(SuperLUroot)/SRC/libsuperlu_dist.a
SuperLUroot = /home/xiaoye/Dropbox/Codes/SuperLU/superlu_dist.git
DSUPERLULIB = $(SuperLUroot)/lib/libsuperlu_dist.a

LIBS = $(DSUPERLULIB) /usr/lib/libf77blas.so /usr/lib/libatlas.so /home/xiaoye/lib/static/parmetis-4.0.3/build/Linux-x86_64/libparmetis/libparmetis.a /home/xiaoye/lib/static/parmetis-4.0.3/build/Linux-x86_64/libmetis/libmetis.a

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

include make.inc

all: install lib example
all: lib install example

lib: superlulib

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for detailed instructions on porting.
The following CPP definitions can be set in CFLAGS.

```
-D_LONGINT
-DXSDK_INDEX_SIZE=64
use 64-bit integers for indexing sparse matrices. (default 32 bit)
-DPRNTlevel=[0,1,2,...]
Expand Down Expand Up @@ -148,7 +148,7 @@ To use OpenMP parallelism, need to link with an OpenMP library, and
set the number of threads you wish to use as follows (bash):
`export OMP_NUM_THREADS=<##>`

To enable Nvidia GPU access, need to take the following 2 step:
To enable NVIDIA GPU access, need to take the following 2 step:
1) Set the following Linux environment variable:
`export ACC=GPU`

Expand Down
1 change: 1 addition & 0 deletions SRC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(sources
smach_dist.c
dmach_dist.c
colamd.c
superlu_dist_version.c
)
set_source_files_properties(superlu_timer.c PROPERTIES COMPILE_FLAGS -O0)

Expand Down
3 changes: 2 additions & 1 deletion SRC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ALLAUX = sp_ienv.o etree.o sp_colorder.o get_perm_c.o \
colamd.o mmd.o comm.o memory.o util.o superlu_grid.o \
pxerr_dist.o superlu_timer.o symbfact.o \
psymbfact.o psymbfact_util.o get_perm_c_parmetis.o mc64ad_dist.o \
static_schedule.o xerr_dist.o smach_dist.o dmach_dist.o
static_schedule.o xerr_dist.o smach_dist.o dmach_dist.o \
superlu_dist_version.o

ifeq "${ACC}" "GPU"
ALLAUX += cublas_utils.o
Expand Down
4 changes: 3 additions & 1 deletion SRC/superlu_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ at the top-level directory.
*/
#define SUPERLU_DIST_MAJOR_VERSION 5
#define SUPERLU_DIST_MINOR_VERSION 2
#define SUPERLU_DIST_PATCH_VERSION 1
#define SUPERLU_DIST_PATCH_VERSION 2
#define SUPERLU_DIST_RELEASE_DATE "October 24, 2017"

#include "superlu_dist_config.h"
/* Define my integer size int_t */
Expand Down Expand Up @@ -710,6 +711,7 @@ extern void PStatFree(SuperLUStat_t *);
extern void PStatPrint(superlu_dist_options_t *, SuperLUStat_t *, gridinfo_t *);
extern void log_memory(long long, SuperLUStat_t *);
extern void print_memorylog(SuperLUStat_t *, char *);
extern int superlu_dist_GetVersionNumber(int *, int *, int *);

/* Prototypes for parallel symbolic factorization */
extern float symbfact_dist
Expand Down
30 changes: 30 additions & 0 deletions SRC/superlu_dist_version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*! \file
Copyright (c) 2003, The Regents of the University of California, through
Lawrence Berkeley National Laboratory (subject to receipt of any required
approvals from U.S. Dept. of Energy)
All rights reserved.
The source code is distributed under BSD license, see the file License.txt
at the top-level directory.
*/
/** @file superlu_dist_version.h
* \brief Gets the SuperLU_DIST's version information from the library.
*
* -- Distributed SuperLU routine (version 5.2) --
* Lawrence Berkeley National Lab, Univ. of California Berkeley,
* October 13, 2017
*
*/

#include "superlu_defs.h"

int superlu_dist_GetVersionNumber(int *major, int *minor, int *bugfix)
{
if (major) *major = SUPERLU_DIST_MAJOR_VERSION;
if (minor) *minor = SUPERLU_DIST_MINOR_VERSION;
if (bugfix) *bugfix = SUPERLU_DIST_PATCH_VERSION;
return 0;
}


0 comments on commit dbda79c

Please sign in to comment.