Exemplo n.º 1
0
//
// Call a function in a task.
//
void chpl_task_taskCallFTable(chpl_fn_int_t fid,          // function to call
                              //void* arg,              // function arg
                              chpl_task_bundle_t* arg,// function arg
                              size_t arg_size,        // length of arg
                              c_sublocid_t subloc,       // desired sublocale
                              int lineno,                // line at which function begins
                              int32_t filename) {           // name of file containing function
  enter_();
  myth_chpl_create(/* is_executeOn = */ false,
                   lineno, filename,
                   subloc, fid, get_next_task_id(), arg, arg_size);
  return_from_();
}
Exemplo n.º 2
0
//
// Launch a task that is the logical continuation of some other task,
// but on a different locale.  This is used to invoke the body of an
// "on" statement.
//
void chpl_task_startMovedTask(chpl_fn_int_t fid,          // function to call
                              chpl_fn_p fp,
                              //void* arg,              // function arg
                              chpl_task_bundle_t* arg,// function arg
                              size_t arg_size, // length of arg in bytes
                              c_sublocid_t subloc,       // desired sublocale
                              chpl_taskID_t id      // task identifier
                             ) {
  enter_();
  myth_chpl_create(/* is_executeOn = */ true,
                   0, CHPL_FILE_IDX_UNKNOWN,
                   subloc, fid, id, arg, arg_size);
  return_from_();
}
Exemplo n.º 3
0
//
// Task list processing.  These are called by the compiler-emitted
// code for all parallel constructs.  addToTaskList() is called for
// each task and builds a list of all of them.  processTaskList()
// actually adds the tasks to the task pool.  executeTasksInList()
// makes sure all the tasks have at least started.  freeTaskList()
// just reclaims space associated with the list.
//
void chpl_task_addToTaskList(
         chpl_fn_int_t fid,      // function to call for task
         //void* arg,              // argument to the function
         chpl_task_bundle_t* arg, size_t arg_size,
         c_sublocid_t subloc,       // desired sublocale
         void** p_task_list_void,             // task list
         c_nodeid_t task_list_locale,         // locale (node) where task list resides
         chpl_bool is_begin_stmt,          // is begin{} stmt?  (vs. cobegin or coforall)
         int lineno,                // line at which function begins
         int32_t filename) { // name of file containing function
  enter_();
  myth_chpl_create(/* is_executeOn = */ false,
                   lineno, filename,
                   subloc, fid, get_next_task_id(), arg, arg_size);
  return_from_();
}
Exemplo n.º 4
0
//
// Launch a task that is the logical continuation of some other task,
// but on a different locale.  This is used to invoke the body of an
// "on" statement.
//
void chpl_task_startMovedTask(chpl_fn_int_t fid,          // function to call
                              chpl_fn_p fp,
                              //void* arg,              // function arg
                              chpl_task_bundle_t* arg,// function arg
                              size_t arg_size, // length of arg in bytes
                              c_sublocid_t subloc,       // desired sublocale
                              chpl_taskID_t id,      // task identifier
                              chpl_bool serial_state) {         // serial state
  enter_();
  if (chpl_task_getSerial()) {
    chpl_ftable[fid](arg);
  } else {
    myth_chpl_create(/* serial_state = */ false,
                     /* is_executeOn = */ true,
                     0, CHPL_FILE_IDX_UNKNOWN, 
                     subloc, fid, id, arg, arg_size);
  }
  return_from_();
}