19
edits
Changes
→Library Utilities
# [mailto:xweng11@myseneca.ca?subject=GPU621 Xi Weng]
# [mailto:hbhuang2@myseneca.ca?subject=GPU621 Ivan Huang]
# [mailto:yli593@myseneca.ca?subject=GPU621 Yu (Jackie) Li]
# [mailto:xweng11@myseneca.ca;hbhuang2@myseneca.ca;yli593@myseneca.ca?subject=GPU621 eMail All]
=== Locality ===
The built-in type locale is used to represent locales in Chapel. When a task is trying to access a variable within the same locale, the cost is less compared to accessing a variable from another locale.
'''numLocales:''' a built-in variable which returns the number of locales for the current program as an integer.
use Time;
/* Create a Timer t */
t.stop();
t.clear();
'''List:''' the list type can be imported using the following statement:
var new_list: list(int) = 1..5;
'''insert(index, value):''' used to insert the value at the specified index.
== Comparison to MPI & OpenMP ==
// Chapel is short and concise.