diff --git a/Makefile b/Makefile index 000cffe96ce8084a450344e766e84987cd24101d..97a7a75034aa2ae8fcca69f7e21cb85b4e42ebf3 100644 --- a/Makefile +++ b/Makefile @@ -5,20 +5,20 @@ TOOL_DIR=/usr/bin -CC=$(TOOL_DIR)/g++ # Compiling with mpicc for now -#CC=$(TOOL_DIR)/clang # Compiling with mpicc for now +#COMPILERS +CC=$(TOOL_DIR)/g++ +ifeq($(CC),"clang") + CC=$(TOOL_DIR)/clang +endif MPICC=$(TOOL_DIR)/mpic++ - AR=$(TOOL_DIR)/ar #FLAGS CFLAGS=-c -Wall -O0 -g -Wpedantic -std=c++11 - #INCLUDE FILES ADIOS_INC=-I./include - INCLUDE=$(ADIOS_INC) #Build Header Dependencies, if one changes it will rebuild @@ -36,32 +36,32 @@ NoMPI_ObjFiles=$(patsubst ./src/nompi/transport/%.cpp, ./bin/%.o, $(NoMPI_CPPFil Common_CPPFiles=$(wildcard ./src/*.cpp) Common_ObjFiles=$(patsubst ./src/%.cpp, ./bin/%.o, $(Common_CPPFiles)) - +NoMPI_Common_ObjFiles=$(patsubst ./src/%.cpp, ./bin/%_nompi.o, $(Common_CPPFiles)) # use for nompi ObjFiles=$(MPI_ObjFiles) $(NoMPI_ObjFiles) #Build all MPI and noMPI all: $(MPI_ObjFiles) $(NoMPI_ObjFiles) $(Common_ObjFiles) $(HFiles) - $(AR) rcs ./lib/libadios.a $(MPI_ObjFiles) $(NoMPI_ObjFiles) ./bin/ADIOS.o ./bin/ADIOSFunctions.o ./bin/CGroup.o - -#MPI build -mpi: $(MPI_ObjFiles) $(Common_ObjFiles) $(MPI_HFiles) $(Local_HFiles) - $(AR) rcs ./lib/libadios.a $(MPI_ObjFiles) ./bin/ADIOS.o ./bin/ADIOSFunctions.o ./bin/CGroup.o - -./bin/%.o: ./src/mpi/transport/%.cpp - $(MPICC) $(CFLAGS) -DHAVE_MPI $(INCLUDE) -o $@ $< - -./bin/%.o: ./src/%.cpp - $(MPICC) $(CFLAGS) -DHAVE_MPI $(INCLUDE) -o $@ $< + $(AR) rcs ./lib/libadios.a $(MPI_ObjFiles) $(NoMPI_ObjFiles) $(Common_ObjFiles) #NoMPI build -nompi: $(NoMPI_ObjFiles) $(Common_ObjFiles) $(NoMPI_HFiles) $(Local_HFiles) - $(AR) rcs ./lib/libadios_nompi.a $(NoMPI_ObjFiles) $(Common_ObjFiles) +nompi: $(NoMPI_ObjFiles) $(NoMPI_Common_ObjFiles) $(NoMPI_HFiles) $(Local_HFiles) + $(AR) rcs ./lib/libadios_nompi.a $(NoMPI_ObjFiles) $(NoMPI_Common_ObjFiles) ./bin/%.o: ./src/nompi/transport/%.cpp $(NoMPI_HFiles) $(Local_HFiles) $(CC) $(CFLAGS) $(INCLUDE) -o $@ $< - + +./bin/%_nompi.o: ./src/%.cpp $(NoMPI_HFiles) $(Local_HFiles) + $(CC) $(CFLAGS) $(INCLUDE) -o $@ $< + + +clean_nompi: + rm ./bin/*_nompi.o ./lib/libadios_nompi.a + +clean_mpi: + rm ./bin/*.o ./lib/libadios.a + clean: rm ./bin/*.o ./lib/libadios.a ./lib/libadios_nompi.a diff --git a/doc/Doxyfile b/doc/Doxyfile index f4d1ec3b47db2fba41564eb41788dace1d61b98a..a6c11c1bd6b9cdbc80581969500638e2636a15cf 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2424,4 +2424,4 @@ GENERATE_LEGEND = YES # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_CLEANUP = YES +DOT_CLEANUP = NO diff --git a/examples/hello/helloADIOS.cpp b/examples/hello/helloADIOS.cpp index 56acfe785f38a77ca79358a9cc8a2c5c68b279b3..547a2e18fad51e819389cd3e8d7c9b023f60a09a 100644 --- a/examples/hello/helloADIOS.cpp +++ b/examples/hello/helloADIOS.cpp @@ -10,25 +10,36 @@ #include <stdexcept> #include <mpi.h> #include <iostream> +#include <fstream> +#include <string> #include "ADIOS.h" int main( int argc, char* argv [] ) { + MPI_Init( &argc, &argv ); + int rank; + MPI_Comm_rank( MPI_COMM_WORLD, &rank ); + try { - MPI_Init( &argc, &argv ); - //testing with CPOSIXMPI adios::ADIOS adiosFile( "writer.xml", MPI_COMM_WORLD ); adiosFile.Init( ); - MPI_Barrier( MPI_COMM_WORLD ); + //Get Monitor info + std::ofstream logStream( "info_" + std::to_string(rank) + ".log" ); + adiosFile.MonitorGroups( logStream ); + + MPI_Barrier( MPI_COMM_WORLD ); } catch( std::exception& e ) //need to think carefully how to handle C++ exceptions with MPI to avoid deadlocking { - std::cout << e.what() << "\n"; + if( rank == 0 ) + { + std::cout << e.what() << "\n"; + } } MPI_Finalize( ); diff --git a/include/ADIOS.h b/include/ADIOS.h index 825bb0dbe88b4b0b105093c500dd7121b7f1b147..f60bea7f436c2d3622777e08dfc9ca65698bd21e 100644 --- a/include/ADIOS.h +++ b/include/ADIOS.h @@ -8,9 +8,11 @@ #ifndef ADIOS_H_ #define ADIOS_H_ +/// \cond #include <string> #include <memory> #include <ostream> +/// \endcond /// #ifdef HAVE_MPI #include <mpi.h> diff --git a/include/ADIOSFunctions.h b/include/ADIOSFunctions.h index 5b57869fa48d3d9e3359d3a0140f34b54eb5bd70..58eb9949c07727d10cc91adfe3cef7bbd96d393c 100644 --- a/include/ADIOSFunctions.h +++ b/include/ADIOSFunctions.h @@ -8,9 +8,12 @@ #ifndef ADIOSFUNCTIONS_H_ #define ADIOSFUNCTIONS_H_ +/// \cond #include <string> #include <vector> #include <map> +/// \endcond + #ifdef HAVE_MPI #include <mpi.h> //Just for MPI_Comm argument in SetMembersMPI diff --git a/include/CGroup.h b/include/CGroup.h index 018a021df1a6e2bd2ff84b7c89504508765b923b..8d194e30f496d465a106a9714b19f6b4a2f42f6e 100644 --- a/include/CGroup.h +++ b/include/CGroup.h @@ -8,11 +8,13 @@ #ifndef CGROUP_H_ #define CGROUP_H_ +/// \cond #include <map> #include <string> #include <memory> //for shared_pointer #include <vector> #include <ostream> +/// \endcond #ifdef HAVE_MPI #include <mpi.h> //for MPI_Comm in overloaded SetTransform diff --git a/include/CTransport.h b/include/CTransport.h index 63de67c57798cb417a321846545837abb359e9a0..b29f2a1d8d71291324760f2f82e52d2bcfaf7d2b 100644 --- a/include/CTransport.h +++ b/include/CTransport.h @@ -8,7 +8,9 @@ #ifndef CTRANSPORT_H_ #define CTRANSPORT_H_ +///cond #include <string> +///endcond #include "CVariable.h" diff --git a/include/CVariable.h b/include/CVariable.h index 5344f3833fd2b31e2ad59531c2b0bc53f0bd6e1a..f15192840ae2610014afc650345bf8d59c5c0122 100644 --- a/include/CVariable.h +++ b/include/CVariable.h @@ -8,11 +8,12 @@ #ifndef CVARIABLE_H_ #define CVARIABLE_H_ +///cond #include <string> #include <vector> #include <typeinfo> // for typeid #include <sstream> - +///endcond namespace adios { diff --git a/src/ADIOS.cpp b/src/ADIOS.cpp index a2b55debaec5651ad272dead558a67f906151c93..91a471fbb3b3ef177f651992689b594de025aeee 100644 --- a/src/ADIOS.cpp +++ b/src/ADIOS.cpp @@ -18,7 +18,7 @@ namespace adios { -//here assign default values of non-primitives + ADIOS::ADIOS( ) { } @@ -36,14 +36,13 @@ ADIOS::ADIOS( const std::string xmlConfigFile, const MPI_Comm mpiComm ): { } #endif + ADIOS::~ADIOS( ) { } void ADIOS::Init( ) { - std::cout << "Just testing the Init Function\n"; - if( m_IsUsingMPI == false && m_XMLConfigFile.empty() == false ) { InitNoMPI( ); @@ -68,8 +67,9 @@ void ADIOS::InitNoMPI( ) #ifdef HAVE_MPI void ADIOS::InitMPI( ) { - int rank; + int rank, size; MPI_Comm_rank( m_MPIComm, &rank ); + MPI_Comm_size( m_MPIComm, &size ); int xmlFileContentSize; // common std::string xmlFileContent; @@ -78,9 +78,9 @@ void ADIOS::InitMPI( ) { std::string xmlFileContent; DumpFileToStream( m_XMLConfigFile, xmlFileContent ); //in ADIOSFunctions.h dumps all XML Config File to xmlFileContent - xmlFileContentSize = m_XMLConfigFile.size( ) + 1; // add one for the null character + xmlFileContentSize = xmlFileContent.size( ) + 1; // add one for the null character - MPI_Bcast( &xmlFileContentSize, 1, MPI_INT, 0, m_MPIComm ); //broadcast size + MPI_Bcast( &xmlFileContentSize, 1, MPI_INT, 0, m_MPIComm ); //broadcast size for allocation MPI_Bcast( (char*)xmlFileContent.c_str(), xmlFileContentSize, MPI_CHAR, 0, m_MPIComm ); SetMembers( xmlFileContent, m_HostLanguage, m_Groups ); @@ -119,6 +119,7 @@ void ADIOS::MonitorGroups( std::ostream& logStream ) const } } + void ADIOS::CheckGroup( const std::string groupName ) { auto it = m_Groups.find( groupName ); @@ -126,8 +127,4 @@ void ADIOS::CheckGroup( const std::string groupName ) } - } //end namespace - - - diff --git a/src/ADIOSFunctions.cpp b/src/ADIOSFunctions.cpp index e83428196cdaa3ce9d81fd5150672466d7b16232..ae458f21dcab633f9ace2a31fe95d9387cecb146 100644 --- a/src/ADIOSFunctions.cpp +++ b/src/ADIOSFunctions.cpp @@ -5,10 +5,12 @@ * Author: wfg */ +///cond #include <fstream> #include <sstream> #include <stdexcept> #include <iostream> +///endcond #include "ADIOSFunctions.h" #include "SSupport.h" diff --git a/src/CGroup.cpp b/src/CGroup.cpp index dcb47db68646ef5575f31d5473d879b0460fd9f8..effe3131f7e070d95ca4d221ecb774bc59f2496a 100644 --- a/src/CGroup.cpp +++ b/src/CGroup.cpp @@ -107,13 +107,21 @@ void CGroup::SetTransport( const std::string method, const unsigned int priority void CGroup::Monitor( std::ostream& logStream ) const { + logStream << "\tVariable \t Type\n"; for( auto& variablePair : m_Variables ) { - logStream << "VarName:..." << variablePair.first << " Type:..." << variablePair.second->m_Type << "\n"; + logStream << "\t" << variablePair.first << " \t " << variablePair.second->m_Type << "\n"; } - logStream << "Transport Method " << m_ActiveTransport << "\n"; - logStream << std::ostream::boolalpha << "Transport Method Unique?: " << m_Transport.unique() << "\n"; + logStream << "\tAttribute \t Type \t Value \n"; + for( auto& attribute : m_Attributes ) + { + logStream << "\t" << attribute.Name << " \t " << attribute.Type << " \t " << attribute.Value << "\n"; + } + + + logStream << "\tTransport Method " << m_ActiveTransport << "\n"; + logStream << "\tIs Transport Method Unique?: " << std::boolalpha << m_Transport.unique() << "\n"; }