Commit 7b36a143 authored by Sonja Happ's avatar Sonja Happ

async insert into Cass DB in separate thread, remove iothreads parameter

parent eeddb90f
Subproject commit 3e5b7044aac5cf890848f6b6b2f999dec1a85d47
Subproject commit 1c87a59c6696e6a8f29cff9f0bc72bcad9d09368
......@@ -155,7 +155,6 @@ db.user = postgres
db.pass = postgres
db.dbname = swarmgrid
cassandra.hosts = 137.226.248.96,137.226.248.86,137.226.248.89
cassandra.iothreads = 10
########################################
############## VILLAS ##################
......
......@@ -155,8 +155,7 @@ void ModelIO::init_db() {
MPI_Bcast(&simId, 1, MPI_INT, 0, MPI_COMM_WORLD);
d_props.result.dbconn->setSimId(simId);
int iothreads = repast::strToInt(props->getProperty("cassandra.iothreads"));
d_props.result.dbconn->setCassandraConfig(props->getProperty("cassandra.hosts"),"swarmgrid", iothreads);
d_props.result.dbconn->setCassandraConfig(props->getProperty("cassandra.hosts"),"swarmgrid");
d_props.result.dbconn->createCassandraSession();
if(rank == 0){
......@@ -256,7 +255,14 @@ void ModelIO::finish_io() {
}
d_props.result.dbconn->endCopy();
if(rank == 0){
std::cout << "Waiting for inserts into DB...";
}
delete d_props.result.dbconn;
if(rank == 0){
std::cout << " Done" << std::endl;
}
}catch(const DBException &e){
std::cout << "[DBEXCEPTION ON RANK " << rank << "] Error: " << e.what() << std::endl;
std::cerr << "[DBEXCEPTION ON RANK " << rank << "] Error: " << e.what() << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment