18#define USE_COMM_WORLD -987654
36 char *
name =
"c_example_save_restore";
39int main(
int argc,
char ** argv)
61 rhs[0]=1.0;rhs[1]=4.0;
66 id_save.
par=1; id_save.
sym=0;
71 id_save.
n =
n; id_save.
nnz =nnz; id_save.
irn=irn; id_save.
jcn=jcn;
74#define ICNTL(I) icntl[(I)-1]
76 id_save.ICNTL(1)=-1; id_save.ICNTL(2)=-1;
77 id_save.ICNTL(3)=-1; id_save.ICNTL(4)=0;
86 printf(
"Saving MUMPS instance in %s with prefix %s.\n",
91 if (id_save.
infog[0]<0) {
92 printf(
"\n (PROC %d) ERROR RETURN: \tINFOG(1)= %d\n\t\t\t\tINFOG(2)= %d\n",
95 }
else if (myid == 0) {
108 id_restore.
par=1; id_restore.
sym=0;
113 id_restore.
rhs = rhs;
117 id_save.ICNTL(1)=-1; id_save.ICNTL(2)=-1;
118 id_save.ICNTL(3)=-1; id_save.ICNTL(4)=0;
122 printf(
"Restoring MUMPS instance in %s with prefix %s.\n",
129 if (id_save.
infog[0]<0) {
130 printf(
"\n (PROC %d) ERROR RETURN: \tINFOG(1)= %d\n\t\t\t\tINFOG(2)= %d\n",
133 }
else if (myid == 0) {
141 printf(
"Calling MUMPS package (solve).\n");
145 if (id_save.
infog[0]<0) {
146 printf(
"=> (PROC %d) ERROR RETURN: \tINFOG(1)= %d\n\t\t\t\tINFOG(2)= %d\n",
149 }
else if (myid == 0) {
155 printf(
"Removing save files.\n");
159 if (id_save.
infog[0]<0) {
160 printf(
"=> (PROC %d) ERROR RETURN: \tINFOG(1)= %d\n\t\t\t\tINFOG(2)= %d\n",
163 }
else if (myid == 0) {
174 printf(
"Solution is : (%8.2f %8.2f)\n", rhs[0],rhs[1]);
176 printf(
"An error has occured, please check error code returned by MUMPS.\n");
void MUMPS_CALL dmumps_c(DMUMPS_STRUC_C *dmumps_par)
LIBSEQ_INT LIBSEQ_CALL MPI_Comm_rank(LIBSEQ_INT comm, LIBSEQ_INT *rank)
LIBSEQ_INT LIBSEQ_CALL MPI_Finalize(void)
static MPI_Comm MPI_COMM_WORLD
LIBSEQ_INT LIBSEQ_CALL MPI_Init(LIBSEQ_INT *pargc, char ***pargv)