40{
41#endif
47 double a[2];
48 double rhs[2];
49
51
52
53
55#if defined(MAIN_COMP)
57#endif
60
61 rhs[0]=1.0;rhs[1]=4.0;
62 a[0]=1.0;a[1]=2.0;
63
64
66 id_save.
par=1; id_save.
sym=0;
69
70 if (myid == 0) {
71 id_save.
n =
n; id_save.
nnz =nnz; id_save.
irn=irn; id_save.
jcn=jcn;
73 }
74#define ICNTL(I) icntl[(I)-1]
75
76 id_save.ICNTL(1)=-1; id_save.ICNTL(2)=-1;
77 id_save.ICNTL(3)=-1; id_save.ICNTL(4)=0;
78
81
82
85 if (myid == 0) {
86 printf("Saving MUMPS instance in %s with prefix %s.\n",
88 }
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) {
96 printf(" DONE\n\n");
97 }
98
99
102
103
104
105 if (!error) {
106
108 id_restore.
par=1; id_restore.
sym=0;
111
112 if (myid == 0) {
113 id_restore.
rhs = rhs;
114 }
115
116
117 id_save.ICNTL(1)=-1; id_save.ICNTL(2)=-1;
118 id_save.ICNTL(3)=-1; id_save.ICNTL(4)=0;
119
120
121 if (myid == 0) {
122 printf("Restoring MUMPS instance in %s with prefix %s.\n",
124 }
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) {
134 printf(" DONE\n\n");
135 }
136 }
137
138 if (!error) {
139
140 if (myid == 0) {
141 printf("Calling MUMPS package (solve).\n");
142 }
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) {
150 printf(" DONE\n\n");
151 }
152
153
154 if (myid == 0) {
155 printf("Removing save files.\n");
156 }
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) {
164 printf(" DONE\n\n");
165 }
166
167
170 }
171
172 if (myid == 0) {
173 if (!error) {
174 printf("Solution is : (%8.2f %8.2f)\n", rhs[0],rhs[1]);
175 } else {
176 printf("An error has occured, please check error code returned by MUMPS.\n");
177 }
178 }
180 return 0;
181}
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)
integer, save, private myid