- Atomic Rc vs Rc taxes for single-threaded module compile with threads:on
- API to allow to switch runtimes:
- Simple threadpool, custom one
- Throughput optimized (work-stealing)
- Latency-optimized (Earliest Deadline First schedulers / priority queues)
- Plug in Cuda/OpenCL async (Streams and Command Queue) or external system like MPI, (Hadoop/Kafka?) etc
- 2 spawns
- spawn that access a global default threadpool for Nim programs composability
- spawn that takes a threadpool as first argument
This file contains hidden or 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
# Copyright MIT and Apache, Mamy Ratsimbazafy 2019 | |
import std/atomics #, optim_hints # for prefetch | |
const WV_CacheLineSize = 128 | |
type | |
Enqueueable = concept x, type T | |
x is ptr | |
x.next is Atomic[T] |
This file contains hidden or 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
from pyutils.ssz.ssz_typing import uint64, List, Bitlist, Bytes32, Bytes96, Container | |
from pyutils.ssz.ssz_impl import hash_tree_root | |
# Minimal | |
# MAX_VALIDATORS_PER_COMMITTEE = 2048 | |
# Mainnet | |
MAX_VALIDATORS_PER_COMMITTEE = 4096 | |
class Checkpoint(Container): |
This file contains hidden or 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
package experimental | |
import "encoding/binary" | |
// Experimental code! Everything a tree and cached by default. | |
type HashFn func(a Root, b Root) Root | |
// A link is called to rebind a value |
Nimbus updates
Doc:
- Build instructions updated for Raspberry Pi
Public testnet: Nimbus testnets metadata up at https://github.com/eth2-clients/eth2-testnets Guidelines: https://github.com/ethereum/eth2.0-pm/blob/f1faca34b712b21602437b7627192cb9ba64edff/interop/deposit_contract_testnets/README.md
- Private Grafana dashboard that we will open up across the next weeks
Either
nim c --passC:"-fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti -fverbose-asm -masm=intel -S" -d:release --noLinking:on "path/to/file.nim"
The result will be in $HOME/.cache/file_r/file.c.o
(_r for release)
The C sources or Nim sources (with --debugger:native) will be interleaved with ASM
Otherwise use:
This file contains hidden or 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
#!/bin/bash | |
set -eo pipefail | |
# Clone Nimbus Eth 2 | |
SRCDIR=${NIMBUS_PATH:-"nim-beacon-chain"} | |
# Read in variables | |
source "$(dirname "$0")/vars.sh" |
This file contains hidden or 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 is just an example to get you started. A typical binary package | |
# uses this file as the main entry point of the application. | |
import strformat, tables, json, strutils, asyncdispatch, asyncnet, strutils, parseutils, options, net | |
from cgi import decodeUrl | |
import terminaltables | |
import mimetypes | |
type |
This file contains hidden or 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
// ---------------------------------- | |
// Time measurements | |
#include <sys/time.h> | |
#include <time.h> | |
// Number of seconds since the Epoch | |
static inline double Wtime_sec(void) | |
{ | |
struct timeval tv; |
This file contains hidden or 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
""" | |
nim_magic.py | |
Jupyter cell magic for your favorite programming language. | |
This is now also available as a proper repo: | |
https://github.com/apahl/nim_magic | |
All further changes will be tracked there. | |
Requirements: Nim (https://nim-lang.org), nimpy (`nimble install nimpy`, thanks to @yglukhov for this great library!) |