image/svg+xml const nProcs=4, count=6;let ems = require('ems')(nProcs, false, 'bsp');// All processes are executing all statementsconsole.log('Hello from Proccess', ems.myID);for(let count = 0; count < size; count += 1) { // All iterations performed by each process}// For serial execution, execute on one processif(ems.myID == 0){ console.log('Only process 0 here:', ems.myID); for(let count = 0; count < size; count += 1) { // All iterations performed by one process }} );ems.barrier(); // Wait until all threads reach herelet arrayA = ems.new(size); // New EMS Array// Iterations are distributed across processesems.parForEach(0, size, (idx) => { arrayA.writeEF(idx, 'Work by #'+ems.myID);} );// Continue parallel execution Bulk Synchronous Parallelism