Skip to content

Commit

Permalink
removed the http server (was used for demo purposes), as does not com…
Browse files Browse the repository at this point in the history
…pile on ubuntu for some reasin
  • Loading branch information
Aapo Kyrola committed Mar 18, 2014
1 parent c61f296 commit da46e25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
25 changes: 14 additions & 11 deletions example_apps/streaming_pagerank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#include "util/toplist.hpp"

/* HTTP admin tool */
#include "httpadmin/chi_httpadmin.hpp"
#include "httpadmin/plotter.hpp"
//#include "httpadmin/chi_httpadmin.hpp"
//#include "httpadmin/plotter.hpp"

using namespace graphchi;

Expand Down Expand Up @@ -115,7 +115,7 @@ struct PagerankProgram : public GraphChiProgram<VertexDataType, EdgeDataType> {
*/
void before_exec_interval(vid_t window_st, vid_t window_en, graphchi_context &ginfo) {
#ifdef DEMO
update_plotdata(dyngraph_engine);
// update_plotdata(dyngraph_engine);
#endif
}

Expand Down Expand Up @@ -175,8 +175,9 @@ struct PagerankProgram : public GraphChiProgram<VertexDataType, EdgeDataType> {

};


/* Demo stuff. */
class IntervalTopRequest : public custom_request_handler {
/*class IntervalTopRequest : public custom_request_handler {
public:
virtual std::string handle(const char * req) {
const char * shardnum_str = &req[strlen("/ajax/shardpagerank")];
Expand Down Expand Up @@ -208,23 +209,23 @@ class IntervalTopRequest : public custom_request_handler {
return (strncmp(req, "/ajax/shardpagerank", 19) == 0);
}
};
};*/

bool running = true;

/*
void * plotter_thread(void * info);
void * plotter_thread(void * info) {
usleep(1000000 * 10);
init_plots(dyngraph_engine);
while(running) {
/* Update plots */
drawplots();
// update plots
drawplots();
usleep(1000000 * 10);
}
return NULL;
}
}*/

/**
* Function executed by a separate thread that streams
Expand Down Expand Up @@ -297,7 +298,7 @@ void * dynamic_graph_reader(void * info) {
dyngraph_engine->set_json("ingestedges", ingested);
}
if (c % 1000 == 0) {
set_ingested_edges(ingested);
// set_ingested_edges(ingested);
}


Expand Down Expand Up @@ -336,12 +337,14 @@ int main(int argc, const char ** argv) {
assert(ret>=0);

/* Start HTTP admin */
start_httpadmin< graphchi_dynamicgraph_engine<float, float> >(dyngraph_engine);
/* start_httpadmin< graphchi_dynamicgraph_engine<float, float> >(dyngraph_engine);
register_http_request_handler(new IntervalTopRequest());
pthread_t plotterthr;
ret = pthread_create(&plotterthr, NULL, plotter_thread, NULL);
assert(ret>=0);
*/

/* Run the engine */
PagerankProgram program;
Expand Down
6 changes: 4 additions & 2 deletions src/external/vpiotr-mongoose-cpp/mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
#define INT64_MAX 9223372036854775807
#endif // HAVE_STDINT

#define INT64_MAX 9223372036854775807


// POSIX dirent interface
struct dirent {
char d_name[PATH_MAX];
Expand Down Expand Up @@ -2500,7 +2502,7 @@ static void send_file_data(struct mg_connection *conn, FILE *fp, int64_t len) {
}

static int parse_range_header(const char *header, int64_t *a, int64_t *b) {
return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b);
return sscanf(header, "bytes=%ld -%" INT64_FMT, a, b);
}

static void handle_file_request(struct mg_connection *conn, const char *path,
Expand Down

0 comments on commit da46e25

Please sign in to comment.