Skip to content

Instantly share code, notes, and snippets.

Gustavo Serra Scalet gut

Block or report user

Report or block gut

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gut /
Last active Jul 3, 2018
[Daisy] subworkflows don't execute until the end

Explanation copied from

I've noticed, for this test workflow that when one SubWorkflow ends, it forces ending all of the others subworkflows, ignoring their tests:

[test-subworkflow.quick]: 2018-07-02T21:01:46-03:00 Running step "wait-forever" (WaitForInstancesSignal)       
[test-subworkflow.quick.wait-forever]: 2018-07-02T21:01:46-03:00 WaitForInstancesSignal: Instance "inst-quick-test-test-subworkflow-quick-14v47": watching serial port 1, SuccessMatch: "BOOTED".
[test-subworkflow.loop]: 2018-07-02T21:01:48-03:00 Running step "wait-forever" (WaitForInstancesSignal)  
[test-subworkflow.loop.wait-forever]: 2018-07-02T21:01:48-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-subworkflow-loop-8jrgh": watching serial port 1, SuccessMatch: "b32531e7ca631a108a8d924262584a5e", StatusMatch: "Printing".                                                                 
gut / PR#46.txt
Created Apr 7, 2017
py-cpuinfo on POWER8 machine
View PR#46.txt
$ python cpuinfo/
Vendor ID:
Hardware Raw:
Brand: POWER8E (raw), altivec supported
Hz Advertised: 3.6900 GHz
Hz Actual: 3.6900 GHz
Hz Advertised Raw: (3690000000, 0)
Hz Actual Raw: (3690000000, 0)
Arch: PPC_64
Bits: 64
gut /
Created Apr 7, 2017
OpenJDK 8 bug when implementing muladd on ppc
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
View torch's VSX patch for multiply.diff
diff --git c/torch/lib/TH/vector/VSX.c w/torch/lib/TH/vector/VSX.c
index 796d3b8..04877e1 100644
--- c/torch/lib/TH/vector/VSX.c
+++ w/torch/lib/TH/vector/VSX.c
@@ -399,7 +399,7 @@ static void THDoubleVector_scale_VSX(double *y, const double c, const ptrdiff_t
-static void THDoubleVector_muls_VSX(double *y, const double *x, const ptrdiff_t n)
+static void THDoubleVector_muls_VSX(double *y, const double *x, const double c, const ptrdiff_t n)
gut / sha256-test.c
Created Mar 14, 2017
Nettle's sha256 usage example
View sha256-test.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include "rsa.h"
static uint8_t * hash_sha_256 (const struct nettle_hash *hash, const char *s,
const size_t len) {
gut / hhvm.gdb
Created Sep 29, 2015
easily print VASMs of current code emission
View hhvm.gdb
# auxiliary of print_vasms
define pvector
set $i = 0
while($i < $arg0.size())
printf "\t"
p $arg0[$i].$arg1
set $i = $i + 1
gut / prctl.h_amd64.txt
Created Sep 21, 2015
asm/prctl.h does not exist for ppc64
View prctl.h_amd64.txt
$ uname -a
Linux gut-x86-64 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux
$ dpkg -l linux-libc-dev
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
ii linux-libc-dev:amd64 3.16.7-ckt11-1 amd64 Linux support headers for userspace development
$ dpkg -S prctl.h
gut / push-pop for
Last active Sep 24, 2015
ppc64 proposal for push/pop operations on assembly level
View push-pop for

The handwritten assembly is located where commented and with less indentation levels(lines 40-80).

The idea is to have a reliable push where the stack pointer $r1 remains unchanged.

On this proposal, the $r10 is used as the pointer to the top of the stack and it'll be initialized by having the same address as the stack pointer $r1:

mr 10, 1

Push will be accomplished with 1 instructions:

gut / fibo.php
Created Aug 24, 2015
Simple PHP fibonacci
View fibo.php
$n = 90; // Input: calculate fibonacci of 90
$f1 = -1;
$f2 = 1;
for ($i = 1; $i <= $n; $i++) {
$f = $f1 + $f2;
$f1 = $f2;
gut / gist:ee81b29f536fed2de5d6
Last active Aug 29, 2015
readfile system call behaves differently on x86_64 vs ppc64le. Reason: old kernel bug from ppc64le. Move to at least version 3.16.0 and it's ok!
View gist:ee81b29f536fed2de5d6
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#define BIG_OFFSET 8589934592
#define TMP_FILE1 "XXXXYYYYZZZ45212480"
#define TMP_FILE2 "666666DDDDDFFFF2480"
int main(void)
You can’t perform that action at this time.