Last active
September 12, 2018 21:03
-
-
Save sadjad/5ed8347686ad34a4b829fe6572edf84d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
gg-init | |
gcc -o sleeper sleeper.c -static | |
gg-collect sleeper | |
for i in $(seq 1 1000) | |
do | |
gg-create-thunk --executable $(gg-hash sleeper) --output output --placeholder ${i}.out $(gg-hash sleeper) sleeper ${i} | |
done | |
time gg-force --no-download --jobs 1000 --engine lambda --status --timeout 3 *.out |
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
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
int main() | |
{ | |
int fd = open( "output", O_WRONLY | O_CREAT | O_TRUNC, 0666 ); | |
close( fd ); | |
sleep( 2 ); | |
return 0; | |
} |
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
#!/usr/bin/env python3 | |
import time | |
import pywren | |
def f(x): | |
time.sleep(2) | |
return x | |
wrenexec = pywren.default_executor() | |
futures = wrenexec.map(f, range(1000)) | |
print(pywren.get_all_results(futures)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment