0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 if ~isfield(dkeparam,'opsplit'),dkeparam.opsplit = 0;end
0021
0022 if dkeparam.opsplit == 0,
0023 A_MUMPSMEX = MMXPC_f_t;
0024 B_MUMPSMEX = MMXR_t;
0025
0026 if job_MUMPSMEX == 1,
0027 id_MUMPSMEX = initmumps;
0028 id_MUMPSMEX = dmumps(id_MUMPSMEX);
0029 id_MUMPSMEX.ICNTL(1:4) = [6,0,0,1];
0030 id_MUMPSMEX.JOB = job_MUMPSMEX;
0031 id_MUMPSMEX = dmumps(id_MUMPSMEX,A_MUMPSMEX);
0032 if isfield(dkeparam.MUMPSparam,'thresholdpivoting'),
0033 if ~isempty(dkeparam.MUMPSparam.thresholdpivoting) | ~isnan(dkeparam.MUMPSparam.thresholdpivoting),
0034 id_MUMPSMEX.CNTL(1) = dkeparam.MUMPSparam.thresholdpivoting;
0035 end
0036 end
0037 if isfield(dkeparam.MUMPSparam,'precinv'),
0038 if ~isempty(dkeparam.MUMPSparam.precinv) | ~isnan(dkeparam.MUMPSparam.precinv),
0039 id_MUMPSMEX.CNTL(2) = dkeparam.MUMPSparam.precinv;
0040 end
0041 end
0042 elseif job_MUMPSMEX == 2,
0043 id_MUMPSMEX.JOB = job_MUMPSMEX;
0044 id_MUMPSMEX = dmumps(id_MUMPSMEX,A_MUMPSMEX);
0045 if id_MUMPSMEX.INFOG(1) == -13,
0046 error('Error in a Fortran ALLOCATE statement in MUMPS factorization. Try reducing the problem size (grid size)');
0047 end
0048 elseif job_MUMPSMEX == 3 | job_MUMPSMEX == 6,
0049 id_MUMPSMEX.JOB = job_MUMPSMEX;
0050 id_MUMPSMEX.RHS = full(B_MUMPSMEX);
0051 id_MUMPSMEX = dmumps(id_MUMPSMEX,A_MUMPSMEX);
0052 if(norm(A_MUMPSMEX*id_MUMPSMEX.SOL - id_MUMPSMEX.RHS,'inf') > sqrt(eps))
0053 warning('Precision of the matrix inversion may not be OK (MUMPSMEX). Try to increase the dkeparam.MUMPSparam.thresholdpivoting parameters (see MUMPS documentation).');
0054 end
0055 X_MUMPSMEX = id_MUMPSMEX.SOL;
0056 flag_MUMPSMEX = 0;
0057 elseif job_MUMPSMEX == -2,
0058 id_MUMPSMEX.JOB = job_MUMPSMEX;
0059 id_MUMPSMEX = dmumps(id_MUMPSMEX);
0060 end
0061 elseif dkeparam.opsplit >= 1,
0062 if mode_MUMPSMEX,
0063 A_MUMPSMEX = MMXPC_P_f_t;
0064 B_MUMPSMEX = MMXR_t;
0065
0066 if job_MUMPSMEX == 1,
0067 id_MUMPSMEX_P = initmumps;
0068 id_MUMPSMEX_P = dmumps(id_MUMPSMEX_P);
0069 id_MUMPSMEX_P.ICNTL(1:4) = [6,0,0,1];
0070 id_MUMPSMEX_P.JOB = job_MUMPSMEX;
0071 id_MUMPSMEX_P = dmumps(id_MUMPSMEX_P,A_MUMPSMEX);
0072 if isfield(dkeparam.MUMPSparam,'thresholdpivoting'),
0073 if ~isempty(dkeparam.MUMPSparam.thresholdpivoting) | ~isnan(dkeparam.MUMPSparam.thresholdpivoting),
0074 id_MUMPSMEX_P.CNTL(1) = dkeparam.MUMPSparam.thresholdpivoting;
0075 end
0076 end
0077 if isfield(dkeparam.MUMPSparam,'precinv'),
0078 if ~isempty(dkeparam.MUMPSparam.precinv) | ~isnan(dkeparam.MUMPSparam.precinv),
0079 id_MUMPSMEX_P.CNTL(2) = dkeparam.MUMPSparam.precinv;
0080 end
0081 end
0082 elseif job_MUMPSMEX == 2,
0083 id_MUMPSMEX_P.JOB = job_MUMPSMEX;
0084 id_MUMPSMEX_P = dmumps(id_MUMPSMEX_P,A_MUMPSMEX);
0085 if id_MUMPSMEX_P.INFOG(1) == -13,
0086 error('Error in a Fortran ALLOCATE statement in MUMPS factorization. Try reducing the problem size (grid size)');
0087 end
0088 elseif job_MUMPSMEX == 3 | job_MUMPSMEX == 6,
0089 id_MUMPSMEX_P.JOB = job_MUMPSMEX;
0090 id_MUMPSMEX_P.RHS = full(B_MUMPSMEX);
0091 id_MUMPSMEX_P = dmumps(id_MUMPSMEX_P,A_MUMPSMEX);
0092 if(norm(A_MUMPSMEX*id_MUMPSMEX_P.SOL - id_MUMPSMEX_P.RHS,'inf') > sqrt(eps))
0093 warning('Precision of the matrix inversion may not be OK (MUMPSMEX). Try to increase the dkeparam.MUMPSparam.thresholdpivoting parameters (see MUMPS documentation).');
0094 end
0095 X_MUMPSMEX = id_MUMPSMEX_P.SOL;
0096 flag_MUMPSMEX = 0;
0097 elseif job_MUMPSMEX == -2,
0098 id_MUMPSMEX_P.JOB = job_MUMPSMEX;
0099 id_MUMPSMEX_P = dmumps(id_MUMPSMEX_P);
0100 end
0101 else
0102 A_MUMPSMEX = MMXPC_R_f_t;
0103 B_MUMPSMEX = MMXR_t;
0104
0105 if job_MUMPSMEX == 1,
0106 id_MUMPSMEX_R = initmumps;
0107 id_MUMPSMEX_R = dmumps(id_MUMPSMEX_R);
0108 id_MUMPSMEX_R.ICNTL(1:4) = [6,0,0,1];
0109 id_MUMPSMEX_R.JOB = job_MUMPSMEX;
0110 id_MUMPSMEX_R = dmumps(id_MUMPSMEX_R,A_MUMPSMEX);
0111 if isfield(dkeparam.MUMPSparam,'thresholdpivoting'),
0112 if ~isempty(dkeparam.MUMPSparam.thresholdpivoting) | ~isnan(dkeparam.MUMPSparam.thresholdpivoting),
0113 id_MUMPSMEX_R.CNTL(1) = dkeparam.MUMPSparam.thresholdpivoting;
0114 end
0115 end
0116 if isfield(dkeparam.MUMPSparam,'precinv'),
0117 if ~isempty(dkeparam.MUMPSparam.precinv) | ~isnan(dkeparam.MUMPSparam.precinv),
0118 id_MUMPSMEX_R.CNTL(2) = dkeparam.MUMPSparam.precinv;
0119 end
0120 end
0121 elseif job_MUMPSMEX == 2,
0122 id_MUMPSMEX_R.JOB = job_MUMPSMEX;
0123 id_MUMPSMEX_R = dmumps(id_MUMPSMEX_R,A_MUMPSMEX);
0124 if id_MUMPSMEX_R.INFOG(1) == -13,
0125 error('Error in a Fortran ALLOCATE statement in MUMPS factorization. Try reducing the problem size (grid size)');
0126 end
0127 elseif job_MUMPSMEX == 3 | job_MUMPSMEX == 6,
0128 id_MUMPSMEX_R.JOB = job_MUMPSMEX;
0129 id_MUMPSMEX_R.RHS = full(B_MUMPSMEX);
0130 id_MUMPSMEX_R = dmumps(id_MUMPSMEX_R,A_MUMPSMEX);
0131 if(norm(A_MUMPSMEX*id_MUMPSMEX_R.SOL - id_MUMPSMEX_R.RHS,'inf') > sqrt(eps))
0132 warning('Precision of the matrix inversion may not be OK (MUMPSMEX). Try to increase the dkeparam.MUMPSparam.thresholdpivoting parameters (see MUMPS documentation).');
0133 end
0134 X_MUMPSMEX = id_MUMPSMEX_R.SOL;
0135 flag_MUMPSMEX = 0;
0136 elseif job_MUMPSMEX == -2,
0137 id_MUMPSMEX_R.JOB = job_MUMPSMEX;
0138 id_MUMPSMEX_R = dmumps(id_MUMPSMEX_R);
0139 end
0140 end
0141 end
0142
0143
0144