Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See Diff Files #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Deploy nightly release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.NIGHTLY_BUILD }}"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: 'nightly'
prerelease: true
title: "Lingua Franca Nightly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ private String getSetupCode() {
"# Set a trap to kill all background jobs on error or control-C",
"# Use two distinct traps so we can see which signal causes this.",
"cleanup() {",
" tmux kill-session -t plasma",
" if [ \"$EXITED_SUCCESSFULLY\" = true ] ; then",
" exit 0",
" else",
Expand All @@ -293,6 +294,7 @@ private String getSetupCode() {
"}",
"",
"trap 'cleanup; exit' EXIT",
"tmux new -d -s plasma plasma_store -m 4000000000 -s /tmp/plasma",
"",
"# Create a random 48-byte text ID for this federation.",
"# The likelihood of two federations having the same ID is 1/16,777,216 (1/2^24).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,31 @@ public StringBuilder generateNetworkSerializerCode(String varName, String origin
serializerCode.append(
"if (global_pickler == NULL) lf_print_error_and_exit(\"The pickle module is not"
+ " loaded.\");\n");
// Define the serialized PyObject
serializerCode
.append(
"PyObject* serialized_pyobject = PyObject_CallMethod(global_pickler, \"dumps\", \"O\","
+ " ")
.append(varName)
.append(");\n");

// Error check
serializerCode.append("if (serialized_pyobject == NULL) {\n");
serializerCode.append(" if (PyErr_Occurred()) PyErr_Print();\n");
// Check that global_serializer is not null
serializerCode.append(
" lf_print_error_and_exit(\"Could not serialize serialized_pyobject.\");\n");
serializerCode.append("}\n");

serializerCode.append("Py_buffer " + serializedVarName + ";\n");
"if (global_serializer == NULL) lf_print_error_and_exit(\"The globalserializer module is"
+ " not loaded.\");\n");
// Define the serialized PyObject
serializerCode.append(
"int returnValue = PyBytes_AsStringAndSize(serialized_pyobject, (char**)&"
"PyObject *serializer_serialize = PyObject_GetAttrString(global_serializer,"
+ " \"serialize\");\n"
+ "PyObject *args = PyTuple_Pack(1, "
+ varName
+ ");\n"
+ "PyObject *serialized_pyobject = PyObject_CallObject(serializer_serialize, args);\n"
+ "if (serialized_pyobject == NULL) {\n"
+ " if (PyErr_Occurred()) PyErr_Print();\n"
+ " lf_print_error_and_exit(\"Could not serialize object.\");\n"
+ "}\n"
+ "Py_buffer "
+ serializedVarName
+ ";\n"
+ "int returnValue = PyBytes_AsStringAndSize(serialized_pyobject, (char**)&"
+ serializedVarName
+ ".buf, &"
+ serializedVarName
+ ".len);\n");
+ ".len);\n"
+ "");
// Error check
serializerCode.append("if (returnValue == -1) {\n");
serializerCode.append(" if (PyErr_Occurred()) PyErr_Print();\n");
Expand All @@ -105,11 +108,18 @@ public StringBuilder generateNetworkDeserializerCode(String varName, String targ
.append("->token->value, ")
.append(varName)
.append("->token->length);\n");
// Check that global_serializer is not null
deserializerCode.append(
"if (global_serializer == NULL) lf_print_error_and_exit(\"The globalserializer module is"
+ " not loaded.\");\n");
// Deserialize using Pickle
deserializerCode.append(
"PyObject* "
"PyObject *serializer_deserialize = PyObject_GetAttrString(global_serializer,"
+ " \"deserialize\");\n"
+ "PyObject *args = PyTuple_Pack(1, message_byte_array);\n"
+ "PyObject *"
+ deserializedVarName
+ " = PyObject_CallMethod(global_pickler, \"loads\", \"O\", message_byte_array);\n");
+ " = PyObject_CallObject(serializer_deserialize, args);\n");
// Error check
deserializerCode.append("if (" + deserializedVarName + " == NULL) {\n");
deserializerCode.append(" if (PyErr_Occurred()) PyErr_Print();\n");
Expand Down
Loading