Disperser routine fails / disperser as a batch job

Report any suspected bugs and unexpected behavior here
Post Reply
david.holler
Posts: 33
Joined: Tue Aug 11, 2020 9:53 pm
Security question 1: No
Security question 2: 7

Disperser routine fails / disperser as a batch job

Post by david.holler » Fri Aug 06, 2021 3:24 pm

Hi all,

I'm creating distribution files with the disperse utility and have observed it stop suddenly while I'm providing the input values. Sometimes this happens 9/10 times in one day, other days it doesn't happen at all. Would there be a possible reason for this?

Also, can the disperser be parallelized or used in a batch job setting? I'm not sure how the successive inputs can be listed in the batch job submission file after "sss2 -disperse".

Thanks for reading and please let me know if I can provide any further information.

David H.

Ana Jambrina
Posts: 682
Joined: Tue May 26, 2020 5:32 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by Ana Jambrina » Fri Aug 06, 2021 4:01 pm

Serpent shouldn't crash in the cluster. What is the error message or error-/log-file output?. Which version are you running? The 'disperse.c' routine has not been modified since the 2.1.28 version. For the time being, the 'disperse' routine is not parallelized.
- Ana

david.holler
Posts: 33
Joined: Tue Aug 11, 2020 9:53 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by david.holler » Fri Aug 06, 2021 4:04 pm

When the disperser stops working, it just freezes before asking for the next expected input. I'm using 2.1.32.
Can the disperser be run in serial from a batch script though?

Ana Jambrina
Posts: 682
Joined: Tue May 26, 2020 5:32 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by Ana Jambrina » Fri Aug 06, 2021 4:26 pm

The disperse routine might be high memory demanding and might take a while to go through. A problem of running out of memory usually is somehow outputted. A ‘frozen’ case might just be a case taking some time to finish if no error output is given. Did you check the CPU/memory usage while running the case?
It should not be a problem to run multiple Serpent cases with the ‘disperse’ command-line option in serial within a batch script as independent runs.
- Ana

david.holler
Posts: 33
Joined: Tue Aug 11, 2020 9:53 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by david.holler » Fri Aug 06, 2021 4:36 pm

I have not checked the CPU or memory usage because when it fails, it fails during the prompted input steps and no error code is given. When the disperse routine succeeds, each prompt is displayed immediately after the previous input is provided. Do you think memory could be an issue during the input steps?
I will look into writing a batch job submission script and post the results.

Ana Jambrina
Posts: 682
Joined: Tue May 26, 2020 5:32 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by Ana Jambrina » Fri Aug 06, 2021 4:49 pm

It depends on the stage. Does it happen in between entering geometrical values? Before or after the grow and shake particles algorithm input? In the former case, it should be neither a memory nor a time problem. In the latter one, some memory allocation might already be in place.

Have you checked how you have provided the input values? Have you tried to run the case without a batch script? Could you post the input here to run some tests?
- Ana

david.holler
Posts: 33
Joined: Tue Aug 11, 2020 9:53 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by david.holler » Fri Aug 06, 2021 7:44 pm

It only freezes during geometry input, and initialization with the grow-and-shake option does seem to take longer than without. Is the grow-and-shake option recommended for some cases?

I've only been using the disperse routine interactively in the terminal, but it takes too long with my target packing fraction of 0.50. The server resets my connection before Serpent can finish the distribution. That's why I'd like to use a batch job to run the disperse program.

Here are the input parameters I'm attempting to use with the disperse routine:
Geometry type = annular cylinder
Outer radius = 4.13 cm
Bottom z-coordinate = 0.0 cm
Top z-coordinate = 4.356 cm
Inner radius = 2.64 cm
Packing fraction = 0.50
Particle radius = 0.0141 cm
Particle universe = 2
More particles? = n
File name = dist.inp
Grow and shake? = n

Ana Jambrina
Posts: 682
Joined: Tue May 26, 2020 5:32 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by Ana Jambrina » Fri Aug 06, 2021 9:05 pm

OK. It seems not to be a problem from the Serpent side but the server/server network side.
The grow and shake algorithm is needed for high packing fractions.
- Ana

david.holler
Posts: 33
Joined: Tue Aug 11, 2020 9:53 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by david.holler » Fri Aug 13, 2021 1:50 am

Yes, I agree. For whatever reason, the prompted inputs seem to work just fine now.
I was also able to put together a command line for a batch job in case anyone reading this is interested:

sss2 -disperse << EOF
4 4.13 0 4.356 2.64 0.5 0.0141 c dist.inp y 0.01 0.01
EOF

This works with both PBS and Slurm based systems. When I enter an alphabet character for particle universe, the program skips the next prompt that typically lets you choose more particles or not. All prompts work as expected when I enter the following:

sss2 -disperse << EOF
4 4.13 0 4.356 2.64 0.5 0.0141 1 n example.inp y 0.01 0.01
EOF

Both of these examples produce the same distribution file so I guess it's not really a big deal. Thanks again for the help and correspondence.

Ana Jambrina
Posts: 682
Joined: Tue May 26, 2020 5:32 pm
Security question 1: No
Security question 2: 7

Re: Disperser routine fails / disperser as a batch job

Post by Ana Jambrina » Fri Aug 13, 2021 6:22 am

Currently, Serpent only accepts integers as universe names and not character arrays. That fact leads to skipping the next prompt entry and misinterpreting the universe name itself, as you can see from the disperse output file.

The following changes in the 'disperse.c' routine will allow you to enter a character array as a universe name (ref. Serpent 2.1.32):
  • Substitute line 33:

    Code: Select all

      long u;
    
    for

    Code: Select all

      char u[MAX_STR];
    
  • Substitute line 505:

    Code: Select all

          if (fscanf(fp, "%ld", &u) == EOF)
    
    for

    Code: Select all

          if (fscanf(fp, "%s", &u) == EOF)
    
  • Substitute line 545:

    Code: Select all

              p[n].u = u;
    
    for

    Code: Select all

              strcpy(p[n].u, &u);
    
  • Substitute lines 1723-1724:

    Code: Select all

        fprintf(fp, "%12.5E %12.5E %12.5E %11.5E %ld\n", p[n].x, p[n].y, p[n].z,
                p[n].rp, p[n].u);
    
    for

    Code: Select all

        fprintf(fp, "%12.5E %12.5E %12.5E %11.5E %s\n", p[n].x, p[n].y, p[n].z,
                p[n].rp, p[n].u);
    
- Ana

Post Reply