diff --git a/Doxyfile b/Doxyfile old mode 100644 new mode 100755 diff --git a/Doxyfile.tmpl b/Doxyfile.tmpl old mode 100644 new mode 100755 diff --git a/Doxyfile.txt b/Doxyfile.txt old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/Makefile.tmpl b/Makefile.tmpl index acef5b4..74a3e4e 100644 --- a/Makefile.tmpl +++ b/Makefile.tmpl @@ -1,82 +1,98 @@ -# Makefile template file for FLAME -# -# FLAME is the FLAME source files -# SOURCE is the user source files -# -# The assumption is that the user only provides C files -# and a model files .xml -# -#=================================================== -# Change this variable for the location of the -# Message Board Library installation -#=================================================== -LIBMBOARD_DIR = /usr/local +# ========================================================================== +# FLAME AUTOMATED GENERATION MAKEFILE TEMPLATE WITH PARQUET SERIALIZATION +# ========================================================================== + +# Message Board Library paths +LIBMBOARD_DIR = /home/sander/build/libmboard LIBMBOARD_INC = $(LIBMBOARD_DIR)/include LIBMBOARD_LIB = $(LIBMBOARD_DIR)/lib -#==================================================== -# Change these for your compliler/loaded -#==================================================== -SERIAL_CCOMP = gcc -PARALLEL_CCOMP = mpicc +# Compilers and Loaders (Using g++ for linking mixed C/C++ objects) +SERIAL_CCOMP = gcc +PARALLEL_CCOMP = mpicc +SERIAL_LOADER = g++ +PARALLEL_LOADER = mpicxx -SERIAL_LOADER = gcc -PARALLEL_LOADER = mpif77 +# Feature Flags +DEFINES = +DEFINES += -DGSL_LIB -DEFINES = -DEFINES += -DGSL_LIB -#DEFINES += -DSTART_END -#DEFINES += -DGRAPHICS +# Toolchain Assignment +CC = $(SERIAL_CCOMP)$(PARALLEL_CCOMP) +CXX = g++ +LD = $(SERIAL_LOADER)$(PARALLEL_LOADER) -# C Compiler -CC = $(SERIAL_CCOMP)$(PARALLEL_CCOMP) -CFLAGS = -I$(LIBMBOARD_INC) ${DEFINES} -CFLAGS += -std=c99 -Wall -D_DEBUG_MODE -g -CFLAGS += -O3 +# Compilation Flags (Included -I. so generated source files can find parquet_engine.h) +CFLAGS = -I$(LIBMBOARD_INC) -I. $(DEFINES) -fcommon -Wall +CXXFLAGS = -I$(LIBMBOARD_INC) -I. $(DEFINES) -Wall -std=c++20 -LD = $(SERIAL_LOADER)$(PARALLEL_LOADER) + +CFLAGS += -std=c11 -D_DEBUG_MODE -g +CXXFLAGS += -D_DEBUG_MODE -g + -LDFLAGS = -L$(LIBMBOARD_LIB) - -LIBS += -lgsl -lgslcblas + +CFLAGS += -O3 +CXXFLAGS += -O3 -LIBS += -lmboard_sd -lmboard_pd -lm -#FLAME source files -FLAME = main.c memory.c xml.c messageboards.c partitioning.c rules.c timing.c +LDFLAGS = -L$(LIBMBOARD_LIB) + +# Library Dependencies (Standard FLAME + Apache Arrow ecosystem) +LIBS = -lmboard_sd -lmboard_pd -lm +LIBS += -larrow -lparquet -lstdc++ +LIBS += -lgsl -lgslcblas + +# FLAME Core Source manifests +FLAME = main.c memory.c xml.c messageboards.c partitioning.c rules.c timing.c +AUX = stategraph.dot stategraph_colour.dot process_order_graph.dot Doxyfile latex.tex -#FLAME auxilary files -AUX = stategraph.dot stategraph_colour.dot process_order_graph.dot Doxyfile latex.tex +# Dynamic Model Manifests (Parsed dynamically by xparser) +SOURCES = $filepath +HEADERS = header.h low_primes.h mboard.h parquet_engine.h $name_agent_header.h -# FLAME generated model files -SOURCES = $filepath -HEADERS = header.h low_primes.h mboard.h $name_agent_header.h +# External Parquet Tracking System Engine Code +PARQUET_SRC = parquet.cpp parquet_engine.cpp -DEPS = Makefile header.h low_primes.h +# Consolidated dependencies (Dynamic generation drops parquet_engine.h straight into place) +DEPS = Makefile header.h low_primes.h parquet_engine.h -OBJECTS = $(SOURCES:.c=.o) $(FLAME:.c=.o) +# Unified Object target arrays derived dynamically from source collections +OBJECTS = $(SOURCES:.c=.o) $(FLAME:.c=.o) $(PARQUET_SRC:.cpp=.o) EXECUTABLE = main -RM = rm -f +RM = rm -f +# Pipeline Execution Targets all: $(SOURCES) $(FLAME) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(LD) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS) +# Core objects depend on native framework headers and generated parquet engine header $(OBJECTS): $(DEPS) +# Structural Suffix Processing Patterns .c.o: $(CC) -c $(CFLAGS) $< -o $@ +.cpp.o: + $(CXX) -c $(CXXFLAGS) $< -o $@ + +# Cleanup Framework Operations (Preserving your *.parquet data files) clean: - $(RM) $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe + $(RM) $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe + vclean: - $(RM) main $(EXECUTABLE) $(EXECUTABLE).exe $(OBJECTS) $(FLAME) $(HEADERS) $(AUX) Makefile + $(RM) main $(EXECUTABLE) $(EXECUTABLE).exe $(OBJECTS) $(FLAME) $(HEADERS) $(AUX) Makefile + format: astyle -A3 $(SOURCES) - for file in $(patsubst %.c,%.h, $(SOURCES)) ; do \ - echo $$file ; \ - astyle -A3 $$file ; \ + for file in $(patsubst %.c,%.h, $(SOURCES)) ; \ + do \ + echo $$file ; \ + astyle -A3 $$file ; \ done + print: a2ps -R -f10 --column=1 $(SOURCES) + \ No newline at end of file diff --git a/Makefile.tmpl.custom b/Makefile.tmpl.custom deleted file mode 100644 index fe097da..0000000 --- a/Makefile.tmpl.custom +++ /dev/null @@ -1,96 +0,0 @@ -# Makefile template file for FLAME -# -# FLAME is the FLAME source files -# SOURCE is the user source files -# -# The assumption is that the user only provides C files -# and a model files .xml -# -#=================================================== -# Change this variable for the location of the -# Message Board Library installation -#=================================================== -LIBMBOARD_DIR = /upb/departments/pc2/users/e/etace004/build/libmboard -LIBMBOARD_INC = $(LIBMBOARD_DIR)/include -LIBMBOARD_LIB = $(LIBMBOARD_DIR)/lib - - -#=================================================== -# Change this variable for the location of the -# GNU Scientific Library (GSL) installation -#=================================================== -GSL_DIR = /cm/shared/apps/pc2/GSL/2.4 -GSL_LIB = $(GSL_DIR)/lib -GSL_INC = $(GSL_DIR)/include - - -#==================================================== -# Change these for your compiler/loader -#==================================================== -SERIAL_CCOMP = gcc -PARALLEL_CCOMP = mpicc - -SERIAL_LOADER = gcc -PARALLEL_LOADER = mpif77 - -DEFINES = - -DEFINES += -DGSL_LIB - - -# C Compiler -CC = $(SERIAL_CCOMP)$(PARALLEL_CCOMP) -CFLAGS = -I$(LIBMBOARD_INC) ${DEFINES} -CFLAGS += -I$(GSL_INC) - -CFLAGS += -std=c99 -Wall -D_DEBUG_MODE -g -CFLAGS += -O3 - -LD = $(SERIAL_LOADER)$(PARALLEL_LOADER) - -LDFLAGS = -L$(LIBMBOARD_LIB) - -LDFLAGS += -L$(GSL_LIB) - -LIBS += -lgsl -lgslcblas - -LIBS += -lmboard_sd -lmboard_pd -lm - -#FLAME source files -FLAME = main.c memory.c xml.c messageboards.c partitioning.c rules.c timing.c - -#FLAME auxilary files -AUX = stategraph.dot stategraph_colour.dot process_order_graph.dot Doxyfile latex.tex - -# FLAME generated model files -SOURCES = $filepath -HEADERS = header.h low_primes.h mboard.h $name_agent_header.h - -DEPS = Makefile header.h low_primes.h - -OBJECTS = $(SOURCES:.c=.o) $(FLAME:.c=.o) -EXECUTABLE = main -RM = rm -f - -all: $(SOURCES) $(FLAME) $(EXECUTABLE) - -$(EXECUTABLE): $(OBJECTS) - $(LD) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS) - -$(OBJECTS): $(DEPS) - -.c.o: - $(CC) -c $(CFLAGS) $< -o $@ - -clean: - $(RM) $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe -vclean: - $(RM) main $(EXECUTABLE) $(EXECUTABLE).exe $(OBJECTS) $(FLAME) $(HEADERS) $(AUX) Makefile -format: - astyle -A3 $(SOURCES) - for file in $(patsubst %.c,%.h, $(SOURCES)) ; do \ - echo $$file ; \ - astyle -A3 $$file ; \ - done -print: - a2ps -R -f10 --column=1 $(SOURCES) diff --git a/README.txt b/README.txt old mode 100644 new mode 100755 diff --git a/Readme2.txt b/Readme2.txt old mode 100644 new mode 100755 diff --git a/dependencygraph.c b/dependencygraph.c old mode 100644 new mode 100755 diff --git a/docs/developer_manual/Makefile b/docs/developer_manual/Makefile old mode 100644 new mode 100755 diff --git a/docs/developer_manual/communication.tex b/docs/developer_manual/communication.tex old mode 100644 new mode 100755 diff --git a/docs/developer_manual/developer_manual.tex b/docs/developer_manual/developer_manual.tex old mode 100644 new mode 100755 diff --git a/docs/developer_manual/execution.tex b/docs/developer_manual/execution.tex old mode 100644 new mode 100755 diff --git a/docs/developer_manual/memory.tex b/docs/developer_manual/memory.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/Makefile b/docs/user_manual/Makefile old mode 100644 new mode 100755 diff --git a/docs/user_manual/XMML.dtd b/docs/user_manual/XMML.dtd old mode 100644 new mode 100755 diff --git a/docs/user_manual/iteration_1.dot b/docs/user_manual/iteration_1.dot old mode 100644 new mode 100755 diff --git a/docs/user_manual/model_description.tex b/docs/user_manual/model_description.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/model_design.tex b/docs/user_manual/model_design.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/model_execution.tex b/docs/user_manual/model_execution.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/model_implementation.tex b/docs/user_manual/model_implementation.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/overview.tex b/docs/user_manual/overview.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/swarm_1.dot b/docs/user_manual/swarm_1.dot old mode 100644 new mode 100755 diff --git a/docs/user_manual/swarm_2.dot b/docs/user_manual/swarm_2.dot old mode 100644 new mode 100755 diff --git a/docs/user_manual/swarm_3.dot b/docs/user_manual/swarm_3.dot old mode 100644 new mode 100755 diff --git a/docs/user_manual/user_manual.tex b/docs/user_manual/user_manual.tex old mode 100644 new mode 100755 diff --git a/docs/user_manual/xmachine.dia b/docs/user_manual/xmachine.dia old mode 100644 new mode 100755 diff --git a/docs/user_manual/xmachine.eps b/docs/user_manual/xmachine.eps old mode 100644 new mode 100755 diff --git a/docs/xparser_parquet/manual.md b/docs/xparser_parquet/manual.md new file mode 100644 index 0000000..70a2e0f --- /dev/null +++ b/docs/xparser_parquet/manual.md @@ -0,0 +1,41 @@ +# Xparser Parquet + +The main focus was not on modifying xparser itself to write Parquet files. Instead, the focus was on enhancing the simulation code templates that xparser reads, allowing the compiled simulation binary to write Parquet files natively at runtime. + +Here is how those responsibilities are split: + +## 1. What xparser Actually Does + +xparser is a pre-compilation code generator, not the simulation engine. Its only job is to read your model's XML specification file (which defines your agents, states, and variables) and unroll code templates (like parquet.cpp.tmpl and parquet_engine.cpp.tmpl) into concrete C++ source files (parquet.cpp and parquet_engine.cpp). + +xparser itself doesn't know anything about Apache Arrow, memory allocation, or Parquet compression. It just substitutes template variables like and $name into plain text. + +## 2. Where the Real Focus Was: The Runtime Engine + +Our actual focus was on building a high-performance runtime data pipeline inside the template files that executes while the simulation is running. + +Instead of changing how xparser parses files, we wrote a standard C++ engine that hooks into FLAME's loop structure to intercept agent data before it gets dumped into the traditional, bulky XML iteration logs. +The Pipeline Architecture We Built: +```text +[FLAME Simulation Loop] + │ + ▼ +[parquet.cpp] ───► Captures simulation state & iteration paths (outputpath) + │ + ▼ +[parquet_engine.cpp] + │ + ├──► 1. Buffers raw C++ vectors (iterations, IDs, agent variables) + ├──► 2. Standardizes memory layouts & resets states (buf.columns.clear()) + ├──► 3. Feeds data into Apache Arrow Builders (Int32Builder, DoubleBuilder) + ├──► 4. Assembles an in-memory Arrow Table with strict Schema enforcement + │ + ▼ +[Physical Disk] ───► Compresses and writes highly optimized .parquet files +``` + +## Summary of the Goal + +The goal was to replace FLAME's default XML runtime output mechanism with an Apache Arrow/Parquet serialization engine. + +We accomplished this by feeding clean, robust C++20 memory management and Arrow API calls into the .tmpl files, so that whenever you run ./xparser and compile your model, the resulting executable natively records data into Parquet format instead of millions of lines of uncompressed XML text. \ No newline at end of file diff --git a/header.h b/header.h old mode 100644 new mode 100755 diff --git a/header.tmpl b/header.tmpl old mode 100644 new mode 100755 index a571f50..36535bf --- a/header.tmpl +++ b/header.tmpl @@ -529,7 +529,17 @@ void readprepartitionedinitialstates(char * filename, char * filelocation, int * void readinitialstates(char * filename, char * filelocation, int * itno, double cloud_data[], int partition_method, int flag); + void saveiterationdata(int iteration_number); +#ifdef __cplusplus +extern "C" { +#endif + +void saveiterationdata_parquet(int iteration_number); + +#ifdef __cplusplus +} +#endif void free_$name($name * temp); void free_$name_static_array($name * array, int size); diff --git a/low_primes.tmpl b/low_primes.tmpl old mode 100644 new mode 100755 diff --git a/main.tmpl b/main.tmpl old mode 100644 new mode 100755 index 430d314..a83aebf --- a/main.tmpl +++ b/main.tmpl @@ -5,6 +5,9 @@ #include "header.h" #include +#define FLAME_TIMER_LAYERS 0 +#define FLAME_TIMER_IO 0 + #ifdef GSL_LIB #include @@ -18,6 +21,9 @@ unsigned long int gsl_seed; #define COMPACT_PRINTOUT_P_THRESHOLD 8 +/* Set inputpath as global variable */ +char inputpath[1000]; + /** \fn int main(int argc, char * argv[]) * \brief Main program loop. * \param argc Argument count. @@ -26,11 +32,10 @@ unsigned long int gsl_seed; int main(int argc, char * argv[]) { /* Timing variables */ - double start, stop, interval; + double start, stop, interval, layer_interval, io_interval; FILE *file; char data[100]; char logfilepath[1000]; - char inputpath[1000]; char * c; int lastd = 0; int i; @@ -410,12 +415,23 @@ if(argc < 2) if(node_number == 0) { /* Write log file */ - sprintf(logfilepath, "%slog.xml", outputpath); + // Check if outputpath leaves enough room for "log.xml" (7 bytes) + null terminator (1 byte) + if (strlen(outputpath) + 8 > sizeof(logfilepath)) { + fprintf(stderr, "Error: outputpath is too long for the log file path buffer.\n"); + // Handle the error gracefully (e.g., return, exit, or fall back) + exit(0); + } + // GCC now knows this snprintf will never truncate, still we use pragma's to shut up the compiler + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-truncation" + snprintf(logfilepath, sizeof(logfilepath), "%slog.xml", outputpath); /* use snprintf to protect against overflow */ + #pragma GCC diagnostic pop if((file = fopen(logfilepath, "w"))==NULL) { printf("Error: cannot open file '%s' for writing\n", logfilepath); exit(0); } + (void)fputs("\n", file); (void)fputs("", file); (void)fputs("serial", file); @@ -509,8 +525,13 @@ if(argc < 2) /* Start iteration function */ start_iteration(); #endif - interval = get_time(); - + interval = get_time(); /* Start timer for iteration */ + + if(FLAME_TIMER_LAYERS) + { + layer_interval = get_time(); /* Start timer for layer 1 */ + } + /* Print out iteration number */ if (totalnodes <= COMPACT_PRINTOUT_P_THRESHOLD) @@ -619,7 +640,8 @@ if(argc < 2) } - /* DEBUG: States with branching functions */ + + /* DEBUG: States with branching functions */ current_xmachine_$agent_name_holder = $agent_name_$name_state->agents; while(current_xmachine_$agent_name_holder) { @@ -870,8 +892,28 @@ if(argc < 2) -/* End of layer number $number */ +if(FLAME_TIMER_LAYERS) +{ + /* Save layer time to log file (log.xml)*/if(node_number == 0) + { + if((file = fopen(logfilepath, "a"))==NULL) + { + printf("Error: cannot open file '%s' for writing\n", logfilepath); + exit(0); + } + (void)fputs(" ", file); + sprintf(data, "%i", $number); + (void)fputs(data, file); + (void)fputs("\n", file); + (void)fclose(file); + }/* End of layer number $number */ + layer_interval = get_time(); /* Start timer for next layer */ +} +/* Start of next layer */ /* Clear message boards that have finished being used * and sync complete if doing late sync complete */ @@ -938,10 +980,15 @@ if(FLAME_$name_message_board_read == 0) #endif - if(iteration_loop%output_frequency == output_offset) +/* if(iteration_loop%output_frequency == output_offset) { - saveiterationdata(iteration_loop); + //XML output + saveiterationdata(iteration_loop); + + //Parquet output + saveiterationdata_parquet(iteration_loop); } +*/ /*printf("$agent_name_$name_state->count = %d\n", $agent_name_$name_state->count);*/ $agent_name_$name_state->count = 0; @@ -959,30 +1006,55 @@ if(FLAME_$name_message_board_read == 0) if(iteration_loop%output_frequency == output_offset) { - saveiterationdata(iteration_loop); + if(FLAME_TIMER_IO) + { + /* Start timer for disk I/O */ + io_interval = get_time(); + } + + //XML output + saveiterationdata(iteration_loop); + + //Parquet output + saveiterationdata_parquet(iteration_loop); + + if(FLAME_TIMER_IO) + { + /* Save I/O time to log file */ if(node_number == 0) + { + if((file = fopen(logfilepath, "a"))==NULL) + { + printf("Error: cannot open file '%s' for writing\n", logfilepath); + exit(0); + } + (void)fputs("", file); + (void)fputs("\n", file); + (void)fclose(file); } + } } /* End of iteration code */ $code - /* Calculate if any agents need to jump S.P. */ - /* propagate_agents(); */ - /* Save iteration time to log file */ - if(node_number == 0) - { - if((file = fopen(logfilepath, "a"))==NULL) - { - printf("Error: cannot open file '%s' for writing\n", logfilepath); - exit(0); - } - (void)fputs("", file); - sprintf(data, "%i", iteration_loop); - (void)fputs(data, file); - (void)fputs("\n", file); - (void)fclose(file); - } + /* Calculate if any agents need to jump S.P. */ + /* propagate_agents(); */ + + /* Save iteration time to log file */if(node_number == 0) { + if((file = fopen(logfilepath, "a"))==NULL) + { + printf("Error: cannot open file '%s' for writing\n", logfilepath); + exit(0); + } + (void)fputs("", file); + sprintf(data, "%i", iteration_loop); + (void)fputs(data, file); + (void)fputs("\n", file); + (void)fclose(file); } #ifdef START_END /* End iteration function */ @@ -991,7 +1063,7 @@ if(FLAME_$name_message_board_read == 0) } #ifdef START_END -/* End simualtion function */ +/* End simulation function */ end_simulation(); #endif diff --git a/memory.c b/memory.c old mode 100644 new mode 100755 diff --git a/memory.tmpl b/memory.tmpl old mode 100644 new mode 100755 index 254417b..0e407c1 --- a/memory.tmpl +++ b/memory.tmpl @@ -461,8 +461,8 @@ void set_$name($type * * if(current_xmachine->xmachine_$name) { - //assert($allvar_name < FLAME_DOUBLE_MAX); - //assert($allvar_name > FLAME_DOUBLE_MIN); + assert($allvar_name < FLAME_DOUBLE_MAX); + assert($allvar_name > FLAME_DOUBLE_MIN); (*current_xmachine->xmachine_$name).$allvar_name = $allvar_name; } } @@ -618,7 +618,7 @@ void clean_up(int code) { int rc; FILE *file; - char data[100]; + char data[1000]; free(current_xmachine); /* Free x-machine memory */ @@ -709,7 +709,18 @@ void clean_up(int code) { /* Write log file */ - sprintf(data, "%slog.xml", outputpath); + // Check if outputpath leaves enough room for "log.xml" (7 bytes) + null terminator (1 byte) + if (strlen(outputpath) + 8 > sizeof(data)) { + fprintf(stderr, "Error: outputpath is too long for the log file path buffer.\n"); + // Handle the error gracefully (e.g., return, exit, or fall back) + exit(0); + } + // GCC now knows this snprintf will never truncate, still we use pragma's to shut up the compiler + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-truncation" + snprintf(data, sizeof(data), "%slog.xml", outputpath); /* use snprintf to protect against overflow */ + #pragma GCC diagnostic pop + file = fopen(data, "a"); fputs("\n", file); fputs("", file); diff --git a/messageboards.tmpl b/messageboards.tmpl old mode 100644 new mode 100755 diff --git a/parquet.cpp.tmpl b/parquet.cpp.tmpl new file mode 100644 index 0000000..cf03bf3 --- /dev/null +++ b/parquet.cpp.tmpl @@ -0,0 +1,93 @@ +#include "header.h" +#include "parquet_engine.h" +#include +#include + + +void write_parquet_data_$name(int iteration_no) { + // Clear out any stale records in the C++ backend buffer for this agent type + parquet_clear_buffer("$name"); + + int active_records_buffered = 0; + + // FIX: Leverage your framework's native structural loop macros + // This expands perfectly to walk the active agent list state + START_LOOP_OVER_$name_AGENTS + + // The macro automatically unpacks and assigns 'current_xmachine_$name' for us! + long agent_id = (long)current_xmachine_$name->id; + + // Register the row context once for this specific agent instance + parquet_start_row("$name", iteration_no, agent_id); + + // Dynamically unroll and pass every single model variable definition + + parquet_buffer_variable( + "$agent_name", // Name of the agent class + "$name", // Name of this specific variable + (double)current_xmachine_$agent_name->$name + ); + + + active_records_buffered++; + + END_LOOP_OVER_$name_AGENTS + + fprintf(stdout, " [PARQUET TRAVERSAL] Agent: %s | Records buffered: %d\n", + "$name", active_records_buffered); + fflush(stdout); + + // Only commit the file to disk if records were actually found and buffered + if (active_records_buffered > 0) { + parquet_write_file("$name", iteration_no); + } else { + fprintf(stdout, " [PARQUET SKIP] Skipping file write for %s: Buffer is empty.\n", "$name"); + fflush(stdout); + } +} + + +#ifdef __cplusplus +extern "C" { +#endif + +// Define the storage allocation for our global directory string +char parquet_output_directory[512] = {0}; + +void saveiterationdata_parquet(int iteration_no) { + + // On the first iteration, resolve the directory prefix from outputpath + if (iteration_no == 1 && parquet_output_directory[0] == '\0') { + // Bind directly to the native FLAME output path character array + extern char outputpath[]; + + // FIX: Removed 'outputpath != NULL' to satisfy the strict compiler array-address check + if (outputpath[0] != '\0') { + std::string full_path(outputpath); + size_t last_slash = full_path.find_last_of("/\\"); + + if (last_slash != std::string::npos) { + // Extract everything up to and including the trailing slash + std::string dir = full_path.substr(0, last_slash + 1); + snprintf(parquet_output_directory, sizeof(parquet_output_directory), "%s", dir.c_str()); + } else { + // No slashes found means the file is in the Current Working Directory + parquet_output_directory[0] = '\0'; + } + } + } + + fprintf(stdout, "\n>>> [PARQUET CORE] Entering saveiterationdata_parquet() for iteration %d...\n", iteration_no); + fflush(stdout); + + + write_parquet_data_$name(iteration_no); + + + fprintf(stdout, ">>> [PARQUET CORE] Completed processing cycle for iteration %d.\n\n", iteration_no); + fflush(stdout); +} + +#ifdef __cplusplus +} +#endif diff --git a/parquet_engine.cpp.tmpl b/parquet_engine.cpp.tmpl new file mode 100644 index 0000000..556fe63 --- /dev/null +++ b/parquet_engine.cpp.tmpl @@ -0,0 +1,154 @@ +#include "parquet_engine.h" +#include +#include +#include +#include +#include + +// Include mandatory Apache Arrow and Parquet C++ headers +#include +#include +#include + +struct AgentBuffer { + std::vector iterations; + std::vector ids; + std::map> columns; +}; + +static std::unordered_map global_buffers; + +extern "C" { + +void parquet_clear_buffer(const char* agent_name) { + std::string agent(agent_name); + auto& buf = global_buffers[agent]; + + buf.iterations.clear(); + buf.ids.clear(); + + + if (agent == "$name") { + + buf.columns["$name"].clear(); + + } + +} + +void parquet_start_row(const char* agent_name, int iteration, long id) { + auto& buf = global_buffers[std::string(agent_name)]; + buf.iterations.push_back(iteration); + buf.ids.push_back(id); +} + +void parquet_buffer_variable(const char* agent_name, const char* var_name, double value) { + auto& buf = global_buffers[std::string(agent_name)]; + buf.columns[std::string(var_name)].push_back(value); +} + +void parquet_write_file(const char* agent_name, int iteration) { + std::string agent(agent_name); + auto& buf = global_buffers[agent]; + + if (buf.iterations.empty()) return; + + // Direct sanity verification trace check before calling Apache Arrow + std::cout << "[Parquet Engine] Verifying structural layout for " << agent << ":\n" + << " -> Primary Metadata Records (Rows): " << buf.iterations.size() << "\n"; + + for (const auto& [col_name, col_vec] : buf.columns) { + std::cout << " -> Column '" << col_name << "' size: " << col_vec.size() << "\n"; + if (col_vec.size() != buf.iterations.size()) { + std::cerr << " [CRITICAL ERROR] Size mismatch detected in column " << col_name + << "! Parquet generation aborted to prevent corruption.\n"; + return; + } + } + + // --- Apache Arrow Serializer Pipeline --- + std::cout << " -> Structure Verified. Writing file out to disk..." << std::endl; + + arrow::Status status; + arrow::MemoryPool* pool = arrow::default_memory_pool(); + + // 1. Create native Arrow array builders for structural tracking metadata + arrow::Int32Builder iter_builder(pool); + arrow::Int64Builder id_builder(pool); + + // Populate the base column builders with data from our structural std::vectors + status = iter_builder.AppendValues(buf.iterations); + if (!status.ok()) { std::cerr << " [ARROW ERROR] Appending iterations failed: " << status.ToString() << "\n"; return; } + + status = id_builder.AppendValues(buf.ids); + if (!status.ok()) { std::cerr << " [ARROW ERROR] Appending agent IDs failed: " << status.ToString() << "\n"; return; } + + // Prepare arrays to hold our structural Schema fields and corresponding Table Column arrays + arrow::FieldVector schema_fields; + arrow::ArrayVector table_arrays; + + // Push the metadata mapping properties into our table configuration fields + schema_fields.push_back(arrow::field("iteration", arrow::int32())); + schema_fields.push_back(arrow::field("agent_id", arrow::int64())); + + std::shared_ptr arr_iter; + std::shared_ptr arr_id; + + // FIXED: Capture and verify status to resolve [[nodiscard]] warning error + status = iter_builder.Finish(&arr_iter); + if (!status.ok()) { std::cerr << " [ARROW ERROR] Completing iteration array failed: " << status.ToString() << "\n"; return; } + + status = id_builder.Finish(&arr_id); + if (!status.ok()) { std::cerr << " [ARROW ERROR] Completing agent ID array failed: " << status.ToString() << "\n"; return; } + + table_arrays.push_back(arr_iter); + table_arrays.push_back(arr_id); + + // 2. Loop through our columns map and dynamically build floating-point array records + for (const auto& [col_name, col_vec] : buf.columns) { + arrow::DoubleBuilder col_builder(pool); + status = col_builder.AppendValues(col_vec); + if (!status.ok()) { + std::cerr << " [ARROW ERROR] Appending column " << col_name << " failed: " << status.ToString() << "\n"; + return; + } + + std::shared_ptr arr_col; + + // FIXED: Capture and verify status inside the map iterator loop + status = col_builder.Finish(&arr_col); + if (!status.ok()) { std::cerr << " [ARROW ERROR] Completing column array for " << col_name << " failed: " << status.ToString() << "\n"; return; } + + schema_fields.push_back(arrow::field(col_name, arrow::float64())); + table_arrays.push_back(arr_col); + } + + // 3. Complete the schema description definition layout and pack columns into an Arrow Table + auto schema = std::make_shared(schema_fields); + auto table = arrow::Table::Make(schema, table_arrays); + + // 4. Construct the output file target path string inside the Current Working Directory + // NOTE: Construct the output file target path relative to 0.xml location + std::string filename = std::string(parquet_output_directory) + agent + "_" + std::to_string(iteration) + ".parquet"; + + // 5. Instantiate a native operating system writable file descriptor stream context + std::shared_ptr outfile; + auto create_res = arrow::io::FileOutputStream::Open(filename); + if (!create_res.ok()) { + std::cerr << " [FILE IO ERROR] Could not open file context '" << filename + << "' for writing. Status: " << create_res.status().ToString() << "\n"; + return; + } + outfile = create_res.ValueOrDie(); + + // 6. Serialize the Table memory layout and compress it straight onto the physical disk + status = parquet::arrow::WriteTable(*table, pool, outfile, 65536); // Standard 64KB row chunks + if (!status.ok()) { + std::cerr << " [PARQUET WRITE FAILURE] Serialization pipeline crash: " << status.ToString() << "\n"; + return; + } + + std::cout << " [PARQUET SUCCESS] File safely committed: " << filename << std::endl; +} + +} // extern "C" diff --git a/parquet_engine.h.tmpl b/parquet_engine.h.tmpl new file mode 100644 index 0000000..140c1db --- /dev/null +++ b/parquet_engine.h.tmpl @@ -0,0 +1,28 @@ +#ifndef PARQUET_ENGINE_H +#define PARQUET_ENGINE_H + +#ifdef __cplusplus +extern "C" { +#endif + +// Global variable to hold the directory path of the initial XML file (this is where parquet files are written out) +extern char parquet_output_directory[512]; + +// Allocates a new row record with identity metadata before streaming its variables +void parquet_start_row(const char* agent_name, int iteration, long id); + +// Streams an individual column value for the current active row record +void parquet_buffer_variable(const char* agent_name, const char* var_name, double value); + +// Lifecycle hooks +void parquet_clear_buffer(const char* agent_name); +void parquet_write_file(const char* agent_name, int iteration); + +// Save iteration data to parquet +void saveiterationdata_parquet(int iteration_no); + +#ifdef __cplusplus +} +#endif + +#endif // PARQUET_ENGINE_H diff --git a/parsetemplate.c b/parsetemplate.c old mode 100644 new mode 100755 diff --git a/partitioning.tmpl b/partitioning.tmpl old mode 100644 new mode 100755 index b224c45..21f5bb9 --- a/partitioning.tmpl +++ b/partitioning.tmpl @@ -355,10 +355,21 @@ void broadcast_node_data(int totalnodes, int node_number) void save_partition_data() { FILE *file; - char data[100]; + char data[1000]; node_information *node_info; - sprintf(data, "%sspace_partitions.xml", outputpath); + // Check if outputpath leaves enough room for "log.xml" (7 bytes) + null terminator (1 byte) + if (strlen(outputpath) + 8 > sizeof(data)) { + fprintf(stderr, "Error: outputpath is too long for the log file path buffer.\n"); + // Handle the error gracefully (e.g., return, exit, or fall back) + exit(0); + } + // GCC now knows this snprintf will never truncate, still we use pragma's to shut up the compiler + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-truncation" + snprintf(data, sizeof(data), "%sspace_partitions.xml", outputpath); /* use snprintf to protect against overflow */ + #pragma GCC diagnostic pop + file = fopen(data, "w"); fputs("\n" , file); fputs("\n" , file); diff --git a/readmodel.c b/readmodel.c old mode 100644 new mode 100755 diff --git a/rules.tmpl b/rules.tmpl old mode 100644 new mode 100755 diff --git a/tests/Makefile b/tests/Makefile old mode 100644 new mode 100755 diff --git a/tests/run_test.c b/tests/run_test.c old mode 100644 new mode 100755 diff --git a/tests/test1/0.xml b/tests/test1/0.xml old mode 100644 new mode 100755 diff --git a/tests/test1/agent_a_functions.c b/tests/test1/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test1/agent_b_functions.c b/tests/test1/agent_b_functions.c old mode 100644 new mode 100755 diff --git a/tests/test1/agents_0.xml b/tests/test1/agents_0.xml old mode 100644 new mode 100755 diff --git a/tests/test1/environment_0.xml b/tests/test1/environment_0.xml old mode 100644 new mode 100755 diff --git a/tests/test1/expected.out b/tests/test1/expected.out old mode 100644 new mode 100755 diff --git a/tests/test1/test_model_1.xml b/tests/test1/test_model_1.xml old mode 100644 new mode 100755 diff --git a/tests/test1/test_model_1_sub_1.xml b/tests/test1/test_model_1_sub_1.xml old mode 100644 new mode 100755 diff --git a/tests/test1/test_model_1_sub_2.xml b/tests/test1/test_model_1_sub_2.xml old mode 100644 new mode 100755 diff --git a/tests/test2/0-output.xml b/tests/test2/0-output.xml old mode 100644 new mode 100755 diff --git a/tests/test2/0.xml b/tests/test2/0.xml old mode 100644 new mode 100755 diff --git a/tests/test2/agent_a_functions.c b/tests/test2/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test2/test_model_2.xml b/tests/test2/test_model_2.xml old mode 100644 new mode 100755 diff --git a/tests/test3/test_truncated_empty_xml_tags.xml b/tests/test3/test_truncated_empty_xml_tags.xml old mode 100644 new mode 100755 diff --git a/tests/test4/0.xml b/tests/test4/0.xml old mode 100644 new mode 100755 diff --git a/tests/test4/agent_a_functions.c b/tests/test4/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test4/agent_b_functions.c b/tests/test4/agent_b_functions.c old mode 100644 new mode 100755 diff --git a/tests/test4/create_initial.c b/tests/test4/create_initial.c old mode 100644 new mode 100755 diff --git a/tests/test4/test_model_4.xml b/tests/test4/test_model_4.xml old mode 100644 new mode 100755 diff --git a/tests/test5/0.xml b/tests/test5/0.xml old mode 100644 new mode 100755 diff --git a/tests/test5/agent_a_functions.c b/tests/test5/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test5/test_model_5.xml b/tests/test5/test_model_5.xml old mode 100644 new mode 100755 diff --git a/tests/test6/0.xml b/tests/test6/0.xml old mode 100644 new mode 100755 diff --git a/tests/test6/agent_a_functions.c b/tests/test6/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test6/test_model_6.xml b/tests/test6/test_model_6.xml old mode 100644 new mode 100755 diff --git a/tests/test7/0.xml b/tests/test7/0.xml old mode 100644 new mode 100755 diff --git a/tests/test7/0_depth_0.xml b/tests/test7/0_depth_0.xml old mode 100644 new mode 100755 diff --git a/tests/test7/0_depth_1.xml b/tests/test7/0_depth_1.xml old mode 100644 new mode 100755 diff --git a/tests/test7/0_depth_1_agent.xml b/tests/test7/0_depth_1_agent.xml old mode 100644 new mode 100755 diff --git a/tests/test7/0_depth_1_env.xml b/tests/test7/0_depth_1_env.xml old mode 100644 new mode 100755 diff --git a/tests/test7/1.xml.saved b/tests/test7/1.xml.saved old mode 100644 new mode 100755 diff --git a/tests/test7/agent_a_functions.c b/tests/test7/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test7/test_model_7.xml b/tests/test7/test_model_7.xml old mode 100644 new mode 100755 diff --git a/tests/test8/0.xml b/tests/test8/0.xml old mode 100644 new mode 100755 diff --git a/tests/test8/agent_a_functions.c b/tests/test8/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test8/test_model_8.xml b/tests/test8/test_model_8.xml old mode 100644 new mode 100755 diff --git a/tests/test9/0.xml b/tests/test9/0.xml old mode 100644 new mode 100755 diff --git a/tests/test9/1.xml.saved b/tests/test9/1.xml.saved old mode 100644 new mode 100755 diff --git a/tests/test9/agent_a_functions.c b/tests/test9/agent_a_functions.c old mode 100644 new mode 100755 diff --git a/tests/test9/test_model_9.xml b/tests/test9/test_model_9.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/basic_agent_order/0.xml b/tests/test_agent_order/models/basic_agent_order/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/basic_agent_order/agent_functions.c b/tests/test_agent_order/models/basic_agent_order/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/basic_agent_order/model.xml b/tests/test_agent_order/models/basic_agent_order/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/basic_agent_order/test_output/test_output.txt b/tests/test_agent_order/models/basic_agent_order/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading/0.xml b/tests/test_agent_order/models/message_reading/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading/agent_functions.c b/tests/test_agent_order/models/message_reading/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading/model.xml b/tests/test_agent_order/models/message_reading/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading/test_output/test_output.txt b/tests/test_agent_order/models/message_reading/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading_print/0.xml b/tests/test_agent_order/models/message_reading_print/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading_print/agent_functions.c b/tests/test_agent_order/models/message_reading_print/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading_print/model.xml b/tests/test_agent_order/models/message_reading_print/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/models/message_reading_print/test_output/test_output.txt b/tests/test_agent_order/models/message_reading_print/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/readme.md b/tests/test_agent_order/readme.md old mode 100644 new mode 100755 diff --git a/tests/test_agent_order/run_all_tests.sh b/tests/test_agent_order/run_all_tests.sh old mode 100644 new mode 100755 diff --git a/tests/test_conditions/create_tests.sh b/tests/test_conditions/create_tests.sh old mode 100644 new mode 100755 diff --git a/tests/test_conditions/doc/tests_conditions.tex b/tests/test_conditions/doc/tests_conditions.tex old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/templates/a.xml b/tests/test_conditions/models/templates/a.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/templates/agent_functions.c b/tests/test_conditions/models/templates/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/templates/b.xml b/tests/test_conditions/models/templates/b.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/templates/c.xml b/tests/test_conditions/models/templates/c.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/templates/d.xml b/tests/test_conditions/models/templates/d.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/a/0.xml b/tests/test_conditions/models/test_1/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/a/agent_functions.c b/tests/test_conditions/models/test_1/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/a/model.xml b/tests/test_conditions/models/test_1/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/ab/model_ab.xml b/tests/test_conditions/models/test_1/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/b/0.xml b/tests/test_conditions/models/test_1/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/b/agent_functions.c b/tests/test_conditions/models/test_1/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/b/model.xml b/tests/test_conditions/models/test_1/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/c/0.xml b/tests/test_conditions/models/test_1/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/c/agent_functions.c b/tests/test_conditions/models/test_1/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/c/model.xml b/tests/test_conditions/models/test_1/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/cd/model_cd.xml b/tests/test_conditions/models/test_1/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/d/0.xml b/tests/test_conditions/models/test_1/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/d/agent_functions.c b/tests/test_conditions/models/test_1/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_1/d/model.xml b/tests/test_conditions/models/test_1/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/a/0.xml b/tests/test_conditions/models/test_10/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/a/agent_functions.c b/tests/test_conditions/models/test_10/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/a/model.xml b/tests/test_conditions/models/test_10/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/ab/model_ab.xml b/tests/test_conditions/models/test_10/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/b/0.xml b/tests/test_conditions/models/test_10/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/b/agent_functions.c b/tests/test_conditions/models/test_10/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/b/model.xml b/tests/test_conditions/models/test_10/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/c/0.xml b/tests/test_conditions/models/test_10/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/c/agent_functions.c b/tests/test_conditions/models/test_10/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/c/model.xml b/tests/test_conditions/models/test_10/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/cd/model_cd.xml b/tests/test_conditions/models/test_10/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/d/0.xml b/tests/test_conditions/models/test_10/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/d/agent_functions.c b/tests/test_conditions/models/test_10/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_10/d/model.xml b/tests/test_conditions/models/test_10/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/a/0.xml b/tests/test_conditions/models/test_11/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/a/agent_functions.c b/tests/test_conditions/models/test_11/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/a/model.xml b/tests/test_conditions/models/test_11/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/ab/model_ab.xml b/tests/test_conditions/models/test_11/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/b/0.xml b/tests/test_conditions/models/test_11/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/b/agent_functions.c b/tests/test_conditions/models/test_11/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/b/model.xml b/tests/test_conditions/models/test_11/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/c/0.xml b/tests/test_conditions/models/test_11/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/c/agent_functions.c b/tests/test_conditions/models/test_11/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/c/model.xml b/tests/test_conditions/models/test_11/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/cd/model_cd.xml b/tests/test_conditions/models/test_11/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/d/0.xml b/tests/test_conditions/models/test_11/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/d/agent_functions.c b/tests/test_conditions/models/test_11/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_11/d/model.xml b/tests/test_conditions/models/test_11/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/a/0.xml b/tests/test_conditions/models/test_12/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/a/agent_functions.c b/tests/test_conditions/models/test_12/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/a/model.xml b/tests/test_conditions/models/test_12/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/ab/model_ab.xml b/tests/test_conditions/models/test_12/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/b/0.xml b/tests/test_conditions/models/test_12/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/b/agent_functions.c b/tests/test_conditions/models/test_12/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/b/model.xml b/tests/test_conditions/models/test_12/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/c/0.xml b/tests/test_conditions/models/test_12/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/c/agent_functions.c b/tests/test_conditions/models/test_12/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/c/model.xml b/tests/test_conditions/models/test_12/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/cd/model_cd.xml b/tests/test_conditions/models/test_12/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/d/0.xml b/tests/test_conditions/models/test_12/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/d/agent_functions.c b/tests/test_conditions/models/test_12/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_12/d/model.xml b/tests/test_conditions/models/test_12/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/a/0.xml b/tests/test_conditions/models/test_13/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/a/agent_functions.c b/tests/test_conditions/models/test_13/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/a/model.xml b/tests/test_conditions/models/test_13/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/ab/model_ab.xml b/tests/test_conditions/models/test_13/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/b/0.xml b/tests/test_conditions/models/test_13/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/b/agent_functions.c b/tests/test_conditions/models/test_13/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/b/model.xml b/tests/test_conditions/models/test_13/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/c/0.xml b/tests/test_conditions/models/test_13/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/c/agent_functions.c b/tests/test_conditions/models/test_13/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/c/model.xml b/tests/test_conditions/models/test_13/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/cd/model_cd.xml b/tests/test_conditions/models/test_13/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/d/0.xml b/tests/test_conditions/models/test_13/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/d/agent_functions.c b/tests/test_conditions/models/test_13/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_13/d/model.xml b/tests/test_conditions/models/test_13/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/a/0.xml b/tests/test_conditions/models/test_14/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/a/agent_functions.c b/tests/test_conditions/models/test_14/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/a/model.xml b/tests/test_conditions/models/test_14/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/ab/model_ab.xml b/tests/test_conditions/models/test_14/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/b/0.xml b/tests/test_conditions/models/test_14/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/b/agent_functions.c b/tests/test_conditions/models/test_14/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/b/model.xml b/tests/test_conditions/models/test_14/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/c/0.xml b/tests/test_conditions/models/test_14/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/c/agent_functions.c b/tests/test_conditions/models/test_14/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/c/model.xml b/tests/test_conditions/models/test_14/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/cd/model_cd.xml b/tests/test_conditions/models/test_14/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/d/0.xml b/tests/test_conditions/models/test_14/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/d/agent_functions.c b/tests/test_conditions/models/test_14/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_14/d/model.xml b/tests/test_conditions/models/test_14/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/a/0.xml b/tests/test_conditions/models/test_15/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/a/agent_functions.c b/tests/test_conditions/models/test_15/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/a/model.xml b/tests/test_conditions/models/test_15/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/ab/model_ab.xml b/tests/test_conditions/models/test_15/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/b/0.xml b/tests/test_conditions/models/test_15/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/b/agent_functions.c b/tests/test_conditions/models/test_15/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/b/model.xml b/tests/test_conditions/models/test_15/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/c/0.xml b/tests/test_conditions/models/test_15/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/c/agent_functions.c b/tests/test_conditions/models/test_15/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/c/model.xml b/tests/test_conditions/models/test_15/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/cd/model_cd.xml b/tests/test_conditions/models/test_15/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/d/0.xml b/tests/test_conditions/models/test_15/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/d/agent_functions.c b/tests/test_conditions/models/test_15/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_15/d/model.xml b/tests/test_conditions/models/test_15/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/a/0.xml b/tests/test_conditions/models/test_16/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/a/agent_functions.c b/tests/test_conditions/models/test_16/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/a/model.xml b/tests/test_conditions/models/test_16/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/ab/model_ab.xml b/tests/test_conditions/models/test_16/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/b/0.xml b/tests/test_conditions/models/test_16/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/b/agent_functions.c b/tests/test_conditions/models/test_16/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/b/model.xml b/tests/test_conditions/models/test_16/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/c/0.xml b/tests/test_conditions/models/test_16/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/c/agent_functions.c b/tests/test_conditions/models/test_16/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/c/model.xml b/tests/test_conditions/models/test_16/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/cd/model_cd.xml b/tests/test_conditions/models/test_16/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/d/0.xml b/tests/test_conditions/models/test_16/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/d/agent_functions.c b/tests/test_conditions/models/test_16/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_16/d/model.xml b/tests/test_conditions/models/test_16/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/a/0.xml b/tests/test_conditions/models/test_2/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/a/agent_functions.c b/tests/test_conditions/models/test_2/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/a/model.xml b/tests/test_conditions/models/test_2/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/ab/model_ab.xml b/tests/test_conditions/models/test_2/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/b/0.xml b/tests/test_conditions/models/test_2/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/b/agent_functions.c b/tests/test_conditions/models/test_2/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/b/model.xml b/tests/test_conditions/models/test_2/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/c/0.xml b/tests/test_conditions/models/test_2/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/c/agent_functions.c b/tests/test_conditions/models/test_2/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/c/model.xml b/tests/test_conditions/models/test_2/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/cd/model_cd.xml b/tests/test_conditions/models/test_2/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/d/0.xml b/tests/test_conditions/models/test_2/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/d/agent_functions.c b/tests/test_conditions/models/test_2/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_2/d/model.xml b/tests/test_conditions/models/test_2/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/a/0.xml b/tests/test_conditions/models/test_3/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/a/agent_functions.c b/tests/test_conditions/models/test_3/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/a/model.xml b/tests/test_conditions/models/test_3/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/ab/model_ab.xml b/tests/test_conditions/models/test_3/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/b/0.xml b/tests/test_conditions/models/test_3/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/b/agent_functions.c b/tests/test_conditions/models/test_3/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/b/model.xml b/tests/test_conditions/models/test_3/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/c/0.xml b/tests/test_conditions/models/test_3/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/c/agent_functions.c b/tests/test_conditions/models/test_3/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/c/model.xml b/tests/test_conditions/models/test_3/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/cd/model_cd.xml b/tests/test_conditions/models/test_3/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/d/0.xml b/tests/test_conditions/models/test_3/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/d/agent_functions.c b/tests/test_conditions/models/test_3/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_3/d/model.xml b/tests/test_conditions/models/test_3/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/a/0.xml b/tests/test_conditions/models/test_4/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/a/agent_functions.c b/tests/test_conditions/models/test_4/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/a/model.xml b/tests/test_conditions/models/test_4/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/ab/model_ab.xml b/tests/test_conditions/models/test_4/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/b/0.xml b/tests/test_conditions/models/test_4/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/b/agent_functions.c b/tests/test_conditions/models/test_4/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/b/model.xml b/tests/test_conditions/models/test_4/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/c/0.xml b/tests/test_conditions/models/test_4/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/c/agent_functions.c b/tests/test_conditions/models/test_4/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/c/model.xml b/tests/test_conditions/models/test_4/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/cd/model_cd.xml b/tests/test_conditions/models/test_4/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/d/0.xml b/tests/test_conditions/models/test_4/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/d/agent_functions.c b/tests/test_conditions/models/test_4/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_4/d/model.xml b/tests/test_conditions/models/test_4/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/a/0.xml b/tests/test_conditions/models/test_5/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/a/agent_functions.c b/tests/test_conditions/models/test_5/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/a/model.xml b/tests/test_conditions/models/test_5/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/ab/model_ab.xml b/tests/test_conditions/models/test_5/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/b/0.xml b/tests/test_conditions/models/test_5/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/b/agent_functions.c b/tests/test_conditions/models/test_5/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/b/model.xml b/tests/test_conditions/models/test_5/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/c/0.xml b/tests/test_conditions/models/test_5/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/c/agent_functions.c b/tests/test_conditions/models/test_5/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/c/model.xml b/tests/test_conditions/models/test_5/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/cd/model_cd.xml b/tests/test_conditions/models/test_5/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/d/0.xml b/tests/test_conditions/models/test_5/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/d/agent_functions.c b/tests/test_conditions/models/test_5/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_5/d/model.xml b/tests/test_conditions/models/test_5/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/a/0.xml b/tests/test_conditions/models/test_6/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/a/agent_functions.c b/tests/test_conditions/models/test_6/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/a/model.xml b/tests/test_conditions/models/test_6/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/ab/model_ab.xml b/tests/test_conditions/models/test_6/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/b/0.xml b/tests/test_conditions/models/test_6/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/b/agent_functions.c b/tests/test_conditions/models/test_6/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/b/model.xml b/tests/test_conditions/models/test_6/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/c/0.xml b/tests/test_conditions/models/test_6/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/c/agent_functions.c b/tests/test_conditions/models/test_6/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/c/model.xml b/tests/test_conditions/models/test_6/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/cd/model_cd.xml b/tests/test_conditions/models/test_6/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/d/0.xml b/tests/test_conditions/models/test_6/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/d/agent_functions.c b/tests/test_conditions/models/test_6/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_6/d/model.xml b/tests/test_conditions/models/test_6/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/a/0.xml b/tests/test_conditions/models/test_7/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/a/agent_functions.c b/tests/test_conditions/models/test_7/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/a/model.xml b/tests/test_conditions/models/test_7/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/ab/model_ab.xml b/tests/test_conditions/models/test_7/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/b/0.xml b/tests/test_conditions/models/test_7/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/b/agent_functions.c b/tests/test_conditions/models/test_7/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/b/model.xml b/tests/test_conditions/models/test_7/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/c/0.xml b/tests/test_conditions/models/test_7/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/c/agent_functions.c b/tests/test_conditions/models/test_7/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/c/model.xml b/tests/test_conditions/models/test_7/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/cd/model_cd.xml b/tests/test_conditions/models/test_7/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/d/0.xml b/tests/test_conditions/models/test_7/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/d/agent_functions.c b/tests/test_conditions/models/test_7/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_7/d/model.xml b/tests/test_conditions/models/test_7/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/a/0.xml b/tests/test_conditions/models/test_8/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/a/agent_functions.c b/tests/test_conditions/models/test_8/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/a/model.xml b/tests/test_conditions/models/test_8/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/ab/model_ab.xml b/tests/test_conditions/models/test_8/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/b/0.xml b/tests/test_conditions/models/test_8/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/b/agent_functions.c b/tests/test_conditions/models/test_8/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/b/model.xml b/tests/test_conditions/models/test_8/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/c/0.xml b/tests/test_conditions/models/test_8/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/c/agent_functions.c b/tests/test_conditions/models/test_8/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/c/model.xml b/tests/test_conditions/models/test_8/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/cd/model_cd.xml b/tests/test_conditions/models/test_8/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/d/0.xml b/tests/test_conditions/models/test_8/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/d/agent_functions.c b/tests/test_conditions/models/test_8/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_8/d/model.xml b/tests/test_conditions/models/test_8/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/a/0.xml b/tests/test_conditions/models/test_9/a/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/a/agent_functions.c b/tests/test_conditions/models/test_9/a/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/a/model.xml b/tests/test_conditions/models/test_9/a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/ab/model_ab.xml b/tests/test_conditions/models/test_9/ab/model_ab.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/b/0.xml b/tests/test_conditions/models/test_9/b/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/b/agent_functions.c b/tests/test_conditions/models/test_9/b/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/b/model.xml b/tests/test_conditions/models/test_9/b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/c/0.xml b/tests/test_conditions/models/test_9/c/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/c/agent_functions.c b/tests/test_conditions/models/test_9/c/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/c/model.xml b/tests/test_conditions/models/test_9/c/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/cd/model_cd.xml b/tests/test_conditions/models/test_9/cd/model_cd.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/d/0.xml b/tests/test_conditions/models/test_9/d/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/d/agent_functions.c b/tests/test_conditions/models/test_9/d/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_conditions/models/test_9/d/model.xml b/tests/test_conditions/models/test_9/d/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_conditions/output/flame_output.txt b/tests/test_conditions/output/flame_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_conditions/output/test_output.txt b/tests/test_conditions/output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_conditions/readme.md b/tests/test_conditions/readme.md old mode 100644 new mode 100755 diff --git a/tests/test_conditions/run_all_tests.sh b/tests/test_conditions/run_all_tests.sh old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering/0.xml b/tests/test_mesg_operations/models/filtering/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering/agent_functions.c b/tests/test_mesg_operations/models/filtering/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering/model.xml b/tests/test_mesg_operations/models/filtering/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering/test_output/test_output.txt b/tests/test_mesg_operations/models/filtering/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering_and_random/0.xml b/tests/test_mesg_operations/models/filtering_and_random/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering_and_random/agent_functions.c b/tests/test_mesg_operations/models/filtering_and_random/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering_and_random/model.xml b/tests/test_mesg_operations/models/filtering_and_random/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/filtering_and_random/test_output/test_output.txt b/tests/test_mesg_operations/models/filtering_and_random/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/randomizing/0.xml b/tests/test_mesg_operations/models/randomizing/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/randomizing/agent_functions.c b/tests/test_mesg_operations/models/randomizing/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/randomizing/model.xml b/tests/test_mesg_operations/models/randomizing/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/randomizing/test_output/test_output.txt b/tests/test_mesg_operations/models/randomizing/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/sorting/0.xml b/tests/test_mesg_operations/models/sorting/0.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/sorting/agent_functions.c b/tests/test_mesg_operations/models/sorting/agent_functions.c old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/sorting/model.xml b/tests/test_mesg_operations/models/sorting/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/models/sorting/test_output/test_output.txt b/tests/test_mesg_operations/models/sorting/test_output/test_output.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/readme.md b/tests/test_mesg_operations/readme.md old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/run_all_tests.sh b/tests/test_mesg_operations/run_all_tests.sh old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/stderr.txt b/tests/test_mesg_operations/stderr.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesg_operations/stdout.txt b/tests/test_mesg_operations/stdout.txt old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model0/model.xml b/tests/test_mesgs/model0/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model1a/model.xml b/tests/test_mesgs/model1a/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model1b/model.xml b/tests/test_mesgs/model1b/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model2/model.xml b/tests/test_mesgs/model2/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model3/model.xml b/tests/test_mesgs/model3/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/model4/model.xml b/tests/test_mesgs/model4/model.xml old mode 100644 new mode 100755 diff --git a/tests/test_mesgs/readme.md b/tests/test_mesgs/readme.md old mode 100644 new mode 100755 diff --git a/timing.tmpl b/timing.tmpl old mode 100644 new mode 100755 diff --git a/xmml.xsd b/xmml.xsd old mode 100644 new mode 100755 diff --git a/xparser.c b/xparser.c old mode 100644 new mode 100755 index b2edd7b..bb24e08 --- a/xparser.c +++ b/xparser.c @@ -268,56 +268,90 @@ int main(int argc, char * argv[]) return 0; } + // Zero-initialize the entire buffer space + memset(filename, 0, sizeof(filename)); + memset(tmpl_name, 0, sizeof(tmpl_name)); + strcpy(filename, directory); strcat(filename, "Makefile"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "Makefile.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "xml.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "xml.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "main.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "main.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "header.h"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "header.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "memory.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "memory.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + + /* Parquet related */ + strcpy(filename, directory); + strcat(filename, "parquet.cpp"); + strcpy(tmpl_name, tmpl_directory); + strcat(tmpl_name, "parquet.cpp.tmpl"); + parseTemplate(filename, tmpl_name, modeldata); + + strcpy(filename, directory); + strcat(filename, "parquet_engine.h"); + strcpy(tmpl_name, tmpl_directory); + strcat(tmpl_name, "parquet_engine.h.tmpl"); + parseTemplate(filename, tmpl_name, modeldata); + + /* Optional: Have xparser generate the engine source file too */ + strcpy(filename, directory); + strcat(filename, "parquet_engine.cpp"); + strcpy(tmpl_name, tmpl_directory); + strcat(tmpl_name, "parquet_engine.cpp.tmpl"); + parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "low_primes.h"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "low_primes.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "messageboards.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "messageboards.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "partitioning.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "partitioning.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "timing.c"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "timing.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "Doxyfile"); strcpy(tmpl_name, tmpl_directory); strcat(tmpl_name, "Doxyfile.tmpl"); parseTemplate(filename, tmpl_name, modeldata); + strcpy(filename, directory); strcat(filename, "rules.c"); strcpy(tmpl_name, tmpl_directory);