/* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. */ /* * Copyright (c) 2011 Cisco Systems, Inc. All rights reserved. * */ import mpi.*; import java.net.InetAddress; class Hello { static public void main(String[] args) throws MPIException { MPI.Init(args); int myrank = MPI.COMM_WORLD.getRank(); int size = MPI.COMM_WORLD.getSize() ; InetAddress IP; try { IP = InetAddress.getLocalHost().getLocalHost(); System.out.println("Hello world from rank " + myrank + " of " + size+" I'm running on "+IP.getLocalHost()); } catch (Exception e) { } MPI.Finalize(); } }