Skip to content

Instantly share code, notes, and snippets.

@gut
gut / README.md
Last active July 3, 2018 00:24
[Daisy] subworkflows don't execute until the end

Explanation copied from GoogleCloudPlatform/compute-image-tools#472:

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
gut / PR#46.txt
Created April 7, 2017 18:47
py-cpuinfo on POWER8 machine
$ python cpuinfo/cpuinfo.py
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
gut / TestMulAdd.java
Created April 7, 2017 14:04
OpenJDK 8 bug when implementing muladd on ppc
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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
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
gut / sha256-test.c
Created March 14, 2017 17:44
Nettle's sha256 usage example
#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
gut / hhvm.gdb
Created September 29, 2015 15:52
easily print VASMs of current code emission
# auxiliary of print_vasms
define pvector
set $i = 0
while($i < $arg0.size())
printf "\t"
p $arg0[$i].$arg1
set $i = $i + 1
end
end
@gut
gut / prctl.h_amd64.txt
Created September 21, 2015 18:42
asm/prctl.h does not exist for ppc64
$ 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
Desired=Unknown/Install/Remove/Purge/Hold
| 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
gut / push-pop for ppc64.md
Last active September 24, 2015 14:23
ppc64 proposal for push/pop operations on assembly level

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
gut / fibo.php
Created August 24, 2015 13:37
Simple PHP fibonacci
<?php
$n = 90; // Input: calculate fibonacci of 90
$f1 = -1;
$f2 = 1;
for ($i = 1; $i <= $n; $i++) {
$f = $f1 + $f2;
$f1 = $f2;
@gut
gut / gist:ee81b29f536fed2de5d6
Last active August 29, 2015 14:23
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!
#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)