Skip to content

Commit

Permalink
Post-Development Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Jan 26, 2024
1 parent c7b7847 commit c4b18cf
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 32 deletions.
8 changes: 3 additions & 5 deletions Stochastic/Tests/statstest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <iostream>
#include <cstdio>

#include "VCELL/SimulationMessaging.h"

const char* input_file_contents = R"INPUT_FILE(
<control>
STARTING_TIME 0.0
Expand Down Expand Up @@ -103,13 +101,13 @@ TEST(statstest,test1) {
std::string outputFileName = std::tmpnam(nullptr);
std::map<int,double> results;
std::fstream inputFileStream;
inputFileStream.open(inputFileName, fstream::out);
inputFileStream.open(inputFileName, std::fstream::out);
if (inputFileStream.fail()) {
std::perror(("File <" + inputFileName + "> could not be created.").c_str());
ASSERT_FALSE(inputFileStream.fail());
}
std::fstream outputFileStream;
outputFileStream.open(outputFileName, fstream::out);
outputFileStream.open(outputFileName, std::fstream::out);
if (outputFileStream.fail()) {
std::perror(("File <" + inputFileName + "> could not be created.").c_str());
ASSERT_FALSE(outputFileStream.fail());
Expand All @@ -127,7 +125,7 @@ TEST(statstest,test1) {
gb->march();

// Verify file contents
outputFileStream.open(outputFileName, fstream::in);
outputFileStream.open(outputFileName, std::fstream::in);
std::string line;
std::getline(outputFileStream, line); // remove header line
for (int i = 0; !outputFileStream.eof(); i++) {
Expand Down
1 change: 0 additions & 1 deletion Stochastic/VCellStoch/src/Gibson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <cstdlib>
#include <iostream>
#include <random>
using namespace std;

#include <ctime>
#include "../include/IndexedTree.h"
Expand Down
1 change: 0 additions & 1 deletion VCell/include/VCELL/PostProcessingHdf5Writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace H5 {
class PostProcessingHdf5Writer
{
public:
PostProcessingHdf5Writer(char* fileName, PostProcessingBlock* postProcessingBlock);
PostProcessingHdf5Writer(std::string fileName, PostProcessingBlock* postProcessingBlock);
virtual ~PostProcessingHdf5Writer();

Expand Down
14 changes: 2 additions & 12 deletions VCell/src/PostProcessingHdf5Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,13 @@
#include <H5Cpp.h>
#include <iostream>
#include <fstream>
#include <utility>
using std::cout;
using std::endl;
#include <sys/stat.h>

#define POST_PROCESSING_ROOT "/PostProcessing"

const char* PostProcessingHdf5Writer::PPGroupName = POST_PROCESSING_ROOT;
const char* PostProcessingHdf5Writer::TimesDataSetName = POST_PROCESSING_ROOT"/Times";

PostProcessingHdf5Writer::PostProcessingHdf5Writer(char* fileName, PostProcessingBlock* ppb) {
this->h5PPFileName = fileName;
this->postProcessingBlock = ppb;
h5PPFile = NULL;
timesDataSet = NULL;
}

PostProcessingHdf5Writer::PostProcessingHdf5Writer(std::string fileName, PostProcessingBlock* ppb) {
this->h5PPFileName = std::move(fileName);
this->postProcessingBlock = ppb;
Expand Down Expand Up @@ -75,7 +65,7 @@ bool PostProcessingHdf5Writer::loadFinal(int numTimes) {
// the max time in log file is numTimes
// hdf5 is missing times
if (timesDim < numTimes) {
cout << "post processing hdf5 times don't match" << endl;
std::cout << "post processing hdf5 times don't match" << std::endl;
return false;
}
double* times = new double[int(timesDim)];
Expand Down Expand Up @@ -109,7 +99,7 @@ bool PostProcessingHdf5Writer::loadFinal(int numTimes) {
}
hdf5Copy.close();
} catch(H5::Exception error ) {
cout << "failed to reload post processing block: " << error.getDetailMsg() << endl;
std::cout << "failed to reload post processing block: " << error.getDetailMsg() << std::endl;
// recreate the file later
}

Expand Down
1 change: 0 additions & 1 deletion VCellMessaging/include/VCELL/SimulationMessaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#endif
#include <iostream>
using namespace std;

#if (defined(WIN32) || defined(WIN64) )
#include <windows.h>
Expand Down
12 changes: 4 additions & 8 deletions VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#include <VCELL/SimulationMessaging.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <sstream>
using std::cerr;
using std::cout;
using std::endl;

#include <stdio.h>
#include <cstdio>
#ifdef USE_MESSAGING
#if ( !defined(WIN32) && !defined(WIN64) ) // UNIX
#include <curl/curl.h>
Expand Down Expand Up @@ -173,13 +169,13 @@ void SimulationMessaging::sendStatus() {
fflush(stdout);
break;
case JOB_STARTING:
cout<< workerEvent->eventMessage << endl;
std::cout<< workerEvent->eventMessage << std::endl;
break;
case JOB_COMPLETED:
cerr << "Simulation Complete in Main() ... " << endl;
std::cerr << "Simulation Complete in Main() ... " << std::endl;
break;
case JOB_FAILURE:
cerr << workerEvent->eventMessage << endl;
std::cerr << workerEvent->eventMessage << std::endl;
break;
}
return;
Expand Down
4 changes: 0 additions & 4 deletions smoldyn-2.38/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ set_source_files_properties(${MAIN_FILES} PROPERTIES LANGUAGE CXX )

include_directories(source/lib source/Smoldyn source/NextSubVolume source/vtk ${CMAKE_CURRENT_BINARY_DIR})

# The following command is to signal we need to link "szip", which hdf5 uses. We should look into
# how to disable this, or at least control it via an option.
# add_link_options("${CMAKE_LINK_LIBRARY_FLAG}sz")

####### Build for debugging or release ##########

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
Expand Down

0 comments on commit c4b18cf

Please sign in to comment.