$darkmode
DENOPTIM
denoptim.fragmenter.ParallelFragmentationAlgorithm Class Reference

Fragments a list of chemical systems by running parallel fragmentation tasks. More...

Inheritance diagram for denoptim.fragmenter.ParallelFragmentationAlgorithm:
[legend]
Collaboration diagram for denoptim.fragmenter.ParallelFragmentationAlgorithm:
[legend]

Public Member Functions

 ParallelFragmentationAlgorithm (FragmenterParameters settings)
 Constructor. More...
 
- Public Member Functions inherited from denoptim.task.ParallelAsynchronousTaskExecutor
 ParallelAsynchronousTaskExecutor (int numberOfTasks, Logger logger)
 Constructor. More...
 
void stopRun ()
 Stops all subtasks and shutdown executor. More...
 
void run () throws DENOPTIMException, IOException
 Run the parallelized task. More...
 

Protected Member Functions

boolean doPreFlightOperations ()
 
void createAndSubmitTasks ()
 Implementations of this method must call the submitTask(Task, String) method to actually send the task to the executor and eventually start it. More...
 
boolean doPostFlightOperations ()
 
- Protected Member Functions inherited from denoptim.task.ParallelAsynchronousTaskExecutor
boolean subtaskHasException ()
 Looks for exceptions in the subtasks and, if any, store its reference locally to allow reporting it back from the main thread. More...
 
Throwable getExceptionFromSubTask ()
 
boolean allTasksCompleted ()
 Check for completion of all subtasks. More...
 
void submitTask (Task task, String logFilePathname)
 
abstract void createAndSubmitTasks ()
 Implementations of this method must call the submitTask(Task, String) method to actually send the task to the executor and eventually start it. More...
 
abstract boolean doPostFlightOperations ()
 
abstract boolean doPreFlightOperations ()
 

Static Protected Member Functions

static List< File > getFilesCollectingIsomorphicFamilyChampions (File workDir)
 

Static Package Functions

static void splitInputForThreads (FragmenterParameters settings, IteratingAtomContainerReader reader)
 Splits the input data (from FragmenterParameters) into batches suitable for parallel batch processing. More...
 
static String getStructureFileNameBatch (FragmenterParameters settings, int i)
 Builds the pathname of the structure file generated for one of the parallel threads. More...
 

Static Private Member Functions

static boolean getFormulaForMol (IAtomContainer mol, int index, LinkedHashMap< String, String > formulae)
 Takes the molecular formula from the given list of formulae and using the 'Title' property of the index or the molecule. More...
 

Private Attributes

File[] structures
 Collection of files with input. More...
 
FragmenterParameters settings = null
 All settings controlling the tasks executed by this class. More...
 

Additional Inherited Members

- Protected Attributes inherited from denoptim.task.ParallelAsynchronousTaskExecutor
final List< Object > results
 List of object returned by completed tasks. More...
 
- Package Attributes inherited from denoptim.task.ParallelAsynchronousTaskExecutor
final ThreadPoolExecutor tpe
 Asynchronous tasks manager. More...
 

Detailed Description

Fragments a list of chemical systems by running parallel fragmentation tasks.

Author
Marco Foscato

Definition at line 56 of file ParallelFragmentationAlgorithm.java.

Constructor & Destructor Documentation

◆ ParallelFragmentationAlgorithm()

denoptim.fragmenter.ParallelFragmentationAlgorithm.ParallelFragmentationAlgorithm ( FragmenterParameters  settings)

Constructor.

Definition at line 76 of file ParallelFragmentationAlgorithm.java.

References denoptim.programs.RunTimeParameters.getLogger(), denoptim.programs.fragmenter.FragmenterParameters.getNumTasks(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.settings.

Here is the call graph for this function:

Member Function Documentation

◆ createAndSubmitTasks()

void denoptim.fragmenter.ParallelFragmentationAlgorithm.createAndSubmitTasks ( )
protected

Implementations of this method must call the submitTask(Task, String) method to actually send the task to the executor and eventually start it.

Reimplemented from denoptim.task.ParallelAsynchronousTaskExecutor.

Definition at line 123 of file ParallelFragmentationAlgorithm.java.

References denoptim.fragmenter.FragmenterTask.getLogFilePathname(), denoptim.programs.fragmenter.FragmenterParameters.getNumTasks(), denoptim.fragmenter.ParallelFragmentationAlgorithm.settings, denoptim.fragmenter.ParallelFragmentationAlgorithm.structures, and denoptim.task.ParallelAsynchronousTaskExecutor.submitTask().

Here is the call graph for this function:

◆ doPostFlightOperations()

◆ doPreFlightOperations()

◆ getFilesCollectingIsomorphicFamilyChampions()

static List< File > denoptim.fragmenter.ParallelFragmentationAlgorithm.getFilesCollectingIsomorphicFamilyChampions ( File  workDir)
staticprotected

Definition at line 259 of file ParallelFragmentationAlgorithm.java.

References denoptim.constants.DENOPTIMConstants.MWSLOTFRAGSFILENAMEROOT, and denoptim.constants.DENOPTIMConstants.MWSLOTFRAGSUNQFILENANEEND.

Referenced by denoptim.fragmenter.ParallelFragmentationAlgorithm.doPostFlightOperations().

Here is the caller graph for this function:

◆ getFormulaForMol()

static boolean denoptim.fragmenter.ParallelFragmentationAlgorithm.getFormulaForMol ( IAtomContainer  mol,
int  index,
LinkedHashMap< String, String >  formulae 
)
staticprivate

Takes the molecular formula from the given list of formulae and using the 'Title' property of the index or the molecule.

The formula taken from the list in argument is then placed among the properties of the chemical object.

Definition at line 437 of file ParallelFragmentationAlgorithm.java.

References denoptim.constants.DENOPTIMConstants.FORMULASTR.

Referenced by denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads().

Here is the caller graph for this function:

◆ getStructureFileNameBatch()

static String denoptim.fragmenter.ParallelFragmentationAlgorithm.getStructureFileNameBatch ( FragmenterParameters  settings,
int  i 
)
staticpackage

Builds the pathname of the structure file generated for one of the parallel threads.

Parameters
settingssettings we work with.
ithe index of the thread
Returns
the pathname

Definition at line 422 of file ParallelFragmentationAlgorithm.java.

References denoptim.programs.RunTimeParameters.getWorkDirectory(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.settings.

Referenced by denoptim.fragmenter.ParallelFragmentationAlgorithm.doPreFlightOperations(), denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads(), and denoptim.fragmenter.ParallelFragmentationAlgorithmTest.testSplitInputForThreads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitInputForThreads()

static void denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads ( FragmenterParameters  settings,
IteratingAtomContainerReader  reader 
)
staticpackage

Splits the input data (from FragmenterParameters) into batches suitable for parallel batch processing.

Since we have to read all the atom containers, we use this chance to do any preparation of the molecular representation (see FragmenterTools#prepareMolToFragmentation(IAtomContainer, FragmenterParameters, int)) and store the molecular formula in the property DENOPTIMConstants#FORMULASTR.

Exceptions
DENOPTIMException
FileNotFoundException

Definition at line 307 of file ParallelFragmentationAlgorithm.java.

References denoptim.io.IteratingAtomContainerReader.close(), denoptim.programs.fragmenter.FragmenterParameters.doCheckFormula(), denoptim.programs.fragmenter.FragmenterParameters.getFormulae(), denoptim.fragmenter.ParallelFragmentationAlgorithm.getFormulaForMol(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.programs.fragmenter.FragmenterParameters.getNumTasks(), denoptim.fragmenter.ParallelFragmentationAlgorithm.getStructureFileNameBatch(), denoptim.programs.fragmenter.FragmenterParameters.getStructuresFile(), denoptim.io.IteratingAtomContainerReader.hasNext(), denoptim.io.IteratingAtomContainerReader.next(), denoptim.fragmenter.FragmenterTools.prepareMolToFragmentation(), denoptim.fragmenter.ParallelFragmentationAlgorithm.settings, and denoptim.io.DenoptimIO.writeSDFFile().

Referenced by denoptim.fragmenter.ParallelFragmentationAlgorithm.doPreFlightOperations(), and denoptim.fragmenter.ParallelFragmentationAlgorithmTest.testSplitInputForThreads().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ settings

◆ structures

File [] denoptim.fragmenter.ParallelFragmentationAlgorithm.structures
private

The documentation for this class was generated from the following file: