Last active
December 5, 2015 01:41
-
-
Save EntilZha/3c8261c15f2e49d50a1b 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
template <typename A> | |
class RDD { | |
public: | |
vector<A> sequence; | |
RDD(vector<A> sequence): sequence(sequence) {} | |
template<typename Func> | |
auto map(Func f) -> RDD<decltype(f(A()))> { | |
auto r = vector<decltype(f(A()))>{f(A())}; | |
return RDD<decltype(f(A()))>(r); | |
} | |
}; | |
int main() { | |
cout << "Hello, World!" << endl; | |
vector<int> data {1, 2, 3, 4}; | |
RDD<int> rdd(data); | |
auto r = rdd.map([](int a) -> double { | |
return 1.5; | |
}); | |
cout << r.sequence.front(); | |
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
object HelloWorld { | |
def main(args: Array[String]) { | |
println("Hello") | |
val d = new RDD(Seq(1, 2)) | |
println(d.map(x => x * 2).sequence) | |
} | |
} | |
class RDD[A](val sequence: Seq[A]) { | |
def map[B](f: A => B): RDD[B] = { | |
return new RDD(sequence.map(f)) | |
} | |
} |
Author
EntilZha
commented
Dec 4, 2015
[ 32%] Building C object third-party/graph500-generator/CMakeFiles/graph500-generator.dir/graph_generator.c.o
[ 32%] Building C object third-party/graph500-generator/CMakeFiles/graph500-generator.dir/make_graph.c.o
[ 35%] Building C object third-party/graph500-generator/CMakeFiles/graph500-generator.dir/splittable_mrg.c.o
[ 35%] Building C object third-party/graph500-generator/CMakeFiles/graph500-generator.dir/utils.c.o
Linking C static library libgraph500-generator.a
[ 35%] Built target graph500-generator
Scanning dependencies of target all-third-party
[ 35%] Built target all-third-party
Scanning dependencies of target Communicator
[ 37%] Building CXX object system/CMakeFiles/Communicator.dir/Communicator.cpp.o
In file included from /home/pedro/dependencies/grappa/system/Communicator.hpp:61:0,
from /home/pedro/dependencies/grappa/system/Communicator.cpp:47:
/home/pedro/dependencies/grappa/system/Communicator.hpp: In member function ‘void Communicator::barrier_notify()’:
/home/pedro/dependencies/grappa/system/Communicator.hpp:293:60: error: ‘MPI_Ibarrier’ was not declared in this scope
MPI_CHECK( MPI_Ibarrier( grappa_comm, &barrier_request ) );
^
/home/pedro/dependencies/grappa/system/common.hpp:400:20: note: in definition of macro ‘MPI_CHECK’
if( (retval = (mpi_call)) != 0 ) { \
^
/home/pedro/dependencies/grappa/system/Communicator.cpp: In member function ‘void Communicator::init(int*, char***)’:
/home/pedro/dependencies/grappa/system/Communicator.cpp:141:51: error: ‘MPI_COMM_TYPE_SHARED’ was not declared in this scope
MPI_CHECK( MPI_Comm_split_type( MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &locale_comm ) );
^
/home/pedro/dependencies/grappa/system/common.hpp:400:20: note: in definition of macro ‘MPI_CHECK’
if( (retval = (mpi_call)) != 0 ) { \
^
/home/pedro/dependencies/grappa/system/Communicator.cpp:141:104: error: ‘MPI_Comm_split_type’ was not declared in this scope
MPI_CHECK( MPI_Comm_split_type( MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &locale_comm ) );
^
/home/pedro/dependencies/grappa/system/common.hpp:400:20: note: in definition of macro ‘MPI_CHECK’
if( (retval = (mpi_call)) != 0 ) { \
^
make[2]: *** [system/CMakeFiles/Communicator.dir/Communicator.cpp.o] Error 1
make[1]: *** [system/CMakeFiles/Communicator.dir/all] Error 2
make: *** [all] Error 2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment