Skip to content

Commit

Permalink
Began on FCHLock and FCHQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisJenkinsCS committed Jul 4, 2017
1 parent 50492ab commit 205021e
Show file tree
Hide file tree
Showing 73 changed files with 127,331 additions and 175 deletions.
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
SRC = $(shell find . -name *.chpl)
OUT = bin/main.exe
CFLAGS = --fast --devel
CHPLFLAGS = --fast --devel
EXTRAFLAGS =

# CFLAGS can be used to add additional compiler flags to Chapel
# CHPLFLAGS can be used to add additional compiler flags to Chapel


# Raw Microbenchmark
Benchmark:
chpl ${CFLAGS} queues/Queue.chpl queues/local/SyncList.chpl queues/local/SyncQueue.chpl \
chpl ${CHPLFLAGS} queues/Queue.chpl queues/local/SyncList.chpl queues/local/SyncQueue.chpl \
queues/local/CCQueue.chpl queues/distributed/DistributedFIFOQueue.chpl \
queues/distributed/DistributedQueue.chpl benchmark/benchmark.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module benchmark
-o $(OUT) --main-module benchmark ${EXTRAFLAGS}

# NQueens Benchmark
NQueens:
chpl ${CFLAGS} queues/Queue.chpl queues/local/SyncList.chpl queues/local/SyncQueue.chpl \
chpl ${CHPLFLAGS} queues/Queue.chpl queues/local/SyncList.chpl queues/local/SyncQueue.chpl \
queues/local/CCQueue.chpl queues/distributed/DistributedFIFOQueue.chpl \
queues/distributed/DistributedQueue.chpl benchmark/NQueens.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module NQueens
-o $(OUT) --main-module NQueens ${EXTRAFLAGS}

# Proof of Correctness Test for CCQueue...
CCQueue:
chpl ${CFLAGS} queues/local/CCQueue.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module CCQueue
chpl ${CHPLFLAGS} queues/local/CCQueue.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module CCQueue ${EXTRAFLAGS}

# Proof of Correctness Test for SyncList...
SyncList:
chpl ${CFLAGS} queues/local/SyncList.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module SyncList
chpl ${CHPLFLAGS} queues/local/SyncList.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module SyncList ${EXTRAFLAGS}

# Proof of Correctness Test for SyncQueue...
SyncQueue:
chpl ${CFLAGS} queues/local/SyncQueue.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module SyncQueue
chpl ${CHPLFLAGS} queues/local/SyncQueue.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
-o $(OUT) --main-module SyncQueue ${EXTRAFLAGS}

# Proof of Correctness Test for FCHQueue...
FCHQueue:
chpl ${CHPLFLAGS} queues/distributed/FCHQueue.chpl queues/Queue.chpl misc/LocalAtomicObject.chpl \
misc/FCHLock.chpl misc/Bitmap.chpl misc/GDT.chpl \
-o $(OUT) --main-module FCHQueue ${EXTRAFLAGS}

# Proof of Correctness Test for FIFO...
FIFO:
chpl ${CFLAGS} queues/Queue.chpl queues/distributed/DistributedFIFOQueue.chpl \
chpl ${CHPLFLAGS} queues/Queue.chpl queues/distributed/DistributedFIFOQueue.chpl \
misc/LocalAtomicObject.chpl queues/local/SyncQueue.chpl \
-o $(OUT) --main-module DistributedFIFOQueue
-o $(OUT) --main-module DistributedFIFOQueue ${EXTRAFLAGS}

# Proof of Correctness Test for MPMC...
MPMC:
chpl ${CFLAGS} queues/Queue.chpl queues/distributed/DistributedQueue.chpl \
-o $(OUT) --main-module DistributedQueue
chpl ${CHPLFLAGS} queues/Queue.chpl queues/distributed/DistributedQueue.chpl \
-o $(OUT) --main-module DistributedQueue ${EXTRAFLAGS}

clean:
rm $(OUT) $(OUT)_real
16 changes: 16 additions & 0 deletions codegen/AlignedTSupport.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* ChapelSyncvar.chpl:921 */
static void chpl__init_AlignedTSupport(int64_t _ln,
int32_t _fn) {
_ref_int32_t refIndentLevel = NULL;
if (chpl__init_AlignedTSupport_p) {
goto _exit_chpl__init_AlignedTSupport;
}
printModuleInit("%*s\n", "AlignedTSupport", INT64(15));
refIndentLevel = &moduleInitLevel;
*(refIndentLevel) += INT64(1);
chpl__init_AlignedTSupport_p = UINT8(true);
*(refIndentLevel) -= INT64(1);
_exit_chpl__init_AlignedTSupport:;
return;
}

58 changes: 58 additions & 0 deletions codegen/ArrayViewSlice.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* ArrayViewSlice.chpl:25 */
static void chpl__init_ArrayViewSlice(int64_t _ln,
int32_t _fn) {
_ref_int32_t refIndentLevel = NULL;
if (chpl__init_ArrayViewSlice_p) {
goto _exit_chpl__init_ArrayViewSlice;
}
printModuleInit("%*s\n", "ArrayViewSlice", INT64(14));
refIndentLevel = &moduleInitLevel;
*(refIndentLevel) += INT64(1);
chpl__init_ArrayViewSlice_p = UINT8(true);
*(refIndentLevel) -= INT64(1);
_exit_chpl__init_ArrayViewSlice:;
return;
}

/* ArrayViewSlice.chpl:32 */
static void chpl__auto_destroy_ArrayViewSliceArr2(chpl____wide_ArrayViewSliceArr__array_DefaultRectangularArr_FCHGlobalNode_1_int64_t_F_int64_t_int64_t_DefaultRectangularDom_1_int64_t_T_int64_t_DefaultRectangularArr__array_DefaultRectangularArr_FCHGlobalNode_1_int64_t_F_int64_t_1_int64_t_T_int64_t this12) {
chpl____wide_BaseArr _parent_destructor_tmp_ = {CHPL_LOCALEID_T_INIT, NULL};
chpl____wide_BaseArr chpl_macro_tmp_5369;
chpl_macro_tmp_5369.locale = (&this12)->locale;
chpl_macro_tmp_5369.addr = ((BaseArr)((&this12)->addr));
_parent_destructor_tmp_ = chpl_macro_tmp_5369;
deinit39(_parent_destructor_tmp_);
return;
}

/* ArrayViewSlice.chpl:32 */
static void chpl__auto_destroy_ArrayViewSliceArr(chpl____wide_ArrayViewSliceArr_Bitmap_int64_t_DefaultRectangularDom_1_int64_t_T_int64_t_DefaultRectangularArr_Bitmap_1_int64_t_T_int64_t this12) {
chpl____wide_BaseArr _parent_destructor_tmp_ = {CHPL_LOCALEID_T_INIT, NULL};
chpl____wide_BaseArr chpl_macro_tmp_5370;
chpl_macro_tmp_5370.locale = (&this12)->locale;
chpl_macro_tmp_5370.addr = ((BaseArr)((&this12)->addr));
_parent_destructor_tmp_ = chpl_macro_tmp_5370;
deinit39(_parent_destructor_tmp_);
return;
}

/* ArrayViewSlice.chpl:361 */
static chpl____wide_DefaultRectangularDom_1_int64_t_T dsiGetBaseDom2(chpl____wide_ArrayViewSliceArr__array_DefaultRectangularArr_FCHGlobalNode_1_int64_t_F_int64_t_int64_t_DefaultRectangularDom_1_int64_t_T_int64_t_DefaultRectangularArr__array_DefaultRectangularArr_FCHGlobalNode_1_int64_t_F_int64_t_1_int64_t_T_int64_t this12) {
chpl____wide_DefaultRectangularDom_1_int64_t_T ret = {CHPL_LOCALEID_T_INIT, NULL};
chpl____wide__ref__wide_DefaultRectangularDom_1_int64_t_T chpl_macro_tmp_5371;
chpl_macro_tmp_5371.locale = (&this12)->locale;
chpl_macro_tmp_5371.addr = &(((&this12)->addr)->dom);
chpl_gen_comm_get(((void*)(&ret)), chpl_nodeFromLocaleID(&((chpl_macro_tmp_5371).locale), INT64(0), INT32(0)), (chpl_macro_tmp_5371).addr, sizeof(chpl____wide_DefaultRectangularDom_1_int64_t_T), -1, COMMID(0), INT64(362), INT64(45));
return ret;
}

/* ArrayViewSlice.chpl:361 */
static chpl____wide_DefaultRectangularDom_1_int64_t_T dsiGetBaseDom(chpl____wide_ArrayViewSliceArr_Bitmap_int64_t_DefaultRectangularDom_1_int64_t_T_int64_t_DefaultRectangularArr_Bitmap_1_int64_t_T_int64_t this12) {
chpl____wide_DefaultRectangularDom_1_int64_t_T ret = {CHPL_LOCALEID_T_INIT, NULL};
chpl____wide__ref__wide_DefaultRectangularDom_1_int64_t_T chpl_macro_tmp_5372;
chpl_macro_tmp_5372.locale = (&this12)->locale;
chpl_macro_tmp_5372.addr = &(((&this12)->addr)->dom);
chpl_gen_comm_get(((void*)(&ret)), chpl_nodeFromLocaleID(&((chpl_macro_tmp_5372).locale), INT64(0), INT32(0)), (chpl_macro_tmp_5372).addr, sizeof(chpl____wide_DefaultRectangularDom_1_int64_t_T), -1, COMMID(1), INT64(362), INT64(45));
return ret;
}

76 changes: 76 additions & 0 deletions codegen/Assert.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* Assert.chpl:31 */
static void chpl__init_Assert(int64_t _ln_chpl,
int32_t _fn_chpl) {
_ref_int32_t refIndentLevel_chpl = NULL;
if (chpl__init_Assert_p) {
goto _exit_chpl__init_Assert_chpl;
}
printModuleInit("%*s\n", "Assert", INT64(6));
refIndentLevel_chpl = &moduleInitLevel;
*(refIndentLevel_chpl) += INT64(1);
chpl__init_Assert_p = UINT8(true);
*(refIndentLevel_chpl) -= INT64(1);
_exit_chpl__init_Assert_chpl:;
return;
}

/* Assert.chpl:41 */
static void assert_chpl(chpl_bool test_chpl) {
chpl_bool call_tmp_chpl;
call_tmp_chpl = (! test_chpl);
if (call_tmp_chpl) {
chpl_error("assert failed", INT64(43), INT32(63));
}
return;
}

/* Assert.chpl:57 */
static void assert_chpl2(chpl_bool test_chpl,
_ref_string _e1_args_chpl) {
string local__str_literal_337_chpl;
string local__str_literal_47_chpl;
chpl_bool call_tmp_chpl;
string tmpstring_chpl;
string call_tmp_chpl2;
string ret_tmp_chpl;
_ref_string ret_to_arg_ref_tmp__chpl = NULL;
string ret_tmp_chpl2;
_ref_string ret_to_arg_ref_tmp__chpl2 = NULL;
int32_t coerce_tmp_chpl;
chpl_bool call_tmp_chpl3;
_ref_string _ref_tmp__chpl = NULL;
chpl____wide__ref_string tmp_chpl = {CHPL_LOCALEID_T_INIT, NULL};
_ref_string _ref_tmp__chpl2 = NULL;
chpl____wide__ref_string tmp_chpl2 = {CHPL_LOCALEID_T_INIT, NULL};
chpl____wide__ref_string chpl_macro_tmp_7202;
chpl____wide__ref_string chpl_macro_tmp_7203;
local__str_literal_337_chpl /* "Cannot call .c_str() on a remote string" */ = _str_literal_337 /* "Cannot call .c_str() on a remote string" */;
local__str_literal_47_chpl /* "assert failed - " */ = _str_literal_47 /* "assert failed - " */;
call_tmp_chpl = (! test_chpl);
if (call_tmp_chpl) {
ret_to_arg_ref_tmp__chpl = &ret_tmp_chpl;
stringify_chpl2(_e1_args_chpl, ret_to_arg_ref_tmp__chpl);
call_tmp_chpl2 = ret_tmp_chpl;
ret_to_arg_ref_tmp__chpl2 = &ret_tmp_chpl2;
chpl___PLUS_(&local__str_literal_47_chpl /* "assert failed - " */, &ret_tmp_chpl, ret_to_arg_ref_tmp__chpl2);
tmpstring_chpl = ret_tmp_chpl2;
coerce_tmp_chpl = (&tmpstring_chpl)->locale_id;
call_tmp_chpl3 = (coerce_tmp_chpl != chpl_nodeID);
if (call_tmp_chpl3) {
halt(&local__str_literal_337_chpl /* "Cannot call .c_str() on a remote string" */, INT64(60), INT32(63));
}
chpl_error(((c_string)(((c_void_ptr)((&tmpstring_chpl)->buff)))), INT64(60), INT32(63));
_ref_tmp__chpl = &tmpstring_chpl;
chpl_macro_tmp_7202.locale = chpl_gen_getLocaleID();
chpl_macro_tmp_7202.addr = _ref_tmp__chpl;
tmp_chpl = chpl_macro_tmp_7202;
deinit44(tmp_chpl);
_ref_tmp__chpl2 = &call_tmp_chpl2;
chpl_macro_tmp_7203.locale = chpl_gen_getLocaleID();
chpl_macro_tmp_7203.addr = _ref_tmp__chpl2;
tmp_chpl2 = chpl_macro_tmp_7203;
deinit44(tmp_chpl2);
}
return;
}

0 comments on commit 205021e

Please sign in to comment.