Skip to content

Commit

Permalink
Merge pull request xiaoyeli#19 from jschueller/longint
Browse files Browse the repository at this point in the history
CMake: Add LONGINT option
  • Loading branch information
xiaoyeli authored Jul 5, 2024
2 parents b36a4a4 + cab0f6d commit 9e23fe7
Show file tree
Hide file tree
Showing 40 changed files with 103 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Build
run: |
cmake -DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic" -DCMAKE_INSTALL_PREFIX=$PWD/install .
make -j2
make -j4
- name: Test
run: ctest -R LA --output-on-failure -j2 --schedule-random --timeout 500
run: ctest --output-on-failure -j4 --schedule-random --timeout 500

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ else ()
message (SEND_ERROR "invalid PLAT setting")
endif ()

option (LONGINT "use 64-bit integers for indexing sparse matrices (default is 32-bit)" OFF)

enable_language(C)
if (enable_fortran)
Expand Down
3 changes: 2 additions & 1 deletion EXAMPLE/pclinsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ main(int argc, char *argv[])
trans_t trans;
complex *xact, *rhs;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *procs,
int_t *n, int_t *b, int_t *w, int_t *r, int_t *maxsup);

nrhs = 1;
trans = NOTRANS;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pclinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -218,7 +220,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pclinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -276,7 +278,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pclinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -234,7 +236,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pcrepeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ main(int argc, char *argv[])
complex *rhsb, *xact;
Gstat_t Gstat;
flops_t flopcnt;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pcspmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ main(int argc, char *argv[])
pthread_t *thread_id;
void *status;
#endif
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
3 changes: 2 additions & 1 deletion EXAMPLE/pdlinsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ main(int argc, char *argv[])
trans_t trans;
double *xact, *rhs;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *procs, int_t *n,
int_t *b, int_t *w, int_t *r, int_t *maxsup);

nrhs = 1;
trans = NOTRANS;
Expand Down
4 changes: 3 additions & 1 deletion EXAMPLE/pdlinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
4 changes: 3 additions & 1 deletion EXAMPLE/pdlinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
4 changes: 3 additions & 1 deletion EXAMPLE/pdlinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pdrepeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ main(int argc, char *argv[])
double *rhsb, *xact;
Gstat_t Gstat;
flops_t flopcnt;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pdspmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ main(int argc, char *argv[])
pthread_t *thread_id;
void *status;
#endif
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
3 changes: 2 additions & 1 deletion EXAMPLE/pslinsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ main(int argc, char *argv[])
trans_t trans;
float *xact, *rhs;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *procs, int_t *n,
int_t *b, int_t *w, int_t *r, int_t *maxsup);

nrhs = 1;
trans = NOTRANS;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pslinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -218,7 +220,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pslinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -276,7 +278,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
6 changes: 4 additions & 2 deletions EXAMPLE/pslinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ main(int argc, char *argv[])
float *ferr, *berr;
float u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down Expand Up @@ -234,7 +236,7 @@ main(int argc, char *argv[])
*/
void
parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
int_t *w, int_t *relax, float *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed)
{
int c;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/psrepeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ main(int argc, char *argv[])
float *rhsb, *xact;
Gstat_t Gstat;
flops_t flopcnt;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/psspmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ main(int argc, char *argv[])
pthread_t *thread_id;
void *status;
#endif
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
3 changes: 2 additions & 1 deletion EXAMPLE/pzlinsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ main(int argc, char *argv[])
trans_t trans;
doublecomplex *xact, *rhs;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *procs, int_t *n,
int_t *b, int_t *w, int_t *r, int_t *maxsup);

nrhs = 1;
trans = NOTRANS;
Expand Down
4 changes: 3 additions & 1 deletion EXAMPLE/pzlinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
5 changes: 3 additions & 2 deletions EXAMPLE/pzlinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();

void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);
/* Default parameters to control factorization. */
nprocs = 1;
fact = EQUILIBRATE;
Expand Down
4 changes: 3 additions & 1 deletion EXAMPLE/pzlinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ main(int argc, char *argv[])
double *ferr, *berr;
double u, drop_tol, rpg, rcond;
superlu_memusage_t superlu_memusage;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs, int_t *lwork,
int_t *w, int_t *relax, double *u, fact_t *fact,
trans_t *trans, yes_no_t *refact, equed_t *equed);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pzrepeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ main(int argc, char *argv[])
doublecomplex *rhsb, *xact;
Gstat_t Gstat;
flops_t flopcnt;
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/pzspmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ main(int argc, char *argv[])
pthread_t *thread_id;
void *status;
#endif
void parse_command_line();
void parse_command_line(int argc, char *argv[], int_t *nprocs);

/* Default parameters to control factorization. */
nprocs = 1;
Expand Down
4 changes: 4 additions & 0 deletions SRC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ elseif (PLAT STREQUAL "_OPENMP")
target_link_libraries (superlu_mt${PLAT} PRIVATE OpenMP::OpenMP_C)
endif ()

if (LONGINT)
target_compile_definitions (superlu_mt${PLAT} PUBLIC _LONGINT)
endif ()

target_include_directories (superlu_mt${PLAT} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (superlu_mt${PLAT} INTERFACE $<INSTALL_INTERFACE:include>)
install (TARGETS superlu_mt${PLAT} DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand Down
4 changes: 2 additions & 2 deletions SRC/creadmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ creadmt(int_t *m, int_t *n, int_t *nonz, complex **nzval, int_t **rowind, int_t
int lasta;
char title[TLEN];
complex *a;
int *asub;
int *xa;
int_t *asub;
int_t *xa;

/* Matrix format:
* up to 60 characters title
Expand Down
4 changes: 2 additions & 2 deletions SRC/dreadmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ dreadmt(int_t *m, int_t *n, int_t *nonz, double **nzval, int_t **rowind, int_t *
int lasta;
char title[TLEN];
double *a;
int *asub;
int *xa;
int_t *asub;
int_t *xa;

/* Matrix format:
* up to 60 characters title
Expand Down
2 changes: 1 addition & 1 deletion SRC/slu_mt_cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ extern int_t Glu_alloc (const int_t, const int_t, const int_t, const MemType,
-------------------*/
extern double SuperLU_timer_();
extern int_t sp_ienv(int_t);
extern double slamch_();
extern double slamch_(char *);
extern int lsame_(char *, char *);
extern int xerbla_(char *, int *);
extern void superlu_abort_and_exit(char *);
Expand Down
2 changes: 1 addition & 1 deletion SRC/slu_mt_ddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ extern int_t Glu_alloc (const int_t, const int_t, const int_t, const MemType,
-------------------*/
extern double SuperLU_timer_();
extern int_t sp_ienv(int_t);
extern double dlamch_();
extern double dlamch_(char *);
extern int lsame_(char *, char *);
extern int xerbla_(char *, int *);
extern void superlu_abort_and_exit(char *);
Expand Down
2 changes: 1 addition & 1 deletion SRC/slu_mt_sdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ extern int_t Glu_alloc (const int_t, const int_t, const int_t, const MemType,
-------------------*/
extern double SuperLU_timer_();
extern int_t sp_ienv(int_t);
extern double slamch_();
extern double slamch_(char *);
extern int lsame_(char *, char *);
extern int xerbla_(char *, int *);
extern void superlu_abort_and_exit(char *);
Expand Down
2 changes: 1 addition & 1 deletion SRC/slu_mt_zdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ extern int_t Glu_alloc (const int_t, const int_t, const int_t, const MemType,
-------------------*/
extern double SuperLU_timer_();
extern int_t sp_ienv(int_t);
extern double dlamch_();
extern double dlamch_(char *);
extern int lsame_(char *, char *);
extern int xerbla_(char *, int *);
extern void superlu_abort_and_exit(char *);
Expand Down
4 changes: 2 additions & 2 deletions SRC/sreadmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ sreadmt(int_t *m, int_t *n, int_t *nonz, float **nzval, int_t **rowind, int_t **
int lasta;
char title[TLEN];
float *a;
int *asub;
int *xa;
int_t *asub;
int_t *xa;

/* Matrix format:
* up to 60 characters title
Expand Down
Loading

0 comments on commit 9e23fe7

Please sign in to comment.