#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
// Get the rank of the process
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
// Get the name of the processor
char processor_name[MPI_MAX_PROCESSOR_NAME];
int name_len;
MPI_Get_processor_name(processor_name, &name_len);
// Print off a hello world message
printf("Hello world from processor %s, rank %d out of %d processors\n", processor_name, world_rank, world_size);
// Finalize the MPI environment.
MPI_Finalize();
}
I2luY2x1ZGUgPG1waS5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCmludCBtYWluKGludCBhcmdjLCBjaGFyKiogYXJndikgewogICAgLy8gSW5pdGlhbGl6ZSB0aGUgTVBJIGVudmlyb25tZW50CiAgICBNUElfSW5pdChOVUxMLCBOVUxMKTsKCiAgICAvLyBHZXQgdGhlIG51bWJlciBvZiBwcm9jZXNzZXMKICAgIGludCB3b3JsZF9zaXplOwogICAgTVBJX0NvbW1fc2l6ZShNUElfQ09NTV9XT1JMRCwgJndvcmxkX3NpemUpOwoKICAgIC8vIEdldCB0aGUgcmFuayBvZiB0aGUgcHJvY2VzcwogICAgaW50IHdvcmxkX3Jhbms7CiAgICBNUElfQ29tbV9yYW5rKE1QSV9DT01NX1dPUkxELCAmd29ybGRfcmFuayk7CgogICAgLy8gR2V0IHRoZSBuYW1lIG9mIHRoZSBwcm9jZXNzb3IKICAgIGNoYXIgcHJvY2Vzc29yX25hbWVbTVBJX01BWF9QUk9DRVNTT1JfTkFNRV07CiAgICBpbnQgbmFtZV9sZW47CiAgICBNUElfR2V0X3Byb2Nlc3Nvcl9uYW1lKHByb2Nlc3Nvcl9uYW1lLCAmbmFtZV9sZW4pOwoKICAgIC8vIFByaW50IG9mZiBhIGhlbGxvIHdvcmxkIG1lc3NhZ2UKICAgIHByaW50ZigiSGVsbG8gd29ybGQgZnJvbSBwcm9jZXNzb3IgJXMsIHJhbmsgJWQgb3V0IG9mICVkIHByb2Nlc3NvcnNcbiIsCiAgICAgICAgICAgcHJvY2Vzc29yX25hbWUsIHdvcmxkX3JhbmssIHdvcmxkX3NpemUpOwoKICAgIC8vIEZpbmFsaXplIHRoZSBNUEkgZW52aXJvbm1lbnQuCiAgICBNUElfRmluYWxpemUoKTsKfQo=