Commit c4c5f7b1 authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Merge branch 'mpi-explosive' of geraldine.fjfi.cvut.cz:/local/projects/tnl/tnl into mpi-explosive

Conflicts:
	src/TNL/Communicators/MpiCommunicator.h
parents a27e4875 ac2693cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ set( headers
     StaticFor.h
     String.h
     Timer.h
     terminal-colors.h
     UniquePointer.h )

set( common_SOURCES
+11 −11
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class MpiCommunicator
      static bool isDistributed()
      {
         return GetSize(AllGroup)>1;
      };
      }

      static void configSetup( Config::ConfigDescription& config, const String& prefix = "" )
      {
@@ -125,7 +125,7 @@ class MpiCommunicator
            }
         }
#endif
      };
      }

      static void Finalize()
      {
@@ -140,7 +140,7 @@ class MpiCommunicator
         }
         MPI_Finalize();
#endif
      };
      }

      static bool IsInitialized()
      {
@@ -152,7 +152,7 @@ class MpiCommunicator
#else
        return false;
#endif
      };
      }

      static int GetRank(CommunicationGroup group)
      {
@@ -164,7 +164,7 @@ class MpiCommunicator
#else
        return 1;
#endif
      };
      }

      static int GetSize(CommunicationGroup group)
      {
@@ -176,7 +176,7 @@ class MpiCommunicator
#else
        return 1;
#endif
      };
      }

        //dim-number of dimesions, distr array of guess distr - 0 for computation
        //distr array will be filled by computed distribution
@@ -201,7 +201,7 @@ class MpiCommunicator

            MPI_Dims_create(nproc, dim, distr);
#endif
        };
        }

         static void Barrier(CommunicationGroup comm)
         {
@@ -211,7 +211,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }

         template <typename T>
         static Request ISend( const T *data, int count, int dest, CommunicationGroup group)
@@ -247,7 +247,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }

        template< typename T > 
        static void Bcast(  T& data, int count, int root,CommunicationGroup group)
@@ -272,7 +272,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }


         template< typename T >
@@ -288,7 +288,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }


      static void writeProlog( Logger& logger ) 
+8 −8
Original line number Diff line number Diff line
@@ -53,22 +53,22 @@ class NoDistrCommunicator
      static bool IsInitialized()
      {   
          return true;
      };
      }

      static bool isDistributed()
      {
          return false;
      };
      }

      static int GetRank(CommunicationGroup group)
      {
          return 0;
      };
      }

      static int GetSize(CommunicationGroup group)
      {
          return 1;
      };
      }

      static void DimsCreate(int nproc, int dim, int *distr)
      {
@@ -76,7 +76,7 @@ class NoDistrCommunicator
          {
              distr[i]=1;
          }
      };
      }

      static void Barrier(CommunicationGroup group)
      {
@@ -96,7 +96,7 @@ class NoDistrCommunicator

      static void WaitAll(Request *reqs, int length)
      {
      };
      }

      template< typename T > 
      static void Bcast(  T& data, int count, int root, CommunicationGroup group)
@@ -111,7 +111,7 @@ class NoDistrCommunicator
                             CommunicationGroup group )
      {
         memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) );
      };
      }

      template< typename T >
      static void Reduce( T* data,
@@ -122,7 +122,7 @@ class NoDistrCommunicator
                          CommunicationGroup group )
      {
         memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) );
      };
      }

      static void writeProlog( Logger& logger ){};
};
+30 −15
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                     if( aux ) f( cell ) = aux;
                  }
               }
            }
            if( profileOrientation == "y" )
            {
               if( p.x() < profileMesh.getOrigin().x() ||
@@ -114,6 +119,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                     if( aux ) f( cell ) = aux;
                  }
               }
            }            
            if( profileOrientation == "z" )
            {
               if( p.x() < profileMesh.getOrigin().x() ||
@@ -139,6 +149,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  }
               }
            }
         }
   String outputFile = parameters.getParameter< String >( "output-file" );
   if( ! f.save( outputFile ) )
   {