diff --git a/Makefile.libs b/Makefile.libs index c0a08b1f09d4e6b823080f361eb2dc42268a2c3c..ce4e7709441e88947ac5dc901d7c1880321603eb 100644 --- a/Makefile.libs +++ b/Makefile.libs @@ -15,10 +15,10 @@ TRANSPORT_INC:=./include/transport TRANSPORT_SRC:=./src/transport ifeq ($(HAVE_DATAMAN),yes) - DATAMAN_LOC:=/home/wfg/Applications/DataMan# need to change this to your local dataman location + DATAMAN_LOC:=/Users/w4g/Dropbox/lib/DataMan# need to change this to your local dataman location CFLAGS += -DHAVE_DATAMAN INC += -I$(DATAMAN_LOC)/include - LIBS += -L$(DATAMAN_LOC)/lib -lcacheman -lstreamman -lzmqman + LIBS += -L$(DATAMAN_LOC)/lib -ldataman else HFiles:=$(filter-out $(ENGINE_INC)/dataman/DataManWriter.h,$(HFiles)) HFiles:=$(filter-out $(ENGINE_INC)/dataman/DataManReader.h,$(HFiles)) diff --git a/buildDataMan.sh b/buildDataMan.sh index 52f2fd81e937eb33f793e9d735657c6ac35f5a4a..dd50058521ae834ec66b527cef6af0f840f67211 100755 --- a/buildDataMan.sh +++ b/buildDataMan.sh @@ -5,8 +5,9 @@ # Created on: Feb 9, 2017 # Author: wfg -DATAMAN_LOCATION=/home/wfg/Applications/DataMan +DATAMAN_LOCATION=/Users/w4g/Dropbox/lib/DataMan MPICOMPILER=mpic++ +export DYLD_LIBRARY_PATH=$DATAMAN_LOCATION/lib:$DYLD_LIBRARY_PATH if [ "$(uname)" == "Darwin" ]; then CCOMPILER=clang++ @@ -19,14 +20,14 @@ echo "########################################################################## echo "Start building ADIOS ./lib/libadios.a ./libadios_nompi.a with DataMan library" echo "######################################################################################" echo -make HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER #build the ./lib/libadios.a and ./libadios_nompi.a +make -j4 HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER #build the ./lib/libadios.a and ./libadios_nompi.a echo echo "#################################################################" echo "Building Dataman Reader and Writer examples" echo "#################################################################" -make -C ./examples/hello/datamanWriter HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER +make -j4 -C ./examples/hello/datamanWriter HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER echo -make -C ./examples/hello/datamanReader HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER +make -j4 -C ./examples/hello/datamanReader HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER echo echo diff --git a/examples/hello/datamanReader/Makefile b/examples/hello/datamanReader/Makefile index a2c6d4204aeebc74023996530270d4af18391cb0..e07e52144eec8acd4cb381f8912feeac0ffb53f7 100644 --- a/examples/hello/datamanReader/Makefile +++ b/examples/hello/datamanReader/Makefile @@ -18,7 +18,7 @@ LIB_NOMPI+= $(ADIOS_DIR)/lib/libadios_nompi.a INC+= -I$(ADIOS_DIR)/include #DATAMAN -DATAMAN_LOC=/home/wfg/Applications/DataMan +DATAMAN_LOC=/Users/w4g/Dropbox/lib/DataMan INC+= -I$(DATAMAN_LOC)/include LIB+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman LIB_NOMPI+= -L$(DATAMAN_LOC)/lib -ldataman diff --git a/examples/hello/datamanWriter/Makefile b/examples/hello/datamanWriter/Makefile index 195afdfbf9c5c294e6d48bb403c0bc7770cc23c8..2866c4029ff64f18eb21cbee5c8d32e2a11803ca 100644 --- a/examples/hello/datamanWriter/Makefile +++ b/examples/hello/datamanWriter/Makefile @@ -18,7 +18,7 @@ LIB_NOMPI+= $(ADIOS_DIR)/lib/libadios_nompi.a INC+= -I$(ADIOS_DIR)/include #DATAMAN -DATAMAN_LOC=/home/wfg/Applications/DataMan +DATAMAN_LOC=/Users/w4g/Dropbox/lib/DataMan INC+= -I$(DATAMAN_LOC)/include LIB+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman LIB_NOMPI+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman diff --git a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp index 0ee05f1ba6695416781273f6927caf0abd0caee1..d9d245c79de90897fddda7e132c2c8f8582fee43 100644 --- a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp @@ -35,8 +35,8 @@ int main( int argc, char* argv [] ) //Define method for engine creation, it is basically straight-forward parameters adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManWriter" ); //default method type is Writer - datamanSettings.SetParameters( "peer-to-peer=yes", "real_time=yes", "compress=no" ); - datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); + datamanSettings.SetParameters( "real_time=yes", "method_type=stream", "method=dump", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12306", "remote_port=12307" ); +// datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); //datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported , will throw an exception //Create engine smart pointer to DataMan Engine due to polymorphism, diff --git a/examples/solidfluid/solidfluid.xml b/examples/solidfluid/solidfluid.xml index 177a0a2239c2c8112260abc576e195ee15e55a0f..84cb101326dffce082b2a2870e23e48a9657d7ad 100644 --- a/examples/solidfluid/solidfluid.xml +++ b/examples/solidfluid/solidfluid.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<adios-config> +<adios-config host-language="C"> <!-- Changes to ADIOS-1 XML Accommodate for the following extensions and flexiblity: diff --git a/examples/solidfluid/solidfluid_read.cpp b/examples/solidfluid/solidfluid_read.cpp index 38f0e528737fbc8abf36e0577e9f9900961d6ee0..9d1a514911167429c0e150dca438a0d85d0b1140 100644 --- a/examples/solidfluid/solidfluid_read.cpp +++ b/examples/solidfluid/solidfluid_read.cpp @@ -12,7 +12,7 @@ #include <string> #include <vector> -#include "ADIOS.h" +#include "ADIOS_OOP.h" struct MYDATA { @@ -33,20 +33,21 @@ void read_ckpt (adios::ADIOS adios, struct MYDATA &solid, struct MYDATA &fluid) // The write transport is associated with the group in the XML // ADIOS pairs that with the corresponding read transport // "r" is required to indicate we are reading - int ckptfile = adios.Open("checkpoint.bp", "checkpoint", "r", comm); + auto ckptfile = adios.Open("checkpoint.bp", "r", comm, "checkpoint"); // We can also manually set the read transport - //int ckptfile = adios.Open("checkpoint.bp", adios::READ_METHOD_BP, "r", comm); + //auto ckptfile = adios.Open("checkpoint.bp", adios::READ_METHOD_BP, "r", comm); // Note: we only see a single step in the input but the checkpoint has // only one step anyway. This makes this code simple // simple immediate read of a scalar - adios.ReadScalar (ckptfile, "solid/NX", &solid.NX); + ckptfile->ReadScalar("solid/NX", &solid.NX); // solid.NX is filled at this point // scheduled version of read of another scalar - adios.ScheduleRead (ckptfile, "fluid/NX", &fluid.NX); - adios.Read(ckptfile); // perform reading now + // //ckptfile->ScheduleRead ("fluid/NX", &fluid.NX); + // //ckptfile->Read(); // perform reading now + ckptfile->Read("fluid/NX", &fluid.NX); // fluid.NX is filled at this point solid.t = new double(solid.NX); @@ -56,11 +57,11 @@ void read_ckpt (adios::ADIOS adios, struct MYDATA &solid, struct MYDATA &fluid) fluid.p = std::vector<double>(fluid.NX); adios::ADIOS_SELECTION_WRITEBLOCK sel(rank); - adios.ScheduleRead (ckptfile, sel, "solid/temperature", solid.t); - adios.ScheduleRead (ckptfile, sel, "solid/pressure", solid.p); - adios.ScheduleRead (ckptfile, sel, "fluid/temperature", fluid.t); + adios.Read (ckptfile, sel, "solid/temperature", solid.t); + adios.Read (ckptfile, sel, "solid/pressure", solid.p); + adios.Read (ckptfile, sel, "fluid/temperature", fluid.t); // force checking if the allocated space equals to the size of the selection: - adios.ScheduleRead (ckptfile, sel, "fluid/pressure", fluid.p, fluid.NX*sizeof(double)); + adios.Read (ckptfile, sel, "fluid/pressure", fluid.p, fluid.NX*sizeof(double)); adios.Read(ckptfile, true); // true: blocking read, which is also default adios.Close(ckptfile); // Should this do Read() if user misses or should we complain? } @@ -253,16 +254,6 @@ void read_fluid (adios::ADIOS adios, struct MYDATA &fluid) int main (int argc, char ** argv) { - int i, j; - ADIOS_FILE * f; - ADIOS_VARINFO * v; - ADIOS_SELECTION * sel; - int steps = 0; - int retval = 0; - float timeout_sec = 1.0; - - void * data = NULL; - uint64_t start[2], count[2]; MPI_Init (&argc, &argv); MPI_Comm_rank (comm, &rank); diff --git a/examples/solidfluid/solidfluid_write.cpp b/examples/solidfluid/solidfluid_write.cpp index 293003b45837f255c61abf1abfab0142017d881c..a5a2d260c62f4365005e4263b41edfc7d03f0da0 100644 --- a/examples/solidfluid/solidfluid_write.cpp +++ b/examples/solidfluid/solidfluid_write.cpp @@ -6,7 +6,6 @@ */ #include <stdexcept> -#include <mpi.h> #include <iostream> #include <fstream> #include <string> diff --git a/include/engine/dataman/DataManWriter.h b/include/engine/dataman/DataManWriter.h index d6b8851ce4c686faae20ff86d30b7b71eb41f361..64b0f343f382d072406e0a7f679a2377a4fbb723 100644 --- a/include/engine/dataman/DataManWriter.h +++ b/include/engine/dataman/DataManWriter.h @@ -86,6 +86,7 @@ private: format::BP1Writer m_BP1Writer; ///< format object will provide the required BP functionality to be applied on m_Buffer and m_Transports bool m_DoRealTime = false; + DataManager m_Man; void Init( ); ///< calls InitCapsules and InitTransports based on Method, called from constructor void InitCapsules( ); @@ -108,10 +109,10 @@ 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/src/engine/dataman/DataManWriter.cpp b/src/engine/dataman/DataManWriter.cpp index af9849a5c2fd128e3151492aa526057c8c634d80..4a94dbbb08be7f0cc686a857c5cf1c3428532fd2 100644 --- a/src/engine/dataman/DataManWriter.cpp +++ b/src/engine/dataman/DataManWriter.cpp @@ -53,10 +53,43 @@ void DataManWriter::Init( ) m_DoRealTime = true; } + if(m_DoRealTime) + { + string method_type="", method="", local_ip="", remote_ip=""; + int local_port=0, remote_port=0, num_channels=0; + + auto i = m_Method.m_Parameters.find( "method_type" ); + if( i != m_Method.m_Parameters.end() ) + method_type = i->second; + if(method_type == "stream"){ + i = m_Method.m_Parameters.find( "method" ); + if( i != m_Method.m_Parameters.end() ) + method = i->second; + i = m_Method.m_Parameters.find( "local_ip" ); + if( i != m_Method.m_Parameters.end() ) + local_ip = i->second; + i = m_Method.m_Parameters.find( "remote_ip" ); + if( i != m_Method.m_Parameters.end() ) + remote_ip = i->second; + i = m_Method.m_Parameters.find( "local_port" ); + if( i != m_Method.m_Parameters.end() ) + istringstream(i->second) >> local_port; + i = m_Method.m_Parameters.find( "remote_port" ); + if( i != m_Method.m_Parameters.end() ) + istringstream(i->second) >> remote_port; + i = m_Method.m_Parameters.find( "num_channels" ); + if( i != m_Method.m_Parameters.end() ) + istringstream(i->second) >> num_channels; + m_Man.add_stream(local_ip, remote_ip, local_port, remote_port, num_channels, method); + } + } + else + { + InitCapsules( ); + InitTransports( ); + } - InitCapsules( ); - InitTransports( ); }