UPC++ Hello world and upcxx::rank*

Issue #33 resolved
Dan Bonachea created an issue

the current Hello World from section 2.2:

#include <upcxx/upcxx.hpp>
#include <iostream>
int main(int argc, char *argv[])
{
  upcxx::init();                        // initialize UPC++

  std::cout << "Hello World" << std::endl
    << " ranks:" << upcxx::rank_n()     // how many UPC++ ranks?
    << " my rank: " << upcxx::rank_me() // which rank am I?
    << std::endl;

  upcxx::finalize();                    // finalize UPC++
  return 0;
}

This example calls functions upcxx::rank_n() and upcxx::rank_me() which are currently undefined.

We need to either change these to upcxx::world().rank_n() and upcxx::world().rank_me(), or define additional functions to provide this as syntactic sugar.

Comments (2)

  1. Former user Account Deleted

    I think it's an oversight to not have rank_n and rank_me as free functions implying world. I don't have the time or a computer. Reassigned to amir to make decision.

  2. Log in to comment