Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:58:20+00:00 2026-06-13T03:58:20+00:00

I am currently developing a Scala framework for multi-process, parallel algorithms using MPJ-Express (i.e.

  • 0

I am currently developing a Scala framework for multi-process, parallel algorithms using MPJ-Express (i.e. a Java MPI-variant).

MPJ-Express, and basically all MPI-variants, work by starting many processes with the same program. Since I have no control over the processes at runtime (my program does not spawn processes), I can’t use standard unit testing frameworks due to the following reasons:

  1. Not all processes will own a local copy of the results after execution (ideally, the results should be collected at an arbitrary root-process)

  2. Lack of control over standard-output. It is not easily possible to get output only from a single process.

  3. Lack of flow control. All processes must enter the same test at the same time to allow single-program multiple data algorithms.

Number 2 is mainly the problem, as 3 might work as expected and 1 can be fixed with an extra communication operation. Does anyone have practical experience, or know of better unit testing strategies for multi-process algorithms?

EDIT

Right now, I seem to be having luck with the following code using scalacheck:

package it.vigtig.thesis.collection.scalacheck

import java.io.OutputStream
import java.io.PrintStream

import org.scalacheck.Prop.forAll
import org.scalacheck.Properties

import it.vigtig.thesis.env.DistEnv.globalRank
import it.vigtig.thesis.env.DistEnv.parallelize

object CollectionCheck {

  def main(args: Array[String]) {

    parallelize(args) {

      if (globalRank > 0) {
        Console.setOut(new PrintStream(new OutputStream() {
          def write(b: Int) { //nop    
          }
        }))
      }

      ST.main(Array())
    }

  }

}

object ST extends Properties("String") {

  //  def println(a: String*) = gprintln(a)
  property("startsWith") = forAll((a: String, b: String) => (a + b).startsWith(a))

  property("concatenate") = forAll((a: String, b: String) =>
    (a + b).length > a.length && (a + b).length > b.length)

  property("substring") = forAll((a: String, b: String, c: String) =>
    (a + b + c).substring(a.length, a.length + b.length) == b)

}

The above code reroutes the scala-println method to a nop-operation for all other processes than p=0. I should be able to run the test-suites with parallel-methods, allowing only the root process to verify the results. The above yields the following output:

MPJ Express (0.38) is started in the multicore configuration
rank-0: 0.212437745 time taken for initialize
+ String.startsWith: OK, passed 100 tests.
! String.concatenate: Falsified after 0 passed tests.
> ARG_0: 
> ARG_1: 
+ String.substring: OK, passed 100 tests.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:58:22+00:00Added an answer on June 13, 2026 at 3:58 am

    github.com/rickynils/scalacheck/issues/37 Apparently, it was due to a kind of bug in scalacheck. This bug will be fixed, but for now it seems you can clone the repository in that post and get a working copy! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem background I am currently developing a framework of Ant Colony System algorithms. I
I'm developing and testing a little straight-forward client-server application using java (and scala). The
Currently developing an application using the newest version of symfony, obtained through PEAR. This
Currently developing a PHP framework and have ran into my first problem. I need
Im currently developing an In-House Enterprise application. I will publish the app using Apple
I'm currently developing a website. Every feature works fine. However, I'm using a lot
I am currently developing a private framework for use on WebKit devices. I have
I'm developing a Java enterprise application, currently doing Java EE security stuff to restrict
I'm developing Scala code using Eclipse, often when I run tests I get this
I am currently developing a simple image editing tool using Winforms and .NET 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.