-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Quapify: Simplify command line use with more messages. - Quapify: Add some new printing features (see -h). - Quapify: Support solving without adding assumptions - QuAPI: Add Zero-Copy support for big formulas as compile time option. Enable using -DENABLE_ZEROCOPY with cmake. - QuAPI: Add ZLib function injection support, so that Minisat works. - QuAPI: Add error for when not compiling on Linux (as only Linux is supported currently). - QuAPI: Add error message for when read() injection didn't work. - QuAPI: Remove strict requirement for PCRE2. Builds now also work without the library being installed, but parsing a solver's stdout is disabled if PCRE2 support is not compiled in. QuAPI exits if one tries to use regular expressions without PCRE2. - General: Add some scripts for running on slurm clusters.
- Loading branch information
1 parent
42ae1af
commit bbaa3d3
Showing
24 changed files
with
1,592 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#ifndef QUAPI_ZERO_COPY_LINUX_H | ||
#define QUAPI_ZERO_COPY_LINUX_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* This optimization is based on this article: | ||
* https://mazzo.li/posts/fast-pipes.html | ||
* | ||
* It replaces FILE and fwrite with a custom implementation based on zero-copy | ||
* splicing into and out of buffers. | ||
*/ | ||
|
||
#if defined(__linux__) && defined(QUAPI_USE_ZEROCOPY_IF_AVAILABLE) | ||
#define USING_ZEROCOPY | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <sys/types.h> | ||
|
||
typedef struct quapi_zerocopy_pipe quapi_zerocopy_pipe; | ||
|
||
quapi_zerocopy_pipe* | ||
quapi_zerocopy_pipe_fdopen(int fd, const char* mode); | ||
|
||
void | ||
quapi_zerocopy_pipe_close(quapi_zerocopy_pipe* pipe); | ||
|
||
ssize_t | ||
quapi_zerocopy_pipe_write(const void* data, | ||
size_t size, | ||
size_t count, | ||
quapi_zerocopy_pipe* pipe); | ||
|
||
void* | ||
quapi_zerocopy_pipe_prepare_write(size_t size, | ||
size_t count, | ||
quapi_zerocopy_pipe* pipe); | ||
|
||
void | ||
quapi_zerocopy_pipe_flush(quapi_zerocopy_pipe* pipe); | ||
|
||
void* | ||
quapi_zerocopy_pipe_read(size_t size, quapi_zerocopy_pipe* pipe); | ||
|
||
#define QUAPI_GIVE_MSGS(NAME, COUNT, PIPE) \ | ||
quapi_msg* NAME = \ | ||
quapi_zerocopy_pipe_prepare_write(sizeof(quapi_msg), COUNT, PIPE); | ||
|
||
#define ZEROCOPY_PIPE_OR_FILE quapi_zerocopy_pipe | ||
|
||
#else | ||
|
||
#define QUAPI_GIVE_MSGS(NAME, COUNT, IGNORED) \ | ||
quapi_msg NAME##_[COUNT]; \ | ||
quapi_msg* NAME = &NAME##_[0]; | ||
|
||
#define ZEROCOPY_PIPE_OR_FILE FILE | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.