/[escript]/trunk/paso/src/SystemMatrixPattern.cpp
ViewVC logotype

Contents of /trunk/paso/src/SystemMatrixPattern.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6034 - (show annotations)
Wed Mar 9 00:37:57 2016 UTC (2 years, 8 months ago) by caltinay
File size: 4424 byte(s)
a few changes to GroupTest / utest:
GroupTest class now takes a name parameter that is used as (shell) function
name in utest for the test group.
By default all tests are run as before but one can now do:
./utest.sh build '-t2' escriptcpp
to only run the escript c++ unit tests.
Also tweaked a couple things so utest.sh does now work with dash.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************/
19
20 /* Paso: SystemMatrixPattern */
21
22 /****************************************************************************/
23
24 /* Author: Lutz Gross, l.gross@uq.edu.au */
25
26 /****************************************************************************/
27
28 #include "Paso.h"
29 #include "SystemMatrixPattern.h"
30
31 namespace paso {
32
33 SystemMatrixPattern::SystemMatrixPattern(int patType, Distribution_ptr outDist,
34 Distribution_ptr inDist, Pattern_ptr mainPat, Pattern_ptr colPat,
35 Pattern_ptr rowPat, Connector_ptr colConn, Connector_ptr rowConn) :
36 type(patType),
37 mainPattern(mainPat),
38 col_couplePattern(colPat),
39 row_couplePattern(rowPat),
40 col_connector(colConn),
41 row_connector(rowConn),
42 output_distribution(outDist),
43 input_distribution(inDist)
44 {
45 std::stringstream ss;
46
47 if (outDist->mpi_info != inDist->mpi_info) {
48 ss << "SystemMatrixPattern: output distribution and input distribution MPI communicators don't match.";
49 } else if (outDist->mpi_info != colConn->mpi_info) {
50 ss << "SystemMatrixPattern: output distribution and col connector MPI communicators don't match.";
51 } else if (outDist->mpi_info != rowConn->mpi_info) {
52 ss << "SystemMatrixPattern: output distribution and row connector MPI communicators don't match.";
53 } else if (mainPat->type != patType) {
54 ss << "SystemMatrixPattern: type of mainPattern (" << mainPat->type
55 << ") does not match expected type (" << patType << ")";
56 } else if (colPat->type != patType) {
57 ss << "SystemMatrixPattern: type of col couplePattern (" << colPat->type
58 << ") does not match expected type (" << patType << ")";
59 } else if (rowPat->type != patType) {
60 ss << "SystemMatrixPattern: type of row couplePattern (" << rowPat->type
61 << ") does not match expected type (" << patType << ")";
62 } else if (colPat->numOutput != mainPat->numOutput) {
63 ss << "SystemMatrixPattern: number of outputs for couple and main "
64 "pattern don't match: " << colPat->numOutput << " != "
65 << mainPat->numOutput;
66 } else if (mainPat->numOutput != outDist->getMyNumComponents()) {
67 ss << "SystemMatrixPattern: number of outputs and given distribution "
68 "don't match: " << mainPat->numOutput << " != "
69 << outDist->getMyNumComponents();
70 } else if (mainPat->numInput != inDist->getMyNumComponents()) {
71 ss << "SystemMatrixPattern: number of input for main pattern and "
72 "number of send components in connector don't match: "
73 << mainPat->numInput << " != " << inDist->getMyNumComponents();
74 } else if (colPat->numInput != colConn->recv->numSharedComponents) {
75 ss << "SystemMatrixPattern: number of inputs for column couple pattern"
76 " and number of received components in connector don't match: "
77 << colPat->numInput << " != " << colConn->recv->numSharedComponents;
78 } else if (rowPat->numOutput != rowConn->recv->numSharedComponents) {
79 ss << "SystemMatrixPattern: number of inputs for row couple pattern "
80 "and number of received components in connector don't match: "
81 << rowPat->numOutput << " != " << rowConn->recv->numSharedComponents;
82 }
83 const std::string msg(ss.str());
84 int error = msg.length(); // proxy for error condition
85 int gerror = error;
86 escript::checkResult(error, gerror, outDist->mpi_info);
87 if (gerror > 0) {
88 char* gmsg;
89 escript::shipString(msg.c_str(), &gmsg, outDist->mpi_info->comm);
90 std::string realmsg(error? msg : gmsg);
91 //throw PasoException(realmsg);
92 }
93 std::cerr << msg << std::endl;
94
95 mpi_info = outDist->mpi_info;
96 }
97
98 } // namespace paso
99
100

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/4.0fordebian/paso/src/SystemMatrixPattern.cpp:5567-5588 /branches/amg_from_3530/paso/src/SystemMatrixPattern.cpp:3531-3826 /branches/lapack2681/paso/src/SystemMatrixPattern.cpp:2682-2741 /branches/pasowrap/paso/src/SystemMatrixPattern.cpp:3661-3674 /branches/py3_attempt2/paso/src/SystemMatrixPattern.cpp:3871-3891 /branches/restext/paso/src/SystemMatrixPattern.cpp:2610-2624 /branches/ripleygmg_from_3668/paso/src/SystemMatrixPattern.cpp:3669-3791 /branches/stage3.0/paso/src/SystemMatrixPattern.cpp:2569-2590 /branches/symbolic_from_3470/paso/src/SystemMatrixPattern.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/paso/src/SystemMatrixPattern.cpp:3517-3974 /release/3.0/paso/src/SystemMatrixPattern.cpp:2591-2601 /release/4.0/paso/src/SystemMatrixPattern.cpp:5380-5406 /trunk/paso/src/SystemMatrixPattern.cpp:4257-4344 /trunk/ripley/test/python/paso/src/SystemMatrixPattern.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26