diff --git a/examples/hello/datamanWriter/Makefile b/examples/hello/datamanWriter/Makefile index e915be6bf9ae0cd5fafdb2efba35f90f47eab843..195afdfbf9c5c294e6d48bb403c0bc7770cc23c8 100644 --- a/examples/hello/datamanWriter/Makefile +++ b/examples/hello/datamanWriter/Makefile @@ -20,23 +20,24 @@ INC+= -I$(ADIOS_DIR)/include #DATAMAN DATAMAN_LOC=/home/wfg/Applications/DataMan INC+= -I$(DATAMAN_LOC)/include -LIB+= -L$(DATAMAN_LOC)/lib -lcacheman -lstreamman -lzmqman +LIB+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman +LIB_NOMPI+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman #COMPILER FLAGS CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11 #SYSTEM LIBS LIB+= -lpthread -LIB_NOMPI+= -lpthread +LIB_NOMPI+= -ldl -lpthread all: mpi nompi mpi: $(ADIOS_LIB) $(ADIOS_HFiles) - $(MPICC) $(CFLAGS) $(INC) -DHAVE_MPI $(BASE_NAME).cpp -o $(BASE_NAME).exe $(LIB) -lpthread + $(MPICC) $(CFLAGS) $(INC) -DHAVE_MPI $(BASE_NAME).cpp -o $(BASE_NAME).exe $(LIB) nompi: $(ADIOS_NOMPI_LIB) $(NoMPI_HFiles) - $(CC) $(CFLAGS) $(INC) $(BASE_NAME)_nompi.cpp -o $(BASE_NAME)_nompi.exe $(LIB_NOMPI) -lpthread + $(CC) $(CFLAGS) $(INC) $(BASE_NAME)_nompi.cpp -o $(BASE_NAME)_nompi.exe $(LIB_NOMPI) clean: rm *.exe; diff --git a/include/core/Engine.h b/include/core/Engine.h index 942cc8ae737890e7358cfeea946c4913633f2c69..e9c176cde782cdf8917da05c4dab5beed0126e68 100644 --- a/include/core/Engine.h +++ b/include/core/Engine.h @@ -233,6 +233,13 @@ protected: bool TransportNamesUniqueness( ) const; ///< checks if transport names are unique among the same types (file I/O) + + /** + * Throws an exception in debug mode if transport index is out of range. + * @param transportIndex must be in the range [ -1 , m_Transports.size()-1 ] + */ + void CheckTransportIndex( const int transportIndex ); + }; diff --git a/include/engine/bp/BPWriter.h b/include/engine/bp/BPWriter.h index 1e603c885c34394af4aabb0d8863956602e5dfd8..ce99908c675250dff927ed9f82024563195ba946 100644 --- a/include/engine/bp/BPWriter.h +++ b/include/engine/bp/BPWriter.h @@ -110,7 +110,7 @@ private: variable.m_AppValues = values; m_WrittenVariables.insert( variable.m_Name ); - //precalculate new metadata and payload sizes + //pre-calculate new metadata and payload sizes const std::size_t indexSize = m_BP1Writer.GetVariableIndexSize( variable ); const std::size_t payloadSize = variable.PayLoadSize(); //will change if compression is applied //Buffer reallocation, expensive part diff --git a/include/engine/dataman/DataManReader.h b/include/engine/dataman/DataManReader.h index ade638d4140e74bbd9f4aff9ea4bd3c5cf0a7154..3e4df180242bb499c031923d3b28b5b48c7ec1a2 100644 --- a/include/engine/dataman/DataManReader.h +++ b/include/engine/dataman/DataManReader.h @@ -16,7 +16,7 @@ //supported capsules #include "capsule/heap/STLVector.h" - +#include "DataManager.h" namespace adios { diff --git a/include/engine/dataman/DataManWriter.h b/include/engine/dataman/DataManWriter.h index 81c9fbb87618d60af1f0dcd0937fd0e283321215..d6b8851ce4c686faae20ff86d30b7b71eb41f361 100644 --- a/include/engine/dataman/DataManWriter.h +++ b/include/engine/dataman/DataManWriter.h @@ -18,7 +18,7 @@ #include "capsule/heap/STLVector.h" -#include "DataMan.h" //here comes your DataMan header +#include "DataManager.h" //here comes your DataMan header namespace adios @@ -108,6 +108,9 @@ private: variable.m_AppValues = values; m_WrittenVariables.insert( variable.m_Name ); + DataManager dataManager; + dataManager.add_stream( "0", "0", 1, 1, 1, "0" ); + //This part will go away, this is just to monitor variables per rank std::cout << "I am hooked to the DataMan library\n"; MPI_Barrier( m_MPIComm ); diff --git a/include/format/BP1Writer.h b/include/format/BP1Writer.h index 7509b4fee61489cf6110cd53a48e06287e857d02..32bb42e3e40d95d8ce23a2115c521c9c494027db 100644 --- a/include/format/BP1Writer.h +++ b/include/format/BP1Writer.h @@ -541,15 +541,6 @@ private: MemcpyToBuffers( buffers, positions, &value, sizeof(T) ); } - - - /** - * - * @param capsule - * @param transport - */ - void CloseRankFile( Capsule& capsule, Transport& transport ) const; - /** * Flattens the metadata indices into a single metadata buffer in capsule * @param metadataSet diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index d9765feac704fa595400e9f87f55211e69aa3861..7b74cd94d4eb3c18bafd7108003bf6ad5a28fc8b 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -155,5 +155,10 @@ bool Engine::TransportNamesUniqueness( ) const } +void Engine::CheckTransportIndex( const int transportIndex ) +{ + +} + } //end namespace diff --git a/src/engine/bp/BPWriter.cpp b/src/engine/bp/BPWriter.cpp index e5e53a31949f792b8587e04e20b8550c188a95a1..ad6c7de2f2749cbdd4e13e9d3bdda17140b77d09 100644 --- a/src/engine/bp/BPWriter.cpp +++ b/src/engine/bp/BPWriter.cpp @@ -167,6 +167,17 @@ void BPWriter::AdvanceStep( ) void BPWriter::Close( const int transportIndex ) { + CheckTransportIndex( transportIndex ); + if( transportIndex == -1 ) + { + for( auto& transport : m_Transports ) //by reference or value or it doesn't matter? + m_BP1Writer.Close( m_MetadataSet, m_Buffer, *transport, m_IsFirstClose ); + } + else + { + m_BP1Writer.Close( m_MetadataSet, m_Buffer, *m_Transports[transportIndex], m_IsFirstClose ); + } + //BP1Writer to update the metadata indices @@ -272,7 +283,7 @@ void BPWriter::WriteProcessGroupIndex( ) m_BP1Writer.WriteProcessGroupIndex( isFortran, name, processID, timeStepName, timeStep, m_Transports, m_Buffer, m_MetadataSet ); - m_BufferVariableCountPosition = m_Buffer.m_DataPosition; //fixed for every PG + m_BufferVariableCountPosition = m_Buffer.m_DataPosition; //fixed for every new PG } diff --git a/src/format/BP1Writer.cpp b/src/format/BP1Writer.cpp index c46161ed057f6a9f90c49d6d779b171539e681fc..59eb3a1263dd76132f72c3a5ad5b4a10cae92bc7 100644 --- a/src/format/BP1Writer.cpp +++ b/src/format/BP1Writer.cpp @@ -224,12 +224,6 @@ void BP1Writer::WriteDimensionRecord( std::vector<char*>& buffers, std::vector<s } -void BP1Writer::CloseRankFile( Capsule& capsule, Transport& transport ) const -{ - -} - - void BP1Writer::FlattenMetadata( BP1MetadataSet& metadataSet, Capsule& capsule ) const noexcept {