Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do the following in C: This is the odd-even sort algorithm: void Odd_even_sort( int a[] /* in/out */, int n /* in */) { int

Do the following in C:

image text in transcribed

This is the odd-even sort algorithm:

void Odd_even_sort(

int a[] /* in/out */,

int n /* in */) {

int phase, i, temp;

for (phase = 0; phase

if (phase % 2 == 0){ /* Even phase */

for (i = 1; i

if (a[i1] > a[i]) {

temp = a[i];

a[i] = a[i1];

a[i1] = temp;

}

} else { /* Odd phase */

for (i = 1; i

if (a[i] > a[i+1]) {

temp = a[i];

a[i] = a[i+1];

a[i+1] = temp;

}

}

} /* Odd even sort */

Here is the PBS Script:

#PBS -l nodes=10:ppn=12,walltime=01:00:00

#PBS -q batch

#PBS -N run_yourname

#PBS -j oe

#PBS -V

#cat $PBS_NODEFILE

cd /home/

for i in 1 2 4 8; do

for j in 1 2 4 8; do

mpiexec -np $i --map-by ppr:$j:node --hostfile $PBS_NODEFILE

done

done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

4. Who would lead the group?

Answered: 1 week ago